From python-checkins at python.org Tue Aug 1 01:27:48 2006 From: python-checkins at python.org (brett.cannon) Date: Tue, 1 Aug 2006 01:27:48 +0200 (CEST) Subject: [Python-checkins] r51009 - in python/branches/bcannon-sandboxing: Include/Python.h Include/objimpl.h Objects/trackedmalloc.c Python/sysmodule.c configure configure.in pyconfig.h.in Message-ID: <20060731232748.700391E4006@bag.python.org> Author: brett.cannon Date: Tue Aug 1 01:27:46 2006 New Revision: 51009 Modified: python/branches/bcannon-sandboxing/Include/Python.h python/branches/bcannon-sandboxing/Include/objimpl.h python/branches/bcannon-sandboxing/Objects/trackedmalloc.c python/branches/bcannon-sandboxing/Python/sysmodule.c python/branches/bcannon-sandboxing/configure python/branches/bcannon-sandboxing/configure.in python/branches/bcannon-sandboxing/pyconfig.h.in Log: Add needed #ifdef protections. Modified: python/branches/bcannon-sandboxing/Include/Python.h ============================================================================== --- python/branches/bcannon-sandboxing/Include/Python.h (original) +++ python/branches/bcannon-sandboxing/Include/Python.h Tue Aug 1 01:27:46 2006 @@ -73,6 +73,13 @@ #if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC) #error "PYMALLOC_DEBUG requires WITH_PYMALLOC" #endif + +#ifdef Py_TRACK_MEMORY +#ifndef HAVE_MALLINFO +#error "Py_TRACK_MEMORY required HAVE_MALLINFO" +#endif /* !HAVE_MALLINFO */ +#endif /* Py_TRACK_MEMORY */ + #include "pymem.h" #include "object.h" Modified: python/branches/bcannon-sandboxing/Include/objimpl.h ============================================================================== --- python/branches/bcannon-sandboxing/Include/objimpl.h (original) +++ python/branches/bcannon-sandboxing/Include/objimpl.h Tue Aug 1 01:27:46 2006 @@ -94,18 +94,20 @@ the object gets initialized via PyObject_{Init, InitVar} after obtaining the raw memory. */ +#ifdef Py_TRACK_MEMORY PyAPI_DATA(unsigned long) Py_ProcessMemUsage; PyAPI_FUNC(PyObject *) Py_MemoryUsage(PyObject *, PyObject *); +PyAPI_FUNC(void *) PyObject_TrackedMalloc(const char *, size_t); +PyAPI_FUNC(void *) PyObject_TrackedRealloc(const char *, void *, size_t); +PyAPI_FUNC(void) PyObject_TrackedFree(const char *, void *); +#endif /* Py_TRACK_MEMORY */ + PyAPI_FUNC(int) PyMalloc_ManagesMemory(void *); PyAPI_FUNC(size_t) PyMalloc_AllocatedSize(void *); PyAPI_FUNC(void *) PyObject_Malloc(size_t); PyAPI_FUNC(void *) PyObject_Realloc(void *, size_t); PyAPI_FUNC(void) PyObject_Free(void *); -PyAPI_FUNC(void *) PyObject_TrackedMalloc(const char *, size_t); -PyAPI_FUNC(void *) PyObject_TrackedRealloc(const char *, void *, size_t); -PyAPI_FUNC(void) PyObject_TrackedFree(const char *, void *); - /* Macros */ #ifdef WITH_PYMALLOC Modified: python/branches/bcannon-sandboxing/Objects/trackedmalloc.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/trackedmalloc.c (original) +++ python/branches/bcannon-sandboxing/Objects/trackedmalloc.c Tue Aug 1 01:27:46 2006 @@ -1,5 +1,11 @@ #include "Python.h" + +/* Must come after Python.h for pyconfig.h value to be set. */ +#ifdef Py_TRACK_MEMORY + +#ifdef HAVE_MALLINFO #include +#endif /* Add accountability to memory allocation. @@ -46,6 +52,8 @@ + Raise an error during compilation if required functionality (e.g. mallinfo()) not available for tracking memory, even if requested. + Completely convert ElementTree. ++ Add an adjust function to compliment track/untrack for realloc usage (allows + for future usage of tracking active object counts) */ unsigned long Py_ProcessMemUsage = 0; @@ -161,7 +169,9 @@ void * PyObject_TrackedMalloc(const char *what, size_t nbytes) { +#ifdef HAVE_MALLINFO struct mallinfo before = mallinfo(); +#endif void *allocated = NULL; size_t used = 0; @@ -174,7 +184,9 @@ used = PyMalloc_AllocatedSize(allocated); } else { +#ifdef HAVE_MALLINFO used = mallinfo().uordblks - before.uordblks; +#endif } PyObject_TrackMemory(what, used); @@ -190,7 +202,9 @@ void * PyObject_TrackedRealloc(const char *what, void *to_resize, size_t new_size) { +#ifdef HAVE_MALLINFO struct mallinfo before = mallinfo(); +#endif void *allocated = NULL; size_t size_delta = 0; @@ -207,7 +221,9 @@ size_delta = PyMalloc_AllocatedSize(allocated) - size_delta; } else { +#ifdef HAVE_MALLINFO size_delta = mallinfo().uordblks - before.uordblks; +#endif } PyObject_TrackMemory(what, size_delta); @@ -221,7 +237,9 @@ void PyObject_TrackedFree(const char *what, void *to_free) { +#ifdef HAVE_MALLINFO struct mallinfo before = mallinfo(); +#endif size_t freed = 0; if (PyMalloc_ManagesMemory(to_free)) { @@ -231,8 +249,12 @@ PyObject_Free(to_free); if (!freed) { +#ifdef HAVE_MALLINFO freed = before.uordblks - mallinfo().uordblks; +#endif } PyObject_UntrackMemory(what, freed); } + +#endif /* Py_TRACK_MEMORY */ Modified: python/branches/bcannon-sandboxing/Python/sysmodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/sysmodule.c (original) +++ python/branches/bcannon-sandboxing/Python/sysmodule.c Tue Aug 1 01:27:46 2006 @@ -782,7 +782,9 @@ #endif {"settrace", sys_settrace, METH_O, settrace_doc}, {"call_tracing", sys_call_tracing, METH_VARARGS, call_tracing_doc}, +#ifdef Py_TRACK_MEMORY {"memoryusage", Py_MemoryUsage, METH_NOARGS, "XXX"}, +#endif {NULL, NULL} /* sentinel */ }; Modified: python/branches/bcannon-sandboxing/configure ============================================================================== --- python/branches/bcannon-sandboxing/configure (original) +++ python/branches/bcannon-sandboxing/configure Tue Aug 1 01:27:46 2006 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 50891 . +# From configure.in Revision: 50892 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for python 2.5. # @@ -3791,6 +3791,61 @@ echo "${ECHO_T}no" >&6 fi; +echo "$as_me:$LINENO: checking for mallinfo" >&5 +echo $ECHO_N "checking for mallinfo... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +void *x=mallinfo + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLINFO 1 +_ACEOF + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be # merged with this chunk of code? @@ -13744,7 +13799,6 @@ echo "$as_me:$LINENO: result: $with_doc_strings" >&5 echo "${ECHO_T}$with_doc_strings" >&6 -# Check for Python-specific malloc support echo "$as_me:$LINENO: checking for --with-tsc" >&5 echo $ECHO_N "checking for --with-tsc... $ECHO_C" >&6 Modified: python/branches/bcannon-sandboxing/configure.in ============================================================================== --- python/branches/bcannon-sandboxing/configure.in (original) +++ python/branches/bcannon-sandboxing/configure.in Tue Aug 1 01:27:46 2006 @@ -740,6 +740,13 @@ fi], [AC_MSG_RESULT(no)]) +AC_MSG_CHECKING(for mallinfo) +AC_TRY_COMPILE([#include ], void *x=mallinfo, + AC_DEFINE(HAVE_MALLINFO, 1, Define if you have the 'mallinfo' function.) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) + # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be # merged with this chunk of code? @@ -2171,7 +2178,6 @@ fi AC_MSG_RESULT($with_doc_strings) -# Check for Python-specific malloc support AC_MSG_CHECKING(for --with-tsc) AC_ARG_WITH(tsc, [ --with(out)-tsc enable/disable timestamp counter profile], [ Modified: python/branches/bcannon-sandboxing/pyconfig.h.in ============================================================================== --- python/branches/bcannon-sandboxing/pyconfig.h.in (original) +++ python/branches/bcannon-sandboxing/pyconfig.h.in Tue Aug 1 01:27:46 2006 @@ -326,6 +326,9 @@ /* Define this if you have the makedev macro. */ #undef HAVE_MAKEDEV +/* Define if you have the 'mallinfo' function. */ +#undef HAVE_MALLINFO + /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE From python-checkins at python.org Tue Aug 1 01:28:35 2006 From: python-checkins at python.org (brett.cannon) Date: Tue, 1 Aug 2006 01:28:35 +0200 (CEST) Subject: [Python-checkins] r51010 - python/branches/bcannon-sandboxing/Objects/trackedmalloc.c Message-ID: <20060731232835.C9DCF1E4006@bag.python.org> Author: brett.cannon Date: Tue Aug 1 01:28:35 2006 New Revision: 51010 Modified: python/branches/bcannon-sandboxing/Objects/trackedmalloc.c Log: Remove entry from todo list for adding proper Py_TRACK_MEMORY #ifdef checks. Modified: python/branches/bcannon-sandboxing/Objects/trackedmalloc.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/trackedmalloc.c (original) +++ python/branches/bcannon-sandboxing/Objects/trackedmalloc.c Tue Aug 1 01:28:35 2006 @@ -48,7 +48,6 @@ XXX: + convert over all APIs. -+ add proper Py_TRACK_MEMORY #ifdef protections. + Raise an error during compilation if required functionality (e.g. mallinfo()) not available for tracking memory, even if requested. + Completely convert ElementTree. From python-checkins at python.org Tue Aug 1 01:31:49 2006 From: python-checkins at python.org (brett.cannon) Date: Tue, 1 Aug 2006 01:31:49 +0200 (CEST) Subject: [Python-checkins] r51011 - python/branches/bcannon-sandboxing/Objects/trackedmalloc.c Message-ID: <20060731233149.B0FE91E4006@bag.python.org> Author: brett.cannon Date: Tue Aug 1 01:31:49 2006 New Revision: 51011 Modified: python/branches/bcannon-sandboxing/Objects/trackedmalloc.c Log: Add PyObject_AdjustMemory(). Modified: python/branches/bcannon-sandboxing/Objects/trackedmalloc.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/trackedmalloc.c (original) +++ python/branches/bcannon-sandboxing/Objects/trackedmalloc.c Tue Aug 1 01:31:49 2006 @@ -53,6 +53,7 @@ + Completely convert ElementTree. + Add an adjust function to compliment track/untrack for realloc usage (allows for future usage of tracking active object counts) ++ Try other ways of storing info to optimize lookup. */ unsigned long Py_ProcessMemUsage = 0; @@ -145,6 +146,19 @@ } /* + Adjust the amount of memory used for a specific use. + + In place for possible future use where tracking creation and deletion at the + object level is to be adjusted, and thus reallocs should not count towards + either. +*/ +int +PyObject_AdjustMemory(const char *what, size_t nbytes) +{ + return PyObject_TrackMemory(what, nbytes); +} + +/* Stop tracking an anonymous chunk of memory. */ int @@ -225,7 +239,7 @@ #endif } - PyObject_TrackMemory(what, size_delta); + PyObject_AdjustMemory(what, size_delta); return allocated; } From python-checkins at python.org Tue Aug 1 03:21:33 2006 From: python-checkins at python.org (brett.cannon) Date: Tue, 1 Aug 2006 03:21:33 +0200 (CEST) Subject: [Python-checkins] r51012 - in python/branches/bcannon-sandboxing: Include/objimpl.h Include/pymem.h Objects/trackedmalloc.c Parser/acceler.c Parser/bitset.c Parser/firstsets.c Parser/grammar.c Parser/node.c Parser/parser.c Parser/parsetok.c Parser/pgen.c Message-ID: <20060801012133.BB3091E4009@bag.python.org> Author: brett.cannon Date: Tue Aug 1 03:21:31 2006 New Revision: 51012 Modified: python/branches/bcannon-sandboxing/Include/objimpl.h python/branches/bcannon-sandboxing/Include/pymem.h python/branches/bcannon-sandboxing/Objects/trackedmalloc.c python/branches/bcannon-sandboxing/Parser/acceler.c python/branches/bcannon-sandboxing/Parser/bitset.c python/branches/bcannon-sandboxing/Parser/firstsets.c python/branches/bcannon-sandboxing/Parser/grammar.c python/branches/bcannon-sandboxing/Parser/node.c python/branches/bcannon-sandboxing/Parser/parser.c python/branches/bcannon-sandboxing/Parser/parsetok.c python/branches/bcannon-sandboxing/Parser/pgen.c Log: Move Parser/ over to tracked memory usage. Introduced PyMem_RAW_*() macros and forced PyObject_MALLOC() and friend over to PyObject_T_MALLOC(). Modified: python/branches/bcannon-sandboxing/Include/objimpl.h ============================================================================== --- python/branches/bcannon-sandboxing/Include/objimpl.h (original) +++ python/branches/bcannon-sandboxing/Include/objimpl.h Tue Aug 1 03:21:31 2006 @@ -108,16 +108,27 @@ PyAPI_FUNC(void *) PyObject_Realloc(void *, size_t); PyAPI_FUNC(void) PyObject_Free(void *); - -/* Macros */ -#ifdef WITH_PYMALLOC -#if defined(PYMALLOC_DEBUG) /* WITH_PYMALLOC && PYMALLOC_DEBUG */ +#ifdef PYMALLOC_DEBUG PyAPI_FUNC(void *) _PyObject_DebugMalloc(size_t nbytes); PyAPI_FUNC(void *) _PyObject_DebugRealloc(void *p, size_t nbytes); PyAPI_FUNC(void) _PyObject_DebugFree(void *p); PyAPI_FUNC(void) _PyObject_DebugDumpAddress(const void *p); PyAPI_FUNC(void) _PyObject_DebugCheckAddress(const void *p); PyAPI_FUNC(void) _PyObject_DebugMallocStats(void); +#endif + + +/* Macros */ +#ifdef WITH_PYMALLOC + +#ifdef Py_TRACK_MEMORY + +#define PyObject_MALLOC(nbytes) PyObject_T_MALLOC("", nbytes) +#define PyObject_REALLOC(ptr, nbytes) PyObject_T_REALLOC("", ptr, nbytes) +#define PyObject_FREE(ptr) PyObject_T_FREE("", ptr) + +#elif defined(PYMALLOC_DEBUG) /* WITH_PYMALLOC && PYMALLOC_DEBUG */ + #define PyObject_MALLOC _PyObject_DebugMalloc #define PyObject_Malloc _PyObject_DebugMalloc #define PyObject_REALLOC _PyObject_DebugRealloc Modified: python/branches/bcannon-sandboxing/Include/pymem.h ============================================================================== --- python/branches/bcannon-sandboxing/Include/pymem.h (original) +++ python/branches/bcannon-sandboxing/Include/pymem.h Tue Aug 1 03:21:31 2006 @@ -73,6 +73,16 @@ #endif /* PYMALLOC_DEBUG */ +#ifdef PYMALLOC +#define PyMem_RAW_MALLOC PyObject_Malloc +#define PyMem_RAW_REALLOC PyObject_Realloc +#define PyMem_RAW_FREE PyObject_Free +#else +#define PyMem_RAW_MALLOC(n) malloc((n) ? (n) : 1) +#define PyMem_RAW_REALLOC(p, n) realloc((p), (n) ? (n) : 1) +#define PyMem_RAW_FREE free +#endif + /* * Type-oriented memory interface * ============================== Modified: python/branches/bcannon-sandboxing/Objects/trackedmalloc.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/trackedmalloc.c (original) +++ python/branches/bcannon-sandboxing/Objects/trackedmalloc.c Tue Aug 1 03:21:31 2006 @@ -103,7 +103,8 @@ { struct mem_item *cur_mem = mem_head; - what = what ? what : UNKNOWN_WHAT; + if (!what || (strcmp(what, "") == 0)) + what = UNKNOWN_WHAT; while (cur_mem->next) { cur_mem = cur_mem->next; Modified: python/branches/bcannon-sandboxing/Parser/acceler.c ============================================================================== --- python/branches/bcannon-sandboxing/Parser/acceler.c (original) +++ python/branches/bcannon-sandboxing/Parser/acceler.c Tue Aug 1 03:21:31 2006 @@ -44,7 +44,7 @@ s = d->d_state; for (j = 0; j < d->d_nstates; j++, s++) { if (s->s_accel) - PyObject_FREE(s->s_accel); + PyObject_Free(s->s_accel); s->s_accel = NULL; } } @@ -68,7 +68,7 @@ int *accel; int nl = g->g_ll.ll_nlabels; s->s_accept = 0; - accel = (int *) PyObject_MALLOC(nl * sizeof(int)); + accel = (int *) PyObject_Malloc(nl * sizeof(int)); if (accel == NULL) { fprintf(stderr, "no mem to build parser accelerators\n"); exit(1); @@ -111,7 +111,7 @@ k++; if (k < nl) { int i; - s->s_accel = (int *) PyObject_MALLOC((nl-k) * sizeof(int)); + s->s_accel = (int *) PyObject_Malloc((nl-k) * sizeof(int)); if (s->s_accel == NULL) { fprintf(stderr, "no mem to add parser accelerators\n"); exit(1); @@ -121,5 +121,5 @@ for (i = 0; k < nl; i++, k++) s->s_accel[i] = accel[k]; } - PyObject_FREE(accel); + PyObject_Free(accel); } Modified: python/branches/bcannon-sandboxing/Parser/bitset.c ============================================================================== --- python/branches/bcannon-sandboxing/Parser/bitset.c (original) +++ python/branches/bcannon-sandboxing/Parser/bitset.c Tue Aug 1 03:21:31 2006 @@ -8,7 +8,7 @@ newbitset(int nbits) { int nbytes = NBYTES(nbits); - bitset ss = (char *)PyObject_MALLOC(sizeof(BYTE) * nbytes); + bitset ss = (char *)PyObject_Malloc(sizeof(BYTE) * nbytes); if (ss == NULL) Py_FatalError("no mem for bitset"); @@ -22,7 +22,7 @@ void delbitset(bitset ss) { - PyObject_FREE(ss); + PyObject_Free(ss); } int Modified: python/branches/bcannon-sandboxing/Parser/firstsets.c ============================================================================== --- python/branches/bcannon-sandboxing/Parser/firstsets.c (original) +++ python/branches/bcannon-sandboxing/Parser/firstsets.c Tue Aug 1 03:21:31 2006 @@ -59,7 +59,7 @@ nbits = g->g_ll.ll_nlabels; result = newbitset(nbits); - sym = (int *)PyObject_MALLOC(sizeof(int)); + sym = (int *)PyObject_Malloc(sizeof(int)); if (sym == NULL) Py_FatalError("no mem for new sym in calcfirstset"); nsyms = 1; @@ -73,7 +73,7 @@ break; } if (j >= nsyms) { /* New label */ - sym = (int *)PyObject_REALLOC(sym, + sym = (int *)PyObject_Realloc(sym, sizeof(int) * (nsyms + 1)); if (sym == NULL) Py_FatalError( @@ -109,5 +109,5 @@ printf(" }\n"); } - PyObject_FREE(sym); + PyObject_Free(sym); } Modified: python/branches/bcannon-sandboxing/Parser/grammar.c ============================================================================== --- python/branches/bcannon-sandboxing/Parser/grammar.c (original) +++ python/branches/bcannon-sandboxing/Parser/grammar.c Tue Aug 1 03:21:31 2006 @@ -20,7 +20,7 @@ { grammar *g; - g = (grammar *)PyObject_MALLOC(sizeof(grammar)); + g = (grammar *)PyObject_Malloc(sizeof(grammar)); if (g == NULL) Py_FatalError("no mem for new grammar"); g->g_ndfas = 0; @@ -37,7 +37,7 @@ { dfa *d; - g->g_dfa = (dfa *)PyObject_REALLOC(g->g_dfa, + g->g_dfa = (dfa *)PyObject_Realloc(g->g_dfa, sizeof(dfa) * (g->g_ndfas + 1)); if (g->g_dfa == NULL) Py_FatalError("no mem to resize dfa in adddfa"); @@ -56,7 +56,7 @@ { state *s; - d->d_state = (state *)PyObject_REALLOC(d->d_state, + d->d_state = (state *)PyObject_Realloc(d->d_state, sizeof(state) * (d->d_nstates + 1)); if (d->d_state == NULL) Py_FatalError("no mem to resize state in addstate"); @@ -80,7 +80,7 @@ assert(0 <= to && to < d->d_nstates); s = &d->d_state[from]; - s->s_arc = (arc *)PyObject_REALLOC(s->s_arc, sizeof(arc) * (s->s_narcs + 1)); + s->s_arc = (arc *)PyObject_Realloc(s->s_arc, sizeof(arc) * (s->s_narcs + 1)); if (s->s_arc == NULL) Py_FatalError("no mem to resize arc list in addarc"); a = &s->s_arc[s->s_narcs++]; @@ -99,7 +99,7 @@ strcmp(ll->ll_label[i].lb_str, str) == 0) return i; } - ll->ll_label = (label *)PyObject_REALLOC(ll->ll_label, + ll->ll_label = (label *)PyObject_Realloc(ll->ll_label, sizeof(label) * (ll->ll_nlabels + 1)); if (ll->ll_label == NULL) Py_FatalError("no mem to resize labellist in addlabel"); Modified: python/branches/bcannon-sandboxing/Parser/node.c ============================================================================== --- python/branches/bcannon-sandboxing/Parser/node.c (original) +++ python/branches/bcannon-sandboxing/Parser/node.c Tue Aug 1 03:21:31 2006 @@ -7,7 +7,7 @@ node * PyNode_New(int type) { - node *n = (node *) PyObject_MALLOC(1 * sizeof(node)); + node *n = (node *) PyObject_Malloc(1 * sizeof(node)); if (n == NULL) return NULL; n->n_type = type; @@ -92,7 +92,7 @@ return E_OVERFLOW; if (current_capacity < required_capacity) { n = n1->n_child; - n = (node *) PyObject_REALLOC(n, + n = (node *) PyObject_Realloc(n, required_capacity * sizeof(node)); if (n == NULL) return E_NOMEM; @@ -118,7 +118,7 @@ { if (n != NULL) { freechildren(n); - PyObject_FREE(n); + PyObject_Free(n); } } @@ -129,7 +129,7 @@ for (i = NCH(n); --i >= 0; ) freechildren(CHILD(n, i)); if (n->n_child != NULL) - PyObject_FREE(n->n_child); + PyObject_Free(n->n_child); if (STR(n) != NULL) - PyObject_FREE(STR(n)); + PyObject_Free(STR(n)); } Modified: python/branches/bcannon-sandboxing/Parser/parser.c ============================================================================== --- python/branches/bcannon-sandboxing/Parser/parser.c (original) +++ python/branches/bcannon-sandboxing/Parser/parser.c Tue Aug 1 03:21:31 2006 @@ -75,7 +75,7 @@ if (!g->g_accel) PyGrammar_AddAccelerators(g); - ps = (parser_state *)PyMem_MALLOC(sizeof(parser_state)); + ps = (parser_state *)PyMem_RAW_MALLOC(sizeof(parser_state)); if (ps == NULL) return NULL; ps->p_grammar = g; @@ -84,7 +84,7 @@ #endif ps->p_tree = PyNode_New(start); if (ps->p_tree == NULL) { - PyMem_FREE(ps); + PyMem_RAW_FREE(ps); return NULL; } s_reset(&ps->p_stack); @@ -98,7 +98,7 @@ /* NB If you want to save the parse tree, you must set p_tree to NULL before calling delparser! */ PyNode_Free(ps->p_tree); - PyMem_FREE(ps); + PyMem_RAW_FREE(ps); } Modified: python/branches/bcannon-sandboxing/Parser/parsetok.c ============================================================================== --- python/branches/bcannon-sandboxing/Parser/parsetok.c (original) +++ python/branches/bcannon-sandboxing/Parser/parsetok.c Tue Aug 1 03:21:31 2006 @@ -154,7 +154,7 @@ else started = 1; len = b - a; /* XXX this may compute NULL - NULL */ - str = (char *) PyObject_MALLOC(len + 1); + str = (char *) PyObject_Malloc(len + 1); if (str == NULL) { fprintf(stderr, "no mem for next token\n"); err_ret->error = E_NOMEM; @@ -195,7 +195,7 @@ PyParser_AddToken(ps, (int)type, str, tok->lineno, col_offset, &(err_ret->expected))) != E_OK) { if (err_ret->error != E_DONE) { - PyObject_FREE(str); + PyObject_Free(str); err_ret->token = type; } break; @@ -220,7 +220,7 @@ assert(tok->cur - tok->buf < INT_MAX); err_ret->offset = (int)(tok->cur - tok->buf); len = tok->inp - tok->buf; - err_ret->text = (char *) PyObject_MALLOC(len + 1); + err_ret->text = (char *) PyObject_Malloc(len + 1); if (err_ret->text != NULL) { if (len > 0) strncpy(err_ret->text, tok->buf, len); Modified: python/branches/bcannon-sandboxing/Parser/pgen.c ============================================================================== --- python/branches/bcannon-sandboxing/Parser/pgen.c (original) +++ python/branches/bcannon-sandboxing/Parser/pgen.c Tue Aug 1 03:21:31 2006 @@ -49,7 +49,7 @@ { nfastate *st; - nf->nf_state = (nfastate *)PyObject_REALLOC(nf->nf_state, + nf->nf_state = (nfastate *)PyObject_Realloc(nf->nf_state, sizeof(nfastate) * (nf->nf_nstates + 1)); if (nf->nf_state == NULL) Py_FatalError("out of mem"); @@ -66,7 +66,7 @@ nfaarc *ar; st = &nf->nf_state[from]; - st->st_arc = (nfaarc *)PyObject_REALLOC(st->st_arc, + st->st_arc = (nfaarc *)PyObject_Realloc(st->st_arc, sizeof(nfaarc) * (st->st_narcs + 1)); if (st->st_arc == NULL) Py_FatalError("out of mem"); @@ -81,7 +81,7 @@ nfa *nf; static int type = NT_OFFSET; /* All types will be disjunct */ - nf = (nfa *)PyObject_MALLOC(sizeof(nfa)); + nf = (nfa *)PyObject_Malloc(sizeof(nfa)); if (nf == NULL) Py_FatalError("no mem for new nfa"); nf->nf_type = type++; @@ -106,7 +106,7 @@ { nfagrammar *gr; - gr = (nfagrammar *)PyObject_MALLOC(sizeof(nfagrammar)); + gr = (nfagrammar *)PyObject_Malloc(sizeof(nfagrammar)); if (gr == NULL) Py_FatalError("no mem for new nfa grammar"); gr->gr_nnfas = 0; @@ -123,7 +123,7 @@ nfa *nf; nf = newnfa(name); - gr->gr_nfa = (nfa **)PyObject_REALLOC(gr->gr_nfa, + gr->gr_nfa = (nfa **)PyObject_Realloc(gr->gr_nfa, sizeof(nfa) * (gr->gr_nnfas + 1)); if (gr->gr_nfa == NULL) Py_FatalError("out of mem"); @@ -395,7 +395,7 @@ ss = newbitset(nbits); addclosure(ss, nf, nf->nf_start); - xx_state = (ss_state *)PyObject_MALLOC(sizeof(ss_state)); + xx_state = (ss_state *)PyObject_Malloc(sizeof(ss_state)); if (xx_state == NULL) Py_FatalError("no mem for xx_state in makedfa"); xx_nstates = 1; @@ -435,7 +435,7 @@ } /* Add new arc for this state */ size = sizeof(ss_arc) * (yy->ss_narcs + 1); - yy->ss_arc = (ss_arc *)PyObject_REALLOC( + yy->ss_arc = (ss_arc *)PyObject_Realloc( yy->ss_arc, size); if (yy->ss_arc == NULL) Py_FatalError("out of mem"); @@ -459,7 +459,7 @@ } } size = sizeof(ss_state) * (xx_nstates + 1); - xx_state = (ss_state *)PyObject_REALLOC(xx_state, + xx_state = (ss_state *)PyObject_Realloc(xx_state, size); if (xx_state == NULL) Py_FatalError("out of mem"); From neal at metaslash.com Tue Aug 1 11:08:41 2006 From: neal at metaslash.com (Neal Norwitz) Date: Tue, 1 Aug 2006 05:08:41 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (2) Message-ID: <20060801090841.GA14421@python.psfb.org> test_cmd_line leaked [0, 17, -17] references test_socket leaked [0, 205, -205] references test_sys leaked [0, 132, -132] references From python-checkins at python.org Tue Aug 1 18:24:31 2006 From: python-checkins at python.org (andrew.kuchling) Date: Tue, 1 Aug 2006 18:24:31 +0200 (CEST) Subject: [Python-checkins] r51013 - python/trunk/Objects/listsort.txt Message-ID: <20060801162431.57D041E4011@bag.python.org> Author: andrew.kuchling Date: Tue Aug 1 18:24:30 2006 New Revision: 51013 Modified: python/trunk/Objects/listsort.txt Log: typo fix Modified: python/trunk/Objects/listsort.txt ============================================================================== --- python/trunk/Objects/listsort.txt (original) +++ python/trunk/Objects/listsort.txt Tue Aug 1 18:24:30 2006 @@ -494,7 +494,7 @@ 467-474, Austin, Texas, 25-27 January 1993. and it probably dates back to an earlier paper by Bentley and Yao. The -McIlory paper in particular has good analysis of a mergesort that's +McIlroy paper in particular has good analysis of a mergesort that's probably strongly related to this one in its galloping strategy. From python-checkins at python.org Tue Aug 1 18:54:45 2006 From: python-checkins at python.org (thomas.heller) Date: Tue, 1 Aug 2006 18:54:45 +0200 (CEST) Subject: [Python-checkins] r51018 - python/trunk/Modules/_ctypes/_ctypes.c Message-ID: <20060801165445.309121E4006@bag.python.org> Author: thomas.heller Date: Tue Aug 1 18:54:43 2006 New Revision: 51018 Modified: python/trunk/Modules/_ctypes/_ctypes.c Log: Fix a potential segfault and various potentail refcount leaks in the cast() function. Modified: python/trunk/Modules/_ctypes/_ctypes.c ============================================================================== --- python/trunk/Modules/_ctypes/_ctypes.c (original) +++ python/trunk/Modules/_ctypes/_ctypes.c Tue Aug 1 18:54:43 2006 @@ -4521,32 +4521,30 @@ if (obj->b_objects == Py_None) { Py_DECREF(Py_None); obj->b_objects = PyDict_New(); - if (!obj->b_objects) { - Py_DECREF(result); - return NULL; - } + if (obj->b_objects == NULL) + goto failed; } - /* XXX(nnorwitz): shouldn't the INCREF only be done in an else? */ - Py_INCREF(obj->b_objects); result->b_objects = obj->b_objects; if (result->b_objects) { - PyObject *index = PyLong_FromVoidPtr((void *)src); + PyObject *index; int rc; - if (index == NULL) { - Py_DECREF(result); - return NULL; - } + Py_INCREF(obj->b_objects); + index = PyLong_FromVoidPtr((void *)src); + if (index == NULL) + goto failed; rc = PyDict_SetItem(result->b_objects, index, src); Py_DECREF(index); - if (rc == -1) { - Py_DECREF(result); - return NULL; - } + if (rc == -1) + goto failed; } } /* Should we assert that result is a pointer type? */ memcpy(result->b_ptr, &ptr, sizeof(void *)); return (PyObject *)result; + + failed: + Py_DECREF(result); + return NULL; } #ifdef CTYPES_UNICODE From python-checkins at python.org Tue Aug 1 19:46:11 2006 From: python-checkins at python.org (thomas.heller) Date: Tue, 1 Aug 2006 19:46:11 +0200 (CEST) Subject: [Python-checkins] r51020 - python/trunk/Modules/_ctypes/callproc.c Message-ID: <20060801174611.05EF91E4006@bag.python.org> Author: thomas.heller Date: Tue Aug 1 19:46:10 2006 New Revision: 51020 Modified: python/trunk/Modules/_ctypes/callproc.c Log: Minimal useful docstring for CopyComPointer. Modified: python/trunk/Modules/_ctypes/callproc.c ============================================================================== --- python/trunk/Modules/_ctypes/callproc.c (original) +++ python/trunk/Modules/_ctypes/callproc.c Tue Aug 1 19:46:10 2006 @@ -1160,7 +1160,7 @@ } static char copy_com_pointer_doc[] = -"CopyComPointer(a, b) -> integer\n"; +"CopyComPointer(src, dst) -> HRESULT value\n"; static PyObject * copy_com_pointer(PyObject *self, PyObject *args) From python-checkins at python.org Tue Aug 1 20:16:15 2006 From: python-checkins at python.org (andrew.kuchling) Date: Tue, 1 Aug 2006 20:16:15 +0200 (CEST) Subject: [Python-checkins] r51021 - python/trunk/Lib/test/test_subprocess.py Message-ID: <20060801181615.AB3AF1E4009@bag.python.org> Author: andrew.kuchling Date: Tue Aug 1 20:16:15 2006 New Revision: 51021 Modified: python/trunk/Lib/test/test_subprocess.py Log: [Patch #1520905] Attempt to suppress core file created by test_subprocess.py. Patch by Douglas Greiman. The test_run_abort() testcase produces a core file on Unix systems, even though the test is successful. This can be confusing or alarming to someone who runs 'make test' and then finds that the Python interpreter apparently crashed. Modified: python/trunk/Lib/test/test_subprocess.py ============================================================================== --- python/trunk/Lib/test/test_subprocess.py (original) +++ python/trunk/Lib/test/test_subprocess.py Tue Aug 1 20:16:15 2006 @@ -476,10 +476,36 @@ else: self.fail("Expected OSError") + def _suppress_core_files(self): + """Try to prevent core files from being created. + Returns previous ulimit if successful, else None. + """ + try: + import resource + old_limit = resource.getrlimit(resource.RLIMIT_CORE) + resource.setrlimit(resource.RLIMIT_CORE, (0,0)) + return old_limit + except (ImportError, ValueError, resource.error): + return None + + def _unsuppress_core_files(self, old_limit): + """Return core file behavior to default.""" + if old_limit is None: + return + try: + import resource + resource.setrlimit(resource.RLIMIT_CORE, old_limit) + except (ImportError, ValueError, resource.error): + return + def test_run_abort(self): # returncode handles signal termination - p = subprocess.Popen([sys.executable, - "-c", "import os; os.abort()"]) + old_limit = self._suppress_core_files() + try: + p = subprocess.Popen([sys.executable, + "-c", "import os; os.abort()"]) + finally: + self._unsuppress_core_files(old_limit) p.wait() self.assertEqual(-p.returncode, signal.SIGABRT) From python-checkins at python.org Tue Aug 1 20:39:16 2006 From: python-checkins at python.org (brett.cannon) Date: Tue, 1 Aug 2006 20:39:16 +0200 (CEST) Subject: [Python-checkins] r51022 - python/branches/bcannon-sandboxing/Objects/object.c Message-ID: <20060801183916.2F1841E4006@bag.python.org> Author: brett.cannon Date: Tue Aug 1 20:39:15 2006 New Revision: 51022 Modified: python/branches/bcannon-sandboxing/Objects/object.c Log: Remove warning of unused variable in _PyObject_Del() when compiling without --with-track-memory. Modified: python/branches/bcannon-sandboxing/Objects/object.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/object.c (original) +++ python/branches/bcannon-sandboxing/Objects/object.c Tue Aug 1 20:39:15 2006 @@ -262,9 +262,7 @@ void _PyObject_Del(void *op) { - PyObject *obj_ptr = (PyObject *)op; - - PyObject_T_FREE(obj_ptr->ob_type->tp_name, op); + PyObject_T_FREE(((PyObject *)op)->ob_type->tp_name, op); } /* Implementation of PyObject_Print with recursion checking */ From python-checkins at python.org Tue Aug 1 20:49:25 2006 From: python-checkins at python.org (georg.brandl) Date: Tue, 1 Aug 2006 20:49:25 +0200 (CEST) Subject: [Python-checkins] r51023 - in python/trunk: Lib/os.py Misc/NEWS Message-ID: <20060801184925.2688F1E4006@bag.python.org> Author: georg.brandl Date: Tue Aug 1 20:49:24 2006 New Revision: 51023 Modified: python/trunk/Lib/os.py python/trunk/Misc/NEWS Log: os.urandom no longer masks unrelated exceptions like SystemExit or KeyboardInterrupt. Modified: python/trunk/Lib/os.py ============================================================================== --- python/trunk/Lib/os.py (original) +++ python/trunk/Lib/os.py Tue Aug 1 20:49:24 2006 @@ -723,7 +723,7 @@ """ try: _urandomfd = open("/dev/urandom", O_RDONLY) - except: + except (OSError, IOError): raise NotImplementedError("/dev/urandom (or equivalent) not found") bytes = "" while len(bytes) < n: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Aug 1 20:49:24 2006 @@ -61,6 +61,9 @@ Library ------- +- os.urandom no longer masks unrelated exceptions like SystemExit or + KeyboardInterrupt. + - Bug #1525866: Don't copy directory stat times in shutil.copytree on Windows From python-checkins at python.org Tue Aug 1 21:14:15 2006 From: python-checkins at python.org (thomas.heller) Date: Tue, 1 Aug 2006 21:14:15 +0200 (CEST) Subject: [Python-checkins] r51025 - python/trunk/Modules/_ctypes/stgdict.c Message-ID: <20060801191415.C12CE1E4006@bag.python.org> Author: thomas.heller Date: Tue Aug 1 21:14:15 2006 New Revision: 51025 Modified: python/trunk/Modules/_ctypes/stgdict.c Log: Speed up PyType_stgdict and PyObject_stgdict. Modified: python/trunk/Modules/_ctypes/stgdict.c ============================================================================== --- python/trunk/Modules/_ctypes/stgdict.c (original) +++ python/trunk/Modules/_ctypes/stgdict.c Tue Aug 1 21:14:15 2006 @@ -134,16 +134,25 @@ type = (PyTypeObject *)obj; if (!PyType_HasFeature(type, Py_TPFLAGS_HAVE_CLASS)) return NULL; - if (!type->tp_dict || !StgDict_Check(type->tp_dict)) + if (!type->tp_dict || !StgDict_CheckExact(type->tp_dict)) return NULL; return (StgDictObject *)type->tp_dict; } /* May return NULL, but does not set an exception! */ +/* + This function should be as fast as possible, so we don't call PyType_stgdict + above but inline the code, and avoid the PyType_Check(). +*/ StgDictObject * PyObject_stgdict(PyObject *self) { - return PyType_stgdict((PyObject *)self->ob_type); + PyTypeObject *type = self->ob_type; + if (!PyType_HasFeature(type, Py_TPFLAGS_HAVE_CLASS)) + return NULL; + if (!type->tp_dict || !StgDict_CheckExact(type->tp_dict)) + return NULL; + return (StgDictObject *)type->tp_dict; } /* descr is the descriptor for a field marked as anonymous. Get all the From buildbot at python.org Tue Aug 1 21:31:08 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 01 Aug 2006 19:31:08 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) trunk Message-ID: <20060801193108.CCB091E4006@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%2520trunk/builds/858 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Tue Aug 1 22:23:36 2006 From: python-checkins at python.org (brett.cannon) Date: Tue, 1 Aug 2006 22:23:36 +0200 (CEST) Subject: [Python-checkins] r51026 - in python/branches/bcannon-sandboxing: Include/pymem.h Parser/pgenmain.c Parser/tokenizer.c Message-ID: <20060801202336.390061E400B@bag.python.org> Author: brett.cannon Date: Tue Aug 1 22:23:34 2006 New Revision: 51026 Modified: python/branches/bcannon-sandboxing/Include/pymem.h python/branches/bcannon-sandboxing/Parser/pgenmain.c python/branches/bcannon-sandboxing/Parser/tokenizer.c Log: Finish converting Parser/* to be usable in face of tracked memory. Modified: python/branches/bcannon-sandboxing/Include/pymem.h ============================================================================== --- python/branches/bcannon-sandboxing/Include/pymem.h (original) +++ python/branches/bcannon-sandboxing/Include/pymem.h Tue Aug 1 22:23:34 2006 @@ -73,7 +73,7 @@ #endif /* PYMALLOC_DEBUG */ -#ifdef PYMALLOC +#ifdef WITH_PYMALLOC #define PyMem_RAW_MALLOC PyObject_Malloc #define PyMem_RAW_REALLOC PyObject_Realloc #define PyMem_RAW_FREE PyObject_Free Modified: python/branches/bcannon-sandboxing/Parser/pgenmain.c ============================================================================== --- python/branches/bcannon-sandboxing/Parser/pgenmain.c (original) +++ python/branches/bcannon-sandboxing/Parser/pgenmain.c Tue Aug 1 22:23:34 2006 @@ -104,7 +104,7 @@ putc(' ', stderr); } fprintf(stderr, "^\n"); - PyObject_FREE(err.text); + PyObject_Free(err.text); } Py_Exit(1); } @@ -136,7 +136,7 @@ PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt) { size_t n = 1000; - char *p = (char *)PyMem_MALLOC(n); + char *p = (char *)PyMem_RAW_MALLOC(n); char *q; if (p == NULL) return NULL; @@ -149,7 +149,7 @@ n = strlen(p); if (n > 0 && p[n-1] != '\n') p[n-1] = '\n'; - return (char *)PyMem_REALLOC(p, n+1); + return (char *)PyMem_RAW_REALLOC(p, n+1); } /* No-nonsense fgets */ Modified: python/branches/bcannon-sandboxing/Parser/tokenizer.c ============================================================================== --- python/branches/bcannon-sandboxing/Parser/tokenizer.c (original) +++ python/branches/bcannon-sandboxing/Parser/tokenizer.c Tue Aug 1 22:23:34 2006 @@ -105,7 +105,7 @@ static struct tok_state * tok_new(void) { - struct tok_state *tok = (struct tok_state *)PyMem_MALLOC( + struct tok_state *tok = (struct tok_state *)PyMem_RAW_MALLOC( sizeof(struct tok_state)); if (tok == NULL) return NULL; @@ -657,7 +657,7 @@ struct tok_state *tok = tok_new(); if (tok == NULL) return NULL; - if ((tok->buf = (char *)PyMem_MALLOC(BUFSIZ)) == NULL) { + if ((tok->buf = (char *)PyMem_RAW_MALLOC(BUFSIZ)) == NULL) { PyTokenizer_Free(tok); return NULL; } @@ -676,14 +676,14 @@ PyTokenizer_Free(struct tok_state *tok) { if (tok->encoding != NULL) - PyMem_FREE(tok->encoding); + PyMem_RAW_FREE(tok->encoding); #ifndef PGEN Py_XDECREF(tok->decoding_readline); Py_XDECREF(tok->decoding_buffer); #endif if (tok->fp != NULL && tok->buf != NULL) - PyMem_FREE(tok->buf); - PyMem_FREE(tok); + PyMem_RAW_FREE(tok->buf); + PyMem_RAW_FREE(tok); } #if !defined(PGEN) && defined(Py_USING_UNICODE) @@ -782,7 +782,7 @@ if (newtok == NULL) tok->done = E_INTR; else if (*newtok == '\0') { - PyMem_FREE(newtok); + PyMem_RAW_FREE(newtok); tok->done = E_EOF; } #if !defined(PGEN) && defined(Py_USING_UNICODE) @@ -794,12 +794,12 @@ size_t oldlen = tok->cur - tok->buf; size_t newlen = oldlen + strlen(newtok); char *buf = tok->buf; - buf = (char *)PyMem_REALLOC(buf, newlen+1); + buf = (char *)PyMem_RAW_REALLOC(buf, newlen+1); tok->lineno++; if (buf == NULL) { - PyMem_FREE(tok->buf); + PyMem_RAW_FREE(tok->buf); tok->buf = NULL; - PyMem_FREE(newtok); + PyMem_RAW_FREE(newtok); tok->done = E_NOMEM; return EOF; } @@ -807,7 +807,7 @@ tok->cur = tok->buf + oldlen; tok->line_start = tok->cur; strcpy(tok->buf + oldlen, newtok); - PyMem_FREE(newtok); + PyMem_RAW_FREE(newtok); tok->inp = tok->buf + newlen; tok->end = tok->inp + 1; tok->start = tok->buf + start; @@ -815,7 +815,7 @@ else { tok->lineno++; if (tok->buf != NULL) - PyMem_FREE(tok->buf); + PyMem_RAW_FREE(tok->buf); tok->buf = newtok; tok->line_start = tok->buf; tok->cur = tok->buf; @@ -831,7 +831,7 @@ if (tok->start == NULL) { if (tok->buf == NULL) { tok->buf = (char *) - PyMem_MALLOC(BUFSIZ); + PyMem_RAW_MALLOC(BUFSIZ); if (tok->buf == NULL) { tok->done = E_NOMEM; return EOF; @@ -866,7 +866,7 @@ Py_ssize_t curvalid = tok->inp - tok->buf; Py_ssize_t newsize = curvalid + BUFSIZ; char *newbuf = tok->buf; - newbuf = (char *)PyMem_REALLOC(newbuf, + newbuf = (char *)PyMem_RAW_REALLOC(newbuf, newsize); if (newbuf == NULL) { tok->done = E_NOMEM; From python-checkins at python.org Tue Aug 1 22:30:32 2006 From: python-checkins at python.org (ronald.oussoren) Date: Tue, 1 Aug 2006 22:30:32 +0200 (CEST) Subject: [Python-checkins] r51027 - python/trunk/Mac/BuildScript/scripts/postflight.patch-profile Message-ID: <20060801203032.0E84D1E4006@bag.python.org> Author: ronald.oussoren Date: Tue Aug 1 22:30:31 2006 New Revision: 51027 Modified: python/trunk/Mac/BuildScript/scripts/postflight.patch-profile Log: Make sure the postinstall action that optionally updates the user's profile on MacOS X actually works correctly in all cases. Modified: python/trunk/Mac/BuildScript/scripts/postflight.patch-profile ============================================================================== --- python/trunk/Mac/BuildScript/scripts/postflight.patch-profile (original) +++ python/trunk/Mac/BuildScript/scripts/postflight.patch-profile Tue Aug 1 22:30:31 2006 @@ -5,14 +5,27 @@ echo "These changes will be effective only in shell windows that you open" echo "after running this script." -PYVER=@PYVER@ +PYVER=2.5 PYTHON_ROOT="/Library/Frameworks/Python.framework/Versions/Current" +if [ `id -ur` = 0 ]; then + # Run from the installer, do some trickery to fetch the information + # we need. + theShell="`finger $USER | grep Shell: | head -1 | awk '{ print $NF }'`" + +else + theShell="${SHELL}" +fi + # Make sure the directory ${PYTHON_ROOT}/bin is on the users PATH. -BSH="`basename "${SHELL}"`" +BSH="`basename "${theShell}"`" case "${BSH}" in bash|ksh|sh|*csh) - P="`${SHELL} -c 'echo $PATH'`" + if [ `id -ur` = 0 ]; then + P=`su - ${USER} -c 'echo A-X-4-X@@$PATH@@X-4-X-A' | grep 'A-X-4-X@@.*@@X-4-X-A' | sed -e 's/^A-X-4-X@@//g' -e 's/@@X-4-X-A$//g'` + else + P="`(exec -l ${theShell} -c 'echo $PATH')`" + fi ;; *) echo "Sorry, I don't know how to patch $BSH shells" @@ -42,10 +55,15 @@ echo "# Setting PATH for MacPython ${PYVER}" >> "${HOME}/.cshrc" echo "# The orginal version is saved in .cshrc.pysave" >> "${HOME}/.cshrc" echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${HOME}/.cshrc" + if [ `id -ur` = 0 ]; then + chown "${USER}" "${HOME}/.cshrc" + fi exit 0 ;; bash) - if [ -e "${HOME}/.profile" ]; then + if [ -e "${HOME}/.bash_profile" ]; then + PR="${HOME}/.bash_profile" + elif [ -e "${HOME}/.profile" ]; then PR="${HOME}/.profile" else PR="${HOME}/.bash_profile" @@ -66,6 +84,6 @@ echo 'PATH="'"${PYTHON_ROOT}/bin"':${PATH}"' >> "${PR}" echo 'export PATH' >> "${PR}" if [ `id -ur` = 0 ]; then - chown "${LOGNAME}" "${PR}" + chown "${USER}" "${PR}" fi exit 0 From python-checkins at python.org Tue Aug 1 23:01:02 2006 From: python-checkins at python.org (ronald.oussoren) Date: Tue, 1 Aug 2006 23:01:02 +0200 (CEST) Subject: [Python-checkins] r51028 - in python/trunk: Mac/PythonLauncher/FileSettings.m Misc/NEWS Message-ID: <20060801210102.40CAF1E401A@bag.python.org> Author: ronald.oussoren Date: Tue Aug 1 23:00:57 2006 New Revision: 51028 Modified: python/trunk/Mac/PythonLauncher/FileSettings.m python/trunk/Misc/NEWS Log: This fixes bug #1527397: PythonLauncher runs scripts with the wrong working directory. It also fixes a bug where PythonLauncher failed to launch scripts when the scriptname (or the path to the script) contains quotes. Modified: python/trunk/Mac/PythonLauncher/FileSettings.m ============================================================================== --- python/trunk/Mac/PythonLauncher/FileSettings.m (original) +++ python/trunk/Mac/PythonLauncher/FileSettings.m Tue Aug 1 23:00:57 2006 @@ -245,12 +245,26 @@ if (value) with_terminal = [value boolValue]; } +- (NSString*)_replaceSingleQuotes: (NSString*)string +{ + /* Replace all single-quotes by '"'"', that way shellquoting will + * be correct when the result value is delimited using single quotes. + */ + NSArray* components = [string componentsSeparatedByString:@"'"]; + + return [components componentsJoinedByString:@"'\"'\"'"]; +} + - (NSString *)commandLineForScript: (NSString *)script { NSString *cur_interp = NULL; + NSString* script_dir = NULL; char hashbangbuf[1024]; FILE *fp; char *p; + + script_dir = [script substringToIndex: + [script length]-[[script lastPathComponent] length]]; if (honourhashbang && (fp=fopen([script cString], "r")) && @@ -266,8 +280,9 @@ cur_interp = interpreter; return [NSString stringWithFormat: - @"\"%@\"%s%s%s%s%s%s %@ \"%@\" %@ %s", - cur_interp, + @"cd '%@' && '%@'%s%s%s%s%s%s %@ '%@' %@ %s", + [self _replaceSingleQuotes:script_dir], + [self _replaceSingleQuotes:cur_interp], debug?" -d":"", verbose?" -v":"", inspect?" -i":"", @@ -275,7 +290,7 @@ nosite?" -S":"", tabs?" -t":"", others, - script, + [self _replaceSingleQuotes:script], scriptargs, with_terminal? "&& echo Exit status: $? && exit 1" : " &"]; } Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Aug 1 23:00:57 2006 @@ -185,6 +185,17 @@ - Bug #1439538: Drop usage of test -e in configure as it is not portable. +Mac +--- + +- PythonLauncher now works correctly when the path to the script contains + characters that are treated specially by the shell (such as quotes). + +- Bug #1527397: PythonLauncher now launches scripts with the working directory + set to the directory that contains the script instead of the user home + directory. That latter was an implementation accident and not what users + expect. + What's New in Python 2.5 beta 2? ================================ From python-checkins at python.org Tue Aug 1 23:54:45 2006 From: python-checkins at python.org (brett.cannon) Date: Tue, 1 Aug 2006 23:54:45 +0200 (CEST) Subject: [Python-checkins] r51029 - python/branches/bcannon-sandboxing Message-ID: <20060801215445.1D9A51E4009@bag.python.org> Author: brett.cannon Date: Tue Aug 1 23:54:44 2006 New Revision: 51029 Modified: python/branches/bcannon-sandboxing/ (props changed) Log: Initialized merge tracking via "svnmerge" with revisions "1-47247" from svn+ssh://pythondev at svn.python.org/python/trunk From python-checkins at python.org Wed Aug 2 00:52:37 2006 From: python-checkins at python.org (brett.cannon) Date: Wed, 2 Aug 2006 00:52:37 +0200 (CEST) Subject: [Python-checkins] r51030 - in python/branches/bcannon-sandboxing: Doc/Makefile.deps Doc/api/api.tex Doc/api/concrete.tex Doc/api/exceptions.tex Doc/api/intro.tex Doc/api/refcounts.dat Doc/commontex/boilerplate.tex Doc/dist/dist.tex Doc/doc/doc.tex Doc/ext/newtypes.tex Doc/ext/windows.tex Doc/howto/doanddont.tex Doc/inst/inst.tex Doc/lib/email.tex Doc/lib/emailgenerator.tex Doc/lib/lib.tex Doc/lib/libanydbm.tex Doc/lib/libbase64.tex Doc/lib/libbinascii.tex Doc/lib/libbsddb.tex Doc/lib/libcompileall.tex Doc/lib/libcookielib.tex Doc/lib/libcsv.tex Doc/lib/libctypes.tex Doc/lib/libetree.tex Doc/lib/libfuncs.tex Doc/lib/libgettext.tex Doc/lib/libimp.tex Doc/lib/libinspect.tex Doc/lib/liblogging.tex Doc/lib/libmailbox.tex Doc/lib/libmimetypes.tex Doc/lib/libnew.tex Doc/lib/liboptparse.tex Doc/lib/libossaudiodev.tex Doc/lib/libpickle.tex Doc/lib/libpkgutil.tex Doc/lib/libposixpath.tex Doc/lib/librandom.tex Doc/lib/libre.tex Doc/lib/libreadline.tex Doc/lib/librunpy.tex Doc/lib/libshelve.tex Doc/lib/libsocket.tex Doc/lib/libsocksvr.tex Doc/lib/libsqlite3.tex Doc/lib/libstdtypes.tex Doc/lib/libstringio.tex Doc/lib/libsubprocess.tex Doc/lib/libsys.tex Doc/lib/libtime.tex Doc/lib/libturtle.tex Doc/lib/libtypes.tex Doc/lib/libundoc.tex Doc/lib/libunicodedata.tex Doc/lib/liburllib.tex Doc/lib/liburllib2.tex Doc/lib/libuuid.tex Doc/lib/libwarnings.tex Doc/lib/libweakref.tex Doc/lib/libwebbrowser.tex Doc/lib/libzipfile.tex Doc/lib/sqlite3/complete_statement.py Doc/lib/tkinter.tex Doc/mac/libmacfs.tex Doc/mac/libmacos.tex Doc/mac/using.tex Doc/ref/ref3.tex Doc/tut/tut.tex Doc/whatsnew/whatsnew20.tex Doc/whatsnew/whatsnew21.tex Doc/whatsnew/whatsnew23.tex Doc/whatsnew/whatsnew24.tex Doc/whatsnew/whatsnew25.tex Include/patchlevel.h Include/pyerrors.h Include/pystate.h Lib/binhex.py Lib/bsddb/test/test_basics.py Lib/compiler/future.py Lib/compiler/transformer.py Lib/ctypes/__init__.py Lib/ctypes/test/test_parameters.py Lib/ctypes/test/test_pointers.py Lib/ctypes/test/test_structures.py Lib/ctypes/test/test_varsize_struct.py Lib/ctypes/test/test_win32.py Lib/ctypes/util.py Lib/distutils/__init__.py Lib/distutils/command/upload.py Lib/distutils/msvccompiler.py Lib/doctest.py Lib/email/__init__.py Lib/email/message.py Lib/email/test/test_email.py Lib/email/test/test_email_renamed.py Lib/email/utils.py Lib/httplib.py Lib/idlelib/CREDITS.txt Lib/idlelib/CallTipWindow.py Lib/idlelib/CallTips.py Lib/idlelib/CodeContext.py Lib/idlelib/ColorDelegator.py Lib/idlelib/EditorWindow.py Lib/idlelib/NEWS.txt Lib/idlelib/ParenMatch.py Lib/idlelib/PyShell.py Lib/idlelib/ScriptBinding.py Lib/idlelib/config-keys.def Lib/idlelib/idlever.py Lib/idlelib/keybindingDialog.py Lib/idlelib/macosxSupport.py Lib/inspect.py Lib/lib-tk/Tkinter.py Lib/lib-tk/turtle.py Lib/logging/handlers.py Lib/mailbox.py Lib/msilib/__init__.py Lib/optparse.py Lib/os.py Lib/pdb.py Lib/pkgutil.py Lib/popen2.py Lib/pydoc.py Lib/runpy.py Lib/shutil.py Lib/socket.py Lib/struct.py Lib/subprocess.py Lib/tarfile.py Lib/test/crashers/bogus_code_obj.py Lib/test/crashers/borrowed_ref_1.py Lib/test/crashers/borrowed_ref_2.py Lib/test/crashers/gc_inspection.py Lib/test/crashers/recursion_limit_too_high.py Lib/test/crashers/recursive_call.py Lib/test/fork_wait.py Lib/test/output/test_ossaudiodev Lib/test/string_tests.py Lib/test/test_ast.py Lib/test/test_bsddb.py Lib/test/test_compile.py Lib/test/test_compiler.py Lib/test/test_defaultdict.py Lib/test/test_dis.py Lib/test/test_doctest.py Lib/test/test_email_codecs.py Lib/test/test_filecmp.py Lib/test/test_fork1.py Lib/test/test_generators.py Lib/test/test_getargs2.py Lib/test/test_grammar.py Lib/test/test_inspect.py Lib/test/test_iterlen.py Lib/test/test_mailbox.py Lib/test/test_mimetools.py Lib/test/test_mimetypes.py Lib/test/test_minidom.py Lib/test/test_multibytecodec.py Lib/test/test_optparse.py Lib/test/test_ossaudiodev.py Lib/test/test_runpy.py Lib/test/test_sax.py Lib/test/test_scope.py Lib/test/test_shutil.py Lib/test/test_signal.py Lib/test/test_subprocess.py Lib/test/test_sys.py Lib/test/test_time.py Lib/test/test_traceback.py Lib/test/test_urllib2.py Lib/test/test_uuid.py Lib/test/test_wait3.py Lib/test/test_wait4.py Lib/test/test_winreg.py Lib/test/test_xml_etree.py Lib/test/test_xml_etree_c.py Lib/traceback.py Lib/types.py Lib/urllib.py Lib/urllib2.py Lib/uuid.py Lib/warnings.py Lib/xml Lib/xml.py Lib/xml/dom Lib/xml/parsers Lib/xml/sax Lib/xmlcore Lib/zipfile.py Mac/BuildScript/scripts/postflight.patch-profile Mac/IDLE/config-main.def Mac/Modules/MacOS.c Mac/Modules/macosmodule.c Mac/PythonLauncher/FileSettings.m Makefile.pre.in Misc/ACKS Misc/NEWS Misc/RPM/python-2.5.spec Misc/build.sh Misc/python-config.in Modules/_bsddb.c Modules/_ctypes/_ctypes.c Modules/_ctypes/callbacks.c Modules/_ctypes/callproc.c Modules/_ctypes/cfield.c Modules/_ctypes/ctypes.h Modules/_ctypes/libffi/configure Modules/_ctypes/libffi/configure.ac Modules/_ctypes/stgdict.c Modules/_cursesmodule.c Modules/_sqlite/cursor.c Modules/_sqlite/util.c Modules/_sqlite/util.h Modules/_ssl.c Modules/_struct.c Modules/_testcapimodule.c Modules/_tkinter.c Modules/_typesmodule.c Modules/bz2module.c Modules/cPickle.c Modules/collectionsmodule.c Modules/config.c.in Modules/cryptmodule.c Modules/dlmodule.c Modules/expat/xmlparse.c Modules/fcntlmodule.c Modules/fpectlmodule.c Modules/getpath.c Modules/itertoolsmodule.c Modules/main.c Modules/posixmodule.c Modules/pyexpat.c Modules/readline.c Modules/selectmodule.c Modules/socketmodule.c Modules/timemodule.c Modules/unicodedata.c Objects/codeobject.c Objects/complexobject.c Objects/dictobject.c Objects/fileobject.c Objects/frameobject.c Objects/funcobject.c Objects/listsort.txt Objects/longobject.c Objects/setobject.c Objects/stringobject.c Objects/typeobject.c Objects/unicodeobject.c PC/_winreg.c PC/config.c PC/getpathp.c PC/os2emx/Makefile PC/os2emx/README.os2emx PC/os2emx/config.c PC/os2emx/pyconfig.h PC/os2emx/python24.def PC/os2emx/python25.def PC/winsound.c PCbuild/_ssl.vcproj PCbuild/build_ssl.bat PCbuild/build_ssl.py PCbuild/pythoncore.vcproj PCbuild/readme.txt Python/ast.c Python/compile.c Python/errors.c Python/future.c Python/getargs.c Python/getopt.c Python/import.c Python/mactoolboxglue.c Python/mystrtoul.c Python/pyarena.c Python/pystate.c Python/pythonrun.c Python/symtable.c Python/sysmodule.c Python/thread.c Python/thread_os2.h README Tools/buildbot/kill_python.c Tools/faqwiz/faqw.py Tools/msi Tools/msi/msi.py Tools/msi/uuids.py Tools/scripts/README Tools/webchecker/webchecker.py configure configure.in Message-ID: <20060801225237.344881E400A@bag.python.org> Author: brett.cannon Date: Wed Aug 2 00:51:44 2006 New Revision: 51030 Added: python/branches/bcannon-sandboxing/Doc/lib/libetree.tex - copied unchanged from r51028, python/trunk/Doc/lib/libetree.tex python/branches/bcannon-sandboxing/Lib/test/crashers/borrowed_ref_1.py - copied unchanged from r51028, python/trunk/Lib/test/crashers/borrowed_ref_1.py python/branches/bcannon-sandboxing/Lib/test/crashers/borrowed_ref_2.py - copied unchanged from r51028, python/trunk/Lib/test/crashers/borrowed_ref_2.py python/branches/bcannon-sandboxing/Lib/test/crashers/recursion_limit_too_high.py - copied unchanged from r51028, python/trunk/Lib/test/crashers/recursion_limit_too_high.py python/branches/bcannon-sandboxing/Lib/xml/ (props changed) - copied from r51028, python/trunk/Lib/xml/ python/branches/bcannon-sandboxing/Mac/Modules/MacOS.c - copied unchanged from r51028, python/trunk/Mac/Modules/MacOS.c python/branches/bcannon-sandboxing/Modules/_typesmodule.c - copied unchanged from r51028, python/trunk/Modules/_typesmodule.c python/branches/bcannon-sandboxing/PC/os2emx/python25.def - copied unchanged from r51028, python/trunk/PC/os2emx/python25.def python/branches/bcannon-sandboxing/PCbuild/build_ssl.bat - copied unchanged from r51028, python/trunk/PCbuild/build_ssl.bat Removed: python/branches/bcannon-sandboxing/Lib/xml.py python/branches/bcannon-sandboxing/Lib/xmlcore/ python/branches/bcannon-sandboxing/Mac/Modules/macosmodule.c python/branches/bcannon-sandboxing/PC/os2emx/python24.def Modified: python/branches/bcannon-sandboxing/ (props changed) python/branches/bcannon-sandboxing/Doc/Makefile.deps python/branches/bcannon-sandboxing/Doc/api/api.tex python/branches/bcannon-sandboxing/Doc/api/concrete.tex python/branches/bcannon-sandboxing/Doc/api/exceptions.tex python/branches/bcannon-sandboxing/Doc/api/intro.tex python/branches/bcannon-sandboxing/Doc/api/refcounts.dat python/branches/bcannon-sandboxing/Doc/commontex/boilerplate.tex python/branches/bcannon-sandboxing/Doc/dist/dist.tex python/branches/bcannon-sandboxing/Doc/doc/doc.tex python/branches/bcannon-sandboxing/Doc/ext/newtypes.tex python/branches/bcannon-sandboxing/Doc/ext/windows.tex python/branches/bcannon-sandboxing/Doc/howto/doanddont.tex python/branches/bcannon-sandboxing/Doc/inst/inst.tex python/branches/bcannon-sandboxing/Doc/lib/email.tex python/branches/bcannon-sandboxing/Doc/lib/emailgenerator.tex python/branches/bcannon-sandboxing/Doc/lib/lib.tex python/branches/bcannon-sandboxing/Doc/lib/libanydbm.tex python/branches/bcannon-sandboxing/Doc/lib/libbase64.tex python/branches/bcannon-sandboxing/Doc/lib/libbinascii.tex python/branches/bcannon-sandboxing/Doc/lib/libbsddb.tex python/branches/bcannon-sandboxing/Doc/lib/libcompileall.tex python/branches/bcannon-sandboxing/Doc/lib/libcookielib.tex python/branches/bcannon-sandboxing/Doc/lib/libcsv.tex python/branches/bcannon-sandboxing/Doc/lib/libctypes.tex python/branches/bcannon-sandboxing/Doc/lib/libfuncs.tex python/branches/bcannon-sandboxing/Doc/lib/libgettext.tex python/branches/bcannon-sandboxing/Doc/lib/libimp.tex python/branches/bcannon-sandboxing/Doc/lib/libinspect.tex python/branches/bcannon-sandboxing/Doc/lib/liblogging.tex python/branches/bcannon-sandboxing/Doc/lib/libmailbox.tex python/branches/bcannon-sandboxing/Doc/lib/libmimetypes.tex python/branches/bcannon-sandboxing/Doc/lib/libnew.tex python/branches/bcannon-sandboxing/Doc/lib/liboptparse.tex python/branches/bcannon-sandboxing/Doc/lib/libossaudiodev.tex python/branches/bcannon-sandboxing/Doc/lib/libpickle.tex python/branches/bcannon-sandboxing/Doc/lib/libpkgutil.tex python/branches/bcannon-sandboxing/Doc/lib/libposixpath.tex python/branches/bcannon-sandboxing/Doc/lib/librandom.tex python/branches/bcannon-sandboxing/Doc/lib/libre.tex python/branches/bcannon-sandboxing/Doc/lib/libreadline.tex python/branches/bcannon-sandboxing/Doc/lib/librunpy.tex python/branches/bcannon-sandboxing/Doc/lib/libshelve.tex python/branches/bcannon-sandboxing/Doc/lib/libsocket.tex python/branches/bcannon-sandboxing/Doc/lib/libsocksvr.tex python/branches/bcannon-sandboxing/Doc/lib/libsqlite3.tex python/branches/bcannon-sandboxing/Doc/lib/libstdtypes.tex python/branches/bcannon-sandboxing/Doc/lib/libstringio.tex python/branches/bcannon-sandboxing/Doc/lib/libsubprocess.tex python/branches/bcannon-sandboxing/Doc/lib/libsys.tex python/branches/bcannon-sandboxing/Doc/lib/libtime.tex python/branches/bcannon-sandboxing/Doc/lib/libturtle.tex python/branches/bcannon-sandboxing/Doc/lib/libtypes.tex python/branches/bcannon-sandboxing/Doc/lib/libundoc.tex python/branches/bcannon-sandboxing/Doc/lib/libunicodedata.tex python/branches/bcannon-sandboxing/Doc/lib/liburllib.tex python/branches/bcannon-sandboxing/Doc/lib/liburllib2.tex python/branches/bcannon-sandboxing/Doc/lib/libuuid.tex python/branches/bcannon-sandboxing/Doc/lib/libwarnings.tex python/branches/bcannon-sandboxing/Doc/lib/libweakref.tex python/branches/bcannon-sandboxing/Doc/lib/libwebbrowser.tex python/branches/bcannon-sandboxing/Doc/lib/libzipfile.tex python/branches/bcannon-sandboxing/Doc/lib/sqlite3/complete_statement.py python/branches/bcannon-sandboxing/Doc/lib/tkinter.tex python/branches/bcannon-sandboxing/Doc/mac/libmacfs.tex python/branches/bcannon-sandboxing/Doc/mac/libmacos.tex python/branches/bcannon-sandboxing/Doc/mac/using.tex python/branches/bcannon-sandboxing/Doc/ref/ref3.tex python/branches/bcannon-sandboxing/Doc/tut/tut.tex python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew20.tex python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew21.tex python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew23.tex python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew24.tex python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew25.tex python/branches/bcannon-sandboxing/Include/patchlevel.h python/branches/bcannon-sandboxing/Include/pyerrors.h python/branches/bcannon-sandboxing/Include/pystate.h python/branches/bcannon-sandboxing/Lib/binhex.py python/branches/bcannon-sandboxing/Lib/bsddb/test/test_basics.py python/branches/bcannon-sandboxing/Lib/compiler/future.py python/branches/bcannon-sandboxing/Lib/compiler/transformer.py python/branches/bcannon-sandboxing/Lib/ctypes/__init__.py python/branches/bcannon-sandboxing/Lib/ctypes/test/test_parameters.py python/branches/bcannon-sandboxing/Lib/ctypes/test/test_pointers.py python/branches/bcannon-sandboxing/Lib/ctypes/test/test_structures.py python/branches/bcannon-sandboxing/Lib/ctypes/test/test_varsize_struct.py python/branches/bcannon-sandboxing/Lib/ctypes/test/test_win32.py python/branches/bcannon-sandboxing/Lib/ctypes/util.py python/branches/bcannon-sandboxing/Lib/distutils/__init__.py python/branches/bcannon-sandboxing/Lib/distutils/command/upload.py python/branches/bcannon-sandboxing/Lib/distutils/msvccompiler.py python/branches/bcannon-sandboxing/Lib/doctest.py python/branches/bcannon-sandboxing/Lib/email/__init__.py python/branches/bcannon-sandboxing/Lib/email/message.py python/branches/bcannon-sandboxing/Lib/email/test/test_email.py python/branches/bcannon-sandboxing/Lib/email/test/test_email_renamed.py python/branches/bcannon-sandboxing/Lib/email/utils.py python/branches/bcannon-sandboxing/Lib/httplib.py python/branches/bcannon-sandboxing/Lib/idlelib/CREDITS.txt python/branches/bcannon-sandboxing/Lib/idlelib/CallTipWindow.py python/branches/bcannon-sandboxing/Lib/idlelib/CallTips.py python/branches/bcannon-sandboxing/Lib/idlelib/CodeContext.py python/branches/bcannon-sandboxing/Lib/idlelib/ColorDelegator.py python/branches/bcannon-sandboxing/Lib/idlelib/EditorWindow.py python/branches/bcannon-sandboxing/Lib/idlelib/NEWS.txt python/branches/bcannon-sandboxing/Lib/idlelib/ParenMatch.py python/branches/bcannon-sandboxing/Lib/idlelib/PyShell.py python/branches/bcannon-sandboxing/Lib/idlelib/ScriptBinding.py python/branches/bcannon-sandboxing/Lib/idlelib/config-keys.def python/branches/bcannon-sandboxing/Lib/idlelib/idlever.py python/branches/bcannon-sandboxing/Lib/idlelib/keybindingDialog.py python/branches/bcannon-sandboxing/Lib/idlelib/macosxSupport.py python/branches/bcannon-sandboxing/Lib/inspect.py python/branches/bcannon-sandboxing/Lib/lib-tk/Tkinter.py python/branches/bcannon-sandboxing/Lib/lib-tk/turtle.py python/branches/bcannon-sandboxing/Lib/logging/handlers.py python/branches/bcannon-sandboxing/Lib/mailbox.py python/branches/bcannon-sandboxing/Lib/msilib/__init__.py python/branches/bcannon-sandboxing/Lib/optparse.py python/branches/bcannon-sandboxing/Lib/os.py python/branches/bcannon-sandboxing/Lib/pdb.py python/branches/bcannon-sandboxing/Lib/pkgutil.py python/branches/bcannon-sandboxing/Lib/popen2.py python/branches/bcannon-sandboxing/Lib/pydoc.py python/branches/bcannon-sandboxing/Lib/runpy.py python/branches/bcannon-sandboxing/Lib/shutil.py python/branches/bcannon-sandboxing/Lib/socket.py python/branches/bcannon-sandboxing/Lib/struct.py python/branches/bcannon-sandboxing/Lib/subprocess.py python/branches/bcannon-sandboxing/Lib/tarfile.py python/branches/bcannon-sandboxing/Lib/test/crashers/bogus_code_obj.py python/branches/bcannon-sandboxing/Lib/test/crashers/gc_inspection.py python/branches/bcannon-sandboxing/Lib/test/crashers/recursive_call.py python/branches/bcannon-sandboxing/Lib/test/fork_wait.py python/branches/bcannon-sandboxing/Lib/test/output/test_ossaudiodev python/branches/bcannon-sandboxing/Lib/test/string_tests.py python/branches/bcannon-sandboxing/Lib/test/test_ast.py python/branches/bcannon-sandboxing/Lib/test/test_bsddb.py python/branches/bcannon-sandboxing/Lib/test/test_compile.py python/branches/bcannon-sandboxing/Lib/test/test_compiler.py python/branches/bcannon-sandboxing/Lib/test/test_defaultdict.py python/branches/bcannon-sandboxing/Lib/test/test_dis.py python/branches/bcannon-sandboxing/Lib/test/test_doctest.py python/branches/bcannon-sandboxing/Lib/test/test_email_codecs.py python/branches/bcannon-sandboxing/Lib/test/test_filecmp.py python/branches/bcannon-sandboxing/Lib/test/test_fork1.py python/branches/bcannon-sandboxing/Lib/test/test_generators.py python/branches/bcannon-sandboxing/Lib/test/test_getargs2.py python/branches/bcannon-sandboxing/Lib/test/test_grammar.py python/branches/bcannon-sandboxing/Lib/test/test_inspect.py python/branches/bcannon-sandboxing/Lib/test/test_iterlen.py python/branches/bcannon-sandboxing/Lib/test/test_mailbox.py python/branches/bcannon-sandboxing/Lib/test/test_mimetools.py python/branches/bcannon-sandboxing/Lib/test/test_mimetypes.py python/branches/bcannon-sandboxing/Lib/test/test_minidom.py python/branches/bcannon-sandboxing/Lib/test/test_multibytecodec.py python/branches/bcannon-sandboxing/Lib/test/test_optparse.py python/branches/bcannon-sandboxing/Lib/test/test_ossaudiodev.py python/branches/bcannon-sandboxing/Lib/test/test_runpy.py python/branches/bcannon-sandboxing/Lib/test/test_sax.py python/branches/bcannon-sandboxing/Lib/test/test_scope.py python/branches/bcannon-sandboxing/Lib/test/test_shutil.py python/branches/bcannon-sandboxing/Lib/test/test_signal.py python/branches/bcannon-sandboxing/Lib/test/test_subprocess.py python/branches/bcannon-sandboxing/Lib/test/test_sys.py python/branches/bcannon-sandboxing/Lib/test/test_time.py python/branches/bcannon-sandboxing/Lib/test/test_traceback.py python/branches/bcannon-sandboxing/Lib/test/test_urllib2.py python/branches/bcannon-sandboxing/Lib/test/test_uuid.py python/branches/bcannon-sandboxing/Lib/test/test_wait3.py python/branches/bcannon-sandboxing/Lib/test/test_wait4.py python/branches/bcannon-sandboxing/Lib/test/test_winreg.py python/branches/bcannon-sandboxing/Lib/test/test_xml_etree.py python/branches/bcannon-sandboxing/Lib/test/test_xml_etree_c.py python/branches/bcannon-sandboxing/Lib/traceback.py python/branches/bcannon-sandboxing/Lib/types.py python/branches/bcannon-sandboxing/Lib/urllib.py python/branches/bcannon-sandboxing/Lib/urllib2.py python/branches/bcannon-sandboxing/Lib/uuid.py python/branches/bcannon-sandboxing/Lib/warnings.py python/branches/bcannon-sandboxing/Lib/xml/dom/ (props changed) python/branches/bcannon-sandboxing/Lib/xml/parsers/ (props changed) python/branches/bcannon-sandboxing/Lib/xml/sax/ (props changed) python/branches/bcannon-sandboxing/Lib/zipfile.py python/branches/bcannon-sandboxing/Mac/BuildScript/scripts/postflight.patch-profile python/branches/bcannon-sandboxing/Mac/IDLE/config-main.def python/branches/bcannon-sandboxing/Mac/PythonLauncher/FileSettings.m python/branches/bcannon-sandboxing/Makefile.pre.in python/branches/bcannon-sandboxing/Misc/ACKS python/branches/bcannon-sandboxing/Misc/NEWS python/branches/bcannon-sandboxing/Misc/RPM/python-2.5.spec python/branches/bcannon-sandboxing/Misc/build.sh python/branches/bcannon-sandboxing/Misc/python-config.in python/branches/bcannon-sandboxing/Modules/_bsddb.c python/branches/bcannon-sandboxing/Modules/_ctypes/_ctypes.c python/branches/bcannon-sandboxing/Modules/_ctypes/callbacks.c python/branches/bcannon-sandboxing/Modules/_ctypes/callproc.c python/branches/bcannon-sandboxing/Modules/_ctypes/cfield.c python/branches/bcannon-sandboxing/Modules/_ctypes/ctypes.h python/branches/bcannon-sandboxing/Modules/_ctypes/libffi/configure python/branches/bcannon-sandboxing/Modules/_ctypes/libffi/configure.ac python/branches/bcannon-sandboxing/Modules/_ctypes/stgdict.c python/branches/bcannon-sandboxing/Modules/_cursesmodule.c python/branches/bcannon-sandboxing/Modules/_sqlite/cursor.c python/branches/bcannon-sandboxing/Modules/_sqlite/util.c python/branches/bcannon-sandboxing/Modules/_sqlite/util.h python/branches/bcannon-sandboxing/Modules/_ssl.c python/branches/bcannon-sandboxing/Modules/_struct.c python/branches/bcannon-sandboxing/Modules/_testcapimodule.c python/branches/bcannon-sandboxing/Modules/_tkinter.c python/branches/bcannon-sandboxing/Modules/bz2module.c python/branches/bcannon-sandboxing/Modules/cPickle.c python/branches/bcannon-sandboxing/Modules/collectionsmodule.c python/branches/bcannon-sandboxing/Modules/config.c.in python/branches/bcannon-sandboxing/Modules/cryptmodule.c python/branches/bcannon-sandboxing/Modules/dlmodule.c python/branches/bcannon-sandboxing/Modules/expat/xmlparse.c python/branches/bcannon-sandboxing/Modules/fcntlmodule.c python/branches/bcannon-sandboxing/Modules/fpectlmodule.c python/branches/bcannon-sandboxing/Modules/getpath.c python/branches/bcannon-sandboxing/Modules/itertoolsmodule.c python/branches/bcannon-sandboxing/Modules/main.c python/branches/bcannon-sandboxing/Modules/posixmodule.c python/branches/bcannon-sandboxing/Modules/pyexpat.c python/branches/bcannon-sandboxing/Modules/readline.c python/branches/bcannon-sandboxing/Modules/selectmodule.c python/branches/bcannon-sandboxing/Modules/socketmodule.c python/branches/bcannon-sandboxing/Modules/timemodule.c python/branches/bcannon-sandboxing/Modules/unicodedata.c python/branches/bcannon-sandboxing/Objects/codeobject.c python/branches/bcannon-sandboxing/Objects/complexobject.c python/branches/bcannon-sandboxing/Objects/dictobject.c python/branches/bcannon-sandboxing/Objects/fileobject.c python/branches/bcannon-sandboxing/Objects/frameobject.c python/branches/bcannon-sandboxing/Objects/funcobject.c python/branches/bcannon-sandboxing/Objects/listsort.txt python/branches/bcannon-sandboxing/Objects/longobject.c python/branches/bcannon-sandboxing/Objects/setobject.c python/branches/bcannon-sandboxing/Objects/stringobject.c python/branches/bcannon-sandboxing/Objects/typeobject.c python/branches/bcannon-sandboxing/Objects/unicodeobject.c python/branches/bcannon-sandboxing/PC/_winreg.c python/branches/bcannon-sandboxing/PC/config.c python/branches/bcannon-sandboxing/PC/getpathp.c python/branches/bcannon-sandboxing/PC/os2emx/Makefile python/branches/bcannon-sandboxing/PC/os2emx/README.os2emx python/branches/bcannon-sandboxing/PC/os2emx/config.c python/branches/bcannon-sandboxing/PC/os2emx/pyconfig.h python/branches/bcannon-sandboxing/PC/winsound.c python/branches/bcannon-sandboxing/PCbuild/_ssl.vcproj python/branches/bcannon-sandboxing/PCbuild/build_ssl.py python/branches/bcannon-sandboxing/PCbuild/pythoncore.vcproj python/branches/bcannon-sandboxing/PCbuild/readme.txt python/branches/bcannon-sandboxing/Python/ast.c python/branches/bcannon-sandboxing/Python/compile.c python/branches/bcannon-sandboxing/Python/errors.c python/branches/bcannon-sandboxing/Python/future.c python/branches/bcannon-sandboxing/Python/getargs.c python/branches/bcannon-sandboxing/Python/getopt.c python/branches/bcannon-sandboxing/Python/import.c python/branches/bcannon-sandboxing/Python/mactoolboxglue.c python/branches/bcannon-sandboxing/Python/mystrtoul.c python/branches/bcannon-sandboxing/Python/pyarena.c python/branches/bcannon-sandboxing/Python/pystate.c python/branches/bcannon-sandboxing/Python/pythonrun.c python/branches/bcannon-sandboxing/Python/symtable.c python/branches/bcannon-sandboxing/Python/sysmodule.c python/branches/bcannon-sandboxing/Python/thread.c python/branches/bcannon-sandboxing/Python/thread_os2.h python/branches/bcannon-sandboxing/README python/branches/bcannon-sandboxing/Tools/buildbot/kill_python.c python/branches/bcannon-sandboxing/Tools/faqwiz/faqw.py python/branches/bcannon-sandboxing/Tools/msi/ (props changed) python/branches/bcannon-sandboxing/Tools/msi/msi.py python/branches/bcannon-sandboxing/Tools/msi/uuids.py python/branches/bcannon-sandboxing/Tools/scripts/README python/branches/bcannon-sandboxing/Tools/webchecker/webchecker.py python/branches/bcannon-sandboxing/configure python/branches/bcannon-sandboxing/configure.in Log: Merged revisions 47248-51029 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk Modified: python/branches/bcannon-sandboxing/Doc/Makefile.deps ============================================================================== --- python/branches/bcannon-sandboxing/Doc/Makefile.deps (original) +++ python/branches/bcannon-sandboxing/Doc/Makefile.deps Wed Aug 2 00:51:44 2006 @@ -270,6 +270,7 @@ lib/xmlsaxhandler.tex \ lib/xmlsaxutils.tex \ lib/xmlsaxreader.tex \ + lib/libetree.tex \ lib/libqueue.tex \ lib/liblocale.tex \ lib/libgettext.tex \ Modified: python/branches/bcannon-sandboxing/Doc/api/api.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/api/api.tex (original) +++ python/branches/bcannon-sandboxing/Doc/api/api.tex Wed Aug 2 00:51:44 2006 @@ -48,11 +48,6 @@ \input{newtypes} -% \chapter{Debugging \label{debugging}} -% -% XXX Explain Py_DEBUG, Py_TRACE_REFS, Py_REF_DEBUG. - - \appendix \chapter{Reporting Bugs} \input{reportingbugs} Modified: python/branches/bcannon-sandboxing/Doc/api/concrete.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/api/concrete.tex (original) +++ python/branches/bcannon-sandboxing/Doc/api/concrete.tex Wed Aug 2 00:51:44 2006 @@ -376,7 +376,7 @@ \versionadded{2.3} \end{cfuncdesc} -\begin{cfuncdesc}{unsigned long}{PyLong_AsUnsignedLongLongMask}{PyObject *io} +\begin{cfuncdesc}{unsigned PY_LONG_LONG}{PyLong_AsUnsignedLongLongMask}{PyObject *io} Return a C \ctype{unsigned long long} from a Python long integer, without checking for overflow. \versionadded{2.3} Modified: python/branches/bcannon-sandboxing/Doc/api/exceptions.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/api/exceptions.tex (original) +++ python/branches/bcannon-sandboxing/Doc/api/exceptions.tex Wed Aug 2 00:51:44 2006 @@ -259,10 +259,14 @@ argument. It is mostly for internal use. \end{cfuncdesc} -\begin{cfuncdesc}{int}{PyErr_Warn}{PyObject *category, char *message} +\begin{cfuncdesc}{int}{PyErr_WarnEx}{PyObject *category, char *message, int stacklevel} Issue a warning message. The \var{category} argument is a warning category (see below) or \NULL; the \var{message} argument is a - message string. + message string. \var{stacklevel} is a positive number giving a + number of stack frames; the warning will be issued from the + currently executing line of code in that stack frame. A \var{stacklevel} + of 1 is the function calling \cfunction{PyErr_WarnEx()}, 2 is + the function above that, and so forth. This function normally prints a warning message to \var{sys.stderr}; however, it is also possible that the user has specified that @@ -294,6 +298,16 @@ command line documentation. There is no C API for warning control. \end{cfuncdesc} +\begin{cfuncdesc}{int}{PyErr_Warn}{PyObject *category, char *message} + Issue a warning message. The \var{category} argument is a warning + category (see below) or \NULL; the \var{message} argument is a + message string. The warning will appear to be issued from the function + calling \cfunction{PyErr_Warn()}, equivalent to calling + \cfunction{PyErr_WarnEx()} with a \var{stacklevel} of 1. + + Deprecated; use \cfunction{PyErr_WarnEx()} instead. +\end{cfuncdesc} + \begin{cfuncdesc}{int}{PyErr_WarnExplicit}{PyObject *category, const char *message, const char *filename, int lineno, const char *module, PyObject *registry} Modified: python/branches/bcannon-sandboxing/Doc/api/intro.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/api/intro.tex (original) +++ python/branches/bcannon-sandboxing/Doc/api/intro.tex Wed Aug 2 00:51:44 2006 @@ -580,3 +580,59 @@ Notice that \cfunction{Py_Finalize} does \emph{not} free all memory allocated by the Python interpreter, e.g. memory allocated by extension modules currently cannot be released. + + +\section{Debugging Builds \label{debugging}} + +Python can be built with several macros to enable extra checks of the +interpreter and extension modules. These checks tend to add a large +amount of overhead to the runtime so they are not enabled by default. + +A full list of the various types of debugging builds is in the file +\file{Misc/SpecialBuilds.txt} in the Python source distribution. +Builds are available that support tracing of reference counts, +debugging the memory allocator, or low-level profiling of the main +interpreter loop. Only the most frequently-used builds will be +described in the remainder of this section. + +Compiling the interpreter with the \csimplemacro{Py_DEBUG} macro +defined produces what is generally meant by "a debug build" of Python. +\csimplemacro{Py_DEBUG} is enabled in the \UNIX{} build by adding +\longprogramopt{with-pydebug} to the \file{configure} command. It is also +implied by the presence of the not-Python-specific +\csimplemacro{_DEBUG} macro. When \csimplemacro{Py_DEBUG} is enabled +in the \UNIX{} build, compiler optimization is disabled. + +In addition to the reference count debugging described below, the +following extra checks are performed: + +\begin{itemize} + \item Extra checks are added to the object allocator. + \item Extra checks are added to the parser and compiler. + \item Downcasts from wide types to narrow types are checked for + loss of information. + \item A number of assertions are added to the dictionary and set + implementations. In addition, the set object acquires a + \method{test_c_api} method. + \item Sanity checks of the input arguments are added to frame + creation. + \item The storage for long ints is initialized with a known + invalid pattern to catch reference to uninitialized + digits. + \item Low-level tracing and extra exception checking are added + to the runtime virtual machine. + \item Extra checks are added to the memory arena implementation. + \item Extra debugging is added to the thread module. +\end{itemize} + +There may be additional checks not mentioned here. + +Defining \csimplemacro{Py_TRACE_REFS} enables reference tracing. When +defined, a circular doubly linked list of active objects is maintained +by adding two extra fields to every \ctype{PyObject}. Total +allocations are tracked as well. Upon exit, all existing references +are printed. (In interactive mode this happens after every statement +run by the interpreter.) Implied by \csimplemacro{Py_DEBUG}. + +Please refer to \file{Misc/SpecialBuilds.txt} in the Python source +distribution for more detailed information. Modified: python/branches/bcannon-sandboxing/Doc/api/refcounts.dat ============================================================================== --- python/branches/bcannon-sandboxing/Doc/api/refcounts.dat (original) +++ python/branches/bcannon-sandboxing/Doc/api/refcounts.dat Wed Aug 2 00:51:44 2006 @@ -303,6 +303,11 @@ PyErr_Warn:PyObject*:category:0: PyErr_Warn:char*:message:: +PyErr_WarnEx:int::: +PyErr_WarnEx:PyObject*:category:0: +PyErr_WarnEx:const char*:message:: +PyErr_WarnEx:Py_ssize_t:stack_level:: + PyEval_AcquireLock:void::: PyEval_AcquireThread:void::: Modified: python/branches/bcannon-sandboxing/Doc/commontex/boilerplate.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/commontex/boilerplate.tex (original) +++ python/branches/bcannon-sandboxing/Doc/commontex/boilerplate.tex Wed Aug 2 00:51:44 2006 @@ -5,5 +5,5 @@ Email: \email{docs at python.org} } -\date{\today} % XXX update before final release! +\date{11th July, 2006} % XXX update before final release! \input{patchlevel} % include Python version information Modified: python/branches/bcannon-sandboxing/Doc/dist/dist.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/dist/dist.tex (original) +++ python/branches/bcannon-sandboxing/Doc/dist/dist.tex Wed Aug 2 00:51:44 2006 @@ -530,7 +530,7 @@ you can take advantage of the fact that header files are installed in a consistent way by the Distutils \command{install\_header} command. For example, the Numerical Python header files are installed (on a standard -Unix installation) to \file{/usr/local/include/python1.5/Numerical}. +\UNIX{} installation) to \file{/usr/local/include/python1.5/Numerical}. (The exact location will differ according to your platform and Python installation.) Since the Python include directory---\file{/usr/local/include/python1.5} in this case---is always @@ -2317,7 +2317,7 @@ \lineiii{name}{the full name of the extension, including any packages --- ie. \emph{not} a filename or pathname, but Python dotted name}{string} \lineiii{sources}{list of source filenames, relative to the distribution -root (where the setup script lives), in Unix form (slash-separated) for +root (where the setup script lives), in \UNIX{} form (slash-separated) for portability. Source files may be C, \Cpp, SWIG (.i), platform-specific resource files, or whatever else is recognized by the \command{build_ext} command as source for a Python extension.}{string} @@ -2873,9 +2873,20 @@ \modulesynopsis{Microsoft Compiler} This module provides \class{MSVCCompiler}, an implementation of the abstract -\class{CCompiler} class for Microsoft Visual Studio. It should also work using -the freely available compiler provided as part of the .Net SDK download. XXX -download link. +\class{CCompiler} class for Microsoft Visual Studio. Typically, extension +modules need to be compiled with the same compiler that was used to compile +Python. For Python 2.3 and earlier, the compiler was Visual Studio 6. For +Python 2.4 and 2.5, the compiler is Visual Studio .NET 2003. The AMD64 +and Itanium binaries are created using the Platform SDK. + +\class{MSVCCompiler} will normally choose the right compiler, linker etc. +on its own. To override this choice, the environment variables +\var{DISTUTILS\_USE\_SDK} and \var{MSSdk} must be both set. \var{MSSdk} +indicates that the current environment has been setup by the SDK's +\code{SetEnv.Cmd} script, or that the environment variables had been +registered when the SDK was installed; \var{DISTUTILS\_USE\_SDK} indicates +that the distutils user has made an explicit choice to override the +compiler selection by \class{MSVCCompiler}. \section{\module{distutils.bcppcompiler} --- Borland Compiler} \declaremodule{standard}{distutils.bcppcompiler} @@ -3088,7 +3099,7 @@ Move file \var{src} to \var{dst}. If \var{dst} is a directory, the file will be moved into it with the same name; otherwise, \var{src} is just renamed to \var{dst}. Returns the new full name of the file. -\warning{Handles cross-device moves on Unix using \function{copy_file()}. +\warning{Handles cross-device moves on \UNIX{} using \function{copy_file()}. What about other systems???} \end{funcdesc} @@ -3131,7 +3142,7 @@ Return 'pathname' as a name that will work on the native filesystem, i.e. split it on '/' and put it back together again using the current directory separator. Needed because filenames in the setup script are -always supplied in Unix style, and have to be converted to the local +always supplied in \UNIX{} style, and have to be converted to the local convention before we can actually use them in the filesystem. Raises \exception{ValueError} on non-\UNIX-ish systems if \var{pathname} either starts or ends with a slash. @@ -3180,7 +3191,7 @@ \end{funcdesc} \begin{funcdesc}{split_quoted}{s} -Split a string up according to Unix shell-like rules for quotes and +Split a string up according to \UNIX{} shell-like rules for quotes and backslashes. In short: words are delimited by spaces, as long as those spaces are not escaped by a backslash, or inside a quoted string. Single and double quotes are equivalent, and the quote characters can Modified: python/branches/bcannon-sandboxing/Doc/doc/doc.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/doc/doc.tex (original) +++ python/branches/bcannon-sandboxing/Doc/doc/doc.tex Wed Aug 2 00:51:44 2006 @@ -187,6 +187,20 @@ Topics which are not covered in the Apple's style guide will be discussed in this document if necessary. + Footnotes are generally discouraged due to the pain of using + footnotes in the HTML conversion of documents. Footnotes may be + used when they are the best way to present specific information. + When a footnote reference is added at the end of the sentence, it + should follow the sentence-ending punctuation. The \LaTeX{} markup + should appear something like this: + +\begin{verbatim} +This sentence has a footnote reference.% + \footnote{This is the footnote text.} +\end{verbatim} + + Footnotes may appear in the middle of sentences where appropriate. + Many special names are used in the Python documentation, including the names of operating systems, programming languages, standards bodies, and the like. Many of these were assigned \LaTeX{} macros @@ -281,10 +295,10 @@ to know about \LaTeX{} syntax. A \dfn{comment} is started by the ``percent'' character - (\character{\%}) and continues through the end of the line and all - leading whitespace on the following line. This is a little - different from any programming language I know of, so an example - is in order: + (\character{\%}) and continues through the end of the line + \emph{and all leading whitespace on the following line}. This is + a little different from any programming language I know of, so an + example is in order: \begin{verbatim} This is text.% comment Modified: python/branches/bcannon-sandboxing/Doc/ext/newtypes.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/ext/newtypes.tex (original) +++ python/branches/bcannon-sandboxing/Doc/ext/newtypes.tex Wed Aug 2 00:51:44 2006 @@ -16,8 +16,9 @@ The way new types are defined changed dramatically (and for the better) in Python 2.2. This document documents how to define new types for Python 2.2 and later. If you need to support older -versions of Python, you will need to refer to older versions of this -documentation. +versions of Python, you will need to refer to +\ulink{older versions of this documentation} + {http://www.python.org/doc/versions/}. \end{notice} \section{The Basics @@ -479,7 +480,7 @@ 1 \item when we know that deallocation of the object\footnote{This is true when we know that the object is a basic type, like a string or - a float} will not cause any + a float.} will not cause any calls back into our type's code \item when decrementing a reference count in a \member{tp_dealloc} handler when garbage-collections is not supported\footnote{We relied @@ -791,9 +792,9 @@ In the second version of the \class{Noddy} example, we allowed any kind of object to be stored in the \member{first} or \member{last} -attributes\footnote{Even in the third version, we aren't guaranteed to +attributes.\footnote{Even in the third version, we aren't guaranteed to avoid cycles. Instances of string subclasses are allowed and string -subclasses could allow cycles even if normal strings don't.}. This +subclasses could allow cycles even if normal strings don't.} This means that \class{Noddy} objects can participate in cycles: \begin{verbatim} @@ -1563,6 +1564,85 @@ avoiding the exception can yield slightly better performance. If an actual error occurs, it should set an exception and return \NULL. + +\subsection{Weak Reference Support\label{weakref-support}} + +One of the goals of Python's weak-reference implementation is to allow +any type to participate in the weak reference mechanism without +incurring the overhead on those objects which do not benefit by weak +referencing (such as numbers). + +For an object to be weakly referencable, the extension must include a +\ctype{PyObject*} field in the instance structure for the use of the +weak reference mechanism; it must be initialized to \NULL{} by the +object's constructor. It must also set the \member{tp_weaklistoffset} +field of the corresponding type object to the offset of the field. +For example, the instance type is defined with the following +structure: + +\begin{verbatim} +typedef struct { + PyObject_HEAD + PyClassObject *in_class; /* The class object */ + PyObject *in_dict; /* A dictionary */ + PyObject *in_weakreflist; /* List of weak references */ +} PyInstanceObject; +\end{verbatim} + +The statically-declared type object for instances is defined this way: + +\begin{verbatim} +PyTypeObject PyInstance_Type = { + PyObject_HEAD_INIT(&PyType_Type) + 0, + "module.instance", + + /* Lots of stuff omitted for brevity... */ + + Py_TPFLAGS_DEFAULT, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + offsetof(PyInstanceObject, in_weakreflist), /* tp_weaklistoffset */ +}; +\end{verbatim} + +The type constructor is responsible for initializing the weak reference +list to \NULL: + +\begin{verbatim} +static PyObject * +instance_new() { + /* Other initialization stuff omitted for brevity */ + + self->in_weakreflist = NULL; + + return (PyObject *) self; +} +\end{verbatim} + +The only further addition is that the destructor needs to call the +weak reference manager to clear any weak references. This should be +done before any other parts of the destruction have occurred, but is +only required if the weak reference list is non-\NULL: + +\begin{verbatim} +static void +instance_dealloc(PyInstanceObject *inst) +{ + /* Allocate temporaries if needed, but do not begin + destruction just yet. + */ + + if (inst->in_weakreflist != NULL) + PyObject_ClearWeakRefs((PyObject *) inst); + + /* Proceed with object destruction normally. */ +} +\end{verbatim} + + \subsection{More Suggestions} Remember that you can omit most of these functions, in which case you Modified: python/branches/bcannon-sandboxing/Doc/ext/windows.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/ext/windows.tex (original) +++ python/branches/bcannon-sandboxing/Doc/ext/windows.tex Wed Aug 2 00:51:44 2006 @@ -28,13 +28,15 @@ \section{A Cookbook Approach \label{win-cookbook}} There are two approaches to building extension modules on Windows, -just as there are on \UNIX: use the \refmodule{distutils} package to +just as there are on \UNIX: use the +\ulink{\module{distutils}}{../lib/module-distutils.html} package to control the build process, or do things manually. The distutils approach works well for most extensions; documentation on using -\refmodule{distutils} to build and package extension modules is -available in \citetitle[../dist/dist.html]{Distributing Python -Modules}. This section describes the manual approach to building -Python extensions written in C or \Cpp. +\ulink{\module{distutils}}{../lib/module-distutils.html} to build and +package extension modules is available in +\citetitle[../dist/dist.html]{Distributing Python Modules}. This +section describes the manual approach to building Python extensions +written in C or \Cpp. To build extensions using these instructions, you need to have a copy of the Python sources of the same version as your installed Python. Modified: python/branches/bcannon-sandboxing/Doc/howto/doanddont.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/howto/doanddont.tex (original) +++ python/branches/bcannon-sandboxing/Doc/howto/doanddont.tex Wed Aug 2 00:51:44 2006 @@ -288,8 +288,9 @@ There are also many useful builtin functions people seem not to be aware of for some reason: \function{min()} and \function{max()} can find the minimum/maximum of any sequence with comparable semantics, -for example, yet many people write they own max/min. Another highly -useful function is \function{reduce()}. Classical use of \function{reduce()} +for example, yet many people write their own +\function{max()}/\function{min()}. Another highly useful function is +\function{reduce()}. A classical use of \function{reduce()} is something like \begin{verbatim} Modified: python/branches/bcannon-sandboxing/Doc/inst/inst.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/inst/inst.tex (original) +++ python/branches/bcannon-sandboxing/Doc/inst/inst.tex Wed Aug 2 00:51:44 2006 @@ -262,7 +262,7 @@ \code{setup.py install}---then the \command{install} command installs to the standard location for third-party Python modules. This location varies by platform and by how you built/installed Python itself. On -\UNIX{} (and Mac OS X, which is also Unix-based), +\UNIX{} (and Mac OS X, which is also \UNIX-based), it also depends on whether the module distribution being installed is pure Python or contains extensions (``non-pure''): \begin{tableiv}{l|l|l|c}{textrm}% Modified: python/branches/bcannon-sandboxing/Doc/lib/email.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/email.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/email.tex Wed Aug 2 00:51:44 2006 @@ -105,7 +105,7 @@ \lineiii{4.0}{Python 2.5}{Python 2.3 to 2.5} \end{tableiii} -Here are the major differences between \module{email} verson 4 and version 3: +Here are the major differences between \module{email} version 4 and version 3: \begin{itemize} \item All modules have been renamed according to \pep{8} standards. For @@ -126,6 +126,15 @@ \item Methods that were deprecated in version 3 have been removed. These include \method{Generator.__call__()}, \method{Message.get_type()}, \method{Message.get_main_type()}, \method{Message.get_subtype()}. + +\item Fixes have been added for \rfc{2231} support which can change some of + the return types for \function{Message.get_param()} and friends. Under + some circumstances, values which used to return a 3-tuple now return + simple strings (specifically, if all extended parameter segments were + unencoded, there is no language and charset designation expected, so the + return type is now a simple string). Also, \%-decoding used to be done + for both encoded and unencoded segments; this decoding is now done only + for encoded segments. \end{itemize} Here are the major differences between \module{email} version 3 and version 2: Modified: python/branches/bcannon-sandboxing/Doc/lib/emailgenerator.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/emailgenerator.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/emailgenerator.tex Wed Aug 2 00:51:44 2006 @@ -31,11 +31,11 @@ \samp{>} character in front of any line in the body that starts exactly as \samp{From }, i.e. \code{From} followed by a space at the beginning of the line. This is the only guaranteed portable way to avoid having such -lines be mistaken for a Unix mailbox format envelope header separator (see +lines be mistaken for a \UNIX{} mailbox format envelope header separator (see \ulink{WHY THE CONTENT-LENGTH FORMAT IS BAD} {http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/content-length.html} for details). \var{mangle_from_} defaults to \code{True}, but you -might want to set this to \code{False} if you are not writing Unix +might want to set this to \code{False} if you are not writing \UNIX{} mailbox format files. Optional \var{maxheaderlen} specifies the longest length for a Modified: python/branches/bcannon-sandboxing/Doc/lib/lib.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/lib.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/lib.tex Wed Aug 2 00:51:44 2006 @@ -71,12 +71,12 @@ % BUILT-INs % ============= -\input{libobjs} % Built-in Types, Exceptions and Functions +\input{libobjs} % Built-in Exceptions and Functions \input{libfuncs} -\input{libstdtypes} \input{libexcs} \input{libconsts} +\input{libstdtypes} % Built-in types % ============= @@ -154,8 +154,8 @@ % encoding stuff \input{libbase64} -\input{libbinascii} \input{libbinhex} +\input{libbinascii} \input{libquopri} \input{libuu} @@ -171,6 +171,7 @@ \input{xmlsaxhandler} \input{xmlsaxutils} \input{xmlsaxreader} +\input{libetree} % \input{libxmllib} \input{fileformats} % Miscellaneous file formats Modified: python/branches/bcannon-sandboxing/Doc/lib/libanydbm.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libanydbm.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libanydbm.tex Wed Aug 2 00:51:44 2006 @@ -46,6 +46,32 @@ \method{keys()} methods are available. Keys and values must always be strings. +The following example records some hostnames and a corresponding title, +and then prints out the contents of the database: + +\begin{verbatim} +import anydbm + +# Open database, creating it if necessary. +db = anydbm.open('cache', 'c') + +# Record some values +db['www.python.org'] = 'Python Website' +db['www.cnn.com'] = 'Cable News Network' + +# Loop through contents. Other dictionary methods +# such as .keys(), .values() also work. +for k, v in db.iteritems(): + print k, '\t', v + +# Storing a non-string key or value will raise an exception (most +# likely a TypeError). +db['www.yahoo.com'] = 4 + +# Close when done. +db.close() +\end{verbatim} + \begin{seealso} \seemodule{dbhash}{BSD \code{db} database interface.} Modified: python/branches/bcannon-sandboxing/Doc/lib/libbase64.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libbase64.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libbase64.tex Wed Aug 2 00:51:44 2006 @@ -146,6 +146,18 @@ always including an extra trailing newline (\code{'\e n'}). \end{funcdesc} +An example usage of the module: + +\begin{verbatim} +>>> import base64 +>>> encoded = base64.b64encode('data to be encoded') +>>> encoded +'ZGF0YSB0byBiZSBlbmNvZGVk' +>>> data = base64.b64decode(encoded) +>>> data +'data to be encoded' +\end{verbatim} + \begin{seealso} \seemodule{binascii}{Support module containing \ASCII-to-binary and binary-to-\ASCII{} conversions.} Modified: python/branches/bcannon-sandboxing/Doc/lib/libbinascii.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libbinascii.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libbinascii.tex Wed Aug 2 00:51:44 2006 @@ -9,10 +9,11 @@ The \module{binascii} module contains a number of methods to convert between binary and various \ASCII-encoded binary representations. Normally, you will not use these functions directly -but use wrapper modules like \refmodule{uu}\refstmodindex{uu} or -\refmodule{binhex}\refstmodindex{binhex} instead, this module solely -exists because bit-manipulation of large amounts of data is slow in -Python. +but use wrapper modules like \refmodule{uu}\refstmodindex{uu}, +\refmodule{base64}\refstmodindex{base64}, or +\refmodule{binhex}\refstmodindex{binhex} instead. The \module{binascii} module +contains low-level functions written in C for greater speed +that are used by the higher-level modules. The \module{binascii} module defines the following functions: Modified: python/branches/bcannon-sandboxing/Doc/lib/libbsddb.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libbsddb.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libbsddb.tex Wed Aug 2 00:51:44 2006 @@ -94,7 +94,7 @@ \begin{notice} -Beginning in 2.3 some Unix versions of Python may have a \module{bsddb185} +Beginning in 2.3 some \UNIX{} versions of Python may have a \module{bsddb185} module. This is present \emph{only} to allow backwards compatibility with systems which ship with the old Berkeley DB 1.85 database library. The \module{bsddb185} module should never be used directly in new code. Modified: python/branches/bcannon-sandboxing/Doc/lib/libcompileall.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libcompileall.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libcompileall.tex Wed Aug 2 00:51:44 2006 @@ -44,6 +44,19 @@ \function{compile_dir()} function. \end{funcdesc} +To force a recompile of all the \file{.py} files in the \file{Lib/} +subdirectory and all its subdirectories: + +\begin{verbatim} +import compileall + +compileall.compile_dir('Lib/', force=True) + +# Perform same compilation, excluding files in .svn directories. +import re +compileall.compile_dir('Lib/', rx=re.compile('/[.]svn'), force=True) +\end{verbatim} + \begin{seealso} \seemodule[pycompile]{py_compile}{Byte-compile a single source file.} Modified: python/branches/bcannon-sandboxing/Doc/lib/libcookielib.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libcookielib.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libcookielib.tex Wed Aug 2 00:51:44 2006 @@ -24,7 +24,7 @@ the de-facto Netscape cookie protocol (which differs substantially from that set out in the original Netscape specification), including taking note of the \code{max-age} and \code{port} cookie-attributes -introduced with RFC 2109. \note{The various named parameters found in +introduced with RFC 2965. \note{The various named parameters found in \mailheader{Set-Cookie} and \mailheader{Set-Cookie2} headers (eg. \code{domain} and \code{expires}) are conventionally referred to as \dfn{attributes}. To distinguish them from Python attributes, the Modified: python/branches/bcannon-sandboxing/Doc/lib/libcsv.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libcsv.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libcsv.tex Wed Aug 2 00:51:44 2006 @@ -55,7 +55,7 @@ Return a reader object which will iterate over lines in the given {}\var{csvfile}. \var{csvfile} can be any object which supports the iterator protocol and returns a string each time its \method{next} -method is called - file objects and list objects are both suitable. +method is called --- file objects and list objects are both suitable. If \var{csvfile} is a file object, it must be opened with the 'b' flag on platforms where that makes a difference. An optional {}\var{dialect} parameter can be given @@ -70,6 +70,18 @@ All data read are returned as strings. No automatic data type conversion is performed. + +\versionchanged[ +The parser is now stricter with respect to multi-line quoted +fields. Previously, if a line ended within a quoted field without a +terminating newline character, a newline would be inserted into the +returned field. This behavior caused problems when reading files +which contained carriage return characters within fields. The +behavior was changed to return the field without inserting newlines. As +a consequence, if newlines embedded within fields are important, the +input should be split into lines in a manner which preserves the newline +characters]{2.5} + \end{funcdesc} \begin{funcdesc}{writer}{csvfile\optional{, @@ -404,7 +416,7 @@ reader = csv.reader(open("passwd", "rb"), 'unixpwd') \end{verbatim} -A slightly more advanced use of the reader - catching and reporting errors: +A slightly more advanced use of the reader --- catching and reporting errors: \begin{verbatim} import csv, sys Modified: python/branches/bcannon-sandboxing/Doc/lib/libctypes.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libctypes.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libctypes.tex Wed Aug 2 00:51:44 2006 @@ -790,10 +790,6 @@ \subsubsection{Pointers\label{ctypes-pointers}} -XXX Rewrite this section. Normally one only uses indexing, not the .contents -attribute! -List some recipes with pointers. bool(ptr), POINTER(tp)(), ...? - Pointer instances are created by calling the \code{pointer} function on a \code{ctypes} type: \begin{verbatim} @@ -826,7 +822,8 @@ attribute would cause the pointer to point to the memory location where this is stored: \begin{verbatim} ->>> pi.contents = c_int(99) +>>> i = c_int(99) +>>> pi.contents = i >>> pi.contents c_long(99) >>> @@ -855,9 +852,6 @@ pointer from a C function, and you \emph{know} that the pointer actually points to an array instead of a single item. - -\subsubsection{Pointer classes/types\label{ctypes-pointer-classestypes}} - Behind the scenes, the \code{pointer} function does more than simply create pointer instances, it has to create pointer \emph{types} first. This is done with the \code{POINTER} function, which accepts any @@ -875,6 +869,31 @@ >>> \end{verbatim} +Calling the pointer type without an argument creates a \code{NULL} +pointer. \code{NULL} pointers have a \code{False} boolean value: +\begin{verbatim} +>>> null_ptr = POINTER(c_int)() +>>> print bool(null_ptr) +False +>>> +\end{verbatim} + +\code{ctypes} checks for \code{NULL} when dereferencing pointers (but +dereferencing non-\code{NULL} pointers would crash Python): +\begin{verbatim} +>>> null_ptr[0] +Traceback (most recent call last): + .... +ValueError: NULL pointer access +>>> + +>>> null_ptr[0] = 1234 +Traceback (most recent call last): + .... +ValueError: NULL pointer access +>>> +\end{verbatim} + \subsubsection{Type conversions\label{ctypes-type-conversions}} @@ -1357,35 +1376,6 @@ >>> \end{verbatim} -The solution is to use 1-element arrays; as a special case ctypes does -no bounds checking on them: -\begin{verbatim} ->>> short_array = (c_short * 1)() ->>> print sizeof(short_array) -2 ->>> resize(short_array, 32) ->>> sizeof(short_array) -32 ->>> sizeof(type(short_array)) -2 ->>> short_array[0:8] -[0, 0, 0, 0, 0, 0, 0, 0] ->>> short_array[7] = 42 ->>> short_array[0:8] -[0, 0, 0, 0, 0, 0, 0, 42] ->>> -\end{verbatim} - -Using 1-element arrays as variable sized fields in structures works as -well, but they should be used as the last field in the structure -definition. This example shows a definition from the Windows header -files: -\begin{verbatim} -class SP_DEVICE_INTERFACE_DETAIL_DATA(Structure): - _fields_ = [("cbSize", c_int), - ("DevicePath", c_char * 1)] -\end{verbatim} - Another way to use variable-sized data types with \code{ctypes} is to use the dynamic nature of Python, and (re-)define the data type after the required size is already known, on a case by case basis. @@ -1474,13 +1464,13 @@ There are several ways to loaded shared libraries into the Python process. One way is to instantiate one of the following classes: -\begin{classdesc}{CDLL}{name, mode=RTLD_LOCAL, handle=None} +\begin{classdesc}{CDLL}{name, mode=DEFAULT_MODE, handle=None} Instances of this class represent loaded shared libraries. Functions in these libraries use the standard C calling convention, and are assumed to return \code{int}. \end{classdesc} -\begin{classdesc}{OleDLL}{name, mode=RTLD_LOCAL, handle=None} +\begin{classdesc}{OleDLL}{name, mode=DEFAULT_MODE, handle=None} Windows only: Instances of this class represent loaded shared libraries, functions in these libraries use the \code{stdcall} calling convention, and are assumed to return the windows specific @@ -1490,7 +1480,7 @@ failure, an \class{WindowsError} is automatically raised. \end{classdesc} -\begin{classdesc}{WinDLL}{name, mode=RTLD_LOCAL, handle=None} +\begin{classdesc}{WinDLL}{name, mode=DEFAULT_MODE, handle=None} Windows only: Instances of this class represent loaded shared libraries, functions in these libraries use the \code{stdcall} calling convention, and are assumed to return \code{int} by default. @@ -1503,7 +1493,7 @@ The Python GIL is released before calling any function exported by these libraries, and reaquired afterwards. -\begin{classdesc}{PyDLL}{name, mode=RTLD_LOCAL, handle=None} +\begin{classdesc}{PyDLL}{name, mode=DEFAULT_MODE, handle=None} Instances of this class behave like \class{CDLL} instances, except that the Python GIL is \emph{not} released during the function call, and after the function execution the Python error flag is checked. @@ -1533,6 +1523,12 @@ available, it is the same as \var{RTLD{\_}GLOBAL}. \end{datadescni} +\begin{datadescni}{DEFAULT_MODE} +The default mode which is used to load shared libraries. On OSX +10.3, this is \var{RTLD{\_}GLOBAL}, otherwise it is the same as +\var{RTLD{\_}LOCAL}. +\end{datadescni} + Instances of these classes have no public methods, however \method{{\_}{\_}getattr{\_}{\_}} and \method{{\_}{\_}getitem{\_}{\_}} have special behaviour: functions exported by the shared library can be accessed as attributes of by @@ -1566,10 +1562,9 @@ return the same library each time. \end{classdesc} -\begin{methoddesc}{LoadLibrary}{name, mode=RTLD_LOCAL, handle=None} +\begin{methoddesc}{LoadLibrary}{name} Load a shared library into the process and return it. This method -always creates a new instance of the library. All three -parameters are passed to the constructor of the library object. +always returns a new instance of the library. \end{methoddesc} These prefabricated library loaders are available: @@ -1648,6 +1643,12 @@ example, a \class{c{\_}char{\_}p} item in the \member{argtypes} tuple will convert a unicode string passed as argument into an byte string using ctypes conversion rules. + +New: It is now possible to put items in argtypes which are not +ctypes types, but each item must have a \method{from{\_}param} method +which returns a value usable as argument (integer, string, ctypes +instance). This allows to define adapters that can adapt custom +objects as function parameters. \end{memberdesc} \begin{memberdesc}{errcheck} @@ -2389,6 +2390,13 @@ separate \member{{\_}fields{\_}} variable, the fields specified in this are appended to the fields of the base class. +Structure and union constructors accept both positional and +keyword arguments. Positional arguments are used to initialize member +fields in the same order as they are appear in \member{{\_}fields{\_}}. Keyword +arguments in the constructor are interpreted as attribute assignments, +so they will initialize \member{{\_}fields{\_}} with the same name, or create new +attributes for names not present in \member{{\_}fields{\_}}. + \subsubsection{Arrays and pointers\label{ctypes-arrays-pointers}} Modified: python/branches/bcannon-sandboxing/Doc/lib/libfuncs.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libfuncs.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libfuncs.tex Wed Aug 2 00:51:44 2006 @@ -401,67 +401,17 @@ \end{funcdesc} \begin{funcdesc}{file}{filename\optional{, mode\optional{, bufsize}}} - Return a new file object (described in - section~\ref{bltin-file-objects}, ``\ulink{File - Objects}{bltin-file-objects.html}''). - The first two arguments are the same as for \code{stdio}'s - \cfunction{fopen()}: \var{filename} is the file name to be opened, - \var{mode} indicates how the file is to be opened: \code{'r'} for - reading, \code{'w'} for writing (truncating an existing file), and - \code{'a'} opens it for appending (which on \emph{some} \UNIX{} - systems means that \emph{all} writes append to the end of the file, - regardless of the current seek position). + Constructor function for the \class{file} type, described further + in section~\ref{bltin-file-objects}, ``\ulink{File + Objects}{bltin-file-objects.html}''. The constructor's arguments + are the same as those of the \function{open()} built-in function + described below. - Modes \code{'r+'}, \code{'w+'} and \code{'a+'} open the file for - updating (note that \code{'w+'} truncates the file). Append - \code{'b'} to the mode to open the file in binary mode, on systems - that differentiate between binary and text files (else it is - ignored). If the file cannot be opened, \exception{IOError} is - raised. - - In addition to the standard \cfunction{fopen()} values \var{mode} - may be \code{'U'} or \code{'rU'}. If Python is built with universal - newline support (the default) the file is opened as a text file, but - lines may be terminated by any of \code{'\e n'}, the Unix end-of-line - convention, - \code{'\e r'}, the Macintosh convention or \code{'\e r\e n'}, the Windows - convention. All of these external representations are seen as - \code{'\e n'} - by the Python program. If Python is built without universal newline support - \var{mode} \code{'U'} is the same as normal text mode. Note that - file objects so opened also have an attribute called - \member{newlines} which has a value of \code{None} (if no newlines - have yet been seen), \code{'\e n'}, \code{'\e r'}, \code{'\e r\e n'}, - or a tuple containing all the newline types seen. - - Python enforces that the mode, after stripping \code{'U'}, begins with - \code{'r'}, \code{'w'} or \code{'a'}. - - If \var{mode} is omitted, it defaults to \code{'r'}. When opening a - binary file, you should append \code{'b'} to the \var{mode} value - for improved portability. (It's useful even on systems which don't - treat binary and text files differently, where it serves as - documentation.) - \index{line-buffered I/O}\index{unbuffered I/O}\index{buffer size, I/O} - \index{I/O control!buffering} - The optional \var{bufsize} argument specifies the - file's desired buffer size: 0 means unbuffered, 1 means line - buffered, any other positive value means use a buffer of - (approximately) that size. A negative \var{bufsize} means to use - the system default, which is usually line buffered for tty - devices and fully buffered for other files. If omitted, the system - default is used.\footnote{ - Specifying a buffer size currently has no effect on systems that - don't have \cfunction{setvbuf()}. The interface to specify the - buffer size is not done using a method that calls - \cfunction{setvbuf()}, because that may dump core when called - after any I/O has been performed, and there's no reliable way to - determine whether this is the case.} + When opening a file, it's preferable to use \function{open()} instead of + invoking this constructor directly. \class{file} is more suited to + type testing (for example, writing \samp{isinstance(f, file)}). \versionadded{2.2} - - \versionchanged[Restriction on first letter of mode string - introduced]{2.5} \end{funcdesc} \begin{funcdesc}{filter}{function, list} @@ -726,10 +676,71 @@ \end{funcdesc} \begin{funcdesc}{open}{filename\optional{, mode\optional{, bufsize}}} - A wrapper for the \function{file()} function above. The intent is - for \function{open()} to be preferred for use as a factory function - returning a new \class{file} object. \class{file} is more suited to - type testing (for example, writing \samp{isinstance(f, file)}). + Open a file, returning an object of the \class{file} type described + in section~\ref{bltin-file-objects}, ``\ulink{File + Objects}{bltin-file-objects.html}''. If the file cannot be opened, + \exception{IOError} is raised. When opening a file, it's + preferable to use \function{open()} instead of invoking the + \class{file} constructor directly. + + The first two arguments are the same as for \code{stdio}'s + \cfunction{fopen()}: \var{filename} is the file name to be opened, + and \var{mode} is a string indicating how the file is to be opened. + + The most commonly-used values of \var{mode} are \code{'r'} for + reading, \code{'w'} for writing (truncating the file if it already + exists), and \code{'a'} for appending (which on \emph{some} \UNIX{} + systems means that \emph{all} writes append to the end of the file + regardless of the current seek position). If \var{mode} is omitted, + it defaults to \code{'r'}. When opening a binary file, you should + append \code{'b'} to the \var{mode} value to open the file in binary + mode, which will improve portability. (Appending \code{'b'} is + useful even on systems that don't treat binary and text files + differently, where it serves as documentation.) See below for more + possible values of \var{mode}. + + \index{line-buffered I/O}\index{unbuffered I/O}\index{buffer size, I/O} + \index{I/O control!buffering} + The optional \var{bufsize} argument specifies the + file's desired buffer size: 0 means unbuffered, 1 means line + buffered, any other positive value means use a buffer of + (approximately) that size. A negative \var{bufsize} means to use + the system default, which is usually line buffered for tty + devices and fully buffered for other files. If omitted, the system + default is used.\footnote{ + Specifying a buffer size currently has no effect on systems that + don't have \cfunction{setvbuf()}. The interface to specify the + buffer size is not done using a method that calls + \cfunction{setvbuf()}, because that may dump core when called + after any I/O has been performed, and there's no reliable way to + determine whether this is the case.} + + Modes \code{'r+'}, \code{'w+'} and \code{'a+'} open the file for + updating (note that \code{'w+'} truncates the file). Append + \code{'b'} to the mode to open the file in binary mode, on systems + that differentiate between binary and text files; on systems + that don't have this distinction, adding the \code{'b'} has no effect. + + In addition to the standard \cfunction{fopen()} values \var{mode} + may be \code{'U'} or \code{'rU'}. Python is usually built with universal + newline support; supplying \code{'U'} opens the file as a text file, but + lines may be terminated by any of the following: the \UNIX{} end-of-line + convention \code{'\e n'}, + the Macintosh convention \code{'\e r'}, or the Windows + convention \code{'\e r\e n'}. All of these external representations are seen as + \code{'\e n'} + by the Python program. If Python is built without universal newline support + a \var{mode} with \code{'U'} is the same as normal text mode. Note that + file objects so opened also have an attribute called + \member{newlines} which has a value of \code{None} (if no newlines + have yet been seen), \code{'\e n'}, \code{'\e r'}, \code{'\e r\e n'}, + or a tuple containing all the newline types seen. + + Python enforces that the mode, after stripping \code{'U'}, begins with + \code{'r'}, \code{'w'} or \code{'a'}. + + \versionchanged[Restriction on first letter of mode string + introduced]{2.5} \end{funcdesc} \begin{funcdesc}{ord}{c} Modified: python/branches/bcannon-sandboxing/Doc/lib/libgettext.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libgettext.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libgettext.tex Wed Aug 2 00:51:44 2006 @@ -549,7 +549,7 @@ written a program called \program{xpot} which does a similar job. It is available as part of his \program{po-utils} package at -\url{http://www.iro.umontreal.ca/contrib/po-utils/HTML/}.} program +\url{http://po-utils.progiciels-bpi.ca/}.} program scans all your Python source code looking for the strings you previously marked as translatable. It is similar to the GNU \program{gettext} program except that it understands all the @@ -585,8 +585,8 @@ translation processing during run-time. How you use the \module{gettext} module in your code depends on -whether you are internationalizing your entire application or a single -module. +whether you are internationalizing a single module or your entire application. +The next two sections will discuss each case. \subsubsection{Localizing your module} Modified: python/branches/bcannon-sandboxing/Doc/lib/libimp.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libimp.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libimp.tex Wed Aug 2 00:51:44 2006 @@ -232,6 +232,24 @@ source file. \end{funcdesc} +\begin{classdesc}{NullImporter}{path_string} +The \class{NullImporter} type is a \pep{302} import hook that handles +non-directory path strings by failing to find any modules. Calling this +type with an existing directory or empty string raises +\exception{ImportError}. Otherwise, a \class{NullImporter} instance is +returned. + +Python adds instances of this type to \code{sys.path_importer_cache} for +any path entries that are not directories and are not handled by any other +path hooks on \code{sys.path_hooks}. Instances have only one method: + +\begin{methoddesc}{find_module}{fullname \optional{, path}} +This method always returns \code{None}, indicating that the requested +module could not be found. +\end{methoddesc} + +\versionadded{2.5} +\end{classdesc} \subsection{Examples} \label{examples-imp} @@ -257,7 +275,7 @@ # there's a problem we can't handle -- let the caller handle it. fp, pathname, description = imp.find_module(name) - + try: return imp.load_module(name, fp, pathname, description) finally: Modified: python/branches/bcannon-sandboxing/Doc/lib/libinspect.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libinspect.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libinspect.tex Wed Aug 2 00:51:44 2006 @@ -180,13 +180,32 @@ Return true if the object is a data descriptor. Data descriptors have both a __get__ and a __set__ attribute. Examples are - properties (defined in Python) and getsets and members (defined in C). - Typically, data descriptors will also have __name__ and __doc__ attributes - (properties, getsets, and members have both of these attributes), but this - is not guaranteed. + properties (defined in Python), getsets, and members. The latter two are + defined in C and there are more specific tests available for those types, + which is robust across Python implementations. Typically, data descriptors + will also have __name__ and __doc__ attributes (properties, getsets, and + members have both of these attributes), but this is not guaranteed. \versionadded{2.3} \end{funcdesc} +\begin{funcdesc}{isgetsetdescriptor}{object} + Return true if the object is a getset descriptor. + + getsets are attributes defined in extension modules via \code{PyGetSetDef} + structures. For Python implementations without such types, this method will + always return \code{False}. +\versionadded{2.5} +\end{funcdesc} + +\begin{funcdesc}{ismemberdescriptor}{object} + Return true if the object is a member descriptor. + + Member descriptors are attributes defined in extension modules via + \code{PyMemberDef} structures. For Python implementations without such + types, this method will always return \code{False}. +\versionadded{2.5} +\end{funcdesc} + \subsection{Retrieving source code \label{inspect-source}} Modified: python/branches/bcannon-sandboxing/Doc/lib/liblogging.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/liblogging.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/liblogging.tex Wed Aug 2 00:51:44 2006 @@ -1068,13 +1068,11 @@ \end{tableii} If \var{backupCount} is non-zero, the system will save old log files by -appending the extensions ".1", ".2" etc., to the filename. For example, -with a \var{backupCount} of 5 and a base file name of \file{app.log}, -you would get \file{app.log}, \file{app.log.1}, \file{app.log.2}, up to -\file{app.log.5}. The file being written to is always \file{app.log}. -When this file is filled, it is closed and renamed to \file{app.log.1}, -and if files \file{app.log.1}, \file{app.log.2}, etc. exist, then they -are renamed to \file{app.log.2}, \file{app.log.3} etc. respectively. +appending extensions to the filename. The extensions are date-and-time +based, using the strftime format \code{\%Y-\%m-\%d_\%H-\%M-\%S} or a leading +portion thereof, depending on the rollover interval. At most \var{backupCount} +files will be kept, and if more would be created when rollover occurs, the +oldest one is deleted. \end{classdesc} \begin{methoddesc}{doRollover}{} @@ -1539,7 +1537,7 @@ To stop the server, call \function{stopListening()}. To send a configuration to the socket, read in the configuration file and send it to the socket as a string of bytes preceded by a four-byte length packed in binary using -struct.\code{pack(">L", n)}. +struct.\code{pack('>L', n)}. \end{funcdesc} \begin{funcdesc}{stopListening}{} Modified: python/branches/bcannon-sandboxing/Doc/lib/libmailbox.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libmailbox.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libmailbox.tex Wed Aug 2 00:51:44 2006 @@ -1367,9 +1367,8 @@ print subject \end{verbatim} -A (surprisingly) simple example of copying all mail from a Babyl mailbox to an -MH mailbox, converting all of the format-specific information that can be -converted: +To copy all mail from a Babyl mailbox to an MH mailbox, converting all +of the format-specific information that can be converted: \begin{verbatim} import mailbox Modified: python/branches/bcannon-sandboxing/Doc/lib/libmimetypes.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libmimetypes.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libmimetypes.tex Wed Aug 2 00:51:44 2006 @@ -158,6 +158,20 @@ \versionadded{2.2} \end{classdesc} +An example usage of the module: + +\begin{verbatim} +>>> import mimetypes +>>> mimetypes.init() +>>> mimetypes.knownfiles +['/etc/mime.types', '/etc/httpd/mime.types', ... ] +>>> mimetypes.suffix_map['.tgz'] +'.tar.gz' +>>> mimetypes.encodings_map['.gz'] +'gzip' +>>> mimetypes.types_map['.tgz'] +'application/x-tar-gz' +\end{verbatim} \subsection{MimeTypes Objects \label{mimetypes-objects}} Modified: python/branches/bcannon-sandboxing/Doc/lib/libnew.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libnew.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libnew.tex Wed Aug 2 00:51:44 2006 @@ -30,13 +30,16 @@ callable. \end{funcdesc} -\begin{funcdesc}{function}{code, globals\optional{, name\optional{, argdefs}}} +\begin{funcdesc}{function}{code, globals\optional{, name\optional{, + argdefs\optional{, closure}}}} Returns a (Python) function with the given code and globals. If \var{name} is given, it must be a string or \code{None}. If it is a string, the function will have the given name, otherwise the function name will be taken from \code{\var{code}.co_name}. If \var{argdefs} is given, it must be a tuple and will be used to -determine the default values of parameters. +determine the default values of parameters. If \var{closure} is given, +it must be \code{None} or a tuple of cell objects containing objects +to bind to the names in \code{\var{code}.co_freevars}. \end{funcdesc} \begin{funcdesc}{code}{argcount, nlocals, stacksize, flags, codestring, Modified: python/branches/bcannon-sandboxing/Doc/lib/liboptparse.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/liboptparse.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/liboptparse.tex Wed Aug 2 00:51:44 2006 @@ -1390,7 +1390,7 @@ \end{verbatim} \end{itemize} -% $Id: reference.txt 505 2005-07-22 01:52:40Z gward $ +% $Id: reference.txt 519 2006-06-11 14:39:11Z gward $ \subsection{Option Callbacks\label{optparse-option-callbacks}} Modified: python/branches/bcannon-sandboxing/Doc/lib/libossaudiodev.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libossaudiodev.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libossaudiodev.tex Wed Aug 2 00:51:44 2006 @@ -68,7 +68,7 @@ Open an audio device and return an OSS audio device object. This object supports many file-like methods, such as \method{read()}, \method{write()}, and \method{fileno()} (although there are subtle -differences between conventional Unix read/write semantics and those of +differences between conventional \UNIX{} read/write semantics and those of OSS audio devices). It also supports a number of audio-specific methods; see below for the complete list of methods. Modified: python/branches/bcannon-sandboxing/Doc/lib/libpickle.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libpickle.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libpickle.tex Wed Aug 2 00:51:44 2006 @@ -725,7 +725,50 @@ \subsection{Example \label{pickle-example}} -Here's a simple example of how to modify pickling behavior for a +For the simplest code, use the \function{dump()} and \function{load()} +functions. Note that a self-referencing list is pickled and restored +correctly. + +\begin{verbatim} +import pickle + +data1 = {'a': [1, 2.0, 3, 4+6j], + 'b': ('string', u'Unicode string'), + 'c': None} + +selfref_list = [1, 2, 3] +selfref_list.append(selfref_list) + +output = open('data.pkl', 'wb') + +# Pickle dictionary using protocol 0. +pickle.dump(data1, output) + +# Pickle the list using the highest protocol available. +pickle.dump(selfref_list, output, -1) + +output.close() +\end{verbatim} + +The following example reads the resulting pickled data. When reading +a pickle-containing file, you should open the file in binary mode +because you can't be sure if the ASCII or binary format was used. + +\begin{verbatim} +import pprint, pickle + +pkl_file = open('data.pkl', 'rb') + +data1 = pickle.load(pkl_file) +pprint.pprint(data1) + +data2 = pickle.load(pkl_file) +pprint.pprint(data2) + +pkl_file.close() +\end{verbatim} + +Here's a larger example that shows how to modify pickling behavior for a class. The \class{TextReader} class opens a text file, and returns the line number and line contents each time its \method{readline()} method is called. If a \class{TextReader} instance is pickled, all Modified: python/branches/bcannon-sandboxing/Doc/lib/libpkgutil.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libpkgutil.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libpkgutil.tex Wed Aug 2 00:51:44 2006 @@ -30,7 +30,7 @@ with \code{import}. A \file{*.pkg} file is trusted at face value: apart from checking for duplicates, all entries found in a \file{*.pkg} file are added to the path, regardless of whether they - exist the filesystem. (This is a feature.) + exist on the filesystem. (This is a feature.) If the input path is not a list (as is the case for frozen packages) it is returned unchanged. The input path is not Modified: python/branches/bcannon-sandboxing/Doc/lib/libposixpath.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libposixpath.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libposixpath.tex Wed Aug 2 00:51:44 2006 @@ -42,8 +42,11 @@ \end{funcdesc} \begin{funcdesc}{exists}{path} -Return \code{True} if \var{path} refers to an existing path. -Returns \code{False} for broken symbolic links. +Return \code{True} if \var{path} refers to an existing path. Returns +\code{False} for broken symbolic links. On some platforms, this +function may return \code{False} if permission is not granted to +execute \function{os.stat()} on the requested file, even if the +\var{path} physically exists. \end{funcdesc} \begin{funcdesc}{lexists}{path} @@ -190,9 +193,8 @@ \end{funcdesc} \begin{funcdesc}{sameopenfile}{fp1, fp2} -Return \code{True} if the file objects \var{fp1} and \var{fp2} refer to the -same file. The two file objects may represent different file -descriptors. +Return \code{True} if the file descriptors \var{fp1} and \var{fp2} refer +to the same file. Availability: Macintosh, \UNIX. \end{funcdesc} Modified: python/branches/bcannon-sandboxing/Doc/lib/librandom.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/librandom.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/librandom.tex Wed Aug 2 00:51:44 2006 @@ -236,7 +236,7 @@ \var{beta} is the shape parameter. \end{funcdesc} -Alternative Generators +Alternative Generators: \begin{classdesc}{WichmannHill}{\optional{seed}} Class that implements the Wichmann-Hill algorithm as the core generator. @@ -267,6 +267,30 @@ \versionadded{2.4} \end{classdesc} +Examples of basic usage: + +\begin{verbatim} +>>> random.random() # Random float x, 0.0 <= x < 1.0 +0.37444887175646646 +>>> random.uniform(1, 10) # Random float x, 1.0 <= x < 10.0 +1.1800146073117523 +>>> random.randint(1, 10) # Integer from 1 to 10, endpoints included +7 +>>> random.randrange(0, 101, 2) # Even integer from 0 to 100 +26 +>>> random.choice('abcdefghij') # Choose a random element +'c' + +>>> items = [1, 2, 3, 4, 5, 6, 7] +>>> random.shuffle(items) +>>> items +[7, 3, 2, 5, 6, 4, 1] + +>>> random.sample([1, 2, 3, 4, 5], 3) # Choose 3 elements +[4, 1, 5] + +\end{verbatim} + \begin{seealso} \seetext{M. Matsumoto and T. Nishimura, ``Mersenne Twister: A 623-dimensionally equidistributed uniform pseudorandom Modified: python/branches/bcannon-sandboxing/Doc/lib/libre.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libre.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libre.tex Wed Aug 2 00:51:44 2006 @@ -897,7 +897,7 @@ \lineii{\code{\%d}} {\regexp{[-+]?\e d+}} \lineii{\code{\%e}, \code{\%E}, \code{\%f}, \code{\%g}} - {\regexp{[-+]?(\e d+(\e.\e d*)?|\e d*\e.\e d+)([eE][-+]?\e d+)?}} + {\regexp{[-+]?(\e d+(\e.\e d*)?|\e.\e d+)([eE][-+]?\e d+)?}} \lineii{\code{\%i}} {\regexp{[-+]?(0[xX][\e dA-Fa-f]+|0[0-7]*|\e d+)}} \lineii{\code{\%o}} Modified: python/branches/bcannon-sandboxing/Doc/lib/libreadline.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libreadline.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libreadline.tex Wed Aug 2 00:51:44 2006 @@ -7,10 +7,13 @@ \modulesynopsis{GNU readline support for Python.} -The \module{readline} module defines a number of functions used either -directly or from the \refmodule{rlcompleter} module to facilitate -completion and history file read and write from the Python -interpreter. +The \module{readline} module defines a number of functions to +facilitate completion and reading/writing of history files from the +Python interpreter. This module can be used directly or via the +\refmodule{rlcompleter} module. Settings made using +this module affect the behaviour of both the interpreter's interactive prompt +and the prompts offered by the \function{raw_input()} and \function{input()} +built-in functions. The \module{readline} module defines the following functions: Modified: python/branches/bcannon-sandboxing/Doc/lib/librunpy.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/librunpy.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/librunpy.tex Wed Aug 2 00:51:44 2006 @@ -35,19 +35,16 @@ global variables below are defined in the supplied dictionary, those definitions are overridden by the \code{run_module} function. -The special global variables \code{__name__}, \code{__module_name__}, -\code{__file__}, \code{__loader__} and \code{__builtins__} are -set in the globals dictionary before the module code is executed. +The special global variables \code{__name__}, \code{__file__}, +\code{__loader__} and \code{__builtins__} are set in the globals +dictionary before the module code is executed. \code{__name__} is set to \var{run_name} if this optional argument is supplied, and the \var{mod_name} argument otherwise. -\code{__module_name__} is always set to \var{mod_name} (this allows -modules to use imports relative to their package name). - \code{__loader__} is set to the PEP 302 module loader used to retrieve -the code for the module (This will not be defined if the module was -found using the standard import mechanism). +the code for the module (This loader may be a wrapper around the +standard import mechanism). \code{__file__} is set to the name provided by the module loader. If the loader does not make filename information available, this @@ -58,12 +55,10 @@ If the argument \var{alter_sys} is supplied and evaluates to \code{True}, then \code{sys.argv[0]} is updated with the value of -\code{__file__} and \code{sys.modules[mod_name]} is updated with a +\code{__file__} and \code{sys.modules[__name__]} is updated with a temporary module object for the module being executed. Both -\code{sys.argv[0]} and \code{sys.modules[mod_name]} are restored to -their original values before the function returns. If \var{run_name} -differs from \var{mod_name} entries are made in \code{sys.modules} -for both names. +\code{sys.argv[0]} and \code{sys.modules[__name__]} are restored to +their original values before the function returns. Note that this manipulation of \module{sys} is not thread-safe. Other threads may see the partially initialised module, as well as the Modified: python/branches/bcannon-sandboxing/Doc/lib/libshelve.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libshelve.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libshelve.tex Wed Aug 2 00:51:44 2006 @@ -143,15 +143,17 @@ del d[key] # delete data stored at key (raises KeyError # if no such key) flag = d.has_key(key) # true if the key exists -list = d.keys() # a list of all existing keys (slow!) +klist = d.keys() # a list of all existing keys (slow!) # as d was opened WITHOUT writeback=True, beware: d['xx'] = range(4) # this works as expected, but... d['xx'].append(5) # *this doesn't!* -- d['xx'] is STILL range(4)!!! + # having opened d without writeback=True, you need to code carefully: temp = d['xx'] # extracts the copy temp.append(5) # mutates the copy d['xx'] = temp # stores the copy right back, to persist it + # or, d=shelve.open(filename,writeback=True) would let you just code # d['xx'].append(5) and have it work as expected, BUT it would also # consume more memory and make the d.close() operation slower. Modified: python/branches/bcannon-sandboxing/Doc/lib/libsocket.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libsocket.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libsocket.tex Wed Aug 2 00:51:44 2006 @@ -711,6 +711,17 @@ read until EOF. The return value is a string of the bytes read. \end{methoddesc} +\begin{methoddesc}{server}{} +Returns a string containing the ASN.1 distinguished name identifying the +server's certificate. (See below for an example +showing what distinguished names look like.) +\end{methoddesc} + +\begin{methoddesc}{issuer}{} +Returns a string containing the ASN.1 distinguished name identifying the +issuer of the server's certificate. +\end{methoddesc} + \subsection{Example \label{socket-example}} Here are four minimal example programs using the TCP/IP protocol:\ a @@ -833,3 +844,44 @@ s.close() print 'Received', repr(data) \end{verbatim} + +This example connects to an SSL server, prints the +server and issuer's distinguished names, sends some bytes, +and reads part of the response: + +\begin{verbatim} +import socket + +s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +s.connect(('www.verisign.com', 443)) + +ssl_sock = socket.ssl(s) + +print repr(ssl_sock.server()) +print repr(ssl_sock.issuer()) + +# Set a simple HTTP request -- use httplib in actual code. +ssl_sock.write("""GET / HTTP/1.0\r +Host: www.verisign.com\r\n\r\n""") + +# Read a chunk of data. Will not necessarily +# read all the data returned by the server. +data = ssl_sock.read() + +# Note that you need to close the underlying socket, not the SSL object. +del ssl_sock +s.close() +\end{verbatim} + +At this writing, this SSL example prints the following output (line +breaks inserted for readability): + +\begin{verbatim} +'/C=US/ST=California/L=Mountain View/ + O=VeriSign, Inc./OU=Production Services/ + OU=Terms of use at www.verisign.com/rpa (c)00/ + CN=www.verisign.com' +'/O=VeriSign Trust Network/OU=VeriSign, Inc./ + OU=VeriSign International Server CA - Class 3/ + OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign' +\end{verbatim} Modified: python/branches/bcannon-sandboxing/Doc/lib/libsocksvr.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libsocksvr.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libsocksvr.tex Wed Aug 2 00:51:44 2006 @@ -74,9 +74,9 @@ \end{verbatim} Note that \class{UnixDatagramServer} derives from \class{UDPServer}, not -from \class{UnixStreamServer} -- the only difference between an IP and a -Unix stream server is the address family, which is simply repeated in both -unix server classes. +from \class{UnixStreamServer} --- the only difference between an IP and a +\UNIX{} stream server is the address family, which is simply repeated in both +\UNIX{} server classes. Forking and threading versions of each type of server can be created using the \class{ForkingMixIn} and \class{ThreadingMixIn} mix-in classes. For Modified: python/branches/bcannon-sandboxing/Doc/lib/libsqlite3.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libsqlite3.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libsqlite3.tex Wed Aug 2 00:51:44 2006 @@ -512,10 +512,10 @@ \class{object} as one of its bases. \end{notice} -The \module{sqlite3} module has two default adapters for Python's builtin -\class{datetime.date} and \class{datetime.datetime} types. Now let's suppose we -want to store \class{datetime.datetime} objects not in ISO representation, but -as Unix timestamp. +The \module{sqlite3} module has two default adapters for Python's built-in +\class{datetime.date} and \class{datetime.datetime} types. Now let's suppose +we want to store \class{datetime.datetime} objects not in ISO representation, +but as a \UNIX{} timestamp. \verbatiminput{sqlite3/adapter_datetime.py} Modified: python/branches/bcannon-sandboxing/Doc/lib/libstdtypes.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libstdtypes.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libstdtypes.tex Wed Aug 2 00:51:44 2006 @@ -1,4 +1,4 @@ -\section{Built-in Types \label{types}} +\chapter{Built-in Types \label{types}} The following sections describe the standard types that are built into the interpreter. @@ -7,14 +7,14 @@ the built-in types as the basis for object-oriented inheritance. This limitation does not exist any longer.} -The principal built-in types are numerics, sequences, mappings, files +The principal built-in types are numerics, sequences, mappings, files, classes, instances and exceptions. \indexii{built-in}{types} Some operations are supported by several object types; in particular, practically all objects can be compared, tested for truth value, -and converted to a string (with the \code{`\textrm{\ldots}`} notation, -the equivalent \function{repr()} function, or the slightly different +and converted to a string (with +the \function{repr()} function or the slightly different \function{str()} function). The latter function is implicitly used when an object is written by the \keyword{print}\stindex{print} statement. @@ -24,7 +24,7 @@ \citetitle[../tut/tut.html]{Python Tutorial}.) -\subsection{Truth Value Testing\label{truth}} +\section{Truth Value Testing\label{truth}} Any object can be tested for truth value, for use in an \keyword{if} or \keyword{while} condition or as operand of the Boolean operations below. @@ -71,7 +71,7 @@ \index{False} \index{True} -\subsection{Boolean Operations --- +\section{Boolean Operations --- \keyword{and}, \keyword{or}, \keyword{not} \label{boolean}} @@ -107,7 +107,7 @@ \end{description} -\subsection{Comparisons \label{comparisons}} +\section{Comparisons \label{comparisons}} Comparison operations are supported by all objects. They all have the same priority (which is higher than that of the Boolean operations). @@ -174,7 +174,7 @@ only by sequence types (below). -\subsection{Numeric Types --- +\section{Numeric Types --- \class{int}, \class{float}, \class{long}, \class{complex} \label{typesnumeric}} @@ -307,7 +307,7 @@ \end{description} % XXXJH exceptions: overflow (when? what operations?) zerodivision -\subsubsection{Bit-string Operations on Integer Types \label{bitstring-ops}} +\subsection{Bit-string Operations on Integer Types \label{bitstring-ops}} \nodename{Bit-string Operations} Plain and long integer types support additional operations that make @@ -350,7 +350,7 @@ \end{description} -\subsection{Iterator Types \label{typeiter}} +\section{Iterator Types \label{typeiter}} \versionadded{2.2} \index{iterator protocol} @@ -414,7 +414,7 @@ supplying the \method{__iter__()} and \method{next()} methods. -\subsection{Sequence Types --- +\section{Sequence Types --- \class{str}, \class{unicode}, \class{list}, \class{tuple}, \class{buffer}, \class{xrange} \label{typesseq}} @@ -566,7 +566,7 @@ \end{description} -\subsubsection{String Methods \label{string-methods}} +\subsection{String Methods \label{string-methods}} \indexii{string}{methods} These are the string methods which both 8-bit strings and Unicode @@ -901,7 +901,7 @@ \end{methoddesc} -\subsubsection{String Formatting Operations \label{typesseq-strings}} +\subsection{String Formatting Operations \label{typesseq-strings}} \index{formatting, string (\%{})} \index{interpolation, string (\%{})} @@ -1072,7 +1072,7 @@ \refmodule{re}.\refstmodindex{re} -\subsubsection{XRange Type \label{typesseq-xrange}} +\subsection{XRange Type \label{typesseq-xrange}} The \class{xrange}\obindex{xrange} type is an immutable sequence which is commonly used for looping. The advantage of the \class{xrange} @@ -1084,7 +1084,7 @@ iteration, and the \function{len()} function. -\subsubsection{Mutable Sequence Types \label{typesseq-mutable}} +\subsection{Mutable Sequence Types \label{typesseq-mutable}} List objects support additional operations that allow in-place modification of the object. @@ -1216,7 +1216,7 @@ that the list has been mutated during a sort. \end{description} -\subsection{Set Types --- +\section{Set Types --- \class{set}, \class{frozenset} \label{types-set}} \obindex{set} @@ -1355,7 +1355,7 @@ \end{seealso} -\subsection{Mapping Types --- \class{dict} \label{typesmapping}} +\section{Mapping Types --- \class{dict} \label{typesmapping}} \obindex{mapping} \obindex{dictionary} @@ -1518,7 +1518,7 @@ \end{description} -\subsection{File Objects +\section{File Objects \label{bltin-file-objects}} File objects\obindex{file} are implemented using C's \code{stdio} @@ -1797,7 +1797,7 @@ \end{memberdesc} -\subsection{Context Manager Types \label{typecontextmanager}} +\section{Context Manager Types \label{typecontextmanager}} \versionadded{2.5} \index{context manager} @@ -1878,13 +1878,13 @@ is negligible. -\subsection{Other Built-in Types \label{typesother}} +\section{Other Built-in Types \label{typesother}} The interpreter supports several other kinds of objects. Most of these support only one or two operations. -\subsubsection{Modules \label{typesmodules}} +\subsection{Modules \label{typesmodules}} The only special operation on a module is attribute access: \code{\var{m}.\var{name}}, where \var{m} is a module and \var{name} @@ -1910,14 +1910,14 @@ '/usr/local/lib/python\shortversion/os.pyc'>}. -\subsubsection{Classes and Class Instances \label{typesobjects}} +\subsection{Classes and Class Instances \label{typesobjects}} \nodename{Classes and Instances} See chapters 3 and 7 of the \citetitle[../ref/ref.html]{Python Reference Manual} for these. -\subsubsection{Functions \label{typesfunctions}} +\subsection{Functions \label{typesfunctions}} Function objects are created by function definitions. The only operation on a function object is to call it: @@ -1931,7 +1931,7 @@ See the \citetitle[../ref/ref.html]{Python Reference Manual} for more information. -\subsubsection{Methods \label{typesmethods}} +\subsection{Methods \label{typesmethods}} \obindex{method} Methods are functions that are called using the attribute notation. @@ -1976,7 +1976,7 @@ information. -\subsubsection{Code Objects \label{bltin-code-objects}} +\subsection{Code Objects \label{bltin-code-objects}} \obindex{code} Code objects are used by the implementation to represent @@ -1999,7 +1999,7 @@ information. -\subsubsection{Type Objects \label{bltin-type-objects}} +\subsection{Type Objects \label{bltin-type-objects}} Type objects represent the various object types. An object's type is accessed by the built-in function \function{type()}. There are no special @@ -2011,7 +2011,7 @@ Types are written like this: \code{}. -\subsubsection{The Null Object \label{bltin-null-object}} +\subsection{The Null Object \label{bltin-null-object}} This object is returned by functions that don't explicitly return a value. It supports no special operations. There is exactly one null @@ -2020,7 +2020,7 @@ It is written as \code{None}. -\subsubsection{The Ellipsis Object \label{bltin-ellipsis-object}} +\subsection{The Ellipsis Object \label{bltin-ellipsis-object}} This object is used by extended slice notation (see the \citetitle[../ref/ref.html]{Python Reference Manual}). It supports no @@ -2029,7 +2029,7 @@ It is written as \code{Ellipsis}. -\subsubsection{Boolean Values} +\subsection{Boolean Values} Boolean values are the two constant objects \code{False} and \code{True}. They are used to represent truth values (although other @@ -2046,14 +2046,14 @@ \indexii{Boolean}{values} -\subsubsection{Internal Objects \label{typesinternal}} +\subsection{Internal Objects \label{typesinternal}} See the \citetitle[../ref/ref.html]{Python Reference Manual} for this information. It describes stack frame objects, traceback objects, and slice objects. -\subsection{Special Attributes \label{specialattrs}} +\section{Special Attributes \label{specialattrs}} The implementation adds a few special read-only attributes to several object types, where they are relevant. Some of these are not reported Modified: python/branches/bcannon-sandboxing/Doc/lib/libstringio.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libstringio.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libstringio.tex Wed Aug 2 00:51:44 2006 @@ -37,6 +37,24 @@ Free the memory buffer. \end{methoddesc} +Example usage: + +\begin{verbatim} +import StringIO + +output = StringIO.StringIO() +output.write('First line.\n') +print >>output, 'Second line.' + +# Retrieve file contents -- this will be +# 'First line.\nSecond line.\n' +contents = output.getvalue() + +# Close object and discard memory buffer -- +# .getvalue() will now raise an exception. +output.close() +\end{verbatim} + \section{\module{cStringIO} --- Faster version of \module{StringIO}} @@ -82,3 +100,22 @@ There is a C API to the module as well; refer to the module source for more information. + +Example usage: + +\begin{verbatim} +import cStringIO + +output = cStringIO.StringIO() +output.write('First line.\n') +print >>output, 'Second line.' + +# Retrieve file contents -- this will be +# 'First line.\nSecond line.\n' +contents = output.getvalue() + +# Close object and discard memory buffer -- +# .getvalue() will now raise an exception. +output.close() +\end{verbatim} + Modified: python/branches/bcannon-sandboxing/Doc/lib/libsubprocess.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libsubprocess.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libsubprocess.tex Wed Aug 2 00:51:44 2006 @@ -107,7 +107,7 @@ If \var{universal_newlines} is \constant{True}, the file objects stdout and stderr are opened as text files, but lines may be terminated by -any of \code{'\e n'}, the Unix end-of-line convention, \code{'\e r'}, +any of \code{'\e n'}, the \UNIX{} end-of-line convention, \code{'\e r'}, the Macintosh convention or \code{'\e r\e n'}, the Windows convention. All of these external representations are seen as \code{'\e n'} by the Python program. \note{This feature is only available if Python is built @@ -140,7 +140,7 @@ Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise \exception{CalledProcessError.} The \exception{CalledProcessError} object will have the return code in the -\member{errno} attribute. +\member{returncode} attribute. The arguments are the same as for the Popen constructor. Example: @@ -164,9 +164,8 @@ A \exception{ValueError} will be raised if \class{Popen} is called with invalid arguments. -check_call() will raise \exception{CalledProcessError}, which is a -subclass of \exception{OSError}, if the called process returns a -non-zero return code. +check_call() will raise \exception{CalledProcessError}, if the called +process returns a non-zero return code. \subsubsection{Security} Modified: python/branches/bcannon-sandboxing/Doc/lib/libsys.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libsys.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libsys.tex Wed Aug 2 00:51:44 2006 @@ -21,7 +21,7 @@ \begin{datadesc}{byteorder} An indicator of the native byte order. This will have the value - \code{'big'} on big-endian (most-signigicant byte first) platforms, + \code{'big'} on big-endian (most-significant byte first) platforms, and \code{'little'} on little-endian (least-significant byte first) platforms. \versionadded{2.0} @@ -41,7 +41,7 @@ \code{Include/patchlevel.h} if the branch is a tag. Otherwise, it is \code{None}. \versionadded{2.5} -\end{datadesc} +\end{datadesc} \begin{datadesc}{builtin_module_names} A tuple of strings giving the names of all modules that are compiled @@ -55,6 +55,23 @@ interpreter. \end{datadesc} +\begin{funcdesc}{_current_frames}{} + Return a dictionary mapping each thread's identifier to the topmost stack + frame currently active in that thread at the time the function is called. + Note that functions in the \refmodule{traceback} module can build the + call stack given such a frame. + + This is most useful for debugging deadlock: this function does not + require the deadlocked threads' cooperation, and such threads' call stacks + are frozen for as long as they remain deadlocked. The frame returned + for a non-deadlocked thread may bear no relationship to that thread's + current activity by the time calling code examines the frame. + + This function should be used for internal and specialized purposes + only. + \versionadded{2.5} +\end{funcdesc} + \begin{datadesc}{dllhandle} Integer specifying the handle of the Python DLL. Availability: Windows. @@ -142,7 +159,7 @@ function, \function{exc_info()} will return three \code{None} values until another exception is raised in the current thread or the execution stack returns to a frame where another exception is being handled. - + This function is only needed in only a few obscure situations. These include logging and error handling systems that report information on the last or current exception. This function can also be used to try to free @@ -241,14 +258,14 @@ \begin{itemize} \item On Windows 9x, the encoding is ``mbcs''. \item On Mac OS X, the encoding is ``utf-8''. -\item On Unix, the encoding is the user's preference - according to the result of nl_langinfo(CODESET), or None if - the nl_langinfo(CODESET) failed. +\item On \UNIX, the encoding is the user's preference + according to the result of nl_langinfo(CODESET), or \constant{None} + if the \code{nl_langinfo(CODESET)} failed. \item On Windows NT+, file names are Unicode natively, so no conversion - is performed. \code{getfilesystemencoding} still returns ``mbcs'', - as this is the encoding that applications should use when they - explicitly want to convert Unicode strings to byte strings that - are equivalent when used as file names. + is performed. \function{getfilesystemencoding()} still returns + \code{'mbcs'}, as this is the encoding that applications should use + when they explicitly want to convert Unicode strings to byte strings + that are equivalent when used as file names. \end{itemize} \versionadded{2.3} \end{funcdesc} @@ -279,8 +296,8 @@ \end{funcdesc} \begin{funcdesc}{getwindowsversion}{} - Return a tuple containing five components, describing the Windows - version currently running. The elements are \var{major}, \var{minor}, + Return a tuple containing five components, describing the Windows + version currently running. The elements are \var{major}, \var{minor}, \var{build}, \var{platform}, and \var{text}. \var{text} contains a string while all other values are integers. @@ -491,7 +508,7 @@ be registered using \function{settrace()} for each thread being debugged. \note{The \function{settrace()} function is intended only for implementing debuggers, profilers, coverage tools and the like. - Its behavior is part of the implementation platform, rather than + Its behavior is part of the implementation platform, rather than part of the language definition, and thus may not be available in all Python implementations.} \end{funcdesc} Modified: python/branches/bcannon-sandboxing/Doc/lib/libtime.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libtime.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libtime.tex Wed Aug 2 00:51:44 2006 @@ -226,6 +226,8 @@ \versionchanged[Allowed \var{t} to be omitted]{2.1} \versionchanged[\exception{ValueError} raised if a field in \var{t} is out of range]{2.4} +\versionchanged[0 is now a legal argument for any position in the time tuple; +if it is normally illegal the value is forced to a correct one.]{2.5} The following directives can be embedded in the \var{format} string. @@ -425,7 +427,7 @@ '16:08:12 05/08/03 AEST' \end{verbatim} -On many Unix systems (including *BSD, Linux, Solaris, and Darwin), it +On many \UNIX{} systems (including *BSD, Linux, Solaris, and Darwin), it is more convenient to use the system's zoneinfo (\manpage{tzfile}{5}) database to specify the timezone rules. To do this, set the \envvar{TZ} environment variable to the path of the required timezone Modified: python/branches/bcannon-sandboxing/Doc/lib/libturtle.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libturtle.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libturtle.tex Wed Aug 2 00:51:44 2006 @@ -27,6 +27,45 @@ Set angle measurement units to radians. \end{funcdesc} +\begin{funcdesc}{setup}{**kwargs} +Sets the size and position of the main window. Keywords are: +\begin{itemize} + \item \code{width}: either a size in pixels or a fraction of the screen. + The default is 50\% of the screen. + \item \code{height}: either a size in pixels or a fraction of the screen. + The default is 50\% of the screen. + \item \code{startx}: starting position in pixels from the left edge + of the screen. \code{None} is the default value and + centers the window horizontally on screen. + \item \code{starty}: starting position in pixels from the top edge + of the screen. \code{None} is the default value and + centers the window vertically on screen. +\end{itemize} + + Examples: + +\begin{verbatim} +# Uses default geometry: 50% x 50% of screen, centered. +setup() + +# Sets window to 200x200 pixels, in upper left of screen +setup (width=200, height=200, startx=0, starty=0) + +# Sets window to 75% of screen by 50% of screen, and centers it. +setup(width=.75, height=0.5, startx=None, starty=None) +\end{verbatim} + +\end{funcdesc} + +\begin{funcdesc}{title}{title_str} +Set the window's title to \var{title}. +\end{funcdesc} + +\begin{funcdesc}{done}{} +Enters the Tk main loop. The window will continue to +be displayed until the user closes it or the process is killed. +\end{funcdesc} + \begin{funcdesc}{reset}{} Clear the screen, re-center the pen, and set variables to the default values. @@ -108,7 +147,9 @@ \end{funcdesc} \begin{funcdesc}{begin\_fill}{} -Switch turtle into filling mode; equivalent to \code{fill(1)}. +Switch turtle into filling mode; +Must eventually be followed by a corresponding end_fill() call. +Otherwise it will be ignored. \versionadded{2.5} \end{funcdesc} Modified: python/branches/bcannon-sandboxing/Doc/lib/libtypes.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libtypes.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libtypes.tex Wed Aug 2 00:51:44 2006 @@ -180,6 +180,30 @@ \function{buffer()}\bifuncindex{buffer} function. \end{datadesc} +\begin{datadesc}{DictProxyType} +The type of dict proxies, such as \code{TypeType.__dict__}. +\end{datadesc} + +\begin{datadesc}{NotImplementedType} +The type of \code{NotImplemented} +\end{datadesc} + +\begin{datadesc}{GetSetDescriptorType} +The type of objects defined in extension modules with \code{PyGetSetDef}, such +as \code{FrameType.f_locals} or \code{array.array.typecode}. This constant is +not defined in implementations of Python that do not have such extension +types, so for portable code use \code{hasattr(types, 'GetSetDescriptorType')}. +\versionadded{2.5} +\end{datadesc} + +\begin{datadesc}{MemberDescriptorType} +The type of objects defined in extension modules with \code{PyMemberDef}, such +as \code {datetime.timedelta.days}. This constant is not defined in +implementations of Python that do not have such extension types, so for +portable code use \code{hasattr(types, 'MemberDescriptorType')}. +\versionadded{2.5} +\end{datadesc} + \begin{datadesc}{StringTypes} A sequence containing \code{StringType} and \code{UnicodeType} used to facilitate easier checking for any string object. Using this is more Modified: python/branches/bcannon-sandboxing/Doc/lib/libundoc.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libundoc.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libundoc.tex Wed Aug 2 00:51:44 2006 @@ -49,7 +49,7 @@ \item[\module{bsddb185}] --- Backwards compatibility module for systems which still use the Berkeley - DB 1.85 module. It is normally only available on certain BSD Unix-based + DB 1.85 module. It is normally only available on certain BSD \UNIX-based systems. It should never be used directly. \end{description} Modified: python/branches/bcannon-sandboxing/Doc/lib/libunicodedata.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libunicodedata.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libunicodedata.tex Wed Aug 2 00:51:44 2006 @@ -14,11 +14,11 @@ This module provides access to the Unicode Character Database which defines character properties for all Unicode characters. The data in this database is based on the \file{UnicodeData.txt} file version -4.1.0 which is publically available from \url{ftp://ftp.unicode.org/}. +4.1.0 which is publicly available from \url{ftp://ftp.unicode.org/}. The module uses the same names and symbols as defined by the UnicodeData File Format 4.1.0 (see -\url{http://www.unicode.org/Public/4.1-Update/UnicodeData-4.1.0.html}). It +\url{http://www.unicode.org/Public/4.1.0/ucd/UCD.html}). It defines the following functions: \begin{funcdesc}{lookup}{name} @@ -108,7 +108,7 @@ Normal form C (NFC) first applies a canonical decomposition, then composes pre-combined characters again. -In addition to these two forms, there two additional normal forms +In addition to these two forms, there are two additional normal forms based on compatibility equivalence. In Unicode, certain characters are supported which normally would be unified with other characters. For example, U+2160 (ROMAN NUMERAL ONE) is really the same thing as U+0049 @@ -139,3 +139,22 @@ \versionadded{2.5} \end{datadesc} + +Examples: + +\begin{verbatim} +>>> unicodedata.lookup('LEFT CURLY BRACKET') +u'{' +>>> unicodedata.name(u'/') +'SOLIDUS' +>>> unicodedata.decimal(u'9') +9 +>>> unicodedata.decimal(u'a') +Traceback (most recent call last): + File "", line 1, in ? +ValueError: not a decimal +>>> unicodedata.category(u'A') # 'L'etter, 'u'ppercase +'Lu' +>>> unicodedata.bidirectional(u'\u0660') # 'A'rabic, 'N'umber +'AN' +\end{verbatim} Modified: python/branches/bcannon-sandboxing/Doc/lib/liburllib.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/liburllib.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/liburllib.tex Wed Aug 2 00:51:44 2006 @@ -270,10 +270,10 @@ environmental proxy settings will be used if present, as discussed in the definition of \function{urlopen()}, above. -Additional keyword parameters, collected in \var{x509}, are used for -authentication with the \file{https:} scheme. The keywords -\var{key_file} and \var{cert_file} are supported; both are needed to -actually retrieve a resource at an \file{https:} URL. +Additional keyword parameters, collected in \var{x509}, may be used for +authentication of the client when using the \file{https:} scheme. The keywords +\var{key_file} and \var{cert_file} are supported to provide an +SSL key and certificate; both are needed to support client authentication. \class{URLopener} objects will raise an \exception{IOError} exception if the server returns an error code. Modified: python/branches/bcannon-sandboxing/Doc/lib/liburllib2.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/liburllib2.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/liburllib2.tex Wed Aug 2 00:51:44 2006 @@ -19,7 +19,8 @@ object. \var{data} may be a string specifying additional data to send to the -server. Currently HTTP requests are the only ones that use \var{data}; +server, or \code{None} if no such data is needed. +Currently HTTP requests are the only ones that use \var{data}; the HTTP request will be a POST instead of a GET when the \var{data} parameter is provided. \var{data} should be a buffer in the standard \mimetype{application/x-www-form-urlencoded} format. The @@ -97,8 +98,17 @@ \optional{, origin_req_host}\optional{, unverifiable}} This class is an abstraction of a URL request. -\var{url} should be a string which is a valid URL. For a description -of \var{data} see the \method{add_data()} description. +\var{url} should be a string containing a valid URL. + +\var{data} may be a string specifying additional data to send to the +server, or \code{None} if no such data is needed. +Currently HTTP requests are the only ones that use \var{data}; +the HTTP request will be a POST instead of a GET when the \var{data} +parameter is provided. \var{data} should be a buffer in the standard +\mimetype{application/x-www-form-urlencoded} format. The +\function{urllib.urlencode()} function takes a mapping or sequence of +2-tuples and returns a string in this format. + \var{headers} should be a dictionary, and will be treated as if \method{add_header()} was called with each key and value as arguments. Modified: python/branches/bcannon-sandboxing/Doc/lib/libuuid.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libuuid.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libuuid.tex Wed Aug 2 00:51:44 2006 @@ -32,7 +32,7 @@ Create a UUID from either a string of 32 hexadecimal digits, a string of 16 bytes as the \var{bytes} argument, a tuple of six -integers (32-bit \var{time_low}, 16-bit \var{time_mid}, +integers (32-bit \var{time_low}, 16-bit \var{time_mid}, 16-bit \var{time_hi_version}, 8-bit \var{clock_seq_hi_variant}, 8-bit \var{clock_seq_low}, 48-bit \var{node}) as the \var{fields} argument, or a single 128-bit integer as the \var{int} @@ -109,10 +109,13 @@ The \module{uuid} module defines the following functions \begin{funcdesc}{getnode}{} -Get the hardware address as a 48-bit integer. The first time this runs, -it may launch a separate program, which could be quite slow. If all +Get the hardware address as a 48-bit positive integer. The first time this +runs, it may launch a separate program, which could be quite slow. If all attempts to obtain the hardware address fail, we choose a random 48-bit -number with its eighth bit set to 1 as recommended in RFC 4122. +number with its eighth bit set to 1 as recommended in RFC 4122. "Hardware +address" means the MAC address of a network interface, and on a machine +with multiple network interfaces the MAC address of any one of them may +be returned. \end{funcdesc} \index{getnode} @@ -126,10 +129,10 @@ \index{uuid1} \begin{funcdesc}{uuid3}{namespace, name} -Generate a UUID based upon a MD5 hash of the \var{name} string value -drawn from a specified namespace. \var{namespace} +Generate a UUID based upon a MD5 hash of the \var{name} string value +drawn from a specified namespace. \var{namespace} must be one of \constant{NAMESPACE_DNS}, -\constant{NAMESPACE_URL}, \constant{NAMESPACE_OID}, +\constant{NAMESPACE_URL}, \constant{NAMESPACE_OID}, or \constant{NAMESPACE_X500}. \end{funcdesc} \index{uuid3} @@ -140,15 +143,15 @@ \index{uuid4} \begin{funcdesc}{uuid5}{namespace, name} -Generate a UUID based upon a SHA-1 hash of the \var{name} string value -drawn from a specified namespace. \var{namespace} +Generate a UUID based upon a SHA-1 hash of the \var{name} string value +drawn from a specified namespace. \var{namespace} must be one of \constant{NAMESPACE_DNS}, -\constant{NAMESPACE_URL}, \constant{NAMESPACE_OID}, +\constant{NAMESPACE_URL}, \constant{NAMESPACE_OID}, or \constant{NAMESPACE_X500}. \end{funcdesc} \index{uuid5} -The \module{uuid} module defines the following namespace constants +The \module{uuid} module defines the following namespace constants for use with \function{uuid3()} or \function{uuid5()}. \begin{datadesc}{NAMESPACE_DNS} @@ -167,7 +170,7 @@ X.500 DN namespace UUID. \end{datadesc} -The \module{uuid} module defines the following constants +The \module{uuid} module defines the following constants for the possible values of the \member{variant} attribute: \begin{datadesc}{RESERVED_NCS} Modified: python/branches/bcannon-sandboxing/Doc/lib/libwarnings.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libwarnings.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libwarnings.tex Wed Aug 2 00:51:44 2006 @@ -71,6 +71,11 @@ \lineii{FutureWarning}{Base category for warnings about constructs that will change semantically in the future.} +\lineii{PendingDeprecationWarning}{Base category for warnings about +features that will be deprecated in the future (ignored by default).} + +\lineii{ImportWarning}{Base category for warnings triggered during the +process of importing a module (ignored by default).} \end{tableii} While these are technically built-in exceptions, they are documented @@ -143,6 +148,17 @@ it is first imported (invalid options are ignored, after printing a message to \code{sys.stderr}). +The warnings that are ignored by default may be enabled by passing + \programopt{-Wd} to the interpreter. This enables default handling +for all warnings, including those that are normally ignored by +default. This is particular useful for enabling ImportWarning when +debugging problems importing a developed package. ImportWarning can +also be enabled explicitly in Python code using: + +\begin{verbatim} + warnings.simplefilter('default', ImportWarning) +\end{verbatim} + \subsection{Available Functions \label{warning-functions}} @@ -209,14 +225,26 @@ inserted at the front by default; if \var{append} is true, it is inserted at the end. This checks the types of the arguments, compiles the message and -module regular expressions, and inserts them as a tuple in front -of the warnings filter. Entries inserted later override entries -inserted earlier, if both match a particular warning. Omitted -arguments default to a value that matches everything. +module regular expressions, and inserts them as a tuple in the +list of warnings filters. Entries closer to the front of the list +override entries later in the list, if both match a particular +warning. Omitted arguments default to a value that matches +everything. +\end{funcdesc} + +\begin{funcdesc}{simplefilter}{action\optional{, + category\optional{, + lineno\optional{, append}}}} +Insert a simple entry into the list of warnings filters. The meaning +of the function parameters is as for \function{filterwarnings()}, but +regular expressions are not needed as the filter inserted always +matches any message in any module as long as the category and line +number match. \end{funcdesc} \begin{funcdesc}{resetwarnings}{} Reset the warnings filter. This discards the effect of all previous calls to \function{filterwarnings()}, including that of the -\programopt{-W} command line options. +\programopt{-W} command line options and calls to +\function{simplefilter()}. \end{funcdesc} Modified: python/branches/bcannon-sandboxing/Doc/lib/libweakref.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libweakref.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libweakref.tex Wed Aug 2 00:51:44 2006 @@ -65,10 +65,14 @@ obj = Dict(red=1, green=2, blue=3) # this object is weak referencable \end{verbatim} -Extension types can easily be made to support weak references; see section -\ref{weakref-extension}, ``Weak References in Extension Types,'' for more -information. - +Extension types can easily be made to support weak references; see +``\ulink{Weak Reference Support}{../ext/weakref-support.html}'' in +\citetitle[../ext/ext.html]{Extending and Embedding the Python +Interpreter}. +% The referenced section used to appear in this document with the +% \label weakref-extension. It would be good to be able to generate a +% redirect for the corresponding HTML page (weakref-extension.html) +% for on-line versions of this document. \begin{classdesc}{ref}{object\optional{, callback}} Return a weak reference to \var{object}. The original object can be @@ -330,83 +334,3 @@ def id2obj(oid): return _id2obj_dict[oid] \end{verbatim} - - -\subsection{Weak References in Extension Types - \label{weakref-extension}} - -One of the goals of the implementation is to allow any type to -participate in the weak reference mechanism without incurring the -overhead on those objects which do not benefit by weak referencing -(such as numbers). - -For an object to be weakly referencable, the extension must include a -\ctype{PyObject*} field in the instance structure for the use of the -weak reference mechanism; it must be initialized to \NULL{} by the -object's constructor. It must also set the \member{tp_weaklistoffset} -field of the corresponding type object to the offset of the field. -Also, it needs to add \constant{Py_TPFLAGS_HAVE_WEAKREFS} to the -tp_flags slot. For example, the instance type is defined with the -following structure: - -\begin{verbatim} -typedef struct { - PyObject_HEAD - PyClassObject *in_class; /* The class object */ - PyObject *in_dict; /* A dictionary */ - PyObject *in_weakreflist; /* List of weak references */ -} PyInstanceObject; -\end{verbatim} - -The statically-declared type object for instances is defined this way: - -\begin{verbatim} -PyTypeObject PyInstance_Type = { - PyObject_HEAD_INIT(&PyType_Type) - 0, - "module.instance", - - /* Lots of stuff omitted for brevity... */ - - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_WEAKREFS /* tp_flags */ - 0, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - offsetof(PyInstanceObject, in_weakreflist), /* tp_weaklistoffset */ -}; -\end{verbatim} - -The type constructor is responsible for initializing the weak reference -list to \NULL: - -\begin{verbatim} -static PyObject * -instance_new() { - /* Other initialization stuff omitted for brevity */ - - self->in_weakreflist = NULL; - - return (PyObject *) self; -} -\end{verbatim} - -The only further addition is that the destructor needs to call the -weak reference manager to clear any weak references. This should be -done before any other parts of the destruction have occurred, but is -only required if the weak reference list is non-\NULL: - -\begin{verbatim} -static void -instance_dealloc(PyInstanceObject *inst) -{ - /* Allocate temporaries if needed, but do not begin - destruction just yet. - */ - - if (inst->in_weakreflist != NULL) - PyObject_ClearWeakRefs((PyObject *) inst); - - /* Proceed with object destruction normally. */ -} -\end{verbatim} Modified: python/branches/bcannon-sandboxing/Doc/lib/libwebbrowser.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libwebbrowser.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libwebbrowser.tex Wed Aug 2 00:51:44 2006 @@ -136,6 +136,18 @@ Only on MacOS X platform. \end{description} +Here are some simple examples: + +\begin{verbatim} +url = 'http://www.python.org' + +# Open URL in a new tab, if a browser window is already open. +webbrowser.open_new_tab(url + '/doc') + +# Open URL in new window, raising the window if possible. +webbrowser.open_new(url) +\end{verbatim} + \subsection{Browser Controller Objects \label{browser-controllers}} Modified: python/branches/bcannon-sandboxing/Doc/lib/libzipfile.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/libzipfile.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/libzipfile.tex Wed Aug 2 00:51:44 2006 @@ -106,12 +106,12 @@ is specified but the \refmodule{zlib} module is not available, \exception{RuntimeError} is also raised. The default is \constant{ZIP_STORED}. - If \var{allowZip64} is \code{True} zipfile will create zipfiles that use - the ZIP64 extensions when the zipfile is larger than 2GBytes. If it is - false (the default) zipfile will raise an exception when the zipfile would - require ZIP64 extensions. ZIP64 extensions are disabled by default because - the default zip and unzip commands on Unix (the InfoZIP utilities) don't - support these extensions. + If \var{allowZip64} is \code{True} zipfile will create ZIP files that use + the ZIP64 extensions when the zipfile is larger than 2 GB. If it is + false (the default) \module{zipfile} will raise an exception when the + ZIP file would require ZIP64 extensions. ZIP64 extensions are disabled by + default because the default \program{zip} and \program{unzip} commands on + \UNIX{} (the InfoZIP utilities) don't support these extensions. \end{classdesc} \begin{methoddesc}{close}{} Modified: python/branches/bcannon-sandboxing/Doc/lib/sqlite3/complete_statement.py ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/sqlite3/complete_statement.py (original) +++ python/branches/bcannon-sandboxing/Doc/lib/sqlite3/complete_statement.py Wed Aug 2 00:51:44 2006 @@ -24,7 +24,7 @@ if buffer.lstrip().upper().startswith("SELECT"): print cur.fetchall() except sqlite3.Error, e: - print "An error occured:", e.args[0] + print "An error occurred:", e.args[0] buffer = "" con.close() Modified: python/branches/bcannon-sandboxing/Doc/lib/tkinter.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/lib/tkinter.tex (original) +++ python/branches/bcannon-sandboxing/Doc/lib/tkinter.tex Wed Aug 2 00:51:44 2006 @@ -18,10 +18,9 @@ module \module{\_tkinter} provides a threadsafe mechanism which allows Python and Tcl to interact. -Tk is not the only GUI for Python, but is however the most commonly -used one; see section~\ref{other-gui-modules}, ``Other User Interface -Modules and Packages,'' for more information on other GUI toolkits for -Python. +Tk is not the only GUI for Python; see +section~\ref{other-gui-packages}, ``Other User Interface Modules and +Packages,'' for more information on other GUI toolkits for Python. % Other sections I have in mind are % Tkinter internals @@ -103,14 +102,14 @@ \end{classdesc} \begin{funcdesc}{Tcl}{screenName=None, baseName=None, className='Tk', useTk=0} -The \function{Tcl} function is a factory function which creates an object -much like that created by the \class{Tk} class, except that it does not -initialize the Tk subsystem. This is most often useful when driving the Tcl -interpreter in an environment where one doesn't want to create extraneous -toplevel windows, or where one cannot (i.e. Unix/Linux systems without an X -server). An object created by the \function{Tcl} object can have a Toplevel -window created (and the Tk subsystem initialized) by calling its -\method{loadtk} method. +The \function{Tcl} function is a factory function which creates an +object much like that created by the \class{Tk} class, except that it +does not initialize the Tk subsystem. This is most often useful when +driving the Tcl interpreter in an environment where one doesn't want +to create extraneous toplevel windows, or where one cannot (such as +\UNIX/Linux systems without an X server). An object created by the +\function{Tcl} object can have a Toplevel window created (and the Tk +subsystem initialized) by calling its \method{loadtk} method. \versionadded{2.4} \end{funcdesc} @@ -316,10 +315,10 @@ periods. For example, \code{.myApp.controlPanel.okButton} might be the name of a widget. -\item[\var{options} ] +\item[\var{options}] configure the widget's appearance and in some cases, its behavior. The options come in the form of a list of flags and values. -Flags are proceeded by a `-', like unix shell command flags, and +Flags are proceeded by a `-', like \UNIX{} shell command flags, and values are put in quotes if they are more than one word. \end{description} @@ -1806,24 +1805,29 @@ through the Tk/Tcl layer.} \end{seealso*} - -Tk is not the only GUI for Python, but is however the -most commonly used one. +Other GUI packages are also available for Python: \begin{seealso*} -\seetitle[http://www.wxwindows.org]{wxWindows}{ -is a GUI toolkit that combines the most attractive attributes of Qt, -Tk, Motif, and GTK+ in one powerful and efficient package. It is -implemented in \Cpp. wxWindows supports two flavors of \UNIX{} -implementation: GTK+ and Motif, and under Windows, it has a standard -Microsoft Foundation Classes (MFC) appearance, because it uses Win32 -widgets. There is a Python class wrapper, independent of Tkinter. - -wxWindows is much richer in widgets than \refmodule{Tkinter}, with its -help system, sophisticated HTML and image viewers, and other -specialized widgets, extensive documentation, and printing capabilities. +\seetitle[http://www.wxpython.org]{wxPython}{ +wxPython is a cross-platform GUI toolkit for Python that is built +around the popular \ulink{wxWidgets}{http://www.wxwidgets.org/} \Cpp{} +toolkit.  It provides a native look and feel for applications on +Windows, Mac OS X, and \UNIX{} systems by using each platform's native +widgets where ever possible, (GTK+ on \UNIX-like systems).  In +addition to an extensive set of widgets, wxPython provides classes for +online documentation and context sensitive help, printing, HTML +viewing, low-level device context drawing, drag and drop, system +clipboard access, an XML-based resource format and more, including an +ever growing library of user-contributed modules.  Both the wxWidgets +and wxPython projects are under active development and continuous +improvement, and have active and helpful user and developer +communities. +} +\seetitle[http://www.amazon.com/exec/obidos/ASIN/1932394621] +{wxPython in Action}{ +The wxPython book, by Noel Rappin and Robin Dunn. } -\seetitle[]{PyQt}{ +\seetitle{PyQt}{ PyQt is a \program{sip}-wrapped binding to the Qt toolkit. Qt is an extensive \Cpp{} GUI toolkit that is available for \UNIX, Windows and Mac OS X. \program{sip} is a tool for generating bindings for \Cpp{} Modified: python/branches/bcannon-sandboxing/Doc/mac/libmacfs.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/mac/libmacfs.tex (original) +++ python/branches/bcannon-sandboxing/Doc/mac/libmacfs.tex Wed Aug 2 00:51:44 2006 @@ -22,10 +22,10 @@ argument can be one of three things:\ (1) a full or partial Macintosh pathname, (2) an \class{FSSpec} object or (3) a 3-tuple \code{(\var{wdRefNum}, \var{parID}, \var{name})} as described in -\citetitle{Inside Macintosh:\ Files}. An \class{FSSpec} can point to +\citetitle{Inside Macintosh:\ Files}. An \class{FSSpec} can point to a non-existing file, as long as the folder containing the file exists. -Under MacPython the same is true for a pathname, but not under unix-Pyton -because of the way pathnames and FSRefs works. See Apple's documentation +Under MacPython the same is true for a pathname, but not under \UNIX-Python +because of the way pathnames and FSRefs works. See Apple's documentation for details. A description of aliases and the Modified: python/branches/bcannon-sandboxing/Doc/mac/libmacos.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/mac/libmacos.tex (original) +++ python/branches/bcannon-sandboxing/Doc/mac/libmacos.tex Wed Aug 2 00:51:44 2006 @@ -25,7 +25,7 @@ incompatible between linking models, packages could use this information to give more decent error messages. The value is one of \code{'static'} for a statically linked Python, \code{'framework'} for Python in a Mac OS X framework, -\code{'shared'} for Python in a standard unix shared library. +\code{'shared'} for Python in a standard \UNIX{} shared library. Older Pythons could also have the value \code{'cfm'} for Mac OS 9-compatible Python. \end{datadesc} Modified: python/branches/bcannon-sandboxing/Doc/mac/using.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/mac/using.tex (original) +++ python/branches/bcannon-sandboxing/Doc/mac/using.tex Wed Aug 2 00:51:44 2006 @@ -6,7 +6,7 @@ features such as the IDE and the Package Manager that are worth pointing out. Python on Mac OS 9 or earlier can be quite different from Python on -Unix or Windows, but is beyond the scope of this manual, as that platform +\UNIX{} or Windows, but is beyond the scope of this manual, as that platform is no longer supported, starting with Python 2.4. See \url{http://www.cwi.nl/\textasciitilde jack/macpython} for installers for the latest 2.3 release for Mac OS 9 and related documentation. Modified: python/branches/bcannon-sandboxing/Doc/ref/ref3.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/ref/ref3.tex (original) +++ python/branches/bcannon-sandboxing/Doc/ref/ref3.tex Wed Aug 2 00:51:44 2006 @@ -1886,6 +1886,9 @@ \method{__pow__()} should be defined to accept an optional third argument if the ternary version of the built-in \function{pow()}\bifuncindex{pow} function is to be supported. + +If one of those methods does not support the operation with the +supplied arguments, it should return \code{NotImplemented}. \end{methoddesc} \begin{methoddesc}[numeric object]{__div__}{self, other} @@ -1937,7 +1940,7 @@ \note{If the right operand's type is a subclass of the left operand's type and that subclass provides the reflected method for the - operation, this method will be called before the right operand's + operation, this method will be called before the left operand's non-reflected method. This behavior allows subclasses to override their ancestors' operations.} \end{methoddesc} Modified: python/branches/bcannon-sandboxing/Doc/tut/tut.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/tut/tut.tex (original) +++ python/branches/bcannon-sandboxing/Doc/tut/tut.tex Wed Aug 2 00:51:44 2006 @@ -2919,14 +2919,13 @@ The submodules often need to refer to each other. For example, the \module{surround} module might use the \module{echo} module. In fact, -such references -are so common that the \keyword{import} statement first looks in the -containing package before looking in the standard module search path. -Thus, the surround module can simply use \code{import echo} or -\code{from echo import echofilter}. If the imported module is not -found in the current package (the package of which the current module -is a submodule), the \keyword{import} statement looks for a top-level -module with the given name. +such references are so common that the \keyword{import} statement +first looks in the containing package before looking in the standard +module search path. Thus, the \module{surround} module can simply use +\code{import echo} or \code{from echo import echofilter}. If the +imported module is not found in the current package (the package of +which the current module is a submodule), the \keyword{import} +statement looks for a top-level module with the given name. When packages are structured into subpackages (as with the \module{Sound} package in the example), there's no shortcut to refer @@ -2936,6 +2935,24 @@ in the \module{Sound.Effects} package, it can use \code{from Sound.Effects import echo}. +Starting with Python 2.5, in addition to the implicit relative imports +described above, you can write explicit relative imports with the +\code{from module import name} form of import statement. These explicit +relative imports use leading dots to indicate the current and parent +packages involved in the relative import. From the \module{surround} +module for example, you might use: + +\begin{verbatim} +from . import echo +from .. import Formats +from ..Filters import equalizer +\end{verbatim} + +Note that both explicit and implicit relative imports are based on the +name of the current module. Since the name of the main module is always +\code{"__main__"}, modules intended for use as the main module of a +Python application should always use absolute imports. + \subsection{Packages in Multiple Directories} Packages support one more special attribute, \member{__path__}. This Modified: python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew20.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew20.tex (original) +++ python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew20.tex Wed Aug 2 00:51:44 2006 @@ -216,7 +216,7 @@ character properties. For example, \code{unicodedata.category(u'A')} returns the 2-character string 'Lu', the 'L' denoting it's a letter, and 'u' meaning that it's uppercase. -\code{u.bidirectional(u'\e x0660')} returns 'AN', meaning that U+0660 is +\code{unicodedata.bidirectional(u'\e u0660')} returns 'AN', meaning that U+0660 is an Arabic number. The \module{codecs} module contains functions to look up existing encodings @@ -571,7 +571,7 @@ The \keyword{print} statement can now have its output directed to a file-like object by following the \keyword{print} with -\verb|>> file|, similar to the redirection operator in Unix shells. +\verb|>> file|, similar to the redirection operator in \UNIX{} shells. Previously you'd either have to use the \method{write()} method of the file-like object, which lacks the convenience and simplicity of \keyword{print}, or you could assign a new value to @@ -894,7 +894,7 @@ name. This third argument is, respectively, a Python object, a C long, or a C string. -A wrapper API was added for Unix-style signal handlers. +A wrapper API was added for \UNIX-style signal handlers. \function{PyOS_getsig()} gets a signal handler and \function{PyOS_setsig()} will set a new handler. @@ -905,7 +905,7 @@ was no way to figure out automatically where Python is installed, or what compiler options to use for extension modules. Software authors had to go through an arduous ritual of editing Makefiles and -configuration files, which only really work on Unix and leave Windows +configuration files, which only really work on \UNIX{} and leave Windows and MacOS unsupported. Python users faced wildly differing installation instructions which varied between different extension packages, which made administering a Python installation something of @@ -1222,7 +1222,7 @@ (Contributed by Peter Bosch, with fixes by Jeremy Hylton.) \item{\module{mmap}:} An interface to memory-mapped files on both -Windows and Unix. A file's contents can be mapped directly into +Windows and \UNIX. A file's contents can be mapped directly into memory, at which point it behaves like a mutable string, so its contents can be read and modified. They can even be passed to functions that expect ordinary strings, such as the \module{re} @@ -1262,7 +1262,7 @@ \item{\module{zipfile}:} A module for reading and writing ZIP-format archives. These are archives produced by \program{PKZIP} on -DOS/Windows or \program{zip} on Unix, not to be confused with +DOS/Windows or \program{zip} on \UNIX, not to be confused with \program{gzip}-format files (which are supported by the \module{gzip} module) (Contributed by James C. Ahlstrom.) Modified: python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew21.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew21.tex (original) +++ python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew21.tex Wed Aug 2 00:51:44 2006 @@ -325,7 +325,7 @@ When compiling Python, the user had to go in and edit the \file{Modules/Setup} file in order to enable various additional modules; the default set is relatively small and limited to modules -that compile on most Unix platforms. This means that on Unix +that compile on most \UNIX{} platforms. This means that on \Unix{} platforms with many more features, most notably Linux, Python installations often don't contain all useful modules they could. @@ -661,7 +661,7 @@ \item The \module{difflib} module contains a class, \class{SequenceMatcher}, which compares two sequences and computes the changes required to transform one sequence into the other. For -example, this module can be used to write a tool similar to the Unix +example, this module can be used to write a tool similar to the \UNIX{} \program{diff} program, and in fact the sample program \file{Tools/scripts/ndiff.py} demonstrates how to write such a script. Modified: python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew23.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew23.tex (original) +++ python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew23.tex Wed Aug 2 00:51:44 2006 @@ -1979,7 +1979,7 @@ The \module{getopt} module provides simple parsing of command-line arguments. The new \module{optparse} module (originally named Optik) -provides more elaborate command-line parsing that follows the Unix +provides more elaborate command-line parsing that follows the \UNIX{} conventions, automatically creates the output for \longprogramopt{help}, and can perform different actions for different options. Modified: python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew24.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew24.tex (original) +++ python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew24.tex Wed Aug 2 00:51:44 2006 @@ -162,7 +162,7 @@ Generator expressions always have to be written inside parentheses, as in the above example. The parentheses signalling a function call also -count, so if you want to create a iterator that will be immediately +count, so if you want to create an iterator that will be immediately passed to a function you could write: \begin{verbatim} Modified: python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew25.tex ============================================================================== --- python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew25.tex (original) +++ python/branches/bcannon-sandboxing/Doc/whatsnew/whatsnew25.tex Wed Aug 2 00:51:44 2006 @@ -6,7 +6,7 @@ % Count up the patches and bugs \title{What's New in Python 2.5} -\release{0.3} +\release{0.4} \author{A.M. Kuchling} \authoraddress{\email{amk at amk.ca}} @@ -74,7 +74,7 @@ Candidates included C's \code{cond ? true_v : false_v}, \code{if cond then true_v else false_v}, and 16 other variations. -GvR eventually chose a surprising syntax: +Guido van~Rossum eventually chose a surprising syntax: \begin{verbatim} x = true_value if condition else false_value @@ -407,7 +407,7 @@ combined version was complicated and it wasn't clear what the semantics of the combined should be. -GvR spent some time working with Java, which does support the +Guido van~Rossum spent some time working with Java, which does support the equivalent of combining \keyword{except} blocks and a \keyword{finally} block, and this clarified what the statement should mean. In Python 2.5, you can now write: @@ -600,7 +600,11 @@ \seepep{342}{Coroutines via Enhanced Generators}{PEP written by Guido van~Rossum and Phillip J. Eby; implemented by Phillip J. Eby. Includes examples of -some fancier uses of generators as coroutines.} +some fancier uses of generators as coroutines. + +Earlier versions of these features were proposed in +\pep{288} by Raymond Hettinger and \pep{325} by Samuele Pedroni. +} \seeurl{http://en.wikipedia.org/wiki/Coroutine}{The Wikipedia entry for coroutines.} @@ -1152,8 +1156,8 @@ false values. \function{any()} returns \constant{True} if any value returned by the iterator is true; otherwise it will return \constant{False}. \function{all()} returns \constant{True} only if -all of the values returned by the iterator evaluate as being true. -(Suggested by GvR, and implemented by Raymond Hettinger.) +all of the values returned by the iterator evaluate as true. +(Suggested by Guido van~Rossum, and implemented by Raymond Hettinger.) \item ASCII is now the default encoding for modules. It's now a syntax error if a module contains string literals with 8-bit @@ -1170,19 +1174,12 @@ to include an \file{__init__.py} module in a package directory. Debugging this mistake can be confusing, and usually requires running Python with the \programopt{-v} switch to log all the paths searched. -In Python 2.5, a new \exception{ImportWarning} warning is raised when +In Python 2.5, a new \exception{ImportWarning} warning is triggered when an import would have picked up a directory as a package but no -\file{__init__.py} was found. (Implemented by Thomas Wouters.) - -To suppress these warnings, you can either supply -\code{\programopt{-W}'ignore:Not importing directory'} when running the Python -interpreter, or use the \module{warnings} module to suppress the -message: - -\begin{verbatim} -warnings.filterwarnings('ignore', 'Not importing directory', - ImportWarning) -\end{verbatim} +\file{__init__.py} was found. This warning is silently ignored by default; +provide the \programopt{-Wd} option when running the Python executable +to display the warning message. +(Implemented by Thomas Wouters.) \item The list of base classes in a class definition can now be empty. As an example, this is now legal: @@ -1213,6 +1210,11 @@ Newbies who try \code{quit()} or \code{exit()} will now exit the interpreter as they expect. (Implemented by Georg Brandl.) +The Python executable now accepts the standard long options +\longprogramopt{help} and \longprogramopt{version}; on Windows, +it also accepts the \programopt{/?} option for displaying a help message. +(Implemented by Georg Brandl.) + %====================================================================== \subsection{Optimizations\label{opts}} @@ -1261,7 +1263,8 @@ \item The code generator's peephole optimizer now performs simple constant folding in expressions. If you write something like \code{a = 2+3}, the code generator will do the arithmetic and produce -code corresponding to \code{a = 5}. +code corresponding to \code{a = 5}. (Proposed and implemented +by Raymond Hettinger.) \item Function calls are now faster because code objects now keep the most recently finished frame (a ``zombie frame'') in an internal @@ -1355,10 +1358,13 @@ 'r': ['ritrovai'], 'u': ['una'], 'v': ['vita', 'via']} \end{verbatim} -The \class{deque} double-ended queue type supplied by the +(Contributed by Guido van~Rossum.) + +\item The \class{deque} double-ended queue type supplied by the \module{collections} module now has a \method{remove(\var{value})} method that removes the first occurrence of \var{value} in the queue, raising \exception{ValueError} if the value isn't found. +(Contributed by Raymond Hettinger.) \item New module: The \module{contextlib} module contains helper functions for use with the new '\keyword{with}' statement. See @@ -1387,6 +1393,17 @@ \member{line_num} attribute that counts the number of physical lines read from the source; records can span multiple physical lines, so \member{line_num} is not the same as the number of records read. + +The CSV parser is now stricter about multi-line quoted +fields. Previously, if a line ended within a quoted field without a +terminating newline character, a newline would be inserted into the +returned field. This behavior caused problems when reading files that +contained carriage return characters within fields, so the code was +changed to return the field without inserting newlines. As a +consequence, if newlines embedded within fields are important, the +input should be split into lines in a manner that preserves the +newline characters. + (Contributed by Skip Montanaro and Andrew McNamara.) \item The \class{datetime} class in the \module{datetime} @@ -1647,7 +1664,7 @@ \end{verbatim} You can also pack and unpack data to and from buffer objects directly -using the \method{pack_to(\var{buffer}, \var{offset}, \var{v1}, +using the \method{pack_into(\var{buffer}, \var{offset}, \var{v1}, \var{v2}, ...)} and \method{unpack_from(\var{buffer}, \var{offset})} methods. This lets you store data directly into an array or a memory-mapped file. @@ -1669,14 +1686,20 @@ \code{"trunk:45355:45356M, Apr 13 2006, 07:42:19"}. (Contributed by Barry Warsaw.) +\item Another new function, \function{sys._current_frames()}, returns +the current stack frames for all running threads as a dictionary +mapping thread identifiers to the topmost stack frame currently active +in that thread at the time the function is called. (Contributed by +Tim Peters.) + \item The \class{TarFile} class in the \module{tarfile} module now has an \method{extractall()} method that extracts all members from the archive into the current working directory. It's also possible to set a different directory as the extraction target, and to unpack only a -subset of the archive's members. +subset of the archive's members. -A tarfile's compression can be autodetected by -using the mode \code{'r|*'}. +The compression used for a tarfile opened in stream mode can now be +autodetected using the mode \code{'r|*'}. % patch 918101 (Contributed by Lars Gust\"abel.) @@ -1748,13 +1771,6 @@ Brandl.) % Patch #754022 -\item The standard library's XML-related package -has been renamed to \module{xmlcore}. The \module{xml} module will -now import either the \module{xmlcore} or PyXML version of subpackages -such as \module{xml.dom}. The renaming means it will always be -possible to import the standard library's XML support whether or not -the PyXML package is installed. - \item The \module{xmlrpclib} module now supports returning \class{datetime} objects for the XML-RPC date type. Supply \code{use_datetime=True} to the \function{loads()} function @@ -2193,6 +2209,11 @@ \begin{itemize} +\item The Python source tree was converted from CVS to Subversion, +in a complex migration procedure that was supervised and flawlessly +carried out by Martin von~L\"owis. The procedure was developed as +\pep{347}. + \item The largest change to the C API came from \pep{353}, which modifies the interpreter to use a \ctype{Py_ssize_t} type definition instead of \ctype{int}. See the earlier @@ -2270,6 +2291,13 @@ \var{dict})} can now accept a tuple of base classes as its \var{base} argument. (Contributed by Georg Brandl.) +\item The \cfunction{PyErr_Warn()} function for issuing warnings +is now deprecated in favour of \cfunction{PyErr_WarnEx(category, +message, stacklevel)} which lets you specify the number of stack +frames separating this function and the caller. A \var{stacklevel} of +1 is the function calling \cfunction{PyErr_WarnEx()}, 2 is the +function above that, and so forth. (Added by Neal Norwitz.) + \item The CPython interpreter is still written in C, but the code can now be compiled with a {\Cpp} compiler without errors. (Implemented by Anthony Baxter, Martin von~L\"owis, Skip Montanaro.) @@ -2312,7 +2340,7 @@ As usual, there were a bunch of other improvements and bugfixes scattered throughout the source tree. A search through the SVN change -logs finds there were XXX patches applied and YYY bugs fixed between +logs finds there were 334 patches applied and 443 bugs fixed between Python 2.4 and 2.5. Both figures are likely to be underestimates. Some of the more notable changes are: @@ -2373,6 +2401,10 @@ described in section~\ref{pep-342}, it's now possible for \member{gi_frame} to be \code{None}. +\item Library: the \module{csv} module is now stricter about multi-line quoted +fields. If your files contain newlines embedded within fields, the +input should be split into lines in a manner which preserves the +newline characters. \item Library: The \module{pickle} and \module{cPickle} modules no longer accept a return value of \code{None} from the @@ -2387,10 +2419,6 @@ \member{rpc_paths} to \code{None} or an empty tuple disables this path checking. -\item Library: the \module{xml} package has been renamed to \module{xmlcore}. -The PyXML package will therefore be \module{xml}, and the Python -distribution's code will always be accessible as \module{xmlcore}. - \item C API: Many functions now use \ctype{Py_ssize_t} instead of \ctype{int} to allow processing more data on 64-bit machines. Extension code may need to make the same change to avoid @@ -2413,8 +2441,10 @@ The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this -article: Nick Coghlan, Phillip J. Eby, Ralf W. Grosse-Kunstleve, Kent -Johnson, Martin von~L\"owis, Fredrik Lundh, Gustavo Niemeyer, James -Pryor, Mike Rovner, Scott Weikart, Barry Warsaw, Thomas Wouters. +article: Nick Coghlan, Phillip J. Eby, Lars Gust\"abel, Raymond Hettinger, Ralf +W. Grosse-Kunstleve, Kent Johnson, Martin von~L\"owis, Fredrik Lundh, +Andrew McNamara, Skip Montanaro, +Gustavo Niemeyer, James Pryor, Mike Rovner, Scott Weikart, Barry +Warsaw, Thomas Wouters. \end{document} Modified: python/branches/bcannon-sandboxing/Include/patchlevel.h ============================================================================== --- python/branches/bcannon-sandboxing/Include/patchlevel.h (original) +++ python/branches/bcannon-sandboxing/Include/patchlevel.h Wed Aug 2 00:51:44 2006 @@ -23,10 +23,10 @@ #define PY_MINOR_VERSION 5 #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA -#define PY_RELEASE_SERIAL 1 +#define PY_RELEASE_SERIAL 2 /* Version as a string */ -#define PY_VERSION "2.5b1" +#define PY_VERSION "2.5b2" /* Subversion Revision number of this file (not of the repository) */ #define PY_PATCHLEVEL_REVISION "$Revision$" Modified: python/branches/bcannon-sandboxing/Include/pyerrors.h ============================================================================== --- python/branches/bcannon-sandboxing/Include/pyerrors.h (original) +++ python/branches/bcannon-sandboxing/Include/pyerrors.h Wed Aug 2 00:51:44 2006 @@ -225,10 +225,14 @@ PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *); /* Issue a warning or exception */ -PyAPI_FUNC(int) PyErr_Warn(PyObject *, char *); +PyAPI_FUNC(int) PyErr_WarnEx(PyObject *category, const char *msg, + Py_ssize_t stack_level); PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, const char *, int, const char *, PyObject *); +/* PyErr_Warn is only for backwards compatability and will be removed. + Use PyErr_WarnEx instead. */ +#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1) /* In sigcheck.c or signalmodule.c */ PyAPI_FUNC(int) PyErr_CheckSignals(void); Modified: python/branches/bcannon-sandboxing/Include/pystate.h ============================================================================== --- python/branches/bcannon-sandboxing/Include/pystate.h (original) +++ python/branches/bcannon-sandboxing/Include/pystate.h Wed Aug 2 00:51:44 2006 @@ -180,6 +180,11 @@ */ PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void); +/* The implementation of sys._current_frames() Returns a dict mapping + thread id to that thread's current frame. +*/ +PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void); + /* Routines for advanced debuggers, requested by David Beazley. Don't use unless you know what you are doing! */ PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void); Modified: python/branches/bcannon-sandboxing/Lib/binhex.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/binhex.py (original) +++ python/branches/bcannon-sandboxing/Lib/binhex.py Wed Aug 2 00:51:44 2006 @@ -44,22 +44,14 @@ # # Workarounds for non-mac machines. -if os.name == 'mac': - import macfs - import MacOS - try: - openrf = MacOS.openrf - except AttributeError: - # Backward compatibility - openrf = open - - def FInfo(): - return macfs.FInfo() +try: + from Carbon.File import FSSpec, FInfo + from MacOS import openrf def getfileinfo(name): - finfo = macfs.FSSpec(name).GetFInfo() + finfo = FSSpec(name).FSpGetFInfo() dir, file = os.path.split(name) - # XXXX Get resource/data sizes + # XXX Get resource/data sizes fp = open(name, 'rb') fp.seek(0, 2) dlen = fp.tell() @@ -75,7 +67,7 @@ mode = '*' + mode[0] return openrf(name, mode) -else: +except ImportError: # # Glue code for non-macintosh usage # @@ -183,7 +175,7 @@ ofname = ofp ofp = open(ofname, 'w') if os.name == 'mac': - fss = macfs.FSSpec(ofname) + fss = FSSpec(ofname) fss.SetCreatorType('BnHq', 'TEXT') ofp.write('(This file must be converted with BinHex 4.0)\n\n:') hqxer = _Hqxcoderengine(ofp) @@ -486,7 +478,7 @@ if not out: out = ifp.FName if os.name == 'mac': - ofss = macfs.FSSpec(out) + ofss = FSSpec(out) out = ofss.as_pathname() ofp = open(out, 'wb') @@ -519,6 +511,7 @@ def _test(): if os.name == 'mac': + import macfs fss, ok = macfs.PromptGetFile('File to convert:') if not ok: sys.exit(0) Modified: python/branches/bcannon-sandboxing/Lib/bsddb/test/test_basics.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/bsddb/test/test_basics.py (original) +++ python/branches/bcannon-sandboxing/Lib/bsddb/test/test_basics.py Wed Aug 2 00:51:44 2006 @@ -562,6 +562,9 @@ num = d.truncate() assert num == 0, "truncate on empty DB returned nonzero (%r)" % (num,) + #---------------------------------------- + + #---------------------------------------------------------------------- @@ -583,18 +586,40 @@ dbopenflags = db.DB_THREAD -class BasicBTreeWithEnvTestCase(BasicTestCase): - dbtype = db.DB_BTREE +class BasicWithEnvTestCase(BasicTestCase): dbopenflags = db.DB_THREAD useEnv = 1 envflags = db.DB_THREAD | db.DB_INIT_MPOOL | db.DB_INIT_LOCK + #---------------------------------------- + + def test07_EnvRemoveAndRename(self): + if not self.env: + return + + if verbose: + print '\n', '-=' * 30 + print "Running %s.test07_EnvRemoveAndRename..." % self.__class__.__name__ + + # can't rename or remove an open DB + self.d.close() + + newname = self.filename + '.renamed' + self.env.dbrename(self.filename, None, newname) + self.env.dbremove(newname) + + # dbremove and dbrename are in 4.1 and later + if db.version() < (4,1): + del test07_EnvRemoveAndRename + + #---------------------------------------- + +class BasicBTreeWithEnvTestCase(BasicWithEnvTestCase): + dbtype = db.DB_BTREE + -class BasicHashWithEnvTestCase(BasicTestCase): +class BasicHashWithEnvTestCase(BasicWithEnvTestCase): dbtype = db.DB_HASH - dbopenflags = db.DB_THREAD - useEnv = 1 - envflags = db.DB_THREAD | db.DB_INIT_MPOOL | db.DB_INIT_LOCK #---------------------------------------------------------------------- Modified: python/branches/bcannon-sandboxing/Lib/compiler/future.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/compiler/future.py (original) +++ python/branches/bcannon-sandboxing/Lib/compiler/future.py Wed Aug 2 00:51:44 2006 @@ -23,14 +23,7 @@ def visitModule(self, node): stmt = node.node - found_docstring = False for s in stmt.nodes: - # Skip over docstrings - if not found_docstring and isinstance(s, ast.Discard) \ - and isinstance(s.expr, ast.Const) \ - and isinstance(s.expr.value, str): - found_docstring = True - continue if not self.check_stmt(s): break Modified: python/branches/bcannon-sandboxing/Lib/compiler/transformer.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/compiler/transformer.py (original) +++ python/branches/bcannon-sandboxing/Lib/compiler/transformer.py Wed Aug 2 00:51:44 2006 @@ -1382,6 +1382,7 @@ symbol.testlist, symbol.testlist_safe, symbol.test, + symbol.or_test, symbol.and_test, symbol.not_test, symbol.comparison, Modified: python/branches/bcannon-sandboxing/Lib/ctypes/__init__.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/ctypes/__init__.py (original) +++ python/branches/bcannon-sandboxing/Lib/ctypes/__init__.py Wed Aug 2 00:51:44 2006 @@ -5,7 +5,7 @@ import os as _os, sys as _sys -__version__ = "0.9.9.7" +__version__ = "1.0.0" from _ctypes import Union, Structure, Array from _ctypes import _Pointer @@ -22,6 +22,23 @@ if _os.name in ("nt", "ce"): from _ctypes import FormatError +DEFAULT_MODE = RTLD_LOCAL +if _os.name == "posix" and _sys.platform == "darwin": + import gestalt + + # gestalt.gestalt("sysv") returns the version number of the + # currently active system file as BCD. + # On OS X 10.4.6 -> 0x1046 + # On OS X 10.2.8 -> 0x1028 + # See also http://www.rgaros.nl/gestalt/ + # + # On OS X 10.3, we use RTLD_GLOBAL as default mode + # because RTLD_LOCAL does not work at least on some + # libraries. + + if gestalt.gestalt("sysv") < 0x1040: + DEFAULT_MODE = RTLD_GLOBAL + from _ctypes import FUNCFLAG_CDECL as _FUNCFLAG_CDECL, \ FUNCFLAG_PYTHONAPI as _FUNCFLAG_PYTHONAPI @@ -284,7 +301,7 @@ _flags_ = _FUNCFLAG_CDECL _restype_ = c_int # default, can be overridden in instances - def __init__(self, name, mode=RTLD_LOCAL, handle=None): + def __init__(self, name, mode=DEFAULT_MODE, handle=None): self._name = name if handle is None: self._handle = _dlopen(self._name, mode) @@ -300,13 +317,14 @@ def __getattr__(self, name): if name.startswith('__') and name.endswith('__'): raise AttributeError, name - return self.__getitem__(name) + func = self.__getitem__(name) + setattr(self, name, func) + return func def __getitem__(self, name_or_ordinal): func = self._FuncPtr((name_or_ordinal, self)) if not isinstance(name_or_ordinal, (int, long)): func.__name__ = name_or_ordinal - setattr(self, name_or_ordinal, func) return func class PyDLL(CDLL): @@ -446,52 +464,21 @@ return _wstring_at(ptr, size) -if _os.name == "nt": # COM stuff +if _os.name in ("nt", "ce"): # COM stuff def DllGetClassObject(rclsid, riid, ppv): - # First ask ctypes.com.server than comtypes.server for the - # class object. - - # trick py2exe by doing dynamic imports - result = -2147221231 # CLASS_E_CLASSNOTAVAILABLE try: - ctcom = __import__("ctypes.com.server", globals(), locals(), ['*']) + ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*']) except ImportError: - pass + return -2147221231 # CLASS_E_CLASSNOTAVAILABLE else: - result = ctcom.DllGetClassObject(rclsid, riid, ppv) - - if result == -2147221231: # CLASS_E_CLASSNOTAVAILABLE - try: - ccom = __import__("comtypes.server", globals(), locals(), ['*']) - except ImportError: - pass - else: - result = ccom.DllGetClassObject(rclsid, riid, ppv) - - return result + return ccom.DllGetClassObject(rclsid, riid, ppv) def DllCanUnloadNow(): - # First ask ctypes.com.server than comtypes.server if we can unload or not. - # trick py2exe by doing dynamic imports - result = 0 # S_OK try: - ctcom = __import__("ctypes.com.server", globals(), locals(), ['*']) + ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*']) except ImportError: - pass - else: - result = ctcom.DllCanUnloadNow() - if result != 0: # != S_OK - return result - - try: - ccom = __import__("comtypes.server", globals(), locals(), ['*']) - except ImportError: - return result - try: - return ccom.DllCanUnloadNow() - except AttributeError: - pass - return result + return 0 # S_OK + return ccom.DllCanUnloadNow() from ctypes._endian import BigEndianStructure, LittleEndianStructure Modified: python/branches/bcannon-sandboxing/Lib/ctypes/test/test_parameters.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/ctypes/test/test_parameters.py (original) +++ python/branches/bcannon-sandboxing/Lib/ctypes/test/test_parameters.py Wed Aug 2 00:51:44 2006 @@ -147,6 +147,41 @@ ## def test_performance(self): ## check_perf() + def test_noctypes_argtype(self): + import _ctypes_test + from ctypes import CDLL, c_void_p, ArgumentError + + func = CDLL(_ctypes_test.__file__)._testfunc_p_p + func.restype = c_void_p + # TypeError: has no from_param method + self.assertRaises(TypeError, setattr, func, "argtypes", (object,)) + + class Adapter(object): + def from_param(cls, obj): + return None + + func.argtypes = (Adapter(),) + self.failUnlessEqual(func(None), None) + self.failUnlessEqual(func(object()), None) + + class Adapter(object): + def from_param(cls, obj): + return obj + + func.argtypes = (Adapter(),) + # don't know how to convert parameter 1 + self.assertRaises(ArgumentError, func, object()) + self.failUnlessEqual(func(c_void_p(42)), 42) + + class Adapter(object): + def from_param(cls, obj): + raise ValueError(obj) + + func.argtypes = (Adapter(),) + # ArgumentError: argument 1: ValueError: 99 + self.assertRaises(ArgumentError, func, 99) + + ################################################################ if __name__ == '__main__': Modified: python/branches/bcannon-sandboxing/Lib/ctypes/test/test_pointers.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/ctypes/test/test_pointers.py (original) +++ python/branches/bcannon-sandboxing/Lib/ctypes/test/test_pointers.py Wed Aug 2 00:51:44 2006 @@ -157,6 +157,23 @@ q = pointer(y) pp[0] = q # <== self.failUnlessEqual(p[0], 6) + def test_c_void_p(self): + # http://sourceforge.net/tracker/?func=detail&aid=1518190&group_id=5470&atid=105470 + if sizeof(c_void_p) == 4: + self.failUnlessEqual(c_void_p(0xFFFFFFFFL).value, + c_void_p(-1).value) + self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFL).value, + c_void_p(-1).value) + elif sizeof(c_void_p) == 8: + self.failUnlessEqual(c_void_p(0xFFFFFFFFL).value, + 0xFFFFFFFFL) + self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFL).value, + c_void_p(-1).value) + self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFFFFFFFFFL).value, + c_void_p(-1).value) + + self.assertRaises(TypeError, c_void_p, 3.14) # make sure floats are NOT accepted + self.assertRaises(TypeError, c_void_p, object()) # nor other objects if __name__ == '__main__': unittest.main() Modified: python/branches/bcannon-sandboxing/Lib/ctypes/test/test_structures.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/ctypes/test/test_structures.py (original) +++ python/branches/bcannon-sandboxing/Lib/ctypes/test/test_structures.py Wed Aug 2 00:51:44 2006 @@ -371,5 +371,15 @@ items = [s.array[i] for i in range(3)] self.failUnlessEqual(items, [1, 2, 3]) + def test_none_to_pointer_fields(self): + class S(Structure): + _fields_ = [("x", c_int), + ("p", POINTER(c_int))] + + s = S() + s.x = 12345678 + s.p = None + self.failUnlessEqual(s.x, 12345678) + if __name__ == '__main__': unittest.main() Modified: python/branches/bcannon-sandboxing/Lib/ctypes/test/test_varsize_struct.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/ctypes/test/test_varsize_struct.py (original) +++ python/branches/bcannon-sandboxing/Lib/ctypes/test/test_varsize_struct.py Wed Aug 2 00:51:44 2006 @@ -46,70 +46,5 @@ self.failUnlessRaises(IndexError, array.__setitem__, -1, None) self.failUnlessRaises(IndexError, array.__getitem__, -1) - def test_varsized_array(self): - array = (c_int * 20)(20, 21, 22, 23, 24, 25, 26, 27, 28, 29) - - # no range checking is done on arrays with size == 1 - varsize_array = (c_int * 1).from_address(addressof(array)) - - # __getitem__ - self.failUnlessEqual(varsize_array[0], 20) - self.failUnlessEqual(varsize_array[1], 21) - self.failUnlessEqual(varsize_array[2], 22) - self.failUnlessEqual(varsize_array[3], 23) - self.failUnlessEqual(varsize_array[4], 24) - self.failUnlessEqual(varsize_array[5], 25) - self.failUnlessEqual(varsize_array[6], 26) - self.failUnlessEqual(varsize_array[7], 27) - self.failUnlessEqual(varsize_array[8], 28) - self.failUnlessEqual(varsize_array[9], 29) - - # still, normal sequence of length one behaviour: - self.failUnlessEqual(varsize_array[-1], 20) - self.failUnlessRaises(IndexError, lambda: varsize_array[-2]) - # except for this one, which will raise MemoryError - self.failUnlessRaises(MemoryError, lambda: varsize_array[:]) - - # __setitem__ - varsize_array[0] = 100 - varsize_array[1] = 101 - varsize_array[2] = 102 - varsize_array[3] = 103 - varsize_array[4] = 104 - varsize_array[5] = 105 - varsize_array[6] = 106 - varsize_array[7] = 107 - varsize_array[8] = 108 - varsize_array[9] = 109 - - for i in range(10): - self.failUnlessEqual(varsize_array[i], i + 100) - self.failUnlessEqual(array[i], i + 100) - - # __getslice__ - self.failUnlessEqual(varsize_array[0:10], range(100, 110)) - self.failUnlessEqual(varsize_array[1:9], range(101, 109)) - self.failUnlessEqual(varsize_array[1:-1], []) - - # __setslice__ - varsize_array[0:10] = range(1000, 1010) - self.failUnlessEqual(varsize_array[0:10], range(1000, 1010)) - - varsize_array[1:9] = range(1001, 1009) - self.failUnlessEqual(varsize_array[1:9], range(1001, 1009)) - - def test_vararray_is_sane(self): - array = (c_int * 15)(20, 21, 22, 23, 24, 25, 26, 27, 28, 29) - - varsize_array = (c_int * 1).from_address(addressof(array)) - varsize_array[:] = [1, 2, 3, 4, 5] - - self.failUnlessEqual(array[:], [1, 2, 3, 4, 5, 25, 26, 27, 28, 29, 0, 0, 0, 0, 0]) - self.failUnlessEqual(varsize_array[0:10], [1, 2, 3, 4, 5, 25, 26, 27, 28, 29]) - - array[:5] = [10, 11, 12, 13, 14] - self.failUnlessEqual(array[:], [10, 11, 12, 13, 14, 25, 26, 27, 28, 29, 0, 0, 0, 0, 0]) - self.failUnlessEqual(varsize_array[0:10], [10, 11, 12, 13, 14, 25, 26, 27, 28, 29]) - if __name__ == "__main__": unittest.main() Modified: python/branches/bcannon-sandboxing/Lib/ctypes/test/test_win32.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/ctypes/test/test_win32.py (original) +++ python/branches/bcannon-sandboxing/Lib/ctypes/test/test_win32.py Wed Aug 2 00:51:44 2006 @@ -1,6 +1,7 @@ # Windows specific tests from ctypes import * +from ctypes.test import is_resource_enabled import unittest, sys import _ctypes_test @@ -30,8 +31,7 @@ # or wrong calling convention self.assertRaises(ValueError, IsWindow, None) - import _ctypes - if _ctypes.uses_seh(): + if is_resource_enabled("SEH"): def test_SEH(self): # Call functions with invalid arguments, and make sure that access violations # are trapped and raise an exception. Modified: python/branches/bcannon-sandboxing/Lib/ctypes/util.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/ctypes/util.py (original) +++ python/branches/bcannon-sandboxing/Lib/ctypes/util.py Wed Aug 2 00:51:44 2006 @@ -47,10 +47,13 @@ def _findLib_gcc(name): expr = '[^\(\)\s]*lib%s\.[^\(\)\s]*' % name + fdout, ccout = tempfile.mkstemp() + os.close(fdout) cmd = 'if type gcc &>/dev/null; then CC=gcc; else CC=cc; fi;' \ - '$CC -Wl,-t -o /dev/null 2>&1 -l' + name + '$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name try: fdout, outfile = tempfile.mkstemp() + os.close(fdout) fd = os.popen(cmd) trace = fd.read() err = fd.close() @@ -60,6 +63,11 @@ except OSError, e: if e.errno != errno.ENOENT: raise + try: + os.unlink(ccout) + except OSError, e: + if e.errno != errno.ENOENT: + raise res = re.search(expr, trace) if not res: return None Modified: python/branches/bcannon-sandboxing/Lib/distutils/__init__.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/distutils/__init__.py (original) +++ python/branches/bcannon-sandboxing/Lib/distutils/__init__.py Wed Aug 2 00:51:44 2006 @@ -12,4 +12,6 @@ __revision__ = "$Id$" -__version__ = "2.4.0" +import sys +__version__ = "%d.%d.%d" % sys.version_info[:3] +del sys Modified: python/branches/bcannon-sandboxing/Lib/distutils/command/upload.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/distutils/command/upload.py (original) +++ python/branches/bcannon-sandboxing/Lib/distutils/command/upload.py Wed Aug 2 00:51:44 2006 @@ -185,7 +185,7 @@ http.endheaders() http.send(body) except socket.error, e: - self.announce(e.msg, log.ERROR) + self.announce(str(e), log.ERROR) return r = http.getresponse() Modified: python/branches/bcannon-sandboxing/Lib/distutils/msvccompiler.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/distutils/msvccompiler.py (original) +++ python/branches/bcannon-sandboxing/Lib/distutils/msvccompiler.py Wed Aug 2 00:51:44 2006 @@ -131,8 +131,10 @@ self.set_macro("FrameworkSDKDir", net, "sdkinstallroot") except KeyError, exc: # raise DistutilsPlatformError, \ - ("The .NET Framework SDK needs to be installed before " - "building extensions for Python.") + ("""Python was built with Visual Studio 2003; +extensions must be built with a compiler than can generate compatible binaries. +Visual Studio 2003 was not found on this system. If you have Cygwin installed, +you can try compiling with MingW32, by passing "-c mingw32" to setup.py.""") p = r"Software\Microsoft\NET Framework Setup\Product" for base in HKEYS: @@ -237,7 +239,7 @@ def initialize(self): self.__paths = [] - if os.environ.has_key("MSSdk") and self.find_exe("cl.exe"): + if os.environ.has_key("DISTUTILS_USE_SDK") and os.environ.has_key("MSSdk") and self.find_exe("cl.exe"): # Assume that the SDK set up everything alright; don't try to be # smarter self.cc = "cl.exe" Modified: python/branches/bcannon-sandboxing/Lib/doctest.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/doctest.py (original) +++ python/branches/bcannon-sandboxing/Lib/doctest.py Wed Aug 2 00:51:44 2006 @@ -821,6 +821,11 @@ # Recursively expore `obj`, extracting DocTests. tests = [] self._find(tests, obj, name, module, source_lines, globs, {}) + # Sort the tests by alpha order of names, for consistency in + # verbose-mode output. This was a feature of doctest in Pythons + # <= 2.3 that got lost by accident in 2.4. It was repaired in + # 2.4.4 and 2.5. + tests.sort() return tests def _from_module(self, module, object): Modified: python/branches/bcannon-sandboxing/Lib/email/__init__.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/email/__init__.py (original) +++ python/branches/bcannon-sandboxing/Lib/email/__init__.py Wed Aug 2 00:51:44 2006 @@ -4,7 +4,7 @@ """A package for parsing, handling, and generating email messages.""" -__version__ = '4.0a2' +__version__ = '4.0.1' __all__ = [ # Old names Modified: python/branches/bcannon-sandboxing/Lib/email/message.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/email/message.py (original) +++ python/branches/bcannon-sandboxing/Lib/email/message.py Wed Aug 2 00:51:44 2006 @@ -747,7 +747,18 @@ if isinstance(charset, tuple): # RFC 2231 encoded, so decode it, and it better end up as ascii. pcharset = charset[0] or 'us-ascii' - charset = unicode(charset[2], pcharset).encode('us-ascii') + try: + # LookupError will be raised if the charset isn't known to + # Python. UnicodeError will be raised if the encoded text + # contains a character not in the charset. + charset = unicode(charset[2], pcharset).encode('us-ascii') + except (LookupError, UnicodeError): + charset = charset[2] + # charset character must be in us-ascii range + try: + charset = unicode(charset, 'us-ascii').encode('us-ascii') + except UnicodeError: + return failobj # RFC 2046, $4.1.2 says charsets are not case sensitive return charset.lower() Modified: python/branches/bcannon-sandboxing/Lib/email/test/test_email.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/email/test/test_email.py (original) +++ python/branches/bcannon-sandboxing/Lib/email/test/test_email.py Wed Aug 2 00:51:44 2006 @@ -3005,14 +3005,29 @@ ''' msg = email.message_from_string(m) - self.assertEqual(msg.get_param('NAME'), - (None, None, 'file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm')) + param = msg.get_param('NAME') + self.failIf(isinstance(param, tuple)) + self.assertEqual( + param, + 'file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm') def test_rfc2231_no_language_or_charset_in_filename(self): m = '''\ Content-Disposition: inline; -\tfilename*0="This%20is%20even%20more%20"; -\tfilename*1="%2A%2A%2Afun%2A%2A%2A%20"; +\tfilename*0*="''This%20is%20even%20more%20"; +\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; +\tfilename*2="is it not.pdf" + +''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_filename(), + 'This is even more ***fun*** is it not.pdf') + + def test_rfc2231_no_language_or_charset_in_filename_encoded(self): + m = '''\ +Content-Disposition: inline; +\tfilename*0*="''This%20is%20even%20more%20"; +\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; \tfilename*2="is it not.pdf" ''' @@ -3020,11 +3035,37 @@ self.assertEqual(msg.get_filename(), 'This is even more ***fun*** is it not.pdf') + def test_rfc2231_partly_encoded(self): + m = '''\ +Content-Disposition: inline; +\tfilename*0="''This%20is%20even%20more%20"; +\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; +\tfilename*2="is it not.pdf" + +''' + msg = email.message_from_string(m) + self.assertEqual( + msg.get_filename(), + 'This%20is%20even%20more%20***fun*** is it not.pdf') + + def test_rfc2231_partly_nonencoded(self): + m = '''\ +Content-Disposition: inline; +\tfilename*0="This%20is%20even%20more%20"; +\tfilename*1="%2A%2A%2Afun%2A%2A%2A%20"; +\tfilename*2="is it not.pdf" + +''' + msg = email.message_from_string(m) + self.assertEqual( + msg.get_filename(), + 'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20is it not.pdf') + def test_rfc2231_no_language_or_charset_in_boundary(self): m = '''\ Content-Type: multipart/alternative; -\tboundary*0="This%20is%20even%20more%20"; -\tboundary*1="%2A%2A%2Afun%2A%2A%2A%20"; +\tboundary*0*="''This%20is%20even%20more%20"; +\tboundary*1*="%2A%2A%2Afun%2A%2A%2A%20"; \tboundary*2="is it not.pdf" ''' @@ -3036,8 +3077,8 @@ # This is a nonsensical charset value, but tests the code anyway m = '''\ Content-Type: text/plain; -\tcharset*0="This%20is%20even%20more%20"; -\tcharset*1="%2A%2A%2Afun%2A%2A%2A%20"; +\tcharset*0*="This%20is%20even%20more%20"; +\tcharset*1*="%2A%2A%2Afun%2A%2A%2A%20"; \tcharset*2="is it not.pdf" ''' @@ -3045,15 +3086,145 @@ self.assertEqual(msg.get_content_charset(), 'this is even more ***fun*** is it not.pdf') + def test_rfc2231_bad_encoding_in_filename(self): + m = '''\ +Content-Disposition: inline; +\tfilename*0*="bogus'xx'This%20is%20even%20more%20"; +\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; +\tfilename*2="is it not.pdf" + +''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_filename(), + 'This is even more ***fun*** is it not.pdf') + + def test_rfc2231_bad_encoding_in_charset(self): + m = """\ +Content-Type: text/plain; charset*=bogus''utf-8%E2%80%9D + +""" + msg = email.message_from_string(m) + # This should return None because non-ascii characters in the charset + # are not allowed. + self.assertEqual(msg.get_content_charset(), None) + + def test_rfc2231_bad_character_in_charset(self): + m = """\ +Content-Type: text/plain; charset*=ascii''utf-8%E2%80%9D + +""" + msg = email.message_from_string(m) + # This should return None because non-ascii characters in the charset + # are not allowed. + self.assertEqual(msg.get_content_charset(), None) + + def test_rfc2231_bad_character_in_filename(self): + m = '''\ +Content-Disposition: inline; +\tfilename*0*="ascii'xx'This%20is%20even%20more%20"; +\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; +\tfilename*2*="is it not.pdf%E2" + +''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_filename(), + u'This is even more ***fun*** is it not.pdf\ufffd') + def test_rfc2231_unknown_encoding(self): m = """\ Content-Transfer-Encoding: 8bit -Content-Disposition: inline; filename*0=X-UNKNOWN''myfile.txt +Content-Disposition: inline; filename*=X-UNKNOWN''myfile.txt """ msg = email.message_from_string(m) self.assertEqual(msg.get_filename(), 'myfile.txt') + def test_rfc2231_single_tick_in_filename_extended(self): + eq = self.assertEqual + m = """\ +Content-Type: application/x-foo; +\tname*0*=\"Frank's\"; name*1*=\" Document\" + +""" + msg = email.message_from_string(m) + charset, language, s = msg.get_param('name') + eq(charset, None) + eq(language, None) + eq(s, "Frank's Document") + + def test_rfc2231_single_tick_in_filename(self): + m = """\ +Content-Type: application/x-foo; name*0=\"Frank's\"; name*1=\" Document\" + +""" + msg = email.message_from_string(m) + param = msg.get_param('name') + self.failIf(isinstance(param, tuple)) + self.assertEqual(param, "Frank's Document") + + def test_rfc2231_tick_attack_extended(self): + eq = self.assertEqual + m = """\ +Content-Type: application/x-foo; +\tname*0*=\"us-ascii'en-us'Frank's\"; name*1*=\" Document\" + +""" + msg = email.message_from_string(m) + charset, language, s = msg.get_param('name') + eq(charset, 'us-ascii') + eq(language, 'en-us') + eq(s, "Frank's Document") + + def test_rfc2231_tick_attack(self): + m = """\ +Content-Type: application/x-foo; +\tname*0=\"us-ascii'en-us'Frank's\"; name*1=\" Document\" + +""" + msg = email.message_from_string(m) + param = msg.get_param('name') + self.failIf(isinstance(param, tuple)) + self.assertEqual(param, "us-ascii'en-us'Frank's Document") + + def test_rfc2231_no_extended_values(self): + eq = self.assertEqual + m = """\ +Content-Type: application/x-foo; name=\"Frank's Document\" + +""" + msg = email.message_from_string(m) + eq(msg.get_param('name'), "Frank's Document") + + def test_rfc2231_encoded_then_unencoded_segments(self): + eq = self.assertEqual + m = """\ +Content-Type: application/x-foo; +\tname*0*=\"us-ascii'en-us'My\"; +\tname*1=\" Document\"; +\tname*2*=\" For You\" + +""" + msg = email.message_from_string(m) + charset, language, s = msg.get_param('name') + eq(charset, 'us-ascii') + eq(language, 'en-us') + eq(s, 'My Document For You') + + def test_rfc2231_unencoded_then_encoded_segments(self): + eq = self.assertEqual + m = """\ +Content-Type: application/x-foo; +\tname*0=\"us-ascii'en-us'My\"; +\tname*1*=\" Document\"; +\tname*2*=\" For You\" + +""" + msg = email.message_from_string(m) + charset, language, s = msg.get_param('name') + eq(charset, 'us-ascii') + eq(language, 'en-us') + eq(s, 'My Document For You') + def _testclasses(): Modified: python/branches/bcannon-sandboxing/Lib/email/test/test_email_renamed.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/email/test/test_email_renamed.py (original) +++ python/branches/bcannon-sandboxing/Lib/email/test/test_email_renamed.py Wed Aug 2 00:51:44 2006 @@ -3011,14 +3011,29 @@ ''' msg = email.message_from_string(m) - self.assertEqual(msg.get_param('NAME'), - (None, None, 'file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm')) + param = msg.get_param('NAME') + self.failIf(isinstance(param, tuple)) + self.assertEqual( + param, + 'file____C__DOCUMENTS_20AND_20SETTINGS_FABIEN_LOCAL_20SETTINGS_TEMP_nsmail.htm') def test_rfc2231_no_language_or_charset_in_filename(self): m = '''\ Content-Disposition: inline; -\tfilename*0="This%20is%20even%20more%20"; -\tfilename*1="%2A%2A%2Afun%2A%2A%2A%20"; +\tfilename*0*="''This%20is%20even%20more%20"; +\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; +\tfilename*2="is it not.pdf" + +''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_filename(), + 'This is even more ***fun*** is it not.pdf') + + def test_rfc2231_no_language_or_charset_in_filename_encoded(self): + m = '''\ +Content-Disposition: inline; +\tfilename*0*="''This%20is%20even%20more%20"; +\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; \tfilename*2="is it not.pdf" ''' @@ -3026,11 +3041,37 @@ self.assertEqual(msg.get_filename(), 'This is even more ***fun*** is it not.pdf') + def test_rfc2231_partly_encoded(self): + m = '''\ +Content-Disposition: inline; +\tfilename*0="''This%20is%20even%20more%20"; +\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; +\tfilename*2="is it not.pdf" + +''' + msg = email.message_from_string(m) + self.assertEqual( + msg.get_filename(), + 'This%20is%20even%20more%20***fun*** is it not.pdf') + + def test_rfc2231_partly_nonencoded(self): + m = '''\ +Content-Disposition: inline; +\tfilename*0="This%20is%20even%20more%20"; +\tfilename*1="%2A%2A%2Afun%2A%2A%2A%20"; +\tfilename*2="is it not.pdf" + +''' + msg = email.message_from_string(m) + self.assertEqual( + msg.get_filename(), + 'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20is it not.pdf') + def test_rfc2231_no_language_or_charset_in_boundary(self): m = '''\ Content-Type: multipart/alternative; -\tboundary*0="This%20is%20even%20more%20"; -\tboundary*1="%2A%2A%2Afun%2A%2A%2A%20"; +\tboundary*0*="''This%20is%20even%20more%20"; +\tboundary*1*="%2A%2A%2Afun%2A%2A%2A%20"; \tboundary*2="is it not.pdf" ''' @@ -3042,8 +3083,8 @@ # This is a nonsensical charset value, but tests the code anyway m = '''\ Content-Type: text/plain; -\tcharset*0="This%20is%20even%20more%20"; -\tcharset*1="%2A%2A%2Afun%2A%2A%2A%20"; +\tcharset*0*="This%20is%20even%20more%20"; +\tcharset*1*="%2A%2A%2Afun%2A%2A%2A%20"; \tcharset*2="is it not.pdf" ''' @@ -3051,15 +3092,145 @@ self.assertEqual(msg.get_content_charset(), 'this is even more ***fun*** is it not.pdf') + def test_rfc2231_bad_encoding_in_filename(self): + m = '''\ +Content-Disposition: inline; +\tfilename*0*="bogus'xx'This%20is%20even%20more%20"; +\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; +\tfilename*2="is it not.pdf" + +''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_filename(), + 'This is even more ***fun*** is it not.pdf') + + def test_rfc2231_bad_encoding_in_charset(self): + m = """\ +Content-Type: text/plain; charset*=bogus''utf-8%E2%80%9D + +""" + msg = email.message_from_string(m) + # This should return None because non-ascii characters in the charset + # are not allowed. + self.assertEqual(msg.get_content_charset(), None) + + def test_rfc2231_bad_character_in_charset(self): + m = """\ +Content-Type: text/plain; charset*=ascii''utf-8%E2%80%9D + +""" + msg = email.message_from_string(m) + # This should return None because non-ascii characters in the charset + # are not allowed. + self.assertEqual(msg.get_content_charset(), None) + + def test_rfc2231_bad_character_in_filename(self): + m = '''\ +Content-Disposition: inline; +\tfilename*0*="ascii'xx'This%20is%20even%20more%20"; +\tfilename*1*="%2A%2A%2Afun%2A%2A%2A%20"; +\tfilename*2*="is it not.pdf%E2" + +''' + msg = email.message_from_string(m) + self.assertEqual(msg.get_filename(), + u'This is even more ***fun*** is it not.pdf\ufffd') + def test_rfc2231_unknown_encoding(self): m = """\ Content-Transfer-Encoding: 8bit -Content-Disposition: inline; filename*0=X-UNKNOWN''myfile.txt +Content-Disposition: inline; filename*=X-UNKNOWN''myfile.txt """ msg = email.message_from_string(m) self.assertEqual(msg.get_filename(), 'myfile.txt') + def test_rfc2231_single_tick_in_filename_extended(self): + eq = self.assertEqual + m = """\ +Content-Type: application/x-foo; +\tname*0*=\"Frank's\"; name*1*=\" Document\" + +""" + msg = email.message_from_string(m) + charset, language, s = msg.get_param('name') + eq(charset, None) + eq(language, None) + eq(s, "Frank's Document") + + def test_rfc2231_single_tick_in_filename(self): + m = """\ +Content-Type: application/x-foo; name*0=\"Frank's\"; name*1=\" Document\" + +""" + msg = email.message_from_string(m) + param = msg.get_param('name') + self.failIf(isinstance(param, tuple)) + self.assertEqual(param, "Frank's Document") + + def test_rfc2231_tick_attack_extended(self): + eq = self.assertEqual + m = """\ +Content-Type: application/x-foo; +\tname*0*=\"us-ascii'en-us'Frank's\"; name*1*=\" Document\" + +""" + msg = email.message_from_string(m) + charset, language, s = msg.get_param('name') + eq(charset, 'us-ascii') + eq(language, 'en-us') + eq(s, "Frank's Document") + + def test_rfc2231_tick_attack(self): + m = """\ +Content-Type: application/x-foo; +\tname*0=\"us-ascii'en-us'Frank's\"; name*1=\" Document\" + +""" + msg = email.message_from_string(m) + param = msg.get_param('name') + self.failIf(isinstance(param, tuple)) + self.assertEqual(param, "us-ascii'en-us'Frank's Document") + + def test_rfc2231_no_extended_values(self): + eq = self.assertEqual + m = """\ +Content-Type: application/x-foo; name=\"Frank's Document\" + +""" + msg = email.message_from_string(m) + eq(msg.get_param('name'), "Frank's Document") + + def test_rfc2231_encoded_then_unencoded_segments(self): + eq = self.assertEqual + m = """\ +Content-Type: application/x-foo; +\tname*0*=\"us-ascii'en-us'My\"; +\tname*1=\" Document\"; +\tname*2*=\" For You\" + +""" + msg = email.message_from_string(m) + charset, language, s = msg.get_param('name') + eq(charset, 'us-ascii') + eq(language, 'en-us') + eq(s, 'My Document For You') + + def test_rfc2231_unencoded_then_encoded_segments(self): + eq = self.assertEqual + m = """\ +Content-Type: application/x-foo; +\tname*0=\"us-ascii'en-us'My\"; +\tname*1*=\" Document\"; +\tname*2*=\" For You\" + +""" + msg = email.message_from_string(m) + charset, language, s = msg.get_param('name') + eq(charset, 'us-ascii') + eq(language, 'en-us') + eq(s, 'My Document For You') + def _testclasses(): Modified: python/branches/bcannon-sandboxing/Lib/email/utils.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/email/utils.py (original) +++ python/branches/bcannon-sandboxing/Lib/email/utils.py Wed Aug 2 00:51:44 2006 @@ -25,6 +25,7 @@ import base64 import random import socket +import urllib import warnings from cStringIO import StringIO @@ -45,6 +46,7 @@ EMPTYSTRING = '' UEMPTYSTRING = u'' CRLF = '\r\n' +TICK = "'" specialsre = re.compile(r'[][\\()<>@,:;".]') escapesre = re.compile(r'[][\\()"]') @@ -230,12 +232,14 @@ # RFC2231-related functions - parameter encoding and decoding def decode_rfc2231(s): """Decode string according to RFC 2231""" - import urllib - parts = s.split("'", 2) - if len(parts) == 1: - return None, None, urllib.unquote(s) - charset, language, s = parts - return charset, language, urllib.unquote(s) + parts = s.split(TICK, 2) + if len(parts) <= 2: + return None, None, s + if len(parts) > 3: + charset, language = parts[:2] + s = TICK.join(parts[2:]) + return charset, language, s + return parts def encode_rfc2231(s, charset=None, language=None): @@ -259,37 +263,54 @@ def decode_params(params): """Decode parameters list according to RFC 2231. - params is a sequence of 2-tuples containing (content type, string value). + params is a sequence of 2-tuples containing (param name, string value). """ + # Copy params so we don't mess with the original + params = params[:] new_params = [] - # maps parameter's name to a list of continuations + # Map parameter's name to a list of continuations. The values are a + # 3-tuple of the continuation number, the string value, and a flag + # specifying whether a particular segment is %-encoded. rfc2231_params = {} - # params is a sequence of 2-tuples containing (content_type, string value) - name, value = params[0] + name, value = params.pop(0) new_params.append((name, value)) - # Cycle through each of the rest of the parameters. - for name, value in params[1:]: + while params: + name, value = params.pop(0) + if name.endswith('*'): + encoded = True + else: + encoded = False value = unquote(value) mo = rfc2231_continuation.match(name) if mo: name, num = mo.group('name', 'num') if num is not None: num = int(num) - rfc2231_param1 = rfc2231_params.setdefault(name, []) - rfc2231_param1.append((num, value)) + rfc2231_params.setdefault(name, []).append((num, value, encoded)) else: new_params.append((name, '"%s"' % quote(value))) if rfc2231_params: for name, continuations in rfc2231_params.items(): value = [] + extended = False # Sort by number continuations.sort() - # And now append all values in num order - for num, continuation in continuations: - value.append(continuation) - charset, language, value = decode_rfc2231(EMPTYSTRING.join(value)) - new_params.append( - (name, (charset, language, '"%s"' % quote(value)))) + # And now append all values in numerical order, converting + # %-encodings for the encoded segments. If any of the + # continuation names ends in a *, then the entire string, after + # decoding segments and concatenating, must have the charset and + # language specifiers at the beginning of the string. + for num, s, encoded in continuations: + if encoded: + s = urllib.unquote(s) + extended = True + value.append(s) + value = quote(EMPTYSTRING.join(value)) + if extended: + charset, language, value = decode_rfc2231(value) + new_params.append((name, (charset, language, '"%s"' % value))) + else: + new_params.append((name, '"%s"' % value)) return new_params def collapse_rfc2231_value(value, errors='replace', Modified: python/branches/bcannon-sandboxing/Lib/httplib.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/httplib.py (original) +++ python/branches/bcannon-sandboxing/Lib/httplib.py Wed Aug 2 00:51:44 2006 @@ -3,7 +3,7 @@ -HTTPConnection go through a number of "states", which defines when a client +HTTPConnection goes through a number of "states", which define when a client may legally make another request or fetch the response for a particular request. This diagram details these state transitions: @@ -926,15 +926,15 @@ self.__state = _CS_IDLE if response.will_close: - # this effectively passes the connection to the response - self.close() + # Pass the socket to the response + self.sock = None else: # remember this, so we can tell when it is complete self.__response = response return response -# The next several classes are used to define FakeSocket,a socket-like +# The next several classes are used to define FakeSocket, a socket-like # interface to an SSL connection. # The primary complexity comes from faking a makefile() method. The Modified: python/branches/bcannon-sandboxing/Lib/idlelib/CREDITS.txt ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/CREDITS.txt (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/CREDITS.txt Wed Aug 2 00:51:44 2006 @@ -19,17 +19,18 @@ subprocess, and made a number of usability enhancements. Other contributors include Raymond Hettinger, Tony Lownds (Mac integration), -Neal Norwitz (code check and clean-up), and Chui Tey (RPC integration, debugger -integration and persistent breakpoints). - -Scott David Daniels, Hernan Foffani, Christos Georgiou, Martin v. Löwis, -Jason Orendorff, Noam Raphael, Josh Robb, Nigel Rowe, Bruce Sherwood, and -Jeff Shute have submitted useful patches. Thanks, guys! +Neal Norwitz (code check and clean-up), Noam Raphael (Code Context, Call Tips, +many other patches), and Chui Tey (RPC integration, debugger integration and +persistent breakpoints). + +Scott David Daniels, Tal Einat, Hernan Foffani, Christos Georgiou, +Martin v. Löwis, Jason Orendorff, Josh Robb, Nigel Rowe, Bruce Sherwood, +and Jeff Shute have submitted useful patches. Thanks, guys! For additional details refer to NEWS.txt and Changelog. -Please contact the IDLE maintainer to have yourself included here if you -are one of those we missed! +Please contact the IDLE maintainer (kbk at shore.net) to have yourself included +here if you are one of those we missed! Modified: python/branches/bcannon-sandboxing/Lib/idlelib/CallTipWindow.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/CallTipWindow.py (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/CallTipWindow.py Wed Aug 2 00:51:44 2006 @@ -49,7 +49,11 @@ """ # truncate overly long calltip if len(text) >= 79: - text = text[:75] + ' ...' + textlines = text.splitlines() + for i, line in enumerate(textlines): + if len(line) > 79: + textlines[i] = line[:75] + ' ...' + text = '\n'.join(textlines) self.text = text if self.tipwindow or not self.text: return Modified: python/branches/bcannon-sandboxing/Lib/idlelib/CallTips.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/CallTips.py (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/CallTips.py Wed Aug 2 00:51:44 2006 @@ -127,7 +127,7 @@ argText = "" if ob is not None: argOffset = 0 - if type(ob)==types.ClassType: + if type(ob) in (types.ClassType, types.TypeType): # Look for the highest __init__ in the class chain. fob = _find_constructor(ob) if fob is None: Modified: python/branches/bcannon-sandboxing/Lib/idlelib/CodeContext.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/CodeContext.py (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/CodeContext.py Wed Aug 2 00:51:44 2006 @@ -11,11 +11,10 @@ """ import Tkinter from configHandler import idleConf -from sets import Set import re from sys import maxint as INFINITY -BLOCKOPENERS = Set(["class", "def", "elif", "else", "except", "finally", "for", +BLOCKOPENERS = set(["class", "def", "elif", "else", "except", "finally", "for", "if", "try", "while"]) UPDATEINTERVAL = 100 # millisec FONTUPDATEINTERVAL = 1000 # millisec Modified: python/branches/bcannon-sandboxing/Lib/idlelib/ColorDelegator.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/ColorDelegator.py (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/ColorDelegator.py Wed Aug 2 00:51:44 2006 @@ -8,28 +8,29 @@ DEBUG = False -def any(name, list): - return "(?P<%s>" % name + "|".join(list) + ")" +def any(name, alternates): + "Return a named group pattern matching list of alternates." + return "(?P<%s>" % name + "|".join(alternates) + ")" def make_pat(): kw = r"\b" + any("KEYWORD", keyword.kwlist) + r"\b" builtinlist = [str(name) for name in dir(__builtin__) if not name.startswith('_')] # self.file = file("file") : - # 1st 'file' colorized normal, 2nd as builtin, 3rd as comment - builtin = r"([^.'\"\\]\b|^)" + any("BUILTIN", builtinlist) + r"\b" + # 1st 'file' colorized normal, 2nd as builtin, 3rd as string + builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b" comment = any("COMMENT", [r"#[^\n]*"]) - sqstring = r"(\b[rR])?'[^'\\\n]*(\\.[^'\\\n]*)*'?" - dqstring = r'(\b[rR])?"[^"\\\n]*(\\.[^"\\\n]*)*"?' - sq3string = r"(\b[rR])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?" - dq3string = r'(\b[rR])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?' + sqstring = r"(\b[rRuU])?'[^'\\\n]*(\\.[^'\\\n]*)*'?" + dqstring = r'(\b[rRuU])?"[^"\\\n]*(\\.[^"\\\n]*)*"?' + sq3string = r"(\b[rRuU])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?" + dq3string = r'(\b[rRuU])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?' string = any("STRING", [sq3string, dq3string, sqstring, dqstring]) return kw + "|" + builtin + "|" + comment + "|" + string +\ "|" + any("SYNC", [r"\n"]) prog = re.compile(make_pat(), re.S) idprog = re.compile(r"\s+(\w+)", re.S) -asprog = re.compile(r".*?\b(as)\b", re.S) +asprog = re.compile(r".*?\b(as)\b") class ColorDelegator(Delegator): @@ -208,10 +209,15 @@ head + "+%dc" % a, head + "+%dc" % b) elif value == "import": - # color all the "as" words on same line; - # cheap approximation to the truth + # color all the "as" words on same line, except + # if in a comment; cheap approximation to the + # truth + if '#' in chars: + endpos = chars.index('#') + else: + endpos = len(chars) while True: - m1 = self.asprog.match(chars, b) + m1 = self.asprog.match(chars, b, endpos) if not m1: break a, b = m1.span(1) Modified: python/branches/bcannon-sandboxing/Lib/idlelib/EditorWindow.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/EditorWindow.py (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/EditorWindow.py Wed Aug 2 00:51:44 2006 @@ -85,17 +85,22 @@ self.flist = flist root = root or flist.root self.root = root + try: + sys.ps1 + except AttributeError: + sys.ps1 = '>>> ' self.menubar = Menu(root) self.top = top = WindowList.ListedToplevel(root, menu=self.menubar) if flist: self.tkinter_vars = flist.vars #self.top.instance_dict makes flist.inversedict avalable to #configDialog.py so it can access all EditorWindow instaces - self.top.instance_dict=flist.inversedict + self.top.instance_dict = flist.inversedict else: self.tkinter_vars = {} # keys: Tkinter event names # values: Tkinter variable instances - self.recent_files_path=os.path.join(idleConf.GetUserCfgDir(), + self.top.instance_dict = {} + self.recent_files_path = os.path.join(idleConf.GetUserCfgDir(), 'recent-files.lst') self.vbar = vbar = Scrollbar(top, name='vbar') self.text_frame = text_frame = Frame(top) @@ -121,6 +126,9 @@ self.top.protocol("WM_DELETE_WINDOW", self.close) self.top.bind("<>", self.close_event) + if macosxSupport.runningAsOSXApp(): + # Command-W on editorwindows doesn't work without this. + text.bind('<>', self.close_event) text.bind("<>", self.cut) text.bind("<>", self.copy) text.bind("<>", self.paste) Modified: python/branches/bcannon-sandboxing/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/NEWS.txt (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/NEWS.txt Wed Aug 2 00:51:44 2006 @@ -1,3 +1,29 @@ +What's New in IDLE 1.2c1? +========================= + +*Release date: XX-XXX-2006* + +- EditorWindow.test() was failing. Bug 1417598 + +- EditorWindow failed when used stand-alone if sys.ps1 not set. + Bug 1010370 Dave Florek + +- Tooltips failed on new-syle class __init__ args. Bug 1027566 Loren Guthrie + +- Avoid occasional failure to detect closing paren properly. + Patch 1407280 Tal Einat + +- Rebinding Tab key was inserting 'tab' instead of 'Tab'. Bug 1179168. + +- Colorizer now handles # correctly, also unicode strings and + 'as' keyword in comment directly following import command. Closes 1325071. + Patch 1479219 Tal Einat + +What's New in IDLE 1.2b2? +========================= + +*Release date: 11-JUL-2006* + What's New in IDLE 1.2b1? ========================= Modified: python/branches/bcannon-sandboxing/Lib/idlelib/ParenMatch.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/ParenMatch.py (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/ParenMatch.py Wed Aug 2 00:51:44 2006 @@ -8,7 +8,7 @@ from HyperParser import HyperParser from configHandler import idleConf -keysym_opener = {"parenright":'(', "bracketright":'[', "braceright":'{'} +_openers = {')':'(',']':'[','}':'{'} CHECK_DELAY = 100 # miliseconds class ParenMatch: @@ -100,12 +100,13 @@ def paren_closed_event(self, event): # If it was a shortcut and not really a closing paren, quit. - if self.text.get("insert-1c") not in (')',']','}'): + closer = self.text.get("insert-1c") + if closer not in _openers: return hp = HyperParser(self.editwin, "insert-1c") if not hp.is_in_code(): return - indices = hp.get_surrounding_brackets(keysym_opener[event.keysym], True) + indices = hp.get_surrounding_brackets(_openers[closer], True) if indices is None: self.warn_mismatched() return Modified: python/branches/bcannon-sandboxing/Lib/idlelib/PyShell.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/PyShell.py (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/PyShell.py Wed Aug 2 00:51:44 2006 @@ -1306,10 +1306,6 @@ script = None startup = False try: - sys.ps1 - except AttributeError: - sys.ps1 = '>>> ' - try: opts, args = getopt.getopt(sys.argv[1:], "c:deihnr:st:") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) Modified: python/branches/bcannon-sandboxing/Lib/idlelib/ScriptBinding.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/ScriptBinding.py (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/ScriptBinding.py Wed Aug 2 00:51:44 2006 @@ -51,7 +51,7 @@ # Provide instance variables referenced by Debugger # XXX This should be done differently self.flist = self.editwin.flist - self.root = self.flist.root + self.root = self.editwin.root def check_module_event(self, event): filename = self.getfilename() Modified: python/branches/bcannon-sandboxing/Lib/idlelib/config-keys.def ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/config-keys.def (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/config-keys.def Wed Aug 2 00:51:44 2006 @@ -159,3 +159,56 @@ change-indentwidth= del-word-left= del-word-right= + +[IDLE Classic OSX] +toggle-tabs = +interrupt-execution = +untabify-region = +remove-selection = +print-window = +replace = +goto-line = +plain-newline-and-indent = +history-previous = +beginning-of-line = +end-of-line = +comment-region = +redo = +close-window = +restart-shell = +save-window-as-file = +close-all-windows = +view-restart = +tabify-region = +find-again = +find = +toggle-auto-coloring = +select-all = +smart-backspace = +change-indentwidth = +do-nothing = +smart-indent = +center-insert = +history-next = +del-word-right = +undo = +save-window = +uncomment-region = +cut = +find-in-files = +dedent-region = +copy = +paste = +indent-region = +del-word-left = +newline-and-indent = +end-of-file = +open-class-browser = +open-new-window = +open-module = +find-selection = +python-context-help = +save-copy-of-window-as-file = +open-window-from-file = +python-docs = + Modified: python/branches/bcannon-sandboxing/Lib/idlelib/idlever.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/idlever.py (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/idlever.py Wed Aug 2 00:51:44 2006 @@ -1 +1 @@ -IDLE_VERSION = "1.2b1" +IDLE_VERSION = "1.2b2" Modified: python/branches/bcannon-sandboxing/Lib/idlelib/keybindingDialog.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/keybindingDialog.py (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/keybindingDialog.py Wed Aug 2 00:51:44 2006 @@ -202,7 +202,7 @@ ':':'colon',',':'comma','.':'period','<':'less','>':'greater', '/':'slash','?':'question','Page Up':'Prior','Page Down':'Next', 'Left Arrow':'Left','Right Arrow':'Right','Up Arrow':'Up', - 'Down Arrow': 'Down', 'Tab':'tab'} + 'Down Arrow': 'Down', 'Tab':'Tab'} if key in translateDict.keys(): key = translateDict[key] if 'Shift' in modifiers and key in string.ascii_lowercase: Modified: python/branches/bcannon-sandboxing/Lib/idlelib/macosxSupport.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/idlelib/macosxSupport.py (original) +++ python/branches/bcannon-sandboxing/Lib/idlelib/macosxSupport.py Wed Aug 2 00:51:44 2006 @@ -25,6 +25,81 @@ def hideTkConsole(root): root.tk.call('console', 'hide') +def overrideRootMenu(root, flist): + """ + Replace the Tk root menu by something that's more appropriate for + IDLE. + """ + # The menu that is attached to the Tk root (".") is also used by AquaTk for + # all windows that don't specify a menu of their own. The default menubar + # contains a number of menus, none of which are appropriate for IDLE. The + # Most annoying of those is an 'About Tck/Tk...' menu in the application + # menu. + # + # This function replaces the default menubar by a mostly empty one, it + # should only contain the correct application menu and the window menu. + # + # Due to a (mis-)feature of TkAqua the user will also see an empty Help + # menu. + from Tkinter import Menu, Text, Text + from EditorWindow import prepstr, get_accelerator + import Bindings + import WindowList + from MultiCall import MultiCallCreator + + menubar = Menu(root) + root.configure(menu=menubar) + menudict = {} + + menudict['windows'] = menu = Menu(menubar, name='windows') + menubar.add_cascade(label='Window', menu=menu, underline=0) + + def postwindowsmenu(menu=menu): + end = menu.index('end') + if end is None: + end = -1 + + if end > 0: + menu.delete(0, end) + WindowList.add_windows_to_menu(menu) + WindowList.register_callback(postwindowsmenu) + + menudict['application'] = menu = Menu(menubar, name='apple') + menubar.add_cascade(label='IDLE', menu=menu) + + def about_dialog(event=None): + import aboutDialog + aboutDialog.AboutDialog(root, 'About IDLE') + + def config_dialog(event=None): + import configDialog + configDialog.ConfigDialog(root, 'Settings') + + root.bind('<>', about_dialog) + root.bind('<>', config_dialog) + if flist: + root.bind('<>', flist.close_all_callback) + + for mname, entrylist in Bindings.menudefs: + menu = menudict.get(mname) + if not menu: + continue + for entry in entrylist: + if not entry: + menu.add_separator() + else: + label, eventname = entry + underline, label = prepstr(label) + accelerator = get_accelerator(Bindings.default_keydefs, + eventname) + def command(text=root, eventname=eventname): + text.event_generate(eventname) + menu.add_command(label=label, underline=underline, + command=command, accelerator=accelerator) + + + + def setupApp(root, flist): """ @@ -33,4 +108,5 @@ if not runningAsOSXApp(): return hideTkConsole(root) + overrideRootMenu(root, flist) addOpenEventSupport(root, flist) Modified: python/branches/bcannon-sandboxing/Lib/inspect.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/inspect.py (original) +++ python/branches/bcannon-sandboxing/Lib/inspect.py Wed Aug 2 00:51:44 2006 @@ -89,6 +89,40 @@ is not guaranteed.""" return (hasattr(object, "__set__") and hasattr(object, "__get__")) +if hasattr(types, 'MemberDescriptorType'): + # CPython and equivalent + def ismemberdescriptor(object): + """Return true if the object is a member descriptor. + + Member descriptors are specialized descriptors defined in extension + modules.""" + return isinstance(object, types.MemberDescriptorType) +else: + # Other implementations + def ismemberdescriptor(object): + """Return true if the object is a member descriptor. + + Member descriptors are specialized descriptors defined in extension + modules.""" + return False + +if hasattr(types, 'GetSetDescriptorType'): + # CPython and equivalent + def isgetsetdescriptor(object): + """Return true if the object is a getset descriptor. + + getset descriptors are specialized descriptors defined in extension + modules.""" + return isinstance(object, types.GetSetDescriptorType) +else: + # Other implementations + def isgetsetdescriptor(object): + """Return true if the object is a getset descriptor. + + getset descriptors are specialized descriptors defined in extension + modules.""" + return False + def isfunction(object): """Return true if the object is a user-defined function. @@ -355,40 +389,38 @@ return None if os.path.exists(filename): return filename - # Ugly but necessary - '' and '' mean that getmodule() - # would infinitely recurse, because they're not real files nor loadable - # Note that this means that writing a PEP 302 loader that uses '<' - # at the start of a filename is now not a good idea. :( - if filename[:1]!='<' and hasattr(getmodule(object), '__loader__'): + # only return a non-existent filename if the module has a PEP 302 loader + if hasattr(getmodule(object, filename), '__loader__'): return filename -def getabsfile(object): +def getabsfile(object, _filename=None): """Return an absolute path to the source or compiled file for an object. The idea is for each object to have a unique origin, so this routine normalizes the result as much as possible.""" - return os.path.normcase( - os.path.abspath(getsourcefile(object) or getfile(object))) + if _filename is None: + _filename = getsourcefile(object) or getfile(object) + return os.path.normcase(os.path.abspath(_filename)) modulesbyfile = {} -def getmodule(object): +def getmodule(object, _filename=None): """Return the module an object was defined in, or None if not found.""" if ismodule(object): return object if hasattr(object, '__module__'): return sys.modules.get(object.__module__) try: - file = getabsfile(object) + file = getabsfile(object, _filename) except TypeError: return None if file in modulesbyfile: return sys.modules.get(modulesbyfile[file]) for module in sys.modules.values(): if ismodule(module) and hasattr(module, '__file__'): - modulesbyfile[ - os.path.realpath( - getabsfile(module))] = module.__name__ + f = getabsfile(module) + modulesbyfile[f] = modulesbyfile[ + os.path.realpath(f)] = module.__name__ if file in modulesbyfile: return sys.modules.get(modulesbyfile[file]) main = sys.modules['__main__'] Modified: python/branches/bcannon-sandboxing/Lib/lib-tk/Tkinter.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/lib-tk/Tkinter.py (original) +++ python/branches/bcannon-sandboxing/Lib/lib-tk/Tkinter.py Wed Aug 2 00:51:44 2006 @@ -186,7 +186,7 @@ if name: self._name = name else: - self._name = 'PY_VAR' + `_varnum` + self._name = 'PY_VAR' + repr(_varnum) _varnum += 1 if value != None: self.set(value) Modified: python/branches/bcannon-sandboxing/Lib/lib-tk/turtle.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/lib-tk/turtle.py (original) +++ python/branches/bcannon-sandboxing/Lib/lib-tk/turtle.py Wed Aug 2 00:51:44 2006 @@ -86,7 +86,6 @@ self._color = "black" self._filling = 0 self._path = [] - self._tofill = [] self.clear() canvas._root().tkraise() @@ -306,19 +305,15 @@ {'fill': self._color, 'smooth': smooth}) self._items.append(item) - if self._tofill: - for item in self._tofill: - self._canvas.itemconfigure(item, fill=self._color) - self._items.append(item) self._path = [] - self._tofill = [] self._filling = flag if flag: self._path.append(self._position) - self.forward(0) def begin_fill(self): """ Called just before drawing a shape to be filled. + Must eventually be followed by a corresponding end_fill() call. + Otherwise it will be ignored. Example: >>> turtle.begin_fill() @@ -331,7 +326,8 @@ >>> turtle.forward(100) >>> turtle.end_fill() """ - self.fill(1) + self._path = [self._position] + self._filling = 1 def end_fill(self): """ Called after drawing a shape to be filled. @@ -365,8 +361,8 @@ >>> turtle.circle(120, 180) # half a circle """ if extent is None: - extent = self._fullcircle - frac = abs(extent)/self._fullcircle + extent = self._fullcircle + frac = abs(extent)/self._fullcircle steps = 1+int(min(11+abs(radius)/6.0, 59.0)*frac) w = 1.0 * extent / steps w2 = 0.5 * w @@ -717,7 +713,7 @@ def setup(**geometry): """ Sets the size and position of the main window. - Keywords are width, height, startx and starty + Keywords are width, height, startx and starty: width: either a size in pixels or a fraction of the screen. Default is 50% of screen. @@ -792,7 +788,7 @@ _root.geometry("%dx%d+%d+%d" % (_width, _height, _startx, _starty)) def title(title): - """ set the window title. + """Set the window title. By default this is set to 'Turtle Graphics' @@ -901,15 +897,30 @@ speed(speeds[sp]) color(0.25,0,0.75) fill(0) - color("green") - left(130) + # draw and fill a concave shape + left(120) up() - forward(90) + forward(70) + right(30) + down() color("red") - speed('fastest') + speed("fastest") + fill(1) + for i in range(4): + circle(50,90) + right(90) + forward(30) + right(90) + color("yellow") + fill(0) + left(90) + up() + forward(30) down(); + color("red") + # create a second turtle and make the original pursue and catch it turtle=Turtle() turtle.reset() Modified: python/branches/bcannon-sandboxing/Lib/logging/handlers.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/logging/handlers.py (original) +++ python/branches/bcannon-sandboxing/Lib/logging/handlers.py Wed Aug 2 00:51:44 2006 @@ -562,6 +562,18 @@ "local7": LOG_LOCAL7, } + #The map below appears to be trivially lowercasing the key. However, + #there's more to it than meets the eye - in some locales, lowercasing + #gives unexpected results. See SF #1524081: in the Turkish locale, + #"INFO".lower() != "info" + priority_map = { + "DEBUG" : "debug", + "INFO" : "info", + "WARNING" : "warning", + "ERROR" : "error", + "CRITICAL" : "critical" + } + def __init__(self, address=('localhost', SYSLOG_UDP_PORT), facility=LOG_USER): """ Initialize a handler. @@ -598,7 +610,7 @@ # necessary. log_format_string = '<%d>%s\000' - def encodePriority (self, facility, priority): + def encodePriority(self, facility, priority): """ Encode the facility and priority. You can pass in strings or integers - if strings are passed, the facility_names and @@ -619,6 +631,16 @@ self.socket.close() logging.Handler.close(self) + def mapPriority(self, levelName): + """ + Map a logging level name to a key in the priority_names map. + This is useful in two scenarios: when custom levels are being + used, and in the case where you can't do a straightforward + mapping by lowercasing the logging level name because of locale- + specific issues (see SF #1524081). + """ + return self.priority_map.get(levelName, "warning") + def emit(self, record): """ Emit a record. @@ -633,8 +655,8 @@ """ msg = self.log_format_string % ( self.encodePriority(self.facility, - string.lower(record.levelname)), - msg) + self.mapPriority(record.levelname)), + msg) try: if self.unixsocket: try: Modified: python/branches/bcannon-sandboxing/Lib/mailbox.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/mailbox.py (original) +++ python/branches/bcannon-sandboxing/Lib/mailbox.py Wed Aug 2 00:51:44 2006 @@ -15,6 +15,9 @@ import rfc822 import StringIO try: + if sys.platform == 'os2emx': + # OS/2 EMX fcntl() not adequate + raise ImportError import fcntl except ImportError: fcntl = None @@ -565,7 +568,8 @@ try: os.rename(new_file.name, self._path) except OSError, e: - if e.errno == errno.EEXIST: + if e.errno == errno.EEXIST or \ + (os.name == 'os2' and e.errno == errno.EACCES): os.remove(self._path) os.rename(new_file.name, self._path) else: @@ -1030,6 +1034,9 @@ if hasattr(os, 'link'): os.link(os.path.join(self._path, str(key)), os.path.join(self._path, str(prev + 1))) + if sys.platform == 'os2emx': + # cannot unlink an open file on OS/2 + f.close() os.unlink(os.path.join(self._path, str(key))) else: f.close() @@ -1828,7 +1835,8 @@ os.rename(pre_lock.name, f.name + '.lock') dotlock_done = True except OSError, e: - if e.errno == errno.EEXIST: + if e.errno == errno.EEXIST or \ + (os.name == 'os2' and e.errno == errno.EACCES): os.remove(pre_lock.name) raise ExternalClashError('dot lock unavailable: %s' % f.name) Modified: python/branches/bcannon-sandboxing/Lib/msilib/__init__.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/msilib/__init__.py (original) +++ python/branches/bcannon-sandboxing/Lib/msilib/__init__.py Wed Aug 2 00:51:44 2006 @@ -187,7 +187,7 @@ self.filenames = sets.Set() self.index = 0 - def gen_id(self, dir, file): + def gen_id(self, file): logical = _logical = make_id(file) pos = 1 while logical in self.filenames: @@ -196,9 +196,11 @@ self.filenames.add(logical) return logical - def append(self, full, logical): + def append(self, full, file, logical): if os.path.isdir(full): return + if not logical: + logical = self.gen_id(file) self.index += 1 self.files.append((full, logical)) return self.index, logical @@ -328,7 +330,7 @@ logical = self.keyfiles[file] else: logical = None - sequence, logical = self.cab.append(absolute, logical) + sequence, logical = self.cab.append(absolute, file, logical) assert logical not in self.ids self.ids.add(logical) short = self.make_short(file) @@ -403,7 +405,7 @@ [(self.dlg.name, self.name, event, argument, condition, ordering)]) - def mapping(self, mapping, attribute): + def mapping(self, event, attribute): add_data(self.dlg.db, "EventMapping", [(self.dlg.name, self.name, event, attribute)]) Modified: python/branches/bcannon-sandboxing/Lib/optparse.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/optparse.py (original) +++ python/branches/bcannon-sandboxing/Lib/optparse.py Wed Aug 2 00:51:44 2006 @@ -16,7 +16,7 @@ # Python developers: please do not make changes to this file, since # it is automatically generated from the Optik source code. -__version__ = "1.5.1+" +__version__ = "1.5.3" __all__ = ['Option', 'SUPPRESS_HELP', @@ -75,9 +75,9 @@ # This file was generated from: -# Id: option_parser.py 522 2006-06-11 16:22:03Z gward +# Id: option_parser.py 527 2006-07-23 15:21:30Z greg # Id: option.py 522 2006-06-11 16:22:03Z gward -# Id: help.py 509 2006-04-20 00:58:24Z gward +# Id: help.py 527 2006-07-23 15:21:30Z greg # Id: errors.py 509 2006-04-20 00:58:24Z gward try: @@ -1631,7 +1631,10 @@ # used by test suite def _get_encoding(self, file): - return getattr(file, "encoding", sys.getdefaultencoding()) + encoding = getattr(file, "encoding", None) + if not encoding: + encoding = sys.getdefaultencoding() + return encoding def print_help(self, file=None): """print_help(file : file = stdout) Modified: python/branches/bcannon-sandboxing/Lib/os.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/os.py (original) +++ python/branches/bcannon-sandboxing/Lib/os.py Wed Aug 2 00:51:44 2006 @@ -723,7 +723,7 @@ """ try: _urandomfd = open("/dev/urandom", O_RDONLY) - except: + except (OSError, IOError): raise NotImplementedError("/dev/urandom (or equivalent) not found") bytes = "" while len(bytes) < n: Modified: python/branches/bcannon-sandboxing/Lib/pdb.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/pdb.py (original) +++ python/branches/bcannon-sandboxing/Lib/pdb.py Wed Aug 2 00:51:44 2006 @@ -230,7 +230,8 @@ """Interpret the argument as though it had been typed in response to the prompt. - Checks wether this line is typed in the normal prompt or in a breakpoint command list definition + Checks whether this line is typed at the normal prompt or in + a breakpoint command list definition. """ if not self.commands_defining: return cmd.Cmd.onecmd(self, line) Modified: python/branches/bcannon-sandboxing/Lib/pkgutil.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/pkgutil.py (original) +++ python/branches/bcannon-sandboxing/Lib/pkgutil.py Wed Aug 2 00:51:44 2006 @@ -69,7 +69,33 @@ def walk_packages(path=None, prefix='', onerror=None): - """Yield submodule names+loaders recursively, for path or sys.path""" + """Yields (module_loader, name, ispkg) for all modules recursively + on path, or, if path is None, all accessible modules. + + 'path' should be either None or a list of paths to look for + modules in. + + 'prefix' is a string to output on the front of every module name + on output. + + Note that this function must import all *packages* (NOT all + modules!) on the given path, in order to access the __path__ + attribute to find submodules. + + 'onerror' is a function which gets called with one argument (the + name of the package which was being imported) if any exception + occurs while trying to import a package. If no onerror function is + supplied, ImportErrors are caught and ignored, while all other + exceptions are propagated, terminating the search. + + Examples: + + # list all modules python can access + walk_packages() + + # list all submodules of ctypes + walk_packages(ctypes.__path__, ctypes.__name__+'.') + """ def seen(p, m={}): if p in m: @@ -84,19 +110,33 @@ __import__(name) except ImportError: if onerror is not None: - onerror() + onerror(name) + except Exception: + if onerror is not None: + onerror(name) + else: + raise else: path = getattr(sys.modules[name], '__path__', None) or [] # don't traverse path items we've seen before path = [p for p in path if not seen(p)] - for item in walk_packages(path, name+'.'): + for item in walk_packages(path, name+'.', onerror): yield item def iter_modules(path=None, prefix=''): - """Yield submodule names+loaders for path or sys.path""" + """Yields (module_loader, name, ispkg) for all submodules on path, + or, if path is None, all top-level modules on sys.path. + + 'path' should be either None or a list of paths to look for + modules in. + + 'prefix' is a string to output on the front of every module name + on output. + """ + if path is None: importers = iter_importers() else: @@ -341,9 +381,7 @@ importer = None sys.path_importer_cache.setdefault(path_item, importer) - # The boolean values are used for caching valid and invalid - # file paths for the built-in import machinery - if importer in (None, True, False): + if importer is None: try: importer = ImpImporter(path_item) except ImportError: Modified: python/branches/bcannon-sandboxing/Lib/popen2.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/popen2.py (original) +++ python/branches/bcannon-sandboxing/Lib/popen2.py Wed Aug 2 00:51:44 2006 @@ -72,7 +72,7 @@ # In case the child hasn't been waited on, check if it's done. self.poll(_deadstate=sys.maxint) if self.sts < 0: - if _active: + if _active is not None: # Child is still running, keep us alive until we can wait on it. _active.append(self) Modified: python/branches/bcannon-sandboxing/Lib/pydoc.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/pydoc.py (original) +++ python/branches/bcannon-sandboxing/Lib/pydoc.py Wed Aug 2 00:51:44 2006 @@ -318,6 +318,8 @@ # identifies something in a way that pydoc itself has issues handling; # think 'super' and how it is a descriptor (which raises the exception # by lacking a __name__ attribute) and an instance. + if inspect.isgetsetdescriptor(object): return self.docdata(*args) + if inspect.ismemberdescriptor(object): return self.docdata(*args) try: if inspect.ismodule(object): return self.docmodule(*args) if inspect.isclass(object): return self.docclass(*args) @@ -333,7 +335,7 @@ name and ' ' + repr(name), type(object).__name__) raise TypeError, message - docmodule = docclass = docroutine = docother = fail + docmodule = docclass = docroutine = docother = docproperty = docdata = fail def getdocloc(self, object): """Return the location of module docs or None""" @@ -915,6 +917,10 @@ lhs = name and '%s = ' % name or '' return lhs + self.repr(object) + def docdata(self, object, name=None, mod=None, cl=None): + """Produce html documentation for a data descriptor.""" + return self._docdescriptor(name, object, mod) + def index(self, dir, shadowed=None): """Generate an HTML index for a directory of modules.""" modpkgs = [] @@ -1268,6 +1274,10 @@ """Produce text documentation for a property.""" return self._docdescriptor(name, object, mod) + def docdata(self, object, name=None, mod=None, cl=None): + """Produce text documentation for a data descriptor.""" + return self._docdescriptor(name, object, mod) + def docother(self, object, name=None, mod=None, parent=None, maxlen=None, doc=None): """Produce text documentation for a data object.""" repr = self.repr(object) @@ -1397,6 +1407,14 @@ return 'module ' + thing.__name__ if inspect.isbuiltin(thing): return 'built-in function ' + thing.__name__ + if inspect.isgetsetdescriptor(thing): + return 'getset descriptor %s.%s.%s' % ( + thing.__objclass__.__module__, thing.__objclass__.__name__, + thing.__name__) + if inspect.ismemberdescriptor(thing): + return 'member descriptor %s.%s.%s' % ( + thing.__objclass__.__module__, thing.__objclass__.__name__, + thing.__name__) if inspect.isclass(thing): return 'class ' + thing.__name__ if inspect.isfunction(thing): @@ -1453,6 +1471,8 @@ if not (inspect.ismodule(object) or inspect.isclass(object) or inspect.isroutine(object) or + inspect.isgetsetdescriptor(object) or + inspect.ismemberdescriptor(object) or isinstance(object, property)): # If the passed object is a piece of data or an instance, # document its available methods instead of its value. Modified: python/branches/bcannon-sandboxing/Lib/runpy.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/runpy.py (original) +++ python/branches/bcannon-sandboxing/Lib/runpy.py Wed Aug 2 00:51:44 2006 @@ -21,19 +21,18 @@ ] -def _run_code(code, run_globals, init_globals, run_name, +def _run_code(code, run_globals, init_globals, mod_name, mod_fname, mod_loader): """Helper for _run_module_code""" if init_globals is not None: run_globals.update(init_globals) - run_globals.update(__name__ = run_name, - __module_name__ = mod_name, + run_globals.update(__name__ = mod_name, __file__ = mod_fname, __loader__ = mod_loader) exec code in run_globals return run_globals -def _run_module_code(code, init_globals=None, run_name=None, +def _run_module_code(code, init_globals=None, mod_name=None, mod_fname=None, mod_loader=None, alter_sys=False): """Helper for run_module""" @@ -43,33 +42,26 @@ temp_module = imp.new_module(mod_name) mod_globals = temp_module.__dict__ saved_argv0 = sys.argv[0] - sentinel = object() - module_mod_name = sys.modules.get(mod_name, sentinel) - module_run_name = sys.modules.get(run_name, sentinel) + restore_module = mod_name in sys.modules + if restore_module: + saved_module = sys.modules[mod_name] sys.argv[0] = mod_fname sys.modules[mod_name] = temp_module - if run_name != mod_name: - sys.modules[run_name] = temp_module try: - _run_code(code, mod_globals, init_globals, run_name, + _run_code(code, mod_globals, init_globals, mod_name, mod_fname, mod_loader) finally: sys.argv[0] = saved_argv0 - if module_mod_name is not sentinel: - sys.modules[mod_name] = module_mod_name - else: - del sys.modules[mod_name] - if run_name != mod_name: - if module_run_name is not sentinel: - sys.modules[run_name] = module_run_name - else: - del sys.modules[run_name] + if restore_module: + sys.modules[mod_name] = saved_module + else: + del sys.modules[mod_name] # Copy the globals of the temporary module, as they # may be cleared when the temporary module goes away return mod_globals.copy() else: # Leave the sys module alone - return _run_code(code, {}, init_globals, run_name, + return _run_code(code, {}, init_globals, mod_name, mod_fname, mod_loader) @@ -100,7 +92,7 @@ if run_name is None: run_name = mod_name return _run_module_code(code, init_globals, run_name, - mod_name, filename, loader, alter_sys) + filename, loader, alter_sys) if __name__ == "__main__": Modified: python/branches/bcannon-sandboxing/Lib/shutil.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/shutil.py (original) +++ python/branches/bcannon-sandboxing/Lib/shutil.py Wed Aug 2 00:51:44 2006 @@ -127,7 +127,13 @@ # continue with other files except Error, err: errors.extend(err.args[0]) - copystat(src, dst) + try: + copystat(src, dst) + except WindowsError: + # can't copy file access times on Windows + pass + except OSError, why: + errors.extend((src, dst, str(why))) if errors: raise Error, errors Modified: python/branches/bcannon-sandboxing/Lib/socket.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/socket.py (original) +++ python/branches/bcannon-sandboxing/Lib/socket.py Wed Aug 2 00:51:44 2006 @@ -139,6 +139,8 @@ __slots__ = [] def _dummy(*args): raise error(EBADF, 'Bad file descriptor') + def close(self): + pass # All _delegate_methods must also be initialized here. send = recv = recv_into = sendto = recvfrom = recvfrom_into = _dummy __getattr__ = _dummy @@ -157,6 +159,7 @@ setattr(self, method, getattr(_sock, method)) def close(self): + self._sock.close() self._sock = _closedsocket() dummy = self._sock._dummy for method in _delegate_methods: Modified: python/branches/bcannon-sandboxing/Lib/struct.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/struct.py (original) +++ python/branches/bcannon-sandboxing/Lib/struct.py Wed Aug 2 00:51:44 2006 @@ -64,7 +64,7 @@ def pack_into(fmt, buf, offset, *args): """ - Pack the values v2, v2, ... according to fmt, write + Pack the values v1, v2, ... according to fmt, write the packed bytes into the writable buffer buf starting at offset. See struct.__doc__ for more on format strings. """ Modified: python/branches/bcannon-sandboxing/Lib/subprocess.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/subprocess.py (original) +++ python/branches/bcannon-sandboxing/Lib/subprocess.py Wed Aug 2 00:51:44 2006 @@ -121,7 +121,7 @@ Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the - return code in the errno attribute. + return code in the returncode attribute. The arguments are the same as for the Popen constructor. Example: @@ -141,8 +141,8 @@ A ValueError will be raised if Popen is called with invalid arguments. -check_call() will raise CalledProcessError, which is a subclass of -OSError, if the called process returns a non-zero return code. +check_call() will raise CalledProcessError, if the called process +returns a non-zero return code. Security @@ -234,7 +234,7 @@ sts = os.system("mycmd" + " myarg") ==> p = Popen("mycmd" + " myarg", shell=True) -sts = os.waitpid(p.pid, 0) +pid, sts = os.waitpid(p.pid, 0) Note: @@ -360,11 +360,16 @@ import traceback # Exception classes used by this module. -class CalledProcessError(OSError): +class CalledProcessError(Exception): """This exception is raised when a process run by check_call() returns a non-zero exit status. The exit status will be stored in the - errno attribute. This exception is a subclass of - OSError.""" + returncode attribute.""" + def __init__(self, returncode, cmd): + self.returncode = returncode + self.cmd = cmd + def __str__(self): + return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode) + if mswindows: import threading @@ -442,7 +447,7 @@ """Run command with arguments. Wait for command to complete. If the exit code was zero then return, otherwise raise CalledProcessError. The CalledProcessError object will have the - return code in the errno attribute. + return code in the returncode attribute. The arguments are the same as for the Popen constructor. Example: @@ -453,7 +458,7 @@ if cmd is None: cmd = popenargs[0] if retcode: - raise CalledProcessError(retcode, "Command %s returned non-zero exit status" % cmd) + raise CalledProcessError(retcode, cmd) return retcode @@ -613,7 +618,7 @@ return # In case the child hasn't been waited on, check if it's done. self.poll(_deadstate=sys.maxint) - if self.returncode is None: + if self.returncode is None and _active is not None: # Child is still running, keep us alive until we can wait on it. _active.append(self) Modified: python/branches/bcannon-sandboxing/Lib/tarfile.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/tarfile.py (original) +++ python/branches/bcannon-sandboxing/Lib/tarfile.py Wed Aug 2 00:51:44 2006 @@ -1750,13 +1750,6 @@ try: tarinfo = TarInfo.frombuf(buf) - # We shouldn't rely on this checksum, because some tar programs - # calculate it differently and it is merely validating the - # header block. We could just as well skip this part, which would - # have a slight effect on performance... - if tarinfo.chksum not in calc_chksums(buf): - self._dbg(1, "tarfile: Bad Checksum %r" % tarinfo.name) - # Set the TarInfo object's offset to the current position of the # TarFile and set self.offset to the position where the data blocks # should begin. Modified: python/branches/bcannon-sandboxing/Lib/test/crashers/bogus_code_obj.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/crashers/bogus_code_obj.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/crashers/bogus_code_obj.py Wed Aug 2 00:51:44 2006 @@ -1,5 +1,15 @@ """ Broken bytecode objects can easily crash the interpreter. + +This is not going to be fixed. It is generally agreed that there is no +point in writing a bytecode verifier and putting it in CPython just for +this. Moreover, a verifier is bound to accept only a subset of all safe +bytecodes, so it could lead to unnecessary breakage. + +For security purposes, "restricted" interpreters are not going to let +the user build or load random bytecodes anyway. Otherwise, this is a +"won't fix" case. + """ import types Modified: python/branches/bcannon-sandboxing/Lib/test/crashers/gc_inspection.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/crashers/gc_inspection.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/crashers/gc_inspection.py Wed Aug 2 00:51:44 2006 @@ -1,5 +1,20 @@ """ gc.get_referrers() can be used to see objects before they are fully built. + +Note that this is only an example. There are many ways to crash Python +by using gc.get_referrers(), as well as many extension modules (even +when they are using perfectly documented patterns to build objects). + +Identifying and removing all places that expose to the GC a +partially-built object is a long-term project. A patch was proposed on +SF specifically for this example but I consider fixing just this single +example a bit pointless (#1517042). + +A fix would include a whole-scale code review, possibly with an API +change to decouple object creation and GC registration, and according +fixes to the documentation for extension module writers. It's unlikely +to happen, though. So this is currently classified as +"gc.get_referrers() is dangerous, use only for debugging". """ import gc Modified: python/branches/bcannon-sandboxing/Lib/test/crashers/recursive_call.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/crashers/recursive_call.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/crashers/recursive_call.py Wed Aug 2 00:51:44 2006 @@ -1,6 +1,11 @@ #!/usr/bin/env python # No bug report AFAIK, mail on python-dev on 2006-01-10 + +# This is a "won't fix" case. It is known that setting a high enough +# recursion limit crashes by overflowing the stack. Unless this is +# redesigned somehow, it won't go away. + import sys sys.setrecursionlimit(1 << 30) Modified: python/branches/bcannon-sandboxing/Lib/test/fork_wait.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/fork_wait.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/fork_wait.py Wed Aug 2 00:51:44 2006 @@ -34,7 +34,14 @@ pass def wait_impl(self, cpid): - spid, status = os.waitpid(cpid, 0) + for i in range(10): + # waitpid() shouldn't hang, but some of the buildbots seem to hang + # in the forking tests. This is an attempt to fix the problem. + spid, status = os.waitpid(cpid, os.WNOHANG) + if spid == cpid: + break + time.sleep(2 * SHORTSLEEP) + self.assertEquals(spid, cpid) self.assertEquals(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8)) Modified: python/branches/bcannon-sandboxing/Lib/test/output/test_ossaudiodev ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/output/test_ossaudiodev (original) +++ python/branches/bcannon-sandboxing/Lib/test/output/test_ossaudiodev Wed Aug 2 00:51:44 2006 @@ -1,3 +1,2 @@ test_ossaudiodev -playing test sound file... -elapsed time: 3.1 sec +playing test sound file (expected running time: 2.93 sec) Modified: python/branches/bcannon-sandboxing/Lib/test/string_tests.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/string_tests.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/string_tests.py Wed Aug 2 00:51:44 2006 @@ -147,8 +147,8 @@ else: r2, rem = len(i)+1, 0 if rem or r1 != r2: - self.assertEqual(rem, 0) - self.assertEqual(r1, r2) + self.assertEqual(rem, 0, '%s != 0 for %s' % (rem, i)) + self.assertEqual(r1, r2, '%s != %s for %s' % (r1, r2, i)) def test_find(self): self.checkequal(0, 'abcdefghiabc', 'find', 'abc') @@ -636,6 +636,11 @@ EQ("bobobXbobob", "bobobobXbobobob", "replace", "bobob", "bob") EQ("BOBOBOB", "BOBOBOB", "replace", "bob", "bobby") + ba = buffer('a') + bb = buffer('b') + EQ("bbc", "abc", "replace", ba, bb) + EQ("aac", "abc", "replace", bb, ba) + # self.checkequal('one at two!three!', 'one!two!three!', 'replace', '!', '@', 1) self.checkequal('onetwothree', 'one!two!three!', 'replace', '!', '') Modified: python/branches/bcannon-sandboxing/Lib/test/test_ast.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_ast.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_ast.py Wed Aug 2 00:51:44 2006 @@ -160,7 +160,7 @@ ('Module', [('FunctionDef', (1, 0), 'f', ('arguments', [], None, None, []), [('Return', (1, 8), ('Num', (1, 15), 1))], [])]), ('Module', [('Delete', (1, 0), [('Name', (1, 4), 'v', ('Del',))])]), ('Module', [('Assign', (1, 0), [('Name', (1, 0), 'v', ('Store',))], ('Num', (1, 4), 1))]), -('Module', [('AugAssign', (1, 0), ('Name', (1, 0), 'v', ('Load',)), ('Add',), ('Num', (1, 5), 1))]), +('Module', [('AugAssign', (1, 0), ('Name', (1, 0), 'v', ('Store',)), ('Add',), ('Num', (1, 5), 1))]), ('Module', [('Print', (1, 0), ('Name', (1, 8), 'f', ('Load',)), [('Num', (1, 11), 1)], False)]), ('Module', [('For', (1, 0), ('Name', (1, 4), 'v', ('Store',)), ('Name', (1, 9), 'v', ('Load',)), [('Pass', (1, 11))], [])]), ('Module', [('While', (1, 0), ('Name', (1, 6), 'v', ('Load',)), [('Pass', (1, 8))], [])]), Modified: python/branches/bcannon-sandboxing/Lib/test/test_bsddb.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_bsddb.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_bsddb.py Wed Aug 2 00:51:44 2006 @@ -8,7 +8,6 @@ import dbhash # Just so we know it's imported import unittest from test import test_support -from sets import Set class TestBSDDB(unittest.TestCase): openflag = 'c' @@ -53,7 +52,7 @@ self.assertEqual(self.f[k], v) def assertSetEquals(self, seqn1, seqn2): - self.assertEqual(Set(seqn1), Set(seqn2)) + self.assertEqual(set(seqn1), set(seqn2)) def test_mapping_iteration_methods(self): f = self.f Modified: python/branches/bcannon-sandboxing/Lib/test/test_compile.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_compile.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_compile.py Wed Aug 2 00:51:44 2006 @@ -166,6 +166,16 @@ pass""" compile(s, "", "exec") + # This test is probably specific to CPython and may not generalize + # to other implementations. We are trying to ensure that when + # the first line of code starts after 256, correct line numbers + # in tracebacks are still produced. + def test_leading_newlines(self): + s256 = "".join(["\n"] * 256 + ["spam"]) + co = compile(s256, 'fn', 'exec') + self.assertEqual(co.co_firstlineno, 257) + self.assertEqual(co.co_lnotab, '') + def test_literals_with_leading_zeroes(self): for arg in ["077787", "0xj", "0x.", "0e", "090000000000000", "080000000000000", "000000000000009", "000000000000008"]: @@ -211,6 +221,25 @@ self.assertEqual(eval("-" + all_one_bits), -18446744073709551615L) else: self.fail("How many bits *does* this machine have???") + # Verify treatment of contant folding on -(sys.maxint+1) + # i.e. -2147483648 on 32 bit platforms. Should return int, not long. + self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 1)), int)) + self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 2)), long)) + + if sys.maxint == 9223372036854775807: + def test_32_63_bit_values(self): + a = +4294967296 # 1 << 32 + b = -4294967296 # 1 << 32 + c = +281474976710656 # 1 << 48 + d = -281474976710656 # 1 << 48 + e = +4611686018427387904 # 1 << 62 + f = -4611686018427387904 # 1 << 62 + g = +9223372036854775807 # 1 << 63 - 1 + h = -9223372036854775807 # 1 << 63 - 1 + + for variable in self.test_32_63_bit_values.func_code.co_consts: + if variable is not None: + self.assertTrue(isinstance(variable, int)) def test_sequence_unpacking_error(self): # Verify sequence packing/unpacking with "or". SF bug #757818 @@ -238,6 +267,8 @@ succeed = [ 'import sys', 'import os, sys', + 'import os as bar', + 'import os.path as bar', 'from __future__ import nested_scopes, generators', 'from __future__ import (nested_scopes,\ngenerators)', 'from __future__ import (nested_scopes,\ngenerators,)', @@ -257,6 +288,10 @@ 'import (sys', 'import sys)', 'import (os,)', + 'import os As bar', + 'import os.path a bar', + 'from sys import stdin As stdout', + 'from sys import stdin a stdout', 'from (sys) import stdin', 'from __future__ import (nested_scopes', 'from __future__ import nested_scopes)', Modified: python/branches/bcannon-sandboxing/Lib/test/test_compiler.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_compiler.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_compiler.py Wed Aug 2 00:51:44 2006 @@ -68,6 +68,14 @@ def testDefaultArgs(self): self.assertRaises(SyntaxError, compiler.parse, "def foo(a=1, b): pass") + def testDocstrings(self): + c = compiler.compile('"doc"', '', 'exec') + self.assert_('__doc__' in c.co_names) + c = compiler.compile('def f():\n "doc"', '', 'exec') + g = {} + exec c in g + self.assertEquals(g['f'].__doc__, "doc") + def testLineNo(self): # Test that all nodes except Module have a correct lineno attribute. filename = __file__ Modified: python/branches/bcannon-sandboxing/Lib/test/test_defaultdict.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_defaultdict.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_defaultdict.py Wed Aug 2 00:51:44 2006 @@ -4,6 +4,7 @@ import copy import tempfile import unittest +from test import test_support from collections import defaultdict @@ -131,5 +132,8 @@ self.assertEqual(d2, d1) +def test_main(): + test_support.run_unittest(TestDefaultDict) + if __name__ == "__main__": - unittest.main() + test_main() Modified: python/branches/bcannon-sandboxing/Lib/test/test_dis.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_dis.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_dis.py Wed Aug 2 00:51:44 2006 @@ -81,6 +81,13 @@ bug1333982.func_code.co_firstlineno + 2, bug1333982.func_code.co_firstlineno + 3) +_BIG_LINENO_FORMAT = """\ +%3d 0 LOAD_GLOBAL 0 (spam) + 3 POP_TOP + 4 LOAD_CONST 0 (None) + 7 RETURN_VALUE +""" + class DisTests(unittest.TestCase): def do_disassembly_test(self, func, expected): s = StringIO.StringIO() @@ -124,6 +131,23 @@ if __debug__: self.do_disassembly_test(bug1333982, dis_bug1333982) + def test_big_linenos(self): + def func(count): + namespace = {} + func = "def foo():\n " + "".join(["\n "] * count + ["spam\n"]) + exec func in namespace + return namespace['foo'] + + # Test all small ranges + for i in xrange(1, 300): + expected = _BIG_LINENO_FORMAT % (i + 2) + self.do_disassembly_test(func(i), expected) + + # Test some larger ranges too + for i in xrange(300, 5000, 10): + expected = _BIG_LINENO_FORMAT % (i + 2) + self.do_disassembly_test(func(i), expected) + def test_main(): run_unittest(DisTests) Modified: python/branches/bcannon-sandboxing/Lib/test/test_doctest.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_doctest.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_doctest.py Wed Aug 2 00:51:44 2006 @@ -419,7 +419,6 @@ >>> finder = doctest.DocTestFinder() >>> tests = finder.find(SampleClass) - >>> tests.sort() >>> for t in tests: ... print '%2s %s' % (len(t.examples), t.name) 3 SampleClass @@ -435,7 +434,6 @@ New-style classes are also supported: >>> tests = finder.find(SampleNewStyleClass) - >>> tests.sort() >>> for t in tests: ... print '%2s %s' % (len(t.examples), t.name) 1 SampleNewStyleClass @@ -475,7 +473,6 @@ >>> # ignoring the objects since they weren't defined in m. >>> import test.test_doctest >>> tests = finder.find(m, module=test.test_doctest) - >>> tests.sort() >>> for t in tests: ... print '%2s %s' % (len(t.examples), t.name) 1 some_module @@ -499,7 +496,6 @@ >>> from test import doctest_aliases >>> tests = excl_empty_finder.find(doctest_aliases) - >>> tests.sort() >>> print len(tests) 2 >>> print tests[0].name @@ -517,7 +513,6 @@ By default, an object with no doctests doesn't create any tests: >>> tests = doctest.DocTestFinder().find(SampleClass) - >>> tests.sort() >>> for t in tests: ... print '%2s %s' % (len(t.examples), t.name) 3 SampleClass @@ -536,7 +531,6 @@ displays. >>> tests = doctest.DocTestFinder(exclude_empty=False).find(SampleClass) - >>> tests.sort() >>> for t in tests: ... print '%2s %s' % (len(t.examples), t.name) 3 SampleClass @@ -557,7 +551,6 @@ using the `recurse` flag: >>> tests = doctest.DocTestFinder(recurse=False).find(SampleClass) - >>> tests.sort() >>> for t in tests: ... print '%2s %s' % (len(t.examples), t.name) 3 SampleClass Modified: python/branches/bcannon-sandboxing/Lib/test/test_email_codecs.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_email_codecs.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_email_codecs.py Wed Aug 2 00:51:44 2006 @@ -1,11 +1,15 @@ # Copyright (C) 2002 Python Software Foundation # email package unit tests for (optional) Asian codecs -import unittest # The specific tests now live in Lib/email/test -from email.test.test_email_codecs import suite +from email.test import test_email_codecs +from email.test import test_email_codecs_renamed +from test import test_support +def test_main(): + suite = test_email_codecs.suite() + suite.addTest(test_email_codecs_renamed.suite()) + test_support.run_suite(suite) - if __name__ == '__main__': - unittest.main(defaultTest='suite') + test_main() Modified: python/branches/bcannon-sandboxing/Lib/test/test_filecmp.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_filecmp.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_filecmp.py Wed Aug 2 00:51:44 2006 @@ -1,5 +1,5 @@ -import os, filecmp, shutil, tempfile +import os, filecmp, shutil, tempfile, shutil import unittest from test import test_support @@ -49,6 +49,7 @@ self.caseinsensitive = os.path.normcase('A') == os.path.normcase('a') data = 'Contents of file go here.\n' for dir in [self.dir, self.dir_same, self.dir_diff]: + shutil.rmtree(dir, True) os.mkdir(dir) if self.caseinsensitive and dir is self.dir_same: fn = 'FiLe' # Verify case-insensitive comparison Modified: python/branches/bcannon-sandboxing/Lib/test/test_fork1.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_fork1.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_fork1.py Wed Aug 2 00:51:44 2006 @@ -2,6 +2,7 @@ """ import os +import time from test.fork_wait import ForkWait from test.test_support import TestSkipped, run_unittest, reap_children @@ -12,7 +13,14 @@ class ForkTest(ForkWait): def wait_impl(self, cpid): - spid, status = os.waitpid(cpid, 0) + for i in range(10): + # waitpid() shouldn't hang, but some of the buildbots seem to hang + # in the forking tests. This is an attempt to fix the problem. + spid, status = os.waitpid(cpid, os.WNOHANG) + if spid == cpid: + break + time.sleep(1.0) + self.assertEqual(spid, cpid) self.assertEqual(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8)) Modified: python/branches/bcannon-sandboxing/Lib/test/test_generators.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_generators.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_generators.py Wed Aug 2 00:51:44 2006 @@ -1497,22 +1497,55 @@ +A yield expression with augmented assignment. + +>>> def coroutine(seq): +... count = 0 +... while count < 200: +... count += yield +... seq.append(count) +>>> seq = [] +>>> c = coroutine(seq) +>>> c.next() +>>> print seq +[] +>>> c.send(10) +>>> print seq +[10] +>>> c.send(10) +>>> print seq +[10, 20] +>>> c.send(10) +>>> print seq +[10, 20, 30] + + Check some syntax errors for yield expressions: >>> f=lambda: (yield 1),(yield 2) Traceback (most recent call last): ... -SyntaxError: 'yield' outside function (, line 1) +SyntaxError: 'yield' outside function (, line 1) >>> def f(): return lambda x=(yield): 1 Traceback (most recent call last): ... -SyntaxError: 'return' with argument inside generator (, line 1) +SyntaxError: 'return' with argument inside generator (, line 1) >>> def f(): x = yield = y Traceback (most recent call last): ... -SyntaxError: assignment to yield expression not possible (, line 1) +SyntaxError: assignment to yield expression not possible (, line 1) + +>>> def f(): (yield bar) = y +Traceback (most recent call last): + ... +SyntaxError: can't assign to yield expression (, line 1) + +>>> def f(): (yield bar) += y +Traceback (most recent call last): + ... +SyntaxError: augmented assignment to yield expression not possible (, line 1) Now check some throw() conditions: Modified: python/branches/bcannon-sandboxing/Lib/test/test_getargs2.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_getargs2.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_getargs2.py Wed Aug 2 00:51:44 2006 @@ -233,8 +233,25 @@ self.failUnlessEqual(VERY_LARGE & ULLONG_MAX, getargs_K(VERY_LARGE)) + +class Tuple_TestCase(unittest.TestCase): + def test_tuple(self): + from _testcapi import getargs_tuple + + ret = getargs_tuple(1, (2, 3)) + self.assertEquals(ret, (1,2,3)) + + # make sure invalid tuple arguments are handled correctly + class seq: + def __len__(self): + return 2 + def __getitem__(self, n): + raise ValueError + self.assertRaises(TypeError, getargs_tuple, 1, seq()) + + def test_main(): - tests = [Signed_TestCase, Unsigned_TestCase] + tests = [Signed_TestCase, Unsigned_TestCase, Tuple_TestCase] try: from _testcapi import getargs_L, getargs_K except ImportError: Modified: python/branches/bcannon-sandboxing/Lib/test/test_grammar.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_grammar.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_grammar.py Wed Aug 2 00:51:44 2006 @@ -531,6 +531,11 @@ for x in Squares(10): n = n+x if n != 285: raise TestFailed, 'for over growing sequence' +result = [] +for x, in [(1,), (2,), (3,)]: + result.append(x) +vereq(result, [1, 2, 3]) + print 'try_stmt' ### try_stmt: 'try' ':' suite (except_clause ':' suite)+ ['else' ':' suite] ### | 'try' ':' suite 'finally' ':' suite Modified: python/branches/bcannon-sandboxing/Lib/test/test_inspect.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_inspect.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_inspect.py Wed Aug 2 00:51:44 2006 @@ -1,6 +1,8 @@ import sys +import types import unittest import inspect +import datetime from test.test_support import TESTFN, run_unittest @@ -40,10 +42,12 @@ self.failIf(other(obj), 'not %s(%s)' % (other.__name__, exp)) class TestPredicates(IsTestBase): - def test_eleven(self): - # Doc/lib/libinspect.tex claims there are 11 such functions + def test_thirteen(self): count = len(filter(lambda x:x.startswith('is'), dir(inspect))) - self.assertEqual(count, 11, "There are %d (not 11) is* functions" % count) + # Doc/lib/libinspect.tex claims there are 13 such functions + expected = 13 + err_msg = "There are %d (not %d) is* functions" % (count, expected) + self.assertEqual(count, expected, err_msg) def test_excluding_predicates(self): self.istest(inspect.isbuiltin, 'sys.exit') @@ -58,6 +62,15 @@ self.istest(inspect.istraceback, 'tb') self.istest(inspect.isdatadescriptor, '__builtin__.file.closed') self.istest(inspect.isdatadescriptor, '__builtin__.file.softspace') + if hasattr(types, 'GetSetDescriptorType'): + self.istest(inspect.isgetsetdescriptor, + 'type(tb.tb_frame).f_locals') + else: + self.failIf(inspect.isgetsetdescriptor(type(tb.tb_frame).f_locals)) + if hasattr(types, 'MemberDescriptorType'): + self.istest(inspect.ismemberdescriptor, 'datetime.timedelta.days') + else: + self.failIf(inspect.ismemberdescriptor(datetime.timedelta.days)) def test_isroutine(self): self.assert_(inspect.isroutine(mod.spam)) @@ -178,6 +191,17 @@ def test_getfile(self): self.assertEqual(inspect.getfile(mod.StupidGit), mod.__file__) + def test_getmodule_recursion(self): + from new import module + name = '__inspect_dummy' + m = sys.modules[name] = module(name) + m.__file__ = "" # hopefully not a real filename... + m.__loader__ = "dummy" # pretend the filename is understood by a loader + exec "def x(): pass" in m.__dict__ + self.assertEqual(inspect.getsourcefile(m.x.func_code), '') + del sys.modules[name] + inspect.getmodule(compile('a=10','','single')) + class TestDecorators(GetSourceBase): fodderFile = mod2 Modified: python/branches/bcannon-sandboxing/Lib/test/test_iterlen.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_iterlen.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_iterlen.py Wed Aug 2 00:51:44 2006 @@ -235,9 +235,7 @@ self.assertEqual(len(it), 0) - -if __name__ == "__main__": - +def test_main(): unittests = [ TestRepeat, TestXrange, @@ -255,3 +253,6 @@ TestSeqIterReversed, ] test_support.run_unittest(*unittests) + +if __name__ == "__main__": + test_main() Modified: python/branches/bcannon-sandboxing/Lib/test/test_mailbox.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_mailbox.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_mailbox.py Wed Aug 2 00:51:44 2006 @@ -461,7 +461,7 @@ def setUp(self): TestMailbox.setUp(self) - if os.name == 'nt': + if os.name in ('nt', 'os2'): self._box.colon = '!' def test_add_MM(self): @@ -520,7 +520,7 @@ # Initialize an existing mailbox self.tearDown() for subdir in '', 'tmp', 'new', 'cur': - os.mkdir(os.path.join(self._path, subdir)) + os.mkdir(os.path.normpath(os.path.join(self._path, subdir))) self._box = mailbox.Maildir(self._path) self._check_basics(factory=rfc822.Message) self._box = mailbox.Maildir(self._path, factory=None) Modified: python/branches/bcannon-sandboxing/Lib/test/test_mimetools.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_mimetools.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_mimetools.py Wed Aug 2 00:51:44 2006 @@ -1,7 +1,7 @@ import unittest from test import test_support -import string, StringIO, mimetools, sets +import string, StringIO, mimetools msgtext1 = mimetools.Message(StringIO.StringIO( """Content-Type: text/plain; charset=iso-8859-1; format=flowed @@ -25,7 +25,7 @@ self.assertEqual(o.getvalue(), start) def test_boundary(self): - s = sets.Set([""]) + s = set([""]) for i in xrange(100): nb = mimetools.choose_boundary() self.assert_(nb not in s) Modified: python/branches/bcannon-sandboxing/Lib/test/test_mimetypes.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_mimetypes.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_mimetypes.py Wed Aug 2 00:51:44 2006 @@ -1,7 +1,6 @@ import mimetypes import StringIO import unittest -from sets import Set from test import test_support @@ -52,8 +51,8 @@ # First try strict. Use a set here for testing the results because if # test_urllib2 is run before test_mimetypes, global state is modified # such that the 'all' set will have more items in it. - all = Set(self.db.guess_all_extensions('text/plain', strict=True)) - unless(all >= Set(['.bat', '.c', '.h', '.ksh', '.pl', '.txt'])) + all = set(self.db.guess_all_extensions('text/plain', strict=True)) + unless(all >= set(['.bat', '.c', '.h', '.ksh', '.pl', '.txt'])) # And now non-strict all = self.db.guess_all_extensions('image/jpg', strict=False) all.sort() Modified: python/branches/bcannon-sandboxing/Lib/test/test_minidom.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_minidom.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_minidom.py Wed Aug 2 00:51:44 2006 @@ -1,4 +1,4 @@ -# test for xmlcore.dom.minidom +# test for xml.dom.minidom import os import sys @@ -7,12 +7,12 @@ from StringIO import StringIO from test.test_support import verbose -import xmlcore.dom -import xmlcore.dom.minidom -import xmlcore.parsers.expat +import xml.dom +import xml.dom.minidom +import xml.parsers.expat -from xmlcore.dom.minidom import parse, Node, Document, parseString -from xmlcore.dom.minidom import getDOMImplementation +from xml.dom.minidom import parse, Node, Document, parseString +from xml.dom.minidom import getDOMImplementation if __name__ == "__main__": @@ -138,29 +138,29 @@ text = dom.createTextNode('text') try: dom.appendChild(text) - except xmlcore.dom.HierarchyRequestErr: pass + except xml.dom.HierarchyRequestErr: pass else: print "dom.appendChild didn't raise HierarchyRequestErr" dom.appendChild(elem) try: dom.insertBefore(text, elem) - except xmlcore.dom.HierarchyRequestErr: pass + except xml.dom.HierarchyRequestErr: pass else: print "dom.appendChild didn't raise HierarchyRequestErr" try: dom.replaceChild(text, elem) - except xmlcore.dom.HierarchyRequestErr: pass + except xml.dom.HierarchyRequestErr: pass else: print "dom.appendChild didn't raise HierarchyRequestErr" nodemap = elem.attributes try: nodemap.setNamedItem(text) - except xmlcore.dom.HierarchyRequestErr: pass + except xml.dom.HierarchyRequestErr: pass else: print "NamedNodeMap.setNamedItem didn't raise HierarchyRequestErr" try: nodemap.setNamedItemNS(text) - except xmlcore.dom.HierarchyRequestErr: pass + except xml.dom.HierarchyRequestErr: pass else: print "NamedNodeMap.setNamedItemNS didn't raise HierarchyRequestErr" @@ -439,7 +439,7 @@ and pi.firstChild is None and pi.lastChild is None and pi.localName is None - and pi.namespaceURI == xmlcore.dom.EMPTY_NAMESPACE) + and pi.namespaceURI == xml.dom.EMPTY_NAMESPACE) def testProcessingInstructionRepr(): pass @@ -454,7 +454,7 @@ elem = doc.createElement("extra") try: doc.appendChild(elem) - except xmlcore.dom.HierarchyRequestErr: + except xml.dom.HierarchyRequestErr: pass else: print "Failed to catch expected exception when" \ @@ -491,7 +491,7 @@ confirm(a1.isSameNode(a2)) try: attrs.removeNamedItem("a") - except xmlcore.dom.NotFoundErr: + except xml.dom.NotFoundErr: pass def testRemoveNamedItemNS(): @@ -503,7 +503,7 @@ confirm(a1.isSameNode(a2)) try: attrs.removeNamedItemNS("http://xml.python.org/", "b") - except xmlcore.dom.NotFoundErr: + except xml.dom.NotFoundErr: pass def testAttrListValues(): pass @@ -682,7 +682,7 @@ doc2 = parseString("") try: doc1.importNode(doc2, deep) - except xmlcore.dom.NotSupportedErr: + except xml.dom.NotSupportedErr: pass else: raise Exception(testName + @@ -705,14 +705,12 @@ doctype = getDOMImplementation().createDocumentType("doc", None, None) doctype.entities._seq = [] doctype.notations._seq = [] - notation = xmlcore.dom.minidom.Notation( - "my-notation", None, - "http://xml.python.org/notations/my") + notation = xml.dom.minidom.Notation("my-notation", None, + "http://xml.python.org/notations/my") doctype.notations._seq.append(notation) - entity = xmlcore.dom.minidom.Entity( - "my-entity", None, - "http://xml.python.org/entities/my", - "my-notation") + entity = xml.dom.minidom.Entity("my-entity", None, + "http://xml.python.org/entities/my", + "my-notation") entity.version = "1.0" entity.encoding = "utf-8" entity.actualEncoding = "us-ascii" @@ -731,7 +729,7 @@ target = create_doc_without_doctype() try: imported = target.importNode(src.doctype, 0) - except xmlcore.dom.NotSupportedErr: + except xml.dom.NotSupportedErr: pass else: raise Exception( @@ -742,7 +740,7 @@ target = create_doc_without_doctype() try: imported = target.importNode(src.doctype, 1) - except xmlcore.dom.NotSupportedErr: + except xml.dom.NotSupportedErr: pass else: raise Exception( @@ -850,7 +848,7 @@ doc.unlink() def testSAX2DOM(): - from xmlcore.dom import pulldom + from xml.dom import pulldom sax2dom = pulldom.SAX2DOM() sax2dom.startDocument() @@ -940,11 +938,11 @@ attr = elem.attributes['a'] # Simple renaming - attr = doc.renameNode(attr, xmlcore.dom.EMPTY_NAMESPACE, "b") + attr = doc.renameNode(attr, xml.dom.EMPTY_NAMESPACE, "b") confirm(attr.name == "b" and attr.nodeName == "b" and attr.localName is None - and attr.namespaceURI == xmlcore.dom.EMPTY_NAMESPACE + and attr.namespaceURI == xml.dom.EMPTY_NAMESPACE and attr.prefix is None and attr.value == "v" and elem.getAttributeNode("a") is None @@ -989,11 +987,11 @@ and attrmap[("http://xml.python.org/ns2", "d")].isSameNode(attr)) # Rename back to a simple non-NS node - attr = doc.renameNode(attr, xmlcore.dom.EMPTY_NAMESPACE, "e") + attr = doc.renameNode(attr, xml.dom.EMPTY_NAMESPACE, "e") confirm(attr.name == "e" and attr.nodeName == "e" and attr.localName is None - and attr.namespaceURI == xmlcore.dom.EMPTY_NAMESPACE + and attr.namespaceURI == xml.dom.EMPTY_NAMESPACE and attr.prefix is None and attr.value == "v" and elem.getAttributeNode("a") is None @@ -1007,7 +1005,7 @@ try: doc.renameNode(attr, "http://xml.python.org/ns", "xmlns") - except xmlcore.dom.NamespaceErr: + except xml.dom.NamespaceErr: pass else: print "expected NamespaceErr" @@ -1020,11 +1018,11 @@ elem = doc.documentElement # Simple renaming - elem = doc.renameNode(elem, xmlcore.dom.EMPTY_NAMESPACE, "a") + elem = doc.renameNode(elem, xml.dom.EMPTY_NAMESPACE, "a") confirm(elem.tagName == "a" and elem.nodeName == "a" and elem.localName is None - and elem.namespaceURI == xmlcore.dom.EMPTY_NAMESPACE + and elem.namespaceURI == xml.dom.EMPTY_NAMESPACE and elem.prefix is None and elem.ownerDocument.isSameNode(doc)) @@ -1047,11 +1045,11 @@ and elem.ownerDocument.isSameNode(doc)) # Rename back to a simple non-NS node - elem = doc.renameNode(elem, xmlcore.dom.EMPTY_NAMESPACE, "d") + elem = doc.renameNode(elem, xml.dom.EMPTY_NAMESPACE, "d") confirm(elem.tagName == "d" and elem.nodeName == "d" and elem.localName is None - and elem.namespaceURI == xmlcore.dom.EMPTY_NAMESPACE + and elem.namespaceURI == xml.dom.EMPTY_NAMESPACE and elem.prefix is None and elem.ownerDocument.isSameNode(doc)) @@ -1062,15 +1060,15 @@ # Make sure illegal NS usage is detected: try: doc.renameNode(node, "http://xml.python.org/ns", "xmlns:foo") - except xmlcore.dom.NamespaceErr: + except xml.dom.NamespaceErr: pass else: print "expected NamespaceErr" doc2 = parseString("") try: - doc2.renameNode(node, xmlcore.dom.EMPTY_NAMESPACE, "foo") - except xmlcore.dom.WrongDocumentErr: + doc2.renameNode(node, xml.dom.EMPTY_NAMESPACE, "foo") + except xml.dom.WrongDocumentErr: pass else: print "expected WrongDocumentErr" @@ -1078,12 +1076,12 @@ def testRenameOther(): # We have to create a comment node explicitly since not all DOM # builders used with minidom add comments to the DOM. - doc = xmlcore.dom.minidom.getDOMImplementation().createDocument( - xmlcore.dom.EMPTY_NAMESPACE, "e", None) + doc = xml.dom.minidom.getDOMImplementation().createDocument( + xml.dom.EMPTY_NAMESPACE, "e", None) node = doc.createComment("comment") try: - doc.renameNode(node, xmlcore.dom.EMPTY_NAMESPACE, "foo") - except xmlcore.dom.NotSupportedErr: + doc.renameNode(node, xml.dom.EMPTY_NAMESPACE, "foo") + except xml.dom.NotSupportedErr: pass else: print "expected NotSupportedErr when renaming comment node" @@ -1194,13 +1192,13 @@ # since each supports a different level of DTD information. t = elem.schemaType confirm(t.name is None - and t.namespace == xmlcore.dom.EMPTY_NAMESPACE) + and t.namespace == xml.dom.EMPTY_NAMESPACE) names = "id notid text enum ref refs ent ents nm nms".split() for name in names: a = elem.getAttributeNode(name) t = a.schemaType confirm(hasattr(t, "name") - and t.namespace == xmlcore.dom.EMPTY_NAMESPACE) + and t.namespace == xml.dom.EMPTY_NAMESPACE) def testSetIdAttribute(): doc = parseString("") @@ -1229,7 +1227,7 @@ and a2.isId and not a3.isId) # renaming an attribute should not affect its ID-ness: - doc.renameNode(a2, xmlcore.dom.EMPTY_NAMESPACE, "an") + doc.renameNode(a2, xml.dom.EMPTY_NAMESPACE, "an") confirm(e.isSameNode(doc.getElementById("w")) and a2.isId) @@ -1265,7 +1263,7 @@ confirm(not a3.isId) confirm(doc.getElementById("v") is None) # renaming an attribute should not affect its ID-ness: - doc.renameNode(a2, xmlcore.dom.EMPTY_NAMESPACE, "an") + doc.renameNode(a2, xml.dom.EMPTY_NAMESPACE, "an") confirm(e.isSameNode(doc.getElementById("w")) and a2.isId) @@ -1301,7 +1299,7 @@ confirm(not a3.isId) confirm(doc.getElementById("v") is None) # renaming an attribute should not affect its ID-ness: - doc.renameNode(a2, xmlcore.dom.EMPTY_NAMESPACE, "an") + doc.renameNode(a2, xml.dom.EMPTY_NAMESPACE, "an") confirm(e.isSameNode(doc.getElementById("w")) and a2.isId) Modified: python/branches/bcannon-sandboxing/Lib/test/test_multibytecodec.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_multibytecodec.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_multibytecodec.py Wed Aug 2 00:51:44 2006 @@ -6,17 +6,37 @@ from test import test_support from test import test_multibytecodec_support -import unittest, StringIO, codecs, sys +from test.test_support import TESTFN +import unittest, StringIO, codecs, sys, os + +ALL_CJKENCODINGS = [ +# _codecs_cn + 'gb2312', 'gbk', 'gb18030', 'hz', +# _codecs_hk + 'big5hkscs', +# _codecs_jp + 'cp932', 'shift_jis', 'euc_jp', 'euc_jisx0213', 'shift_jisx0213', + 'euc_jis_2004', 'shift_jis_2004', +# _codecs_kr + 'cp949', 'euc_kr', 'johab', +# _codecs_tw + 'big5', 'cp950', +# _codecs_iso2022 + 'iso2022_jp', 'iso2022_jp_1', 'iso2022_jp_2', 'iso2022_jp_2004', + 'iso2022_jp_3', 'iso2022_jp_ext', 'iso2022_kr', +] class Test_MultibyteCodec(unittest.TestCase): def test_nullcoding(self): - self.assertEqual(''.decode('gb18030'), u'') - self.assertEqual(unicode('', 'gb18030'), u'') - self.assertEqual(u''.encode('gb18030'), '') + for enc in ALL_CJKENCODINGS: + self.assertEqual(''.decode(enc), u'') + self.assertEqual(unicode('', enc), u'') + self.assertEqual(u''.encode(enc), '') def test_str_decode(self): - self.assertEqual('abcd'.encode('gb18030'), 'abcd') + for enc in ALL_CJKENCODINGS: + self.assertEqual('abcd'.encode(enc), 'abcd') def test_errorcallback_longindex(self): dec = codecs.getdecoder('euc-kr') @@ -25,6 +45,14 @@ self.assertRaises(IndexError, dec, 'apple\x92ham\x93spam', 'test.cjktest') + def test_codingspec(self): + try: + for enc in ALL_CJKENCODINGS: + print >> open(TESTFN, 'w'), '# coding:', enc + exec open(TESTFN) + finally: + os.unlink(TESTFN) + class Test_IncrementalEncoder(unittest.TestCase): def test_stateless(self): Modified: python/branches/bcannon-sandboxing/Lib/test/test_optparse.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_optparse.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_optparse.py Wed Aug 2 00:51:44 2006 @@ -1460,10 +1460,11 @@ make_option("--foo", action="append", type="string", dest='foo', help="store FOO in the foo list for later fooing"), ] - # The parser constructor looks at the COLUMNS envar. We need to - # restore the original value after the parser is constructed, else - # that's a permanent change possibly affecting other tests, and - # definitely affecting these tests when they're run multiple times. + + # We need to set COLUMNS for the OptionParser constructor, but + # we must restore its original value -- otherwise, this test + # screws things up for other tests when it's part of the Python + # test suite. orig_columns = os.environ.get('COLUMNS') os.environ['COLUMNS'] = str(columns) try: Modified: python/branches/bcannon-sandboxing/Lib/test/test_ossaudiodev.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_ossaudiodev.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_ossaudiodev.py Wed Aug 2 00:51:44 2006 @@ -40,6 +40,10 @@ data = audioop.ulaw2lin(data, 2) return (data, rate, 16, nchannels) +# version of assert that still works with -O +def _assert(expr, message=None): + if not expr: + raise AssertionError(message or "assertion failed") def play_sound_file(data, rate, ssize, nchannels): try: @@ -57,9 +61,9 @@ dsp.fileno() # Make sure the read-only attributes work. - assert dsp.closed is False, "dsp.closed is not False" - assert dsp.name == "/dev/dsp" - assert dsp.mode == 'w', "bad dsp.mode: %r" % dsp.mode + _assert(dsp.closed is False, "dsp.closed is not False") + _assert(dsp.name == "/dev/dsp") + _assert(dsp.mode == 'w', "bad dsp.mode: %r" % dsp.mode) # And make sure they're really read-only. for attr in ('closed', 'name', 'mode'): @@ -69,14 +73,23 @@ except TypeError: pass + # Compute expected running time of sound sample (in seconds). + expected_time = float(len(data)) / (ssize/8) / nchannels / rate + # set parameters based on .au file headers dsp.setparameters(AFMT_S16_NE, nchannels, rate) + print ("playing test sound file (expected running time: %.2f sec)" + % expected_time) t1 = time.time() - print "playing test sound file..." dsp.write(data) dsp.close() t2 = time.time() - print "elapsed time: %.1f sec" % (t2-t1) + elapsed_time = t2 - t1 + + percent_diff = (abs(elapsed_time - expected_time) / expected_time) * 100 + _assert(percent_diff <= 10.0, \ + ("elapsed time (%.2f sec) > 10%% off of expected time (%.2f sec)" + % (elapsed_time, expected_time))) def test_setparameters(dsp): # Two configurations for testing: @@ -101,11 +114,11 @@ # setparameters() should be able to set this configuration in # either strict or non-strict mode. result = dsp.setparameters(fmt, channels, rate, False) - assert result == (fmt, channels, rate), \ - "setparameters%r: returned %r" % (config + result) + _assert(result == (fmt, channels, rate), + "setparameters%r: returned %r" % (config, result)) result = dsp.setparameters(fmt, channels, rate, True) - assert result == (fmt, channels, rate), \ - "setparameters%r: returned %r" % (config + result) + _assert(result == (fmt, channels, rate), + "setparameters%r: returned %r" % (config, result)) def test_bad_setparameters(dsp): @@ -123,8 +136,8 @@ ]: (fmt, channels, rate) = config result = dsp.setparameters(fmt, channels, rate, False) - assert result != config, \ - "setparameters: unexpectedly got requested configuration" + _assert(result != config, + "setparameters: unexpectedly got requested configuration") try: result = dsp.setparameters(fmt, channels, rate, True) @@ -145,6 +158,6 @@ #test_bad_setparameters(dsp) finally: dsp.close() - assert dsp.closed is True, "dsp.closed is not True" + _assert(dsp.closed is True, "dsp.closed is not True") test() Modified: python/branches/bcannon-sandboxing/Lib/test/test_runpy.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_runpy.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_runpy.py Wed Aug 2 00:51:44 2006 @@ -23,8 +23,6 @@ "run_argv0 = sys.argv[0]\n" "if __name__ in sys.modules:\n" " run_name = sys.modules[__name__].__name__\n" - "if __module_name__ in sys.modules:\n" - " mod_name = sys.modules[__module_name__].__module_name__\n" "# Check nested operation\n" "import runpy\n" "nested = runpy._run_module_code('x=1\\n', mod_name='',\n" @@ -34,16 +32,14 @@ def test_run_module_code(self): initial = object() - run_name = "" - mod_name = "" + name = "" file = "Some other nonsense" loader = "Now you're just being silly" d1 = dict(initial=initial) saved_argv0 = sys.argv[0] d2 = _run_module_code(self.test_source, d1, - run_name, - mod_name, + name, file, loader, True) @@ -51,23 +47,19 @@ self.failUnless(d2["initial"] is initial) self.failUnless(d2["result"] == self.expected_result) self.failUnless(d2["nested"]["x"] == 1) - self.failUnless(d2["__name__"] is run_name) - self.failUnless(d2["run_name"] is run_name) - self.failUnless(d2["__module_name__"] is mod_name) - self.failUnless(d2["mod_name"] is mod_name) + self.failUnless(d2["__name__"] is name) + self.failUnless(d2["run_name"] is name) self.failUnless(d2["__file__"] is file) self.failUnless(d2["run_argv0"] is file) self.failUnless(d2["__loader__"] is loader) self.failUnless(sys.argv[0] is saved_argv0) - self.failUnless(mod_name not in sys.modules) - self.failUnless(run_name not in sys.modules) + self.failUnless(name not in sys.modules) def test_run_module_code_defaults(self): saved_argv0 = sys.argv[0] d = _run_module_code(self.test_source) self.failUnless(d["result"] == self.expected_result) self.failUnless(d["__name__"] is None) - self.failUnless(d["__module_name__"] is None) self.failUnless(d["__file__"] is None) self.failUnless(d["__loader__"] is None) self.failUnless(d["run_argv0"] is saved_argv0) Modified: python/branches/bcannon-sandboxing/Lib/test/test_sax.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_sax.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_sax.py Wed Aug 2 00:51:44 2006 @@ -1,17 +1,17 @@ # regression test for SAX 2.0 -*- coding: iso-8859-1 -*- # $Id$ -from xmlcore.sax import make_parser, ContentHandler, \ - SAXException, SAXReaderNotAvailable, SAXParseException +from xml.sax import make_parser, ContentHandler, \ + SAXException, SAXReaderNotAvailable, SAXParseException try: make_parser() except SAXReaderNotAvailable: # don't try to test this module if we cannot create a parser raise ImportError("no XML parsers available") -from xmlcore.sax.saxutils import XMLGenerator, escape, unescape, quoteattr, \ - XMLFilterBase -from xmlcore.sax.expatreader import create_parser -from xmlcore.sax.xmlreader import InputSource, AttributesImpl, AttributesNSImpl +from xml.sax.saxutils import XMLGenerator, escape, unescape, quoteattr, \ + XMLFilterBase +from xml.sax.expatreader import create_parser +from xml.sax.xmlreader import InputSource, AttributesImpl, AttributesNSImpl from cStringIO import StringIO from test.test_support import verify, verbose, TestFailed, findfile import os @@ -36,17 +36,17 @@ # Creating parsers several times in a row should succeed. # Testing this because there have been failures of this kind # before. - from xmlcore.sax import make_parser + from xml.sax import make_parser p = make_parser() - from xmlcore.sax import make_parser + from xml.sax import make_parser p = make_parser() - from xmlcore.sax import make_parser + from xml.sax import make_parser p = make_parser() - from xmlcore.sax import make_parser + from xml.sax import make_parser p = make_parser() - from xmlcore.sax import make_parser + from xml.sax import make_parser p = make_parser() - from xmlcore.sax import make_parser + from xml.sax import make_parser p = make_parser() except: return 0 @@ -108,7 +108,7 @@ try: # Creating a parser should succeed - it should fall back # to the expatreader - p = make_parser(['xmlcore.parsers.no_such_parser']) + p = make_parser(['xml.parsers.no_such_parser']) except: return 0 else: @@ -671,6 +671,55 @@ attrs.getQNameByName((ns_uri, "attr")) == "ns:attr" +# During the development of Python 2.5, an attempt to move the "xml" +# package implementation to a new package ("xmlcore") proved painful. +# The goal of this change was to allow applications to be able to +# obtain and rely on behavior in the standard library implementation +# of the XML support without needing to be concerned about the +# availability of the PyXML implementation. +# +# While the existing import hackery in Lib/xml/__init__.py can cause +# PyXML's _xmlpus package to supplant the "xml" package, that only +# works because either implementation uses the "xml" package name for +# imports. +# +# The move resulted in a number of problems related to the fact that +# the import machinery's "package context" is based on the name that's +# being imported rather than the __name__ of the actual package +# containment; it wasn't possible for the "xml" package to be replaced +# by a simple module that indirected imports to the "xmlcore" package. +# +# The following two tests exercised bugs that were introduced in that +# attempt. Keeping these tests around will help detect problems with +# other attempts to provide reliable access to the standard library's +# implementation of the XML support. + +def test_sf_1511497(): + # Bug report: http://www.python.org/sf/1511497 + import sys + old_modules = sys.modules.copy() + for modname in sys.modules.keys(): + if modname.startswith("xml."): + del sys.modules[modname] + try: + import xml.sax.expatreader + module = xml.sax.expatreader + return module.__name__ == "xml.sax.expatreader" + finally: + sys.modules.update(old_modules) + +def test_sf_1513611(): + # Bug report: http://www.python.org/sf/1513611 + sio = StringIO("invalid") + parser = make_parser() + from xml.sax import SAXParseException + try: + parser.parse(sio) + except SAXParseException: + return True + else: + return False + # ===== Main program def make_test_output(): Modified: python/branches/bcannon-sandboxing/Lib/test/test_scope.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_scope.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_scope.py Wed Aug 2 00:51:44 2006 @@ -299,6 +299,17 @@ else: raise TestFailed +# test for bug #1501934: incorrect LOAD/STORE_GLOBAL generation +global_x = 1 +def f(): + global_x += 1 +try: + f() +except UnboundLocalError: + pass +else: + raise TestFailed, 'scope of global_x not correctly determined' + print "14. complex definitions" def makeReturner(*lst): Modified: python/branches/bcannon-sandboxing/Lib/test/test_shutil.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_shutil.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_shutil.py Wed Aug 2 00:51:44 2006 @@ -74,6 +74,33 @@ except: pass + + def test_copytree_simple(self): + src_dir = tempfile.mkdtemp() + dst_dir = os.path.join(tempfile.mkdtemp(), 'destination') + open(os.path.join(src_dir, 'test.txt'), 'w').write('123') + os.mkdir(os.path.join(src_dir, 'test_dir')) + open(os.path.join(src_dir, 'test_dir', 'test.txt'), 'w').write('456') + # + try: + shutil.copytree(src_dir, dst_dir) + self.assertTrue(os.path.isfile(os.path.join(dst_dir, 'test.txt'))) + self.assertTrue(os.path.isdir(os.path.join(dst_dir, 'test_dir'))) + self.assertTrue(os.path.isfile(os.path.join(dst_dir, 'test_dir', 'test.txt'))) + self.assertEqual(open(os.path.join(dst_dir, 'test.txt')).read(), '123') + self.assertEqual(open(os.path.join(dst_dir, 'test_dir', 'test.txt')).read(), '456') + finally: + try: + os.remove(os.path.join(src_dir, 'test.txt')) + os.remove(os.path.join(dst_dir, 'test.txt')) + os.remove(os.path.join(src_dir, 'test_dir', 'test.txt')) + os.remove(os.path.join(dst_dir, 'test_dir', 'test.txt')) + os.removedirs(src_dir) + os.removedirs(dst_dir) + except: + pass + + if hasattr(os, "symlink"): def test_dont_copy_file_onto_link_to_itself(self): # bug 851123. Modified: python/branches/bcannon-sandboxing/Lib/test/test_signal.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_signal.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_signal.py Wed Aug 2 00:51:44 2006 @@ -25,7 +25,11 @@ ) & """ % vars() +a_called = b_called = False + def handlerA(*args): + global a_called + a_called = True if verbose: print "handlerA", args @@ -33,11 +37,14 @@ pass def handlerB(*args): + global b_called + b_called = True if verbose: print "handlerB", args raise HandlerBCalled, args -signal.alarm(20) # Entire test lasts at most 20 sec. +MAX_DURATION = 20 +signal.alarm(MAX_DURATION) # Entire test should last at most 20 sec. hup = signal.signal(signal.SIGHUP, handlerA) usr1 = signal.signal(signal.SIGUSR1, handlerB) usr2 = signal.signal(signal.SIGUSR2, signal.SIG_IGN) @@ -65,9 +72,34 @@ except TypeError: pass +# Set up a child to send an alarm signal to us (the parent) after waiting +# long enough to receive the alarm. It seems we miss the alarm for some +# reason. This will hopefully stop the hangs on Tru64/Alpha. +def force_test_exit(): + # Sigh, both imports seem necessary to avoid errors. + import os + fork_pid = os.fork() + if fork_pid == 0: + # In child + import os, time + try: + # Wait 5 seconds longer than the expected alarm to give enough + # time for the normal sequence of events to occur. This is + # just a stop-gap to prevent the test from hanging. + time.sleep(MAX_DURATION + 5) + for i in range(3): + os.kill(pid, signal.SIGALARM) + finally: + os._exit(0) + # In parent (or error) + return fork_pid + try: os.system(script) + # Try to ensure this test exits even if there is some problem with alarm. + # Tru64/Alpha sometimes hangs and is ultimately killed by the buildbot. + fork_pid = force_test_exit() print "starting pause() loop..." try: @@ -88,6 +120,22 @@ if verbose: print "KeyboardInterrupt (assume the alarm() went off)" + # Forcibly kill the child we created to ping us if there was a test error. + try: + # Make sure we don't kill ourself if there was a fork error. + if fork_pid > 0: + os.kill(fork_pid, signal.SIGKILL) + except: + # If the child killed us, it has probably exited. Killing a + # non-existant process will raise an error which we don't care about. + pass + + if not a_called: + print 'HandlerA not called' + + if not b_called: + print 'HandlerB not called' + finally: signal.signal(signal.SIGHUP, hup) signal.signal(signal.SIGUSR1, usr1) Modified: python/branches/bcannon-sandboxing/Lib/test/test_subprocess.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_subprocess.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_subprocess.py Wed Aug 2 00:51:44 2006 @@ -30,12 +30,14 @@ def setUp(self): # Try to minimize the number of children we have so this test # doesn't crash on some buildbots (Alphas in particular). - test_support.reap_children() + if hasattr(test_support, "reap_children"): + test_support.reap_children() def tearDown(self): # Try to minimize the number of children we have so this test # doesn't crash on some buildbots (Alphas in particular). - test_support.reap_children() + if hasattr(test_support, "reap_children"): + test_support.reap_children() def mkstemp(self): """wrapper for mkstemp, calling mktemp if mkstemp is not available""" @@ -66,7 +68,7 @@ subprocess.check_call([sys.executable, "-c", "import sys; sys.exit(47)"]) except subprocess.CalledProcessError, e: - self.assertEqual(e.errno, 47) + self.assertEqual(e.returncode, 47) else: self.fail("Expected CalledProcessError") @@ -474,10 +476,36 @@ else: self.fail("Expected OSError") + def _suppress_core_files(self): + """Try to prevent core files from being created. + Returns previous ulimit if successful, else None. + """ + try: + import resource + old_limit = resource.getrlimit(resource.RLIMIT_CORE) + resource.setrlimit(resource.RLIMIT_CORE, (0,0)) + return old_limit + except (ImportError, ValueError, resource.error): + return None + + def _unsuppress_core_files(self, old_limit): + """Return core file behavior to default.""" + if old_limit is None: + return + try: + import resource + resource.setrlimit(resource.RLIMIT_CORE, old_limit) + except (ImportError, ValueError, resource.error): + return + def test_run_abort(self): # returncode handles signal termination - p = subprocess.Popen([sys.executable, - "-c", "import os; os.abort()"]) + old_limit = self._suppress_core_files() + try: + p = subprocess.Popen([sys.executable, + "-c", "import os; os.abort()"]) + finally: + self._unsuppress_core_files(old_limit) p.wait() self.assertEqual(-p.returncode, signal.SIGABRT) @@ -610,7 +638,8 @@ def test_main(): test_support.run_unittest(ProcessTestCase) - test_support.reap_children() + if hasattr(test_support, "reap_children"): + test_support.reap_children() if __name__ == "__main__": test_main() Modified: python/branches/bcannon-sandboxing/Lib/test/test_sys.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_sys.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_sys.py Wed Aug 2 00:51:44 2006 @@ -237,6 +237,90 @@ is sys._getframe().f_code ) + # sys._current_frames() is a CPython-only gimmick. + def test_current_frames(self): + have_threads = True + try: + import thread + except ImportError: + have_threads = False + + if have_threads: + self.current_frames_with_threads() + else: + self.current_frames_without_threads() + + # Test sys._current_frames() in a WITH_THREADS build. + def current_frames_with_threads(self): + import threading, thread + import traceback + + # Spawn a thread that blocks at a known place. Then the main + # thread does sys._current_frames(), and verifies that the frames + # returned make sense. + entered_g = threading.Event() + leave_g = threading.Event() + thread_info = [] # the thread's id + + def f123(): + g456() + + def g456(): + thread_info.append(thread.get_ident()) + entered_g.set() + leave_g.wait() + + t = threading.Thread(target=f123) + t.start() + entered_g.wait() + + # At this point, t has finished its entered_g.set(), although it's + # impossible to guess whether it's still on that line or has moved on + # to its leave_g.wait(). + self.assertEqual(len(thread_info), 1) + thread_id = thread_info[0] + + d = sys._current_frames() + + main_id = thread.get_ident() + self.assert_(main_id in d) + self.assert_(thread_id in d) + + # Verify that the captured main-thread frame is _this_ frame. + frame = d.pop(main_id) + self.assert_(frame is sys._getframe()) + + # Verify that the captured thread frame is blocked in g456, called + # from f123. This is a litte tricky, since various bits of + # threading.py are also in the thread's call stack. + frame = d.pop(thread_id) + stack = traceback.extract_stack(frame) + for i, (filename, lineno, funcname, sourceline) in enumerate(stack): + if funcname == "f123": + break + else: + self.fail("didn't find f123() on thread's call stack") + + self.assertEqual(sourceline, "g456()") + + # And the next record must be for g456(). + filename, lineno, funcname, sourceline = stack[i+1] + self.assertEqual(funcname, "g456") + self.assert_(sourceline in ["leave_g.wait()", "entered_g.set()"]) + + # Reap the spawned thread. + leave_g.set() + t.join() + + # Test sys._current_frames() when thread support doesn't exist. + def current_frames_without_threads(self): + # Not much happens here: there is only one thread, with artificial + # "thread id" 0. + d = sys._current_frames() + self.assertEqual(len(d), 1) + self.assert_(0 in d) + self.assert_(d[0] is sys._getframe()) + def test_attributes(self): self.assert_(isinstance(sys.api_version, int)) self.assert_(isinstance(sys.argv, list)) Modified: python/branches/bcannon-sandboxing/Lib/test/test_time.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_time.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_time.py Wed Aug 2 00:51:44 2006 @@ -39,9 +39,9 @@ def test_strftime_bounds_checking(self): # Make sure that strftime() checks the bounds of the various parts - #of the time tuple. + #of the time tuple (0 is valid for *all* values). - # Check year + # Check year [1900, max(int)] self.assertRaises(ValueError, time.strftime, '', (1899, 1, 1, 0, 0, 0, 0, 1, -1)) if time.accept2dyear: @@ -49,27 +49,27 @@ (-1, 1, 1, 0, 0, 0, 0, 1, -1)) self.assertRaises(ValueError, time.strftime, '', (100, 1, 1, 0, 0, 0, 0, 1, -1)) - # Check month + # Check month [1, 12] + zero support self.assertRaises(ValueError, time.strftime, '', - (1900, 0, 1, 0, 0, 0, 0, 1, -1)) + (1900, -1, 1, 0, 0, 0, 0, 1, -1)) self.assertRaises(ValueError, time.strftime, '', (1900, 13, 1, 0, 0, 0, 0, 1, -1)) - # Check day of month + # Check day of month [1, 31] + zero support self.assertRaises(ValueError, time.strftime, '', - (1900, 1, 0, 0, 0, 0, 0, 1, -1)) + (1900, 1, -1, 0, 0, 0, 0, 1, -1)) self.assertRaises(ValueError, time.strftime, '', (1900, 1, 32, 0, 0, 0, 0, 1, -1)) - # Check hour + # Check hour [0, 23] self.assertRaises(ValueError, time.strftime, '', (1900, 1, 1, -1, 0, 0, 0, 1, -1)) self.assertRaises(ValueError, time.strftime, '', (1900, 1, 1, 24, 0, 0, 0, 1, -1)) - # Check minute + # Check minute [0, 59] self.assertRaises(ValueError, time.strftime, '', (1900, 1, 1, 0, -1, 0, 0, 1, -1)) self.assertRaises(ValueError, time.strftime, '', (1900, 1, 1, 0, 60, 0, 0, 1, -1)) - # Check second + # Check second [0, 61] self.assertRaises(ValueError, time.strftime, '', (1900, 1, 1, 0, 0, -1, 0, 1, -1)) # C99 only requires allowing for one leap second, but Python's docs say @@ -82,17 +82,25 @@ # modulo. self.assertRaises(ValueError, time.strftime, '', (1900, 1, 1, 0, 0, 0, -2, 1, -1)) - # Check day of the year + # Check day of the year [1, 366] + zero support self.assertRaises(ValueError, time.strftime, '', - (1900, 1, 1, 0, 0, 0, 0, 0, -1)) + (1900, 1, 1, 0, 0, 0, 0, -1, -1)) self.assertRaises(ValueError, time.strftime, '', (1900, 1, 1, 0, 0, 0, 0, 367, -1)) - # Check daylight savings flag + # Check daylight savings flag [-1, 1] self.assertRaises(ValueError, time.strftime, '', (1900, 1, 1, 0, 0, 0, 0, 1, -2)) self.assertRaises(ValueError, time.strftime, '', (1900, 1, 1, 0, 0, 0, 0, 1, 2)) + def test_default_values_for_zero(self): + # Make sure that using all zeros uses the proper default values. + # No test for daylight savings since strftime() does not change output + # based on its value. + expected = "2000 01 01 00 00 00 1 001" + result = time.strftime("%Y %m %d %H %M %S %w %j", (0,)*9) + self.assertEquals(expected, result) + def test_strptime(self): tt = time.gmtime(self.t) for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I', Modified: python/branches/bcannon-sandboxing/Lib/test/test_traceback.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_traceback.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_traceback.py Wed Aug 2 00:51:44 2006 @@ -31,8 +31,9 @@ err = self.get_exception_format(self.syntax_error_with_caret, SyntaxError) self.assert_(len(err) == 4) - self.assert_("^" in err[2]) # third line has caret self.assert_(err[1].strip() == "return x!") + self.assert_("^" in err[2]) # third line has caret + self.assert_(err[1].find("!") == err[2].find("^")) # in the right place def test_nocaret(self): if is_jython: @@ -47,8 +48,9 @@ err = self.get_exception_format(self.syntax_error_bad_indentation, IndentationError) self.assert_(len(err) == 4) - self.assert_("^" in err[2]) self.assert_(err[1].strip() == "print 2") + self.assert_("^" in err[2]) + self.assert_(err[1].find("2") == err[2].find("^")) def test_bug737473(self): import sys, os, tempfile, time @@ -109,6 +111,36 @@ lst = traceback.format_exception_only(e.__class__, e) self.assertEqual(lst, ['KeyboardInterrupt\n']) + # String exceptions are deprecated, but legal. The quirky form with + # separate "type" and "value" tends to break things, because + # not isinstance(value, type) + # and a string cannot be the first argument to issubclass. + # + # Note that sys.last_type and sys.last_value do not get set if an + # exception is caught, so we sort of cheat and just emulate them. + # + # test_string_exception1 is equivalent to + # + # >>> raise "String Exception" + # + # test_string_exception2 is equivalent to + # + # >>> raise "String Exception", "String Value" + # + def test_string_exception1(self): + str_type = "String Exception" + err = traceback.format_exception_only(str_type, None) + self.assert_(len(err) == 1) + self.assert_(err[0] == str_type + '\n') + + def test_string_exception2(self): + str_type = "String Exception" + str_value = "String Value" + err = traceback.format_exception_only(str_type, str_value) + self.assert_(len(err) == 1) + self.assert_(err[0] == str_type + ': ' + str_value + '\n') + + def test_main(): run_unittest(TracebackCases) Modified: python/branches/bcannon-sandboxing/Lib/test/test_urllib2.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_urllib2.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_urllib2.py Wed Aug 2 00:51:44 2006 @@ -676,11 +676,11 @@ r = MockResponse(200, "OK", {}, "") newreq = h.do_request_(req) if data is None: # GET - self.assert_("Content-length" not in req.unredirected_hdrs) - self.assert_("Content-type" not in req.unredirected_hdrs) + self.assert_("Content-Length" not in req.unredirected_hdrs) + self.assert_("Content-Type" not in req.unredirected_hdrs) else: # POST - self.assertEqual(req.unredirected_hdrs["Content-length"], "0") - self.assertEqual(req.unredirected_hdrs["Content-type"], + self.assertEqual(req.unredirected_hdrs["Content-Length"], "0") + self.assertEqual(req.unredirected_hdrs["Content-Type"], "application/x-www-form-urlencoded") # XXX the details of Host could be better tested self.assertEqual(req.unredirected_hdrs["Host"], "example.com") @@ -692,8 +692,8 @@ req.add_unredirected_header("Host", "baz") req.add_unredirected_header("Spam", "foo") newreq = h.do_request_(req) - self.assertEqual(req.unredirected_hdrs["Content-length"], "foo") - self.assertEqual(req.unredirected_hdrs["Content-type"], "bar") + self.assertEqual(req.unredirected_hdrs["Content-Length"], "foo") + self.assertEqual(req.unredirected_hdrs["Content-Type"], "bar") self.assertEqual(req.unredirected_hdrs["Host"], "baz") self.assertEqual(req.unredirected_hdrs["Spam"], "foo") @@ -847,7 +847,7 @@ 407, 'Proxy-Authenticate: Basic realm="%s"\r\n\r\n' % realm) opener.add_handler(auth_handler) opener.add_handler(http_handler) - self._test_basic_auth(opener, auth_handler, "Proxy-authorization", + self._test_basic_auth(opener, auth_handler, "Proxy-Authorization", realm, http_handler, password_manager, "http://acme.example.com:3128/protected", "proxy.example.com:3128", Modified: python/branches/bcannon-sandboxing/Lib/test/test_uuid.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_uuid.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_uuid.py Wed Aug 2 00:51:44 2006 @@ -1,4 +1,5 @@ -from unittest import TestCase, main +from unittest import TestCase +from test import test_support import uuid def importable(name): @@ -10,6 +11,7 @@ class TestUUID(TestCase): last_node = None + source2node = {} def test_UUID(self): equal = self.assertEqual @@ -265,7 +267,7 @@ badtype(lambda: setattr(u, 'fields', f)) badtype(lambda: setattr(u, 'int', i)) - def check_node(self, node, source=''): + def check_node(self, node, source): individual_group_bit = (node >> 40L) & 1 universal_local_bit = (node >> 40L) & 2 message = "%012x doesn't look like a real MAC address" % node @@ -274,25 +276,41 @@ self.assertNotEqual(node, 0, message) self.assertNotEqual(node, 0xffffffffffffL, message) self.assert_(0 <= node, message) - self.assert_(node < 1<<48L, message) + self.assert_(node < (1L << 48), message) - import sys - if source: - sys.stderr.write('(%s: %012x)' % (source, node)) + TestUUID.source2node[source] = node if TestUUID.last_node: - self.assertEqual(TestUUID.last_node, node, 'inconsistent node IDs') + if TestUUID.last_node != node: + msg = "different sources disagree on node:\n" + for s, n in TestUUID.source2node.iteritems(): + msg += " from source %r, node was %012x\n" % (s, n) + # There's actually no reason to expect the MAC addresses + # to agree across various methods -- e.g., a box may have + # multiple network interfaces, and different ways of getting + # a MAC address may favor different HW. + ##self.fail(msg) else: TestUUID.last_node = node def test_ifconfig_getnode(self): + import sys + print >>sys.__stdout__, \ +""" WARNING: uuid._ifconfig_getnode is unreliable on many platforms. + It is disabled until the code and/or test can be fixed properly.""" + return + import os if os.name == 'posix': - self.check_node(uuid._ifconfig_getnode(), 'ifconfig') + node = uuid._ifconfig_getnode() + if node is not None: + self.check_node(node, 'ifconfig') def test_ipconfig_getnode(self): import os if os.name == 'nt': - self.check_node(uuid._ipconfig_getnode(), 'ipconfig') + node = uuid._ipconfig_getnode() + if node is not None: + self.check_node(node, 'ipconfig') def test_netbios_getnode(self): if importable('win32wnet') and importable('netbios'): @@ -301,9 +319,15 @@ def test_random_getnode(self): node = uuid._random_getnode() self.assert_(0 <= node) - self.assert_(node < 1<<48L) + self.assert_(node < (1L <<48)) def test_unixdll_getnode(self): + import sys + print >>sys.__stdout__, \ +""" WARNING: uuid._unixdll_getnode is unreliable on many platforms. + It is disabled until the code and/or test can be fixed properly.""" + return + import os if importable('ctypes') and os.name == 'posix': self.check_node(uuid._unixdll_getnode(), 'unixdll') @@ -314,10 +338,20 @@ self.check_node(uuid._windll_getnode(), 'windll') def test_getnode(self): - self.check_node(uuid.getnode()) + import sys + print >>sys.__stdout__, \ +""" WARNING: uuid.getnode is unreliable on many platforms. + It is disabled until the code and/or test can be fixed properly.""" + return + + node1 = uuid.getnode() + self.check_node(node1, "getnode1") # Test it again to ensure consistency. - self.check_node(uuid.getnode()) + node2 = uuid.getnode() + self.check_node(node2, "getnode2") + + self.assertEqual(node1, node2) def test_uuid1(self): equal = self.assertEqual @@ -392,5 +426,9 @@ equal(u, uuid.UUID(v)) equal(str(u), v) + +def test_main(): + test_support.run_unittest(TestUUID) + if __name__ == '__main__': - main() + test_main() Modified: python/branches/bcannon-sandboxing/Lib/test/test_wait3.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_wait3.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_wait3.py Wed Aug 2 00:51:44 2006 @@ -2,6 +2,7 @@ """ import os +import time from test.fork_wait import ForkWait from test.test_support import TestSkipped, run_unittest, reap_children @@ -17,10 +18,14 @@ class Wait3Test(ForkWait): def wait_impl(self, cpid): - while 1: - spid, status, rusage = os.wait3(0) + for i in range(10): + # wait3() shouldn't hang, but some of the buildbots seem to hang + # in the forking tests. This is an attempt to fix the problem. + spid, status, rusage = os.wait3(os.WNOHANG) if spid == cpid: break + time.sleep(1.0) + self.assertEqual(spid, cpid) self.assertEqual(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8)) self.assertTrue(rusage) Modified: python/branches/bcannon-sandboxing/Lib/test/test_wait4.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_wait4.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_wait4.py Wed Aug 2 00:51:44 2006 @@ -2,6 +2,7 @@ """ import os +import time from test.fork_wait import ForkWait from test.test_support import TestSkipped, run_unittest, reap_children @@ -17,7 +18,13 @@ class Wait4Test(ForkWait): def wait_impl(self, cpid): - spid, status, rusage = os.wait4(cpid, 0) + for i in range(10): + # wait4() shouldn't hang, but some of the buildbots seem to hang + # in the forking tests. This is an attempt to fix the problem. + spid, status, rusage = os.wait4(cpid, os.WNOHANG) + if spid == cpid: + break + time.sleep(1.0) self.assertEqual(spid, cpid) self.assertEqual(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8)) self.assertTrue(rusage) Modified: python/branches/bcannon-sandboxing/Lib/test/test_winreg.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_winreg.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_winreg.py Wed Aug 2 00:51:44 2006 @@ -151,3 +151,6 @@ else: print "Remote registry calls can be tested using", print "'test_winreg.py --remote \\\\machine_name'" + # perform minimal ConnectRegistry test which just invokes it + h = ConnectRegistry(None, HKEY_LOCAL_MACHINE) + h.Close() Modified: python/branches/bcannon-sandboxing/Lib/test/test_xml_etree.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_xml_etree.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_xml_etree.py Wed Aug 2 00:51:44 2006 @@ -1,4 +1,4 @@ -# xmlcore.etree test. This file contains enough tests to make sure that +# xml.etree test. This file contains enough tests to make sure that # all included components work as they should. For a more extensive # test suite, see the selftest script in the ElementTree distribution. @@ -6,8 +6,6 @@ from test import test_support -from xmlcore.etree import ElementTree as ET - SAMPLE_XML = """ text @@ -32,9 +30,9 @@ """ Import sanity. - >>> from xmlcore.etree import ElementTree - >>> from xmlcore.etree import ElementInclude - >>> from xmlcore.etree import ElementPath + >>> from xml.etree import ElementTree + >>> from xml.etree import ElementInclude + >>> from xml.etree import ElementPath """ def check_method(method): @@ -61,6 +59,8 @@ """ Test element tree interface. + >>> from xml.etree import ElementTree as ET + >>> element = ET.Element("tag", key="value") >>> tree = ET.ElementTree(element) @@ -108,6 +108,8 @@ """ Test find methods (including xpath syntax). + >>> from xml.etree import ElementTree as ET + >>> elem = ET.XML(SAMPLE_XML) >>> elem.find("tag").tag 'tag' @@ -174,6 +176,8 @@ def parseliteral(): r""" + >>> from xml.etree import ElementTree as ET + >>> element = ET.XML("text") >>> ET.ElementTree(element).write(sys.stdout) text @@ -195,18 +199,20 @@ 'body' """ -def check_encoding(encoding): + +def check_encoding(ET, encoding): """ - >>> check_encoding("ascii") - >>> check_encoding("us-ascii") - >>> check_encoding("iso-8859-1") - >>> check_encoding("iso-8859-15") - >>> check_encoding("cp437") - >>> check_encoding("mac-roman") + >>> from xml.etree import ElementTree as ET + + >>> check_encoding(ET, "ascii") + >>> check_encoding(ET, "us-ascii") + >>> check_encoding(ET, "iso-8859-1") + >>> check_encoding(ET, "iso-8859-15") + >>> check_encoding(ET, "cp437") + >>> check_encoding(ET, "mac-roman") """ - ET.XML( - "" % encoding - ) + ET.XML("" % encoding) + # # xinclude tests (samples from appendix C of the xinclude specification) @@ -282,14 +288,16 @@ except KeyError: raise IOError("resource not found") if parse == "xml": - return ET.XML(data) + from xml.etree.ElementTree import XML + return XML(data) return data def xinclude(): r""" Basic inclusion example (XInclude C.1) - >>> from xmlcore.etree import ElementInclude + >>> from xml.etree import ElementTree as ET + >>> from xml.etree import ElementInclude >>> document = xinclude_loader("C1.xml") >>> ElementInclude.include(document, xinclude_loader) Modified: python/branches/bcannon-sandboxing/Lib/test/test_xml_etree_c.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/test/test_xml_etree_c.py (original) +++ python/branches/bcannon-sandboxing/Lib/test/test_xml_etree_c.py Wed Aug 2 00:51:44 2006 @@ -1,10 +1,10 @@ -# xmlcore.etree test for cElementTree +# xml.etree test for cElementTree import doctest, sys from test import test_support -from xmlcore.etree import cElementTree as ET +from xml.etree import cElementTree as ET SAMPLE_XML = """ @@ -30,7 +30,7 @@ """ Import sanity. - >>> from xmlcore.etree import cElementTree + >>> from xml.etree import cElementTree """ def check_method(method): Modified: python/branches/bcannon-sandboxing/Lib/traceback.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/traceback.py (original) +++ python/branches/bcannon-sandboxing/Lib/traceback.py Wed Aug 2 00:51:44 2006 @@ -150,50 +150,63 @@ The arguments are the exception type and value such as given by sys.last_type and sys.last_value. The return value is a list of - strings, each ending in a newline. Normally, the list contains a - single string; however, for SyntaxError exceptions, it contains - several lines that (when printed) display detailed information - about where the syntax error occurred. The message indicating - which exception occurred is the always last string in the list. + strings, each ending in a newline. + + Normally, the list contains a single string; however, for + SyntaxError exceptions, it contains several lines that (when + printed) display detailed information about where the syntax + error occurred. + + The message indicating which exception occurred is always the last + string in the list. + """ - list = [] - if (type(etype) == types.ClassType - or (isinstance(etype, type) and issubclass(etype, BaseException))): - stype = etype.__name__ + + # An instance should not have a meaningful value parameter, but + # sometimes does, particularly for string exceptions, such as + # >>> raise string1, string2 # deprecated + # + # Clear these out first because issubtype(string1, SyntaxError) + # would throw another exception and mask the original problem. + if (isinstance(etype, BaseException) or + isinstance(etype, types.InstanceType) or + type(etype) is str): + return [_format_final_exc_line(etype, value)] + + stype = etype.__name__ + + if not issubclass(etype, SyntaxError): + return [_format_final_exc_line(stype, value)] + + # It was a syntax error; show exactly where the problem was found. + lines = [] + try: + msg, (filename, lineno, offset, badline) = value + except Exception: + pass else: - stype = etype - if value is None: - list.append(str(stype) + '\n') + filename = filename or "" + lines.append(' File "%s", line %d\n' % (filename, lineno)) + if badline is not None: + lines.append(' %s\n' % badline.strip()) + if offset is not None: + caretspace = badline[:offset].lstrip() + # non-space whitespace (likes tabs) must be kept for alignment + caretspace = ((c.isspace() and c or ' ') for c in caretspace) + # only three spaces to account for offset1 == pos 0 + lines.append(' %s^\n' % ''.join(caretspace)) + value = msg + + lines.append(_format_final_exc_line(stype, value)) + return lines + +def _format_final_exc_line(etype, value): + """Return a list of a single line -- normal case for format_exception_only""" + if value is None or not str(value): + line = "%s\n" % etype else: - if issubclass(etype, SyntaxError): - try: - msg, (filename, lineno, offset, line) = value - except: - pass - else: - if not filename: filename = "" - list.append(' File "%s", line %d\n' % - (filename, lineno)) - if line is not None: - i = 0 - while i < len(line) and line[i].isspace(): - i = i+1 - list.append(' %s\n' % line.strip()) - if offset is not None: - s = ' ' - for c in line[i:offset-1]: - if c.isspace(): - s = s + c - else: - s = s + ' ' - list.append('%s^\n' % s) - value = msg - s = _some_str(value) - if s: - list.append('%s: %s\n' % (str(stype), s)) - else: - list.append('%s\n' % str(stype)) - return list + line = "%s: %s\n" % (etype, _some_str(value)) + return line def _some_str(value): try: Modified: python/branches/bcannon-sandboxing/Lib/types.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/types.py (original) +++ python/branches/bcannon-sandboxing/Lib/types.py Wed Aug 2 00:51:44 2006 @@ -86,4 +86,16 @@ DictProxyType = type(TypeType.__dict__) NotImplementedType = type(NotImplemented) -del sys, _f, _g, _C, _x # Not for export +# Extension types defined in a C helper module. XXX There may be no +# equivalent in implementations other than CPython, so it seems better to +# leave them undefined then to set them to e.g. None. +try: + import _types +except ImportError: + pass +else: + GetSetDescriptorType = type(_types.Helper.getter) + MemberDescriptorType = type(_types.Helper.member) + del _types + +del sys, _f, _g, _C, _x # Not for export Modified: python/branches/bcannon-sandboxing/Lib/urllib.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/urllib.py (original) +++ python/branches/bcannon-sandboxing/Lib/urllib.py Wed Aug 2 00:51:44 2006 @@ -118,7 +118,7 @@ self.proxies = proxies self.key_file = x509.get('key_file') self.cert_file = x509.get('cert_file') - self.addheaders = [('User-agent', self.version)] + self.addheaders = [('User-Agent', self.version)] self.__tempfiles = [] self.__unlink = os.unlink # See cleanup() self.tempcache = None @@ -314,8 +314,8 @@ h = httplib.HTTP(host) if data is not None: h.putrequest('POST', selector) - h.putheader('Content-type', 'application/x-www-form-urlencoded') - h.putheader('Content-length', '%d' % len(data)) + h.putheader('Content-Type', 'application/x-www-form-urlencoded') + h.putheader('Content-Length', '%d' % len(data)) else: h.putrequest('GET', selector) if proxy_auth: h.putheader('Proxy-Authorization', 'Basic %s' % proxy_auth) @@ -400,9 +400,9 @@ cert_file=self.cert_file) if data is not None: h.putrequest('POST', selector) - h.putheader('Content-type', + h.putheader('Content-Type', 'application/x-www-form-urlencoded') - h.putheader('Content-length', '%d' % len(data)) + h.putheader('Content-Length', '%d' % len(data)) else: h.putrequest('GET', selector) if proxy_auth: h.putheader('Proxy-Authorization: Basic %s' % proxy_auth) @@ -584,7 +584,7 @@ data = base64.decodestring(data) else: data = unquote(data) - msg.append('Content-length: %d' % len(data)) + msg.append('Content-Length: %d' % len(data)) msg.append('') msg.append(data) msg = '\n'.join(msg) Modified: python/branches/bcannon-sandboxing/Lib/urllib2.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/urllib2.py (original) +++ python/branches/bcannon-sandboxing/Lib/urllib2.py Wed Aug 2 00:51:44 2006 @@ -263,11 +263,11 @@ def add_header(self, key, val): # useful for something like authentication - self.headers[key.capitalize()] = val + self.headers[key.title()] = val def add_unredirected_header(self, key, val): # will not be added to a redirected request - self.unredirected_hdrs[key.capitalize()] = val + self.unredirected_hdrs[key.title()] = val def has_header(self, header_name): return (header_name in self.headers or @@ -286,7 +286,7 @@ class OpenerDirector: def __init__(self): client_version = "Python-urllib/%s" % __version__ - self.addheaders = [('User-agent', client_version)] + self.addheaders = [('User-Agent', client_version)] # manage the individual handlers self.handlers = [] self.handle_open = {} @@ -675,7 +675,7 @@ if user and password: user_pass = '%s:%s' % (unquote(user), unquote(password)) creds = base64.encodestring(user_pass).strip() - req.add_header('Proxy-authorization', 'Basic ' + creds) + req.add_header('Proxy-Authorization', 'Basic ' + creds) hostport = unquote(hostport) req.set_proxy(hostport, proxy_type) if orig_type == proxy_type: @@ -819,7 +819,7 @@ class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): - auth_header = 'Proxy-authorization' + auth_header = 'Proxy-Authorization' def http_error_407(self, req, fp, code, msg, headers): # http_error_auth_reqed requires that there is no userinfo component in @@ -1022,20 +1022,20 @@ if request.has_data(): # POST data = request.get_data() - if not request.has_header('Content-type'): + if not request.has_header('Content-Type'): request.add_unredirected_header( - 'Content-type', + 'Content-Type', 'application/x-www-form-urlencoded') - if not request.has_header('Content-length'): + if not request.has_header('Content-Length'): request.add_unredirected_header( - 'Content-length', '%d' % len(data)) + 'Content-Length', '%d' % len(data)) scheme, sel = splittype(request.get_selector()) sel_host, sel_path = splithost(sel) if not request.has_header('Host'): request.add_unredirected_header('Host', sel_host or host) for name, value in self.parent.addheaders: - name = name.capitalize() + name = name.title() if not request.has_header(name): request.add_unredirected_header(name, value) @@ -1217,7 +1217,7 @@ modified = email.Utils.formatdate(stats.st_mtime, usegmt=True) mtype = mimetypes.guess_type(file)[0] headers = mimetools.Message(StringIO( - 'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' % + 'Content-Type: %s\nContent-Length: %d\nLast-Modified: %s\n' % (mtype or 'text/plain', size, modified))) if host: host, port = splitport(host) @@ -1272,9 +1272,9 @@ headers = "" mtype = mimetypes.guess_type(req.get_full_url())[0] if mtype: - headers += "Content-type: %s\n" % mtype + headers += "Content-Type: %s\n" % mtype if retrlen is not None and retrlen >= 0: - headers += "Content-length: %d\n" % retrlen + headers += "Content-Length: %d\n" % retrlen sf = StringIO(headers) headers = mimetools.Message(sf) return addinfourl(fp, headers, req.get_full_url()) Modified: python/branches/bcannon-sandboxing/Lib/uuid.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/uuid.py (original) +++ python/branches/bcannon-sandboxing/Lib/uuid.py Wed Aug 2 00:51:44 2006 @@ -271,19 +271,51 @@ version = property(get_version) -def _ifconfig_getnode(): - """Get the hardware address on Unix by running ifconfig.""" +def _find_mac(command, args, hw_identifiers, get_index): import os for dir in ['', '/sbin/', '/usr/sbin']: + executable = os.path.join(dir, command) + if not os.path.exists(executable): + continue + try: - pipe = os.popen(os.path.join(dir, 'ifconfig')) + # LC_ALL to get English output, 2>/dev/null to + # prevent output on stderr + cmd = 'LC_ALL=C %s %s 2>/dev/null' % (executable, args) + pipe = os.popen(cmd) except IOError: continue + for line in pipe: words = line.lower().split() for i in range(len(words)): - if words[i] in ['hwaddr', 'ether']: - return int(words[i + 1].replace(':', ''), 16) + if words[i] in hw_identifiers: + return int(words[get_index(i)].replace(':', ''), 16) + return None + +def _ifconfig_getnode(): + """Get the hardware address on Unix by running ifconfig.""" + + # This works on Linux ('' or '-a'), Tru64 ('-av'), but not all Unixes. + for args in ('', '-a', '-av'): + mac = _find_mac('ifconfig', args, ['hwaddr', 'ether'], lambda i: i+1) + if mac: + return mac + + import socket + ip_addr = socket.gethostbyname(socket.gethostname()) + + # Try getting the MAC addr from arp based on our IP address (Solaris). + mac = _find_mac('arp', '-an', [ip_addr], lambda i: -1) + if mac: + return mac + + # This might work on HP-UX. + mac = _find_mac('lanscan', '-ai', ['lan0'], lambda i: 0) + if mac: + return mac + + return None def _ipconfig_getnode(): """Get the hardware address on Windows by running ipconfig.exe.""" @@ -359,6 +391,10 @@ # hardware address. On Windows 2000 and later, UuidCreate makes a # random UUID and UuidCreateSequential gives a UUID containing the # hardware address. These routines are provided by the RPC runtime. + # NOTE: at least on Tim's WinXP Pro SP2 desktop box, while the last + # 6 bytes returned by UuidCreateSequential are fixed, they don't appear + # to bear any relationship to the MAC address of any network device + # on the box. try: lib = ctypes.windll.rpcrt4 except: @@ -386,10 +422,13 @@ _node = None def getnode(): - """Get the hardware address as a 48-bit integer. The first time this - runs, it may launch a separate program, which could be quite slow. If - all attempts to obtain the hardware address fail, we choose a random - 48-bit number with its eighth bit set to 1 as recommended in RFC 4122.""" + """Get the hardware address as a 48-bit positive integer. + + The first time this runs, it may launch a separate program, which could + be quite slow. If all attempts to obtain the hardware address fail, we + choose a random 48-bit number with its eighth bit set to 1 as recommended + in RFC 4122. + """ global _node if _node is not None: Modified: python/branches/bcannon-sandboxing/Lib/warnings.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/warnings.py (original) +++ python/branches/bcannon-sandboxing/Lib/warnings.py Wed Aug 2 00:51:44 2006 @@ -261,3 +261,4 @@ # Module initialization _processoptions(sys.warnoptions) simplefilter("ignore", category=PendingDeprecationWarning, append=1) +simplefilter("ignore", category=ImportWarning, append=1) Deleted: /python/branches/bcannon-sandboxing/Lib/xml.py ============================================================================== --- /python/branches/bcannon-sandboxing/Lib/xml.py Wed Aug 2 00:51:44 2006 +++ (empty file) @@ -1,47 +0,0 @@ -"""Core XML support for Python. - -This package contains four sub-packages: - -dom -- The W3C Document Object Model. This supports DOM Level 1 + - Namespaces. - -parsers -- Python wrappers for XML parsers (currently only supports Expat). - -sax -- The Simple API for XML, developed by XML-Dev, led by David - Megginson and ported to Python by Lars Marius Garshol. This - supports the SAX 2 API. - -etree -- The ElementTree XML library. This is a subset of the full - ElementTree XML release. - -""" - -import sys -import xmlcore - -__all__ = ["dom", "parsers", "sax", "etree"] - -# When being checked-out without options, this has the form -# "Revision: x.y " -# When exported using -kv, it is "x.y". -__version__ = "$Revision$".split()[-2:][0] - - -_MINIMUM_XMLPLUS_VERSION = (0, 8, 4) - -try: - import _xmlplus -except ImportError: - sys.modules[__name__] = xmlcore -else: - try: - v = _xmlplus.version_info - except AttributeError: - # _xmlplus is too old; ignore it - pass - else: - if v >= _MINIMUM_XMLPLUS_VERSION: - _xmlplus.__path__.extend(xmlcore.__path__) - sys.modules[__name__] = _xmlplus - else: - del v Modified: python/branches/bcannon-sandboxing/Lib/zipfile.py ============================================================================== --- python/branches/bcannon-sandboxing/Lib/zipfile.py (original) +++ python/branches/bcannon-sandboxing/Lib/zipfile.py Wed Aug 2 00:51:44 2006 @@ -664,7 +664,7 @@ if zinfo.header_offset > ZIP64_LIMIT: extra.append(zinfo.header_offset) - header_offset = 0xffffffff #-1 + header_offset = -1 # struct "l" format: 32 one bits else: header_offset = zinfo.header_offset @@ -708,9 +708,10 @@ stringEndArchive64Locator, 0, pos2, 1) self.fp.write(zip64locrec) + # XXX Why is `pos3` computed next? It's never referenced. pos3 = self.fp.tell() endrec = struct.pack(structEndArchive, stringEndArchive, - 0, 0, count, count, pos2 - pos1, 0xffffffff, 0) # -1, 0) + 0, 0, count, count, pos2 - pos1, -1, 0) self.fp.write(endrec) else: Modified: python/branches/bcannon-sandboxing/Mac/BuildScript/scripts/postflight.patch-profile ============================================================================== --- python/branches/bcannon-sandboxing/Mac/BuildScript/scripts/postflight.patch-profile (original) +++ python/branches/bcannon-sandboxing/Mac/BuildScript/scripts/postflight.patch-profile Wed Aug 2 00:51:44 2006 @@ -5,14 +5,27 @@ echo "These changes will be effective only in shell windows that you open" echo "after running this script." -PYVER=@PYVER@ +PYVER=2.5 PYTHON_ROOT="/Library/Frameworks/Python.framework/Versions/Current" +if [ `id -ur` = 0 ]; then + # Run from the installer, do some trickery to fetch the information + # we need. + theShell="`finger $USER | grep Shell: | head -1 | awk '{ print $NF }'`" + +else + theShell="${SHELL}" +fi + # Make sure the directory ${PYTHON_ROOT}/bin is on the users PATH. -BSH="`basename "${SHELL}"`" +BSH="`basename "${theShell}"`" case "${BSH}" in bash|ksh|sh|*csh) - P="`${SHELL} -c 'echo $PATH'`" + if [ `id -ur` = 0 ]; then + P=`su - ${USER} -c 'echo A-X-4-X@@$PATH@@X-4-X-A' | grep 'A-X-4-X@@.*@@X-4-X-A' | sed -e 's/^A-X-4-X@@//g' -e 's/@@X-4-X-A$//g'` + else + P="`(exec -l ${theShell} -c 'echo $PATH')`" + fi ;; *) echo "Sorry, I don't know how to patch $BSH shells" @@ -42,10 +55,15 @@ echo "# Setting PATH for MacPython ${PYVER}" >> "${HOME}/.cshrc" echo "# The orginal version is saved in .cshrc.pysave" >> "${HOME}/.cshrc" echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${HOME}/.cshrc" + if [ `id -ur` = 0 ]; then + chown "${USER}" "${HOME}/.cshrc" + fi exit 0 ;; bash) - if [ -e "${HOME}/.profile" ]; then + if [ -e "${HOME}/.bash_profile" ]; then + PR="${HOME}/.bash_profile" + elif [ -e "${HOME}/.profile" ]; then PR="${HOME}/.profile" else PR="${HOME}/.bash_profile" @@ -66,6 +84,6 @@ echo 'PATH="'"${PYTHON_ROOT}/bin"':${PATH}"' >> "${PR}" echo 'export PATH' >> "${PR}" if [ `id -ur` = 0 ]; then - chown "${LOGNAME}" "${PR}" + chown "${USER}" "${PR}" fi exit 0 Modified: python/branches/bcannon-sandboxing/Mac/IDLE/config-main.def ============================================================================== --- python/branches/bcannon-sandboxing/Mac/IDLE/config-main.def (original) +++ python/branches/bcannon-sandboxing/Mac/IDLE/config-main.def Wed Aug 2 00:51:44 2006 @@ -71,7 +71,7 @@ [Keys] default= 1 -name= IDLE Classic Mac +name= IDLE Classic OSX [History] cyclic=1 Deleted: /python/branches/bcannon-sandboxing/Mac/Modules/macosmodule.c ============================================================================== --- /python/branches/bcannon-sandboxing/Mac/Modules/macosmodule.c Wed Aug 2 00:51:44 2006 +++ (empty file) @@ -1,643 +0,0 @@ -/*********************************************************** -Copyright 1991-1997 by Stichting Mathematisch Centrum, Amsterdam, -The Netherlands. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation, and that the names of Stichting Mathematisch -Centrum or CWI not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior permission. - -STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO -THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE -FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -******************************************************************/ - -/* Macintosh OS-specific interface */ - -#include "Python.h" -#include "pymactoolbox.h" - -#include -#include - -static PyObject *MacOS_Error; /* Exception MacOS.Error */ - -#define PATHNAMELEN 1024 - -/* ----------------------------------------------------- */ - -/* Declarations for objects of type Resource fork */ - -typedef struct { - PyObject_HEAD - short fRefNum; - int isclosed; -} rfobject; - -static PyTypeObject Rftype; - - - -/* ---------------------------------------------------------------- */ - -static void -do_close(rfobject *self) -{ - if (self->isclosed ) return; - (void)FSClose(self->fRefNum); - self->isclosed = 1; -} - -static char rf_read__doc__[] = -"Read data from resource fork" -; - -static PyObject * -rf_read(rfobject *self, PyObject *args) -{ - long n; - PyObject *v; - OSErr err; - - if (self->isclosed) { - PyErr_SetString(PyExc_ValueError, "Operation on closed file"); - return NULL; - } - - if (!PyArg_ParseTuple(args, "l", &n)) - return NULL; - - v = PyString_FromStringAndSize((char *)NULL, n); - if (v == NULL) - return NULL; - - err = FSRead(self->fRefNum, &n, PyString_AsString(v)); - if (err && err != eofErr) { - PyMac_Error(err); - Py_DECREF(v); - return NULL; - } - _PyString_Resize(&v, n); - return v; -} - - -static char rf_write__doc__[] = -"Write to resource fork" -; - -static PyObject * -rf_write(rfobject *self, PyObject *args) -{ - char *buffer; - long size; - OSErr err; - - if (self->isclosed) { - PyErr_SetString(PyExc_ValueError, "Operation on closed file"); - return NULL; - } - if (!PyArg_ParseTuple(args, "s#", &buffer, &size)) - return NULL; - err = FSWrite(self->fRefNum, &size, buffer); - if (err) { - PyMac_Error(err); - return NULL; - } - Py_INCREF(Py_None); - return Py_None; -} - - -static char rf_seek__doc__[] = -"Set file position" -; - -static PyObject * -rf_seek(rfobject *self, PyObject *args) -{ - long amount, pos; - int whence = SEEK_SET; - long eof; - OSErr err; - - if (self->isclosed) { - PyErr_SetString(PyExc_ValueError, "Operation on closed file"); - return NULL; - } - if (!PyArg_ParseTuple(args, "l|i", &amount, &whence)) - return NULL; - - if ((err = GetEOF(self->fRefNum, &eof))) - goto ioerr; - - switch (whence) { - case SEEK_CUR: - if ((err = GetFPos(self->fRefNum, &pos))) - goto ioerr; - break; - case SEEK_END: - pos = eof; - break; - case SEEK_SET: - pos = 0; - break; - default: - PyErr_BadArgument(); - return NULL; - } - - pos += amount; - - /* Don't bother implementing seek past EOF */ - if (pos > eof || pos < 0) { - PyErr_BadArgument(); - return NULL; - } - - if ((err = SetFPos(self->fRefNum, fsFromStart, pos)) ) { -ioerr: - PyMac_Error(err); - return NULL; - } - Py_INCREF(Py_None); - return Py_None; -} - - -static char rf_tell__doc__[] = -"Get file position" -; - -static PyObject * -rf_tell(rfobject *self, PyObject *args) -{ - long where; - OSErr err; - - if (self->isclosed) { - PyErr_SetString(PyExc_ValueError, "Operation on closed file"); - return NULL; - } - if (!PyArg_ParseTuple(args, "")) - return NULL; - if ((err = GetFPos(self->fRefNum, &where)) ) { - PyMac_Error(err); - return NULL; - } - return PyInt_FromLong(where); -} - -static char rf_close__doc__[] = -"Close resource fork" -; - -static PyObject * -rf_close(rfobject *self, PyObject *args) -{ - if (!PyArg_ParseTuple(args, "")) - return NULL; - do_close(self); - Py_INCREF(Py_None); - return Py_None; -} - - -static struct PyMethodDef rf_methods[] = { - {"read", (PyCFunction)rf_read, 1, rf_read__doc__}, - {"write", (PyCFunction)rf_write, 1, rf_write__doc__}, - {"seek", (PyCFunction)rf_seek, 1, rf_seek__doc__}, - {"tell", (PyCFunction)rf_tell, 1, rf_tell__doc__}, - {"close", (PyCFunction)rf_close, 1, rf_close__doc__}, - - {NULL, NULL} /* sentinel */ -}; - -/* ---------- */ - - -static rfobject * -newrfobject(void) -{ - rfobject *self; - - self = PyObject_NEW(rfobject, &Rftype); - if (self == NULL) - return NULL; - self->isclosed = 1; - return self; -} - - -static void -rf_dealloc(rfobject *self) -{ - do_close(self); - PyObject_DEL(self); -} - -static PyObject * -rf_getattr(rfobject *self, char *name) -{ - return Py_FindMethod(rf_methods, (PyObject *)self, name); -} - -static char Rftype__doc__[] = -"Resource fork file object" -; - -static PyTypeObject Rftype = { - PyObject_HEAD_INIT(&PyType_Type) - 0, /*ob_size*/ - "MacOS.ResourceFork", /*tp_name*/ - sizeof(rfobject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - /* methods */ - (destructor)rf_dealloc, /*tp_dealloc*/ - (printfunc)0, /*tp_print*/ - (getattrfunc)rf_getattr, /*tp_getattr*/ - (setattrfunc)0, /*tp_setattr*/ - (cmpfunc)0, /*tp_compare*/ - (reprfunc)0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - (hashfunc)0, /*tp_hash*/ - (ternaryfunc)0, /*tp_call*/ - (reprfunc)0, /*tp_str*/ - - /* Space for future expansion */ - 0L,0L,0L,0L, - Rftype__doc__ /* Documentation string */ -}; - -/* End of code for Resource fork objects */ -/* -------------------------------------------------------- */ - -/*----------------------------------------------------------------------*/ -/* Miscellaneous File System Operations */ - -static char getcrtp_doc[] = "Get MacOS 4-char creator and type for a file"; - -static PyObject * -MacOS_GetCreatorAndType(PyObject *self, PyObject *args) -{ - FSSpec fss; - FInfo info; - PyObject *creator, *type, *res; - OSErr err; - - if (!PyArg_ParseTuple(args, "O&", PyMac_GetFSSpec, &fss)) - return NULL; - if ((err = FSpGetFInfo(&fss, &info)) != noErr) - return PyErr_Mac(MacOS_Error, err); - creator = PyString_FromStringAndSize((char *)&info.fdCreator, 4); - type = PyString_FromStringAndSize((char *)&info.fdType, 4); - res = Py_BuildValue("OO", creator, type); - Py_DECREF(creator); - Py_DECREF(type); - return res; -} - -static char setcrtp_doc[] = "Set MacOS 4-char creator and type for a file"; - -static PyObject * -MacOS_SetCreatorAndType(PyObject *self, PyObject *args) -{ - FSSpec fss; - ResType creator, type; - FInfo info; - OSErr err; - - if (!PyArg_ParseTuple(args, "O&O&O&", - PyMac_GetFSSpec, &fss, PyMac_GetOSType, &creator, PyMac_GetOSType, &type)) - return NULL; - if ((err = FSpGetFInfo(&fss, &info)) != noErr) - return PyErr_Mac(MacOS_Error, err); - info.fdCreator = creator; - info.fdType = type; - if ((err = FSpSetFInfo(&fss, &info)) != noErr) - return PyErr_Mac(MacOS_Error, err); - Py_INCREF(Py_None); - return Py_None; -} - - -static char geterr_doc[] = "Convert OSErr number to string"; - -static PyObject * -MacOS_GetErrorString(PyObject *self, PyObject *args) -{ - int err; - char buf[256]; - Handle h; - char *str; - static int errors_loaded; - - if (!PyArg_ParseTuple(args, "i", &err)) - return NULL; - - h = GetResource('Estr', err); - if (!h && !errors_loaded) { - /* - ** Attempt to open the resource file containing the - ** Estr resources. We ignore all errors. We also try - ** this only once. - */ - PyObject *m, *rv; - errors_loaded = 1; - - m = PyImport_ImportModule("macresource"); - if (!m) { - if (Py_VerboseFlag) - PyErr_Print(); - PyErr_Clear(); - } - else { - rv = PyObject_CallMethod(m, "open_error_resource", ""); - if (!rv) { - if (Py_VerboseFlag) - PyErr_Print(); - PyErr_Clear(); - } - else { - Py_DECREF(rv); - /* And try again... */ - h = GetResource('Estr', err); - } - } - } - /* - ** Whether the code above succeeded or not, we won't try - ** again. - */ - errors_loaded = 1; - - if (h) { - HLock(h); - str = (char *)*h; - memcpy(buf, str+1, (unsigned char)str[0]); - buf[(unsigned char)str[0]] = '\0'; - HUnlock(h); - ReleaseResource(h); - } - else { - PyOS_snprintf(buf, sizeof(buf), "Mac OS error code %d", err); - } - - return Py_BuildValue("s", buf); -} - -static char splash_doc[] = "Open a splash-screen dialog by resource-id (0=close)"; - -static PyObject * -MacOS_splash(PyObject *self, PyObject *args) -{ - int resid = -1; - static DialogPtr curdialog = NULL; - DialogPtr olddialog; - WindowRef theWindow; - CGrafPtr thePort; -#if 0 - short xpos, ypos, width, height, swidth, sheight; -#endif - - if (!PyArg_ParseTuple(args, "|i", &resid)) - return NULL; - olddialog = curdialog; - curdialog = NULL; - - if ( resid != -1 ) { - curdialog = GetNewDialog(resid, NULL, (WindowPtr)-1); - if ( curdialog ) { - theWindow = GetDialogWindow(curdialog); - thePort = GetWindowPort(theWindow); -#if 0 - width = thePort->portRect.right - thePort->portRect.left; - height = thePort->portRect.bottom - thePort->portRect.top; - swidth = qd.screenBits.bounds.right - qd.screenBits.bounds.left; - sheight = qd.screenBits.bounds.bottom - qd.screenBits.bounds.top - LMGetMBarHeight(); - xpos = (swidth-width)/2; - ypos = (sheight-height)/5 + LMGetMBarHeight(); - MoveWindow(theWindow, xpos, ypos, 0); - ShowWindow(theWindow); -#endif - DrawDialog(curdialog); - } - } - if (olddialog) - DisposeDialog(olddialog); - Py_INCREF(Py_None); - return Py_None; -} - -static char DebugStr_doc[] = "Switch to low-level debugger with a message"; - -static PyObject * -MacOS_DebugStr(PyObject *self, PyObject *args) -{ - Str255 message; - PyObject *object = 0; - - if (!PyArg_ParseTuple(args, "O&|O", PyMac_GetStr255, message, &object)) - return NULL; - DebugStr(message); - Py_INCREF(Py_None); - return Py_None; -} - -static char SysBeep_doc[] = "BEEEEEP!!!"; - -static PyObject * -MacOS_SysBeep(PyObject *self, PyObject *args) -{ - int duration = 6; - - if (!PyArg_ParseTuple(args, "|i", &duration)) - return NULL; - SysBeep(duration); - Py_INCREF(Py_None); - return Py_None; -} - -static char WMAvailable_doc[] = - "True if this process can interact with the display." - "Will foreground the application on the first call as a side-effect." - ; - -static PyObject * -MacOS_WMAvailable(PyObject *self, PyObject *args) -{ - static PyObject *rv = NULL; - - if (!PyArg_ParseTuple(args, "")) - return NULL; - if (!rv) { - ProcessSerialNumber psn; - - /* - ** This is a fairly innocuous call to make if we don't have a window - ** manager, or if we have no permission to talk to it. It will print - ** a message on stderr, but at least it won't abort the process. - ** It appears the function caches the result itself, and it's cheap, so - ** no need for us to cache. - */ -#ifdef kCGNullDirectDisplay - /* On 10.1 CGMainDisplayID() isn't available, and - ** kCGNullDirectDisplay isn't defined. - */ - if (CGMainDisplayID() == 0) { - rv = Py_False; - } else { -#else - { -#endif - if (GetCurrentProcess(&psn) < 0 || - SetFrontProcess(&psn) < 0) { - rv = Py_False; - } else { - rv = Py_True; - } - } - } - Py_INCREF(rv); - return rv; -} - -static char GetTicks_doc[] = "Return number of ticks since bootup"; - -static PyObject * -MacOS_GetTicks(PyObject *self, PyObject *args) -{ - return Py_BuildValue("i", (int)TickCount()); -} - -static char openrf_doc[] = "Open resource fork of a file"; - -static PyObject * -MacOS_openrf(PyObject *self, PyObject *args) -{ - OSErr err; - char *mode = "r"; - FSSpec fss; - SignedByte permission = 1; - rfobject *fp; - - if (!PyArg_ParseTuple(args, "O&|s", PyMac_GetFSSpec, &fss, &mode)) - return NULL; - while (*mode) { - switch (*mode++) { - case '*': break; - case 'r': permission = 1; break; - case 'w': permission = 2; break; - case 'b': break; - default: - PyErr_BadArgument(); - return NULL; - } - } - - if ( (fp = newrfobject()) == NULL ) - return NULL; - - err = HOpenRF(fss.vRefNum, fss.parID, fss.name, permission, &fp->fRefNum); - - if ( err == fnfErr ) { - /* In stead of doing complicated things here to get creator/type - ** correct we let the standard i/o library handle it - */ - FILE *tfp; - char pathname[PATHNAMELEN]; - - if ( (err=PyMac_GetFullPathname(&fss, pathname, PATHNAMELEN)) ) { - PyMac_Error(err); - Py_DECREF(fp); - return NULL; - } - - if ( (tfp = fopen(pathname, "w")) == NULL ) { - PyMac_Error(fnfErr); /* What else... */ - Py_DECREF(fp); - return NULL; - } - fclose(tfp); - err = HOpenRF(fss.vRefNum, fss.parID, fss.name, permission, &fp->fRefNum); - } - if ( err ) { - Py_DECREF(fp); - PyMac_Error(err); - return NULL; - } - fp->isclosed = 0; - return (PyObject *)fp; -} - - -static PyMethodDef MacOS_Methods[] = { - {"GetCreatorAndType", MacOS_GetCreatorAndType, 1, getcrtp_doc}, - {"SetCreatorAndType", MacOS_SetCreatorAndType, 1, setcrtp_doc}, - {"GetErrorString", MacOS_GetErrorString, 1, geterr_doc}, - {"openrf", MacOS_openrf, 1, openrf_doc}, - {"splash", MacOS_splash, 1, splash_doc}, - {"DebugStr", MacOS_DebugStr, 1, DebugStr_doc}, - {"GetTicks", MacOS_GetTicks, 1, GetTicks_doc}, - {"SysBeep", MacOS_SysBeep, 1, SysBeep_doc}, - {"WMAvailable", MacOS_WMAvailable, 1, WMAvailable_doc}, - {NULL, NULL} /* Sentinel */ -}; - - -void -initMacOS(void) -{ - PyObject *m, *d; - - m = Py_InitModule("MacOS", MacOS_Methods); - d = PyModule_GetDict(m); - - /* Initialize MacOS.Error exception */ - MacOS_Error = PyMac_GetOSErrException(); - if (MacOS_Error == NULL || PyDict_SetItemString(d, "Error", MacOS_Error) != 0) - return; - Rftype.ob_type = &PyType_Type; - Py_INCREF(&Rftype); - if (PyDict_SetItemString(d, "ResourceForkType", (PyObject *)&Rftype) != 0) - return; - /* - ** This is a hack: the following constant added to the id() of a string - ** object gives you the address of the data. Unfortunately, it is needed for - ** some of the image and sound processing interfaces on the mac:-( - */ - { - PyStringObject *p = 0; - long off = (long)&(p->ob_sval[0]); - - if( PyDict_SetItemString(d, "string_id_to_buffer", Py_BuildValue("i", off)) != 0) - return; - } -#define PY_RUNTIMEMODEL "macho" - if (PyDict_SetItemString(d, "runtimemodel", - Py_BuildValue("s", PY_RUNTIMEMODEL)) != 0) - return; -#if defined(WITH_NEXT_FRAMEWORK) -#define PY_LINKMODEL "framework" -#elif defined(Py_ENABLE_SHARED) -#define PY_LINKMODEL "shared" -#else -#define PY_LINKMODEL "static" -#endif - if (PyDict_SetItemString(d, "linkmodel", - Py_BuildValue("s", PY_LINKMODEL)) != 0) - return; - -} Modified: python/branches/bcannon-sandboxing/Mac/PythonLauncher/FileSettings.m ============================================================================== --- python/branches/bcannon-sandboxing/Mac/PythonLauncher/FileSettings.m (original) +++ python/branches/bcannon-sandboxing/Mac/PythonLauncher/FileSettings.m Wed Aug 2 00:51:44 2006 @@ -245,12 +245,26 @@ if (value) with_terminal = [value boolValue]; } +- (NSString*)_replaceSingleQuotes: (NSString*)string +{ + /* Replace all single-quotes by '"'"', that way shellquoting will + * be correct when the result value is delimited using single quotes. + */ + NSArray* components = [string componentsSeparatedByString:@"'"]; + + return [components componentsJoinedByString:@"'\"'\"'"]; +} + - (NSString *)commandLineForScript: (NSString *)script { NSString *cur_interp = NULL; + NSString* script_dir = NULL; char hashbangbuf[1024]; FILE *fp; char *p; + + script_dir = [script substringToIndex: + [script length]-[[script lastPathComponent] length]]; if (honourhashbang && (fp=fopen([script cString], "r")) && @@ -266,8 +280,9 @@ cur_interp = interpreter; return [NSString stringWithFormat: - @"\"%@\"%s%s%s%s%s%s %@ \"%@\" %@ %s", - cur_interp, + @"cd '%@' && '%@'%s%s%s%s%s%s %@ '%@' %@ %s", + [self _replaceSingleQuotes:script_dir], + [self _replaceSingleQuotes:cur_interp], debug?" -d":"", verbose?" -v":"", inspect?" -i":"", @@ -275,7 +290,7 @@ nosite?" -S":"", tabs?" -t":"", others, - script, + [self _replaceSingleQuotes:script], scriptargs, with_terminal? "&& echo Exit status: $? && exit 1" : " &"]; } Modified: python/branches/bcannon-sandboxing/Makefile.pre.in ============================================================================== --- python/branches/bcannon-sandboxing/Makefile.pre.in (original) +++ python/branches/bcannon-sandboxing/Makefile.pre.in Wed Aug 2 00:51:44 2006 @@ -318,6 +318,7 @@ ########################################################################## # objects that get linked into the Python library LIBRARY_OBJS= \ + Modules/_typesmodule.o \ Modules/getbuildinfo.o \ $(PARSER_OBJS) \ $(OBJECT_OBJS) \ @@ -354,6 +355,7 @@ $(LIBRARY): $(LIBRARY_OBJS) -rm -f $@ $(AR) cr $@ Modules/getbuildinfo.o + $(AR) cr $@ Modules/_typesmodule.o $(AR) cr $@ $(PARSER_OBJS) $(AR) cr $@ $(OBJECT_OBJS) $(AR) cr $@ $(PYTHON_OBJS) @@ -486,7 +488,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES) $(ASDLGEN) -c $(AST_C_DIR) $(AST_ASDL) - + Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H) Python/getplatform.o: $(srcdir)/Python/getplatform.c @@ -650,6 +652,7 @@ else true; \ fi (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)) + (cd $(DESTDIR)$(BINDIR); $(LN) -sf python$(VERSION)-config python-config) # Install the interpreter with $(VERSION) affixed # This goes into $(exec_prefix) @@ -693,7 +696,7 @@ EXTRAPLATDIR= @EXTRAPLATDIR@ EXTRAMACHDEPPATH=@EXTRAMACHDEPPATH@ MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR) -XMLLIBSUBDIRS= xmlcore xmlcore/dom xmlcore/etree xmlcore/parsers xmlcore/sax +XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \ plat-mac/lib-scriptpackages/_builtinSuites \ plat-mac/lib-scriptpackages/CodeWarrior \ @@ -850,8 +853,8 @@ $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh # Substitution happens here, as the completely-expanded BINDIR # is not available in configure - sed -e "s, at BINDIR@,$(BINDIR)," < $(srcdir)/Misc/python-config.in >python-config - $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python-config + sed -e "s, at EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config + $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config rm python-config @if [ -s Modules/python.exp -a \ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \ @@ -935,7 +938,7 @@ # Install a number of symlinks to keep software that expects a normal unix # install (which includes python-config) happy. frameworkinstallmaclib: - ln -s "../../../Python" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a" + ln -fs "../../../Python" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a" cd Mac && $(MAKE) installmacsubtree DESTDIR="$(DESTDIR)" # This installs the IDE, the Launcher and other apps into /Applications Modified: python/branches/bcannon-sandboxing/Misc/ACKS ============================================================================== --- python/branches/bcannon-sandboxing/Misc/ACKS (original) +++ python/branches/bcannon-sandboxing/Misc/ACKS Wed Aug 2 00:51:44 2006 @@ -203,6 +203,7 @@ Russell Finn Nils Fischbeck Frederik Fix +Matt Fleming Hernán Martínez Foffani Doug Fort John Fouhy @@ -623,6 +624,7 @@ John Tromp Jason Trowbridge Anthony Tuininga +Christopher Tur Lesniewski-Laas Stephen Turner Bill Tutt Doobee R. Tzeck Modified: python/branches/bcannon-sandboxing/Misc/NEWS ============================================================================== --- python/branches/bcannon-sandboxing/Misc/NEWS (original) +++ python/branches/bcannon-sandboxing/Misc/NEWS Wed Aug 2 00:51:44 2006 @@ -4,14 +4,213 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 2.5 beta 3? +================================ + +*Release date: XX-AUG-2006* + +Core and builtins +----------------- + +- Bug #1515471: string.replace() accepts character buffers again. + +- Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn(). + This provides the proper warning for struct.pack(). + PyErr_Warn() is now deprecated in favor of PyErr_WarnEx(). + +- Patch #1531113: Fix augmented assignment with yield expressions. + Also fix a SystemError when trying to assign to yield expressions. + +- Bug #1529871: The speed enhancement patch #921466 broke Python's compliance + with PEP 302. This was fixed by adding an ``imp.NullImporter`` type that is + used in ``sys.path_importer_cache`` to cache non-directory paths and avoid + excessive filesystem operations during imports. + +- Bug #1521947: When checking for overflow, ``PyOS_strtol()`` used some + operations on signed longs that are formally undefined by C. + Unfortunately, at least one compiler now cares about that, so complicated + the code to make that compiler happy again. + +- Bug #1524310: Properly report errors from FindNextFile in os.listdir. + +- Patch #1232023: Stop including current directory in search + path on Windows. + +- Fix some potential crashes found with failmalloc. + +- Fix warnings reported by Klocwork's static analysis tool. + +- Bug #1512814, Fix incorrect lineno's when code within a function + had more than 255 blank lines. + +- Patch #1521179: Python now accepts the standard options ``--help`` and + ``--version`` as well as ``/?`` on Windows. + +- Bug #1520864: unpacking singleton tuples in a 'for' loop (for x, in) works + again. Fixing this problem required changing the .pyc magic number. + This means that .pyc files generated before 2.5c1 will be regenerated. + +- Bug #1524317: Compiling Python ``--without-threads`` failed. + The Python core compiles again then, and, in a build without threads, the + new ``sys._current_frames()`` returns a dictionary with one entry, + mapping the faux "thread id" 0 to the current frame. + +- Bug #1525447: build on MacOS X on a case-sensitive filesystem. + + +Library +------- + +- os.urandom no longer masks unrelated exceptions like SystemExit or + KeyboardInterrupt. + +- Bug #1525866: Don't copy directory stat times in + shutil.copytree on Windows + +- Bug #1002398: The documentation for os.path.sameopenfile now correctly + refers to file descriptors, not file objects. + +- Rename of the xml package to xmlcore, and the import hackery done to + make it appear at both names, has been removed. Bug #1511497, + #1513611, and probably others. + +- Bug #1441397: The compiler module now recognizes module and function + docstrings correctly as it did in Python 2.4. + +- Bug #1529297: The rewrite of doctest for Python 2.4 unintentionally + lost that tests are sorted by name before being run. This rarely + matters for well-written tests, but can create baffling symptoms if + side effects from one test to the next affect outcomes. ``DocTestFinder`` + has been changed to sort the list of tests it returns. + +- The distutils version has been changed to 2.5.0, and are now kept + in sync with sys.version_info[:3]. + +- Bug #978833: Really close underlying socket in _socketobject.close. + +- Bug #1459963: urllib and urllib2 now normalize HTTP header names correctly + with title(). + +- Patch #1525766: In pkgutil.walk_packages, correctly pass the onerror callback + to recursive calls and call it with the failing package name. + +- Bug #1525817: Don't truncate short lines in IDLE's tool tips. + +- Patch #1515343: Fix printing of deprecated string exceptions with a + value in the traceback module. + +- Resync optparse with Optik 1.5.3: minor tweaks for/to tests. + +- Patch #1524429: Use repr() instead of backticks in Tkinter again. + +- Bug #1520914: Change time.strftime() to accept a zero for any position in its + argument tuple. For arguments where zero is illegal, the value is forced to + the minimum value that is correct. This is to support an undocumented but + common way people used to fill in inconsequential information in the time + tuple pre-2.4. + +- Patch #1220874: Update the binhex module for Mach-O. + +- The email package has improved RFC 2231 support, specifically for + recognizing the difference between encoded (name*0*=) and non-encoded + (name*0=) parameter continuations. This may change the types of + values returned from email.message.Message.get_param() and friends. + Specifically in some cases where non-encoded continuations were used, + get_param() used to return a 3-tuple of (None, None, string) whereas now it + will just return the string (since non-encoded continuations don't have + charset and language parts). + + Also, whereas % values were decoded in all parameter continuations, they are + now only decoded in encoded parameter parts. + +- Bug #1517990: IDLE keybindings on MacOS X now work correctly + +- Bug #1517996: IDLE now longer shows the default Tk menu when a + path browser, class browser or debugger is the frontmost window on MacOS X + +- Patch #1520294: Support for getset and member descriptors in types.py, + inspect.py, and pydoc.py. Specifically, this allows for querying the type + of an object against these built-in types and more importantly, for getting + their docstrings printed in the interactive interpreter's help() function. + + +Extension Modules +----------------- + +- Patch #1529514: The _ctypes extension is now compiled on more + openbsd target platforms. + +- The ``__reduce__()`` method of the new ``collections.defaultdict`` had + a memory leak, affecting pickles and deep copies. + +- Bug #1471938: Fix curses module build problem on Solaris 8; patch by + Paul Eggert. + +- Patch #1448199: Release interpreter lock in _winreg.ConnectRegistry. + +- Patch #1521817: Index range checking on ctypes arrays containing + exactly one element enabled again. This allows iterating over these + arrays, without the need to check the array size before. + +- Bug #1521375: When the code in ctypes.util.find_library was + run with root privileges, it could overwrite or delete + /dev/null in certain cases; this is now fixed. + +- Bug #1467450: On Mac OS X 10.3, RTLD_GLOBAL is now used as the + default mode for loading shared libraries in ctypes. + +- Because of a misspelled preprocessor symbol, ctypes was always + compiled without thread support; this is now fixed. + +- pybsddb Bug #1527939: bsddb module DBEnv dbremove and dbrename + methods now allow their database parameter to be None as the + sleepycat API allows. + +- Bug #1526460: Fix socketmodule compile on NetBSD as it has a different + bluetooth API compared with Linux and FreeBSD. + +Tests +----- + +- Bug #1501330: Change test_ossaudiodev to be much more tolerant in terms of + how long the test file should take to play. Now accepts taking 2.93 secs + (exact time) +/- 10% instead of the hard-coded 3.1 sec. + +- Patch #1529686: The standard tests ``test_defaultdict``, ``test_iterlen``, + ``test_uuid`` and ``test_email_codecs`` didn't actually run any tests when + run via ``regrtest.py``. Now they do. + +Build +----- + +- Bug #1439538: Drop usage of test -e in configure as it is not portable. + +Mac +--- + +- PythonLauncher now works correctly when the path to the script contains + characters that are treated specially by the shell (such as quotes). + +- Bug #1527397: PythonLauncher now launches scripts with the working directory + set to the directory that contains the script instead of the user home + directory. That latter was an implementation accident and not what users + expect. + + What's New in Python 2.5 beta 2? ================================ -*Release date: XX-JUL-2006* +*Release date: 11-JUL-2006* Core and builtins ----------------- +- Bug #1441486: The literal representation of -(sys.maxint - 1) + again evaluates to a int object, not a long. + +- Bug #1501934: The scope of global variables that are locally assigned + using augmented assignment is now correctly determined. + - Bug #927248: Recursive method-wrapper objects can now safely be released. @@ -22,9 +221,37 @@ omit a default "error" argument for NULL pointer. This allows the parser to take a codec from cjkcodecs again. +- Bug #1519018: 'as' is now validated properly in import statements. + +- On 64 bit systems, int literals that use less than 64 bits are + now ints rather than longs. + +- Bug #1512814, Fix incorrect lineno's when code at module scope + started after line 256. + +- New function ``sys._current_frames()`` returns a dict mapping thread + id to topmost thread stack frame. This is for expert use, and is + especially useful for debugging application deadlocks. The functionality + was previously available in Fazal Majid's ``threadframe`` extension + module, but it wasn't possible to do this in a wholly threadsafe way from + an extension. + Library ------- +- Bug #1257728: Mention Cygwin in distutils error message about a missing + VS 2003. + +- Patch #1519566: Update turtle demo, make begin_fill idempotent. + +- Bug #1508010: msvccompiler now requires the DISTUTILS_USE_SDK + environment variable to be set in order to the SDK environment + for finding the compiler, include files, etc. + +- Bug #1515998: Properly generate logical ids for files in bdist_msi. + +- warnings.py now ignores ImportWarning by default + - string.Template() now correctly handles tuple-values. Previously, multi-value tuples would raise an exception and single-value tuples would be treated as the value they contain, instead. @@ -47,9 +274,6 @@ - Bug #1513223: .close() of a _socketobj now releases the underlying socket again, which then gets closed as it becomes unreferenced. -- The '_ctypes' extension module now works when Python is configured - with the --without-threads option. - - Bug #1504333: Make sgmllib support angle brackets in quoted attribute values. @@ -77,15 +301,52 @@ Extension Modules ----------------- +- #1494314: Fix a regression with high-numbered sockets in 2.4.3. This + means that select() on sockets > FD_SETSIZE (typically 1024) work again. + The patch makes sockets use poll() internally where available. + +- Assigning None to pointer type fields in ctypes structures possible + overwrote the wrong fields, this is fixed now. + +- Fixed a segfault in _ctypes when ctypes.wintypes were imported + on non-Windows platforms. + +- Bug #1518190: The ctypes.c_void_p constructor now accepts any + integer or long, without range checking. + +- Patch #1517790: It is now possible to use custom objects in the ctypes + foreign function argtypes sequence as long as they provide a from_param + method, no longer is it required that the object is a ctypes type. + +- The '_ctypes' extension module now works when Python is configured + with the --without-threads option. + - Bug #1513646: os.access on Windows now correctly determines write access, again. - Bug #1512695: cPickle.loads could crash if it was interrupted with a KeyboardInterrupt. +- Bug #1296433: parsing XML with a non-default encoding and + a CharacterDataHandler could crash the interpreter in pyexpat. + +- Patch #1516912: improve Modules support for OpenVMS. + Build ----- +- Automate Windows build process for the Win64 SSL module. + +- 'configure' now detects the zlib library the same way as distutils. + Previously, the slight difference could cause compilation errors of the + 'zlib' module on systems with more than one version of zlib. + +- The MSI compileall step was fixed to also support a TARGETDIR + with spaces in it. + +- Bug #1517388: sqlite3.dll is now installed on Windows independent + of Tcl/Tk. + - Bug #1513032: 'make install' failed on FreeBSD 5.3 due to lib-old trying to be installed even though it's empty. @@ -98,8 +359,12 @@ Documentation ------------- +- Cover ImportWarning, PendingDeprecationWarning and simplefilter() in the + documentation for the warnings module. + - Patch #1509163: MS Toolkit Compiler no longer available. +- Patch #1504046: Add documentation for xml.etree. What's New in Python 2.5 beta 1? ================================ @@ -476,6 +741,10 @@ Library ------- +- Bug #1223937: subprocess.CalledProcessError reports the exit status + of the process using the returncode attribute, instead of + abusing errno. + - Patch #1475231: ``doctest`` has a new ``SKIP`` option, which causes a doctest to be skipped (the code is not run, and the expected output or exception is ignored). @@ -1094,6 +1363,10 @@ Library ------- +- Patch #1388073: Numerous __-prefixed attributes of unittest.TestCase have + been renamed to have only a single underscore prefix. This was done to + make subclassing easier. + - PEP 338: new module runpy defines a run_module function to support executing modules which provide access to source code or a code object via the PEP 302 import mechanisms. @@ -1409,8 +1682,8 @@ - Bug #792570: SimpleXMLRPCServer had problems if the request grew too large. Fixed by reading the HTTP body in chunks instead of one big socket.read(). -- Patches #893642, #1039083: add allow_none, encoding arguments to constructors of - SimpleXMLRPCServer and CGIXMLRPCRequestHandler. +- Patches #893642, #1039083: add allow_none, encoding arguments to + constructors of SimpleXMLRPCServer and CGIXMLRPCRequestHandler. - Bug #1110478: Revert os.environ.update to do putenv again. Modified: python/branches/bcannon-sandboxing/Misc/RPM/python-2.5.spec ============================================================================== --- python/branches/bcannon-sandboxing/Misc/RPM/python-2.5.spec (original) +++ python/branches/bcannon-sandboxing/Misc/RPM/python-2.5.spec Wed Aug 2 00:51:44 2006 @@ -33,7 +33,7 @@ ################################# %define name python -%define version 2.5a2 +%define version 2.5b2 %define libvers 2.5 %define release 1pydotorg %define __prefix /usr Modified: python/branches/bcannon-sandboxing/Misc/build.sh ============================================================================== --- python/branches/bcannon-sandboxing/Misc/build.sh (original) +++ python/branches/bcannon-sandboxing/Misc/build.sh Wed Aug 2 00:51:44 2006 @@ -161,6 +161,10 @@ make install >& build/$F update_status "Installing" "$F" $start + if [ ! -x $PYTHON ]; then + ln -s ${PYTHON}2.* $PYTHON + fi + ## make and run basic tests F=make-test.out start=`current_time` Modified: python/branches/bcannon-sandboxing/Misc/python-config.in ============================================================================== --- python/branches/bcannon-sandboxing/Misc/python-config.in (original) +++ python/branches/bcannon-sandboxing/Misc/python-config.in Wed Aug 2 00:51:44 2006 @@ -1,4 +1,4 @@ -#!@BINDIR@/python +#!@EXENAME@ import sys import os @@ -36,13 +36,14 @@ print sysconfig.EXEC_PREFIX elif opt in ('--includes', '--cflags'): - flags = ['-I'+dir for dir in getvar('INCLDIRSTOMAKE').split()] + flags = ['-I' + sysconfig.get_python_inc(), + '-I' + sysconfig.get_python_inc(plat_specific=True)] if opt == '--cflags': flags.extend(getvar('CFLAGS').split()) print ' '.join(flags) elif opt in ('--libs', '--ldflags'): - libs = sysconfig.get_config_var('LIBS').split() + libs = getvar('LIBS').split() + getvar('SYSLIBS').split() libs.append('-lpython'+pyver) if opt == '--ldflags': libs.insert(0, '-L' + getvar('LIBPL')) Modified: python/branches/bcannon-sandboxing/Modules/_bsddb.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_bsddb.c (original) +++ python/branches/bcannon-sandboxing/Modules/_bsddb.c Wed Aug 2 00:51:44 2006 @@ -98,7 +98,7 @@ #error "eek! DBVER can't handle minor versions > 9" #endif -#define PY_BSDDB_VERSION "4.4.4" +#define PY_BSDDB_VERSION "4.4.5" static char *rcs_id = "$Id$"; @@ -528,6 +528,7 @@ PyObject *errObj = NULL; PyObject *errTuple = NULL; int exceptionRaised = 0; + unsigned int bytes_left; switch (err) { case 0: /* successful, no error */ break; @@ -535,12 +536,15 @@ #if (DBVER < 41) case DB_INCOMPLETE: #if INCOMPLETE_IS_WARNING - our_strlcpy(errTxt, db_strerror(err), sizeof(errTxt)); - if (_db_errmsg[0]) { + bytes_left = our_strlcpy(errTxt, db_strerror(err), sizeof(errTxt)); + /* Ensure that bytes_left never goes negative */ + if (_db_errmsg[0] && bytes_left < (sizeof(errTxt) - 4)) { + bytes_left = sizeof(errTxt) - bytes_left - 4 - 1; + assert(bytes_left >= 0); strcat(errTxt, " -- "); - strcat(errTxt, _db_errmsg); - _db_errmsg[0] = 0; + strncat(errTxt, _db_errmsg, bytes_left); } + _db_errmsg[0] = 0; #ifdef HAVE_WARNINGS exceptionRaised = PyErr_Warn(PyExc_RuntimeWarning, errTxt); #else @@ -588,12 +592,15 @@ } if (errObj != NULL) { - our_strlcpy(errTxt, db_strerror(err), sizeof(errTxt)); - if (_db_errmsg[0]) { + bytes_left = our_strlcpy(errTxt, db_strerror(err), sizeof(errTxt)); + /* Ensure that bytes_left never goes negative */ + if (_db_errmsg[0] && bytes_left < (sizeof(errTxt) - 4)) { + bytes_left = sizeof(errTxt) - bytes_left - 4 - 1; + assert(bytes_left >= 0); strcat(errTxt, " -- "); - strcat(errTxt, _db_errmsg); - _db_errmsg[0] = 0; + strncat(errTxt, _db_errmsg, bytes_left); } + _db_errmsg[0] = 0; errTuple = Py_BuildValue("(is)", err, errTxt); PyErr_SetObject(errObj, errTuple); @@ -798,10 +805,12 @@ MYDB_BEGIN_ALLOW_THREADS; err = db_create(&self->db, db_env, flags); - self->db->set_errcall(self->db, _db_errorCallback); + if (self->db != NULL) { + self->db->set_errcall(self->db, _db_errorCallback); #if (DBVER >= 33) - self->db->app_private = (void*)self; + self->db->app_private = (void*)self; #endif + } MYDB_END_ALLOW_THREADS; /* TODO add a weakref(self) to the self->myenvobj->open_child_weakrefs * list so that a DBEnv can refuse to close without aborting any open @@ -3867,7 +3876,7 @@ static char* kwnames[] = { "file", "database", "txn", "flags", NULL }; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ss|Oi:dbremove", kwnames, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|zOi:dbremove", kwnames, &file, &database, &txnobj, &flags)) { return NULL; } @@ -3895,7 +3904,7 @@ static char* kwnames[] = { "file", "database", "newname", "txn", "flags", NULL }; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "sss|Oi:dbrename", kwnames, + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "szs|Oi:dbrename", kwnames, &file, &database, &newname, &txnobj, &flags)) { return NULL; } Modified: python/branches/bcannon-sandboxing/Modules/_ctypes/_ctypes.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_ctypes/_ctypes.c (original) +++ python/branches/bcannon-sandboxing/Modules/_ctypes/_ctypes.c Wed Aug 2 00:51:44 2006 @@ -1384,13 +1384,20 @@ Py_DECREF(result); return NULL; } + fmt = getentry(PyString_AS_STRING(proto)); + if (fmt == NULL) { + Py_DECREF(result); + PyErr_Format(PyExc_ValueError, + "_type_ '%s' not supported", + PyString_AS_STRING(proto)); + return NULL; + } + stgdict = (StgDictObject *)PyObject_CallObject( (PyObject *)&StgDict_Type, NULL); if (!stgdict) return NULL; - fmt = getentry(PyString_AS_STRING(proto)); - stgdict->ffi_type_pointer = *fmt->pffi_type; stgdict->align = fmt->pffi_type->alignment; stgdict->length = 0; @@ -1633,9 +1640,8 @@ for (i = 0; i < nArgs; ++i) { PyObject *tp = PyTuple_GET_ITEM(ob, i); - StgDictObject *dict = PyType_stgdict(tp); PyObject *cnv = PyObject_GetAttrString(tp, "from_param"); - if (!dict || !cnv) + if (!cnv) goto argtypes_error_1; PyTuple_SET_ITEM(converters, i, cnv); } @@ -1646,7 +1652,7 @@ Py_XDECREF(converters); Py_DECREF(ob); PyErr_Format(PyExc_TypeError, - "item %d in _argtypes_ is not a valid C type", i+1); + "item %d in _argtypes_ has no from_param method", i+1); return NULL; } @@ -2181,7 +2187,7 @@ Py_DECREF(ob); return result; } else if (value == Py_None && PointerTypeObject_Check(type)) { - *(void **)dst->b_ptr = NULL; + *(void **)ptr = NULL; Py_INCREF(Py_None); return Py_None; } else { @@ -3567,7 +3573,8 @@ int offset, size; StgDictObject *stgdict; - if (self->b_length == 0 || index < 0 || (self->b_length > 1 && index >= self->b_length)) { + + if (index < 0 || index >= self->b_length) { PyErr_SetString(PyExc_IndexError, "invalid index"); return NULL; @@ -3596,11 +3603,11 @@ if (ilow < 0) ilow = 0; - else if (ilow > self->b_length && self->b_length != 1) + else if (ilow > self->b_length) ilow = self->b_length; if (ihigh < ilow) ihigh = ilow; - else if (ihigh > self->b_length && self->b_length != 1) + else if (ihigh > self->b_length) ihigh = self->b_length; len = ihigh - ilow; @@ -3643,8 +3650,7 @@ } stgdict = PyObject_stgdict((PyObject *)self); - if (self->b_length == 0 || index < 0 - || (self->b_length > 1 && index >= self->b_length)) { + if (index < 0 || index >= stgdict->length) { PyErr_SetString(PyExc_IndexError, "invalid index"); return -1; @@ -3671,19 +3677,17 @@ if (ilow < 0) ilow = 0; - else if (ilow > self->b_length && self->b_length != 1) + else if (ilow > self->b_length) ilow = self->b_length; - if (ihigh < 0) ihigh = 0; - if (ihigh < ilow) ihigh = ilow; - else if (ihigh > self->b_length && self->b_length != 1) + else if (ihigh > self->b_length) ihigh = self->b_length; len = PySequence_Length(value); - if (self->b_length != 1 && len != ihigh - ilow) { + if (len != ihigh - ilow) { PyErr_SetString(PyExc_ValueError, "Can only assign sequence of same size"); return -1; @@ -4517,23 +4521,30 @@ if (obj->b_objects == Py_None) { Py_DECREF(Py_None); obj->b_objects = PyDict_New(); + if (obj->b_objects == NULL) + goto failed; } - Py_INCREF(obj->b_objects); result->b_objects = obj->b_objects; if (result->b_objects) { - PyObject *index = PyLong_FromVoidPtr((void *)src); + PyObject *index; int rc; + Py_INCREF(obj->b_objects); + index = PyLong_FromVoidPtr((void *)src); if (index == NULL) - return NULL; + goto failed; rc = PyDict_SetItem(result->b_objects, index, src); Py_DECREF(index); if (rc == -1) - return NULL; + goto failed; } } /* Should we assert that result is a pointer type? */ memcpy(result->b_ptr, &ptr, sizeof(void *)); return (PyObject *)result; + + failed: + Py_DECREF(result); + return NULL; } #ifdef CTYPES_UNICODE @@ -4555,7 +4566,7 @@ ob_type is the metatype (the 'type'), defaults to PyType_Type, tp_base is the base type, defaults to 'object' aka PyBaseObject_Type. */ -#ifdef WITH_THREADS +#ifdef WITH_THREAD PyEval_InitThreads(); #endif m = Py_InitModule3("_ctypes", module_methods, module_docs); @@ -4667,7 +4678,7 @@ #endif PyModule_AddObject(m, "FUNCFLAG_CDECL", PyInt_FromLong(FUNCFLAG_CDECL)); PyModule_AddObject(m, "FUNCFLAG_PYTHONAPI", PyInt_FromLong(FUNCFLAG_PYTHONAPI)); - PyModule_AddStringConstant(m, "__version__", "0.9.9.7"); + PyModule_AddStringConstant(m, "__version__", "1.0.0"); PyModule_AddObject(m, "_memmove_addr", PyLong_FromVoidPtr(memmove)); PyModule_AddObject(m, "_memset_addr", PyLong_FromVoidPtr(memset)); @@ -4705,13 +4716,14 @@ } /***************************************************************** - * replacements for broken Python api functions + * replacements for broken Python api functions (in Python 2.3). + * See #1047269 Buffer overwrite in PyUnicode_AsWideChar */ #ifdef HAVE_WCHAR_H PyObject *My_PyUnicode_FromWideChar(register const wchar_t *w, - int size) + Py_ssize_t size) { PyUnicodeObject *unicode; @@ -4743,7 +4755,7 @@ int My_PyUnicode_AsWideChar(PyUnicodeObject *unicode, register wchar_t *w, - int size) + Py_ssize_t size) { if (unicode == NULL) { PyErr_BadInternalCall(); Modified: python/branches/bcannon-sandboxing/Modules/_ctypes/callbacks.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_ctypes/callbacks.c (original) +++ python/branches/bcannon-sandboxing/Modules/_ctypes/callbacks.c Wed Aug 2 00:51:44 2006 @@ -127,7 +127,7 @@ PyObject *result; PyObject *arglist = NULL; int nArgs; -#ifdef WITH_THREADS +#ifdef WITH_THREAD PyGILState_STATE state = PyGILState_Ensure(); #endif @@ -237,7 +237,7 @@ Py_XDECREF(result); Done: Py_XDECREF(arglist); -#ifdef WITH_THREADS +#ifdef WITH_THREAD PyGILState_Release(state); #endif } @@ -348,7 +348,9 @@ static void LoadPython(void) { if (!Py_IsInitialized()) { +#ifdef WITH_THREAD PyEval_InitThreads(); +#endif Py_Initialize(); } } @@ -400,16 +402,16 @@ LPVOID *ppv) { long result; -#ifdef WITH_THREADS +#ifdef WITH_THREAD PyGILState_STATE state; #endif LoadPython(); -#ifdef WITH_THREADS +#ifdef WITH_THREAD state = PyGILState_Ensure(); #endif result = Call_GetClassObject(rclsid, riid, ppv); -#ifdef WITH_THREADS +#ifdef WITH_THREAD PyGILState_Release(state); #endif return result; @@ -463,11 +465,11 @@ STDAPI DllCanUnloadNow(void) { long result; -#ifdef WITH_THREADS +#ifdef WITH_THREAD PyGILState_STATE state = PyGILState_Ensure(); #endif result = Call_CanUnloadNow(); -#ifdef WITH_THREADS +#ifdef WITH_THREAD PyGILState_Release(state); #endif return result; Modified: python/branches/bcannon-sandboxing/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_ctypes/callproc.c (original) +++ python/branches/bcannon-sandboxing/Modules/_ctypes/callproc.c Wed Aug 2 00:51:44 2006 @@ -617,7 +617,7 @@ void *resmem, int argcount) { -#ifdef WITH_THREADS +#ifdef WITH_THREAD PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */ #endif ffi_cif cif; @@ -651,7 +651,7 @@ return -1; } -#ifdef WITH_THREADS +#ifdef WITH_THREAD if ((flags & FUNCFLAG_PYTHONAPI) == 0) Py_UNBLOCK_THREADS #endif @@ -671,7 +671,7 @@ } #endif #endif -#ifdef WITH_THREADS +#ifdef WITH_THREAD if ((flags & FUNCFLAG_PYTHONAPI) == 0) Py_BLOCK_THREADS #endif @@ -818,7 +818,9 @@ /* We absolutely have to release the GIL during COM method calls, otherwise we may get a deadlock! */ +#ifdef WITH_THREAD Py_BEGIN_ALLOW_THREADS +#endif hr = pIunk->lpVtbl->QueryInterface(pIunk, &IID_ISupportErrorInfo, (void **)&psei); if (FAILED(hr)) @@ -842,22 +844,24 @@ pei->lpVtbl->Release(pei); failed: +#ifdef WITH_THREAD Py_END_ALLOW_THREADS +#endif progid = NULL; ProgIDFromCLSID(&guid, &progid); -/* XXX Is COMError derived from WindowsError or not? */ text = FormatError(errcode); + obj = Py_BuildValue( #ifdef _UNICODE - obj = Py_BuildValue("iu(uuuiu)", + "iu(uuuiu)", #else - obj = Py_BuildValue("is(uuuiu)", + "is(uuuiu)", #endif - errcode, - text, - descr, source, helpfile, helpcontext, - progid); + errcode, + text, + descr, source, helpfile, helpcontext, + progid); if (obj) { PyErr_SetObject(ComError, obj); Py_DECREF(obj); @@ -1156,7 +1160,7 @@ } static char copy_com_pointer_doc[] = -"CopyComPointer(a, b) -> integer\n"; +"CopyComPointer(src, dst) -> HRESULT value\n"; static PyObject * copy_com_pointer(PyObject *self, PyObject *args) @@ -1526,21 +1530,7 @@ return Py_None; } -static PyObject * -uses_seh(PyObject *self, PyObject *args) -{ -#if defined(DONT_USE_SEH) || !defined(MS_WIN32) - Py_INCREF(Py_False); - return Py_False; -#else - Py_INCREF(Py_True); - return Py_True; -#endif -} - PyMethodDef module_methods[] = { - {"uses_seh", uses_seh, METH_NOARGS, - "Return whether ctypes uses Windows structured exception handling"}, {"resize", resize, METH_VARARGS, "Resize the memory buffer of a ctypes instance"}, #ifdef CTYPES_UNICODE {"set_conversion_mode", set_conversion_mode, METH_VARARGS, set_conversion_mode_doc}, Modified: python/branches/bcannon-sandboxing/Modules/_ctypes/cfield.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_ctypes/cfield.c (original) +++ python/branches/bcannon-sandboxing/Modules/_ctypes/cfield.c Wed Aug 2 00:51:44 2006 @@ -124,7 +124,7 @@ self->getfunc = getfunc; self->index = index; - Py_XINCREF(proto); + Py_INCREF(proto); self->proto = proto; switch (fieldtype) { @@ -1486,16 +1486,27 @@ *(void **)ptr = NULL; _RET(value); } - - v = PyLong_AsVoidPtr(value); - if (PyErr_Occurred()) { - /* prevent the SystemError: bad argument to internal function */ - if (!PyInt_Check(value) && !PyLong_Check(value)) { - PyErr_SetString(PyExc_TypeError, - "cannot be converted to pointer"); - } + + if (!PyInt_Check(value) && !PyLong_Check(value)) { + PyErr_SetString(PyExc_TypeError, + "cannot be converted to pointer"); return NULL; } + +#if SIZEOF_VOID_P <= SIZEOF_LONG + v = (void *)PyInt_AsUnsignedLongMask(value); +#else +#ifndef HAVE_LONG_LONG +# error "PyLong_AsVoidPtr: sizeof(void*) > sizeof(long), but no long long" +#elif SIZEOF_LONG_LONG < SIZEOF_VOID_P +# error "PyLong_AsVoidPtr: sizeof(PY_LONG_LONG) < sizeof(void*)" +#endif + v = (void *)PyInt_AsUnsignedLongLongMask(value); +#endif + + if (PyErr_Occurred()) + return NULL; + *(void **)ptr = v; _RET(value); } Modified: python/branches/bcannon-sandboxing/Modules/_ctypes/ctypes.h ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_ctypes/ctypes.h (original) +++ python/branches/bcannon-sandboxing/Modules/_ctypes/ctypes.h Wed Aug 2 00:51:44 2006 @@ -377,8 +377,8 @@ # undef PyUnicode_AsWideChar # define PyUnicode_AsWideChar My_PyUnicode_AsWideChar -extern PyObject *My_PyUnicode_FromWideChar(const wchar_t *, int); -extern int My_PyUnicode_AsWideChar(PyUnicodeObject *, wchar_t *, int); +extern PyObject *My_PyUnicode_FromWideChar(const wchar_t *, Py_ssize_t); +extern int My_PyUnicode_AsWideChar(PyUnicodeObject *, wchar_t *, Py_ssize_t); #endif Modified: python/branches/bcannon-sandboxing/Modules/_ctypes/libffi/configure ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_ctypes/libffi/configure (original) +++ python/branches/bcannon-sandboxing/Modules/_ctypes/libffi/configure Wed Aug 2 00:51:44 2006 @@ -934,7 +934,7 @@ else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd $ac_popdir + cd "$ac_popdir" done fi @@ -1973,8 +1973,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2032,8 +2031,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2149,8 +2147,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2204,8 +2201,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2250,8 +2246,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2295,8 +2290,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2623,8 +2617,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2794,8 +2787,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2862,8 +2854,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3047,8 +3038,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3111,8 +3101,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3290,8 +3279,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3408,8 +3396,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3483,6 +3470,12 @@ TARGETDIR="unknown" case "$host" in +mips*-*-openbsd*) TARGET=MIPS; TARGETDIR=mips;; +sparc-*-openbsd*) TARGET=SPARC; TARGETDIR=sparc;; +sparc64-*-openbsd*) TARGET=SPARC; TARGETDIR=sparc;; +alpha*-*-openbsd*) TARGET=ALPHA; TARGETDIR=alpha;; +m68k-*-openbsd*) TARGET=M68K; TARGETDIR=m68k;; +powerpc-*-openbsd*) TARGET=POWERPC; TARGETDIR=powerpc;; i*86-*-darwin*) TARGET=X86_DARWIN; TARGETDIR=x86;; i*86-*-linux*) TARGET=X86; TARGETDIR=x86;; i*86-*-gnu*) TARGET=X86; TARGETDIR=x86;; @@ -3575,8 +3568,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3777,8 +3769,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3841,8 +3832,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3923,8 +3913,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4065,8 +4054,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4202,8 +4190,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4265,8 +4252,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4306,8 +4292,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4363,8 +4348,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4404,8 +4388,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4469,8 +4452,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4501,10 +4483,8 @@ esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -4616,8 +4596,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4679,8 +4658,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4720,8 +4698,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4777,8 +4754,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4818,8 +4794,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4883,8 +4858,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4915,10 +4889,8 @@ esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -5048,8 +5020,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5091,8 +5062,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5149,8 +5119,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5282,8 +5251,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5349,8 +5317,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6309,11 +6276,6 @@ - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -6352,6 +6314,12 @@ fi;; esac done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub Modified: python/branches/bcannon-sandboxing/Modules/_ctypes/libffi/configure.ac ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_ctypes/libffi/configure.ac (original) +++ python/branches/bcannon-sandboxing/Modules/_ctypes/libffi/configure.ac Wed Aug 2 00:51:44 2006 @@ -21,6 +21,12 @@ TARGETDIR="unknown" case "$host" in +mips*-*-openbsd*) TARGET=MIPS; TARGETDIR=mips;; +sparc-*-openbsd*) TARGET=SPARC; TARGETDIR=sparc;; +sparc64-*-openbsd*) TARGET=SPARC; TARGETDIR=sparc;; +alpha*-*-openbsd*) TARGET=ALPHA; TARGETDIR=alpha;; +m68k-*-openbsd*) TARGET=M68K; TARGETDIR=m68k;; +powerpc-*-openbsd*) TARGET=POWERPC; TARGETDIR=powerpc;; i*86-*-darwin*) TARGET=X86_DARWIN; TARGETDIR=x86;; i*86-*-linux*) TARGET=X86; TARGETDIR=x86;; i*86-*-gnu*) TARGET=X86; TARGETDIR=x86;; Modified: python/branches/bcannon-sandboxing/Modules/_ctypes/stgdict.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_ctypes/stgdict.c (original) +++ python/branches/bcannon-sandboxing/Modules/_ctypes/stgdict.c Wed Aug 2 00:51:44 2006 @@ -134,16 +134,25 @@ type = (PyTypeObject *)obj; if (!PyType_HasFeature(type, Py_TPFLAGS_HAVE_CLASS)) return NULL; - if (!type->tp_dict || !StgDict_Check(type->tp_dict)) + if (!type->tp_dict || !StgDict_CheckExact(type->tp_dict)) return NULL; return (StgDictObject *)type->tp_dict; } /* May return NULL, but does not set an exception! */ +/* + This function should be as fast as possible, so we don't call PyType_stgdict + above but inline the code, and avoid the PyType_Check(). +*/ StgDictObject * PyObject_stgdict(PyObject *self) { - return PyType_stgdict((PyObject *)self->ob_type); + PyTypeObject *type = self->ob_type; + if (!PyType_HasFeature(type, Py_TPFLAGS_HAVE_CLASS)) + return NULL; + if (!type->tp_dict || !StgDict_CheckExact(type->tp_dict)) + return NULL; + return (StgDictObject *)type->tp_dict; } /* descr is the descriptor for a field marked as anonymous. Get all the Modified: python/branches/bcannon-sandboxing/Modules/_cursesmodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_cursesmodule.c (original) +++ python/branches/bcannon-sandboxing/Modules/_cursesmodule.c Wed Aug 2 00:51:44 2006 @@ -43,7 +43,7 @@ del_curterm delscreen dupwin inchnstr inchstr innstr keyok mcprint mvaddchnstr mvaddchstr mvchgat mvcur mvinchnstr mvinchstr mvinnstr mmvwaddchnstr mvwaddchstr mvwchgat - mvwgetnstr mvwinchnstr mvwinchstr mvwinnstr newterm + mvwinchnstr mvwinchstr mvwinnstr newterm restartterm ripoffline scr_dump scr_init scr_restore scr_set scrl set_curterm set_term setterm tgetent tgetflag tgetnum tgetstr tgoto timeout tputs @@ -819,14 +819,17 @@ if (!PyArg_ParseTuple(args,"ii;y,x",&y,&x)) return NULL; Py_BEGIN_ALLOW_THREADS +#ifdef STRICT_SYSV_CURSES + rtn2 = wmove(self->win,y,x)==ERR ? ERR : wgetnstr(self->win, rtn, 1023); +#else rtn2 = mvwgetnstr(self->win,y,x,rtn, 1023); +#endif Py_END_ALLOW_THREADS break; case 3: if (!PyArg_ParseTuple(args,"iii;y,x,n", &y, &x, &n)) return NULL; #ifdef STRICT_SYSV_CURSES - /* Untested */ Py_BEGIN_ALLOW_THREADS rtn2 = wmove(self->win,y,x)==ERR ? ERR : wgetnstr(self->win, rtn, MIN(n, 1023)); @@ -838,7 +841,7 @@ #endif break; default: - PyErr_SetString(PyExc_TypeError, "getstr requires 0 to 2 arguments"); + PyErr_SetString(PyExc_TypeError, "getstr requires 0 to 3 arguments"); return NULL; } if (rtn2 == ERR) Modified: python/branches/bcannon-sandboxing/Modules/_sqlite/cursor.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_sqlite/cursor.c (original) +++ python/branches/bcannon-sandboxing/Modules/_sqlite/cursor.c Wed Aug 2 00:51:44 2006 @@ -621,7 +621,7 @@ } } else { if (PyErr_Occurred()) { - /* there was an error that occured in a user-defined callback */ + /* there was an error that occurred in a user-defined callback */ if (_enable_callback_tracebacks) { PyErr_Print(); } else { Modified: python/branches/bcannon-sandboxing/Modules/_sqlite/util.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_sqlite/util.c (original) +++ python/branches/bcannon-sandboxing/Modules/_sqlite/util.c Wed Aug 2 00:51:44 2006 @@ -38,7 +38,7 @@ /** * Checks the SQLite error code and sets the appropriate DB-API exception. - * Returns the error code (0 means no error occured). + * Returns the error code (0 means no error occurred). */ int _seterror(sqlite3* db) { Modified: python/branches/bcannon-sandboxing/Modules/_sqlite/util.h ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_sqlite/util.h (original) +++ python/branches/bcannon-sandboxing/Modules/_sqlite/util.h Wed Aug 2 00:51:44 2006 @@ -32,7 +32,7 @@ /** * Checks the SQLite error code and sets the appropriate DB-API exception. - * Returns the error code (0 means no error occured). + * Returns the error code (0 means no error occurred). */ int _seterror(sqlite3* db); #endif Modified: python/branches/bcannon-sandboxing/Modules/_ssl.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_ssl.c (original) +++ python/branches/bcannon-sandboxing/Modules/_ssl.c Wed Aug 2 00:51:44 2006 @@ -26,6 +26,12 @@ /* Include symbols from _socket module */ #include "socketmodule.h" +#if defined(HAVE_POLL_H) +#include +#elif defined(HAVE_SYS_POLL_H) +#include +#endif + /* Include OpenSSL header files */ #include "openssl/rsa.h" #include "openssl/crypto.h" @@ -351,7 +357,7 @@ PyObject_Del(self); } -/* If the socket has a timeout, do a select() on the socket. +/* If the socket has a timeout, do a select()/poll() on the socket. The argument writing indicates the direction. Returns one of the possibilities in the timeout_state enum (above). */ @@ -373,6 +379,26 @@ if (s->sock_fd < 0) return SOCKET_HAS_BEEN_CLOSED; + /* Prefer poll, if available, since you can poll() any fd + * which can't be done with select(). */ +#ifdef HAVE_POLL + { + struct pollfd pollfd; + int timeout; + + pollfd.fd = s->sock_fd; + pollfd.events = writing ? POLLOUT : POLLIN; + + /* s->sock_timeout is in seconds, timeout in ms */ + timeout = (int)(s->sock_timeout * 1000 + 0.5); + Py_BEGIN_ALLOW_THREADS + rc = poll(&pollfd, 1, timeout); + Py_END_ALLOW_THREADS + + goto normal_return; + } +#endif + /* Guard against socket too large for select*/ #ifndef Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE if (s->sock_fd >= FD_SETSIZE) @@ -393,6 +419,7 @@ rc = select(s->sock_fd+1, &fds, NULL, NULL, &tv); Py_END_ALLOW_THREADS +normal_return: /* Return SOCKET_TIMED_OUT on timeout, SOCKET_OPERATION_OK otherwise (when we are able to write or when there's something to read) */ return rc == 0 ? SOCKET_HAS_TIMED_OUT : SOCKET_OPERATION_OK; Modified: python/branches/bcannon-sandboxing/Modules/_struct.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_struct.c (original) +++ python/branches/bcannon-sandboxing/Modules/_struct.c Wed Aug 2 00:51:44 2006 @@ -214,6 +214,8 @@ /* Helper routine to get a Python integer and raise the appropriate error if it isn't one */ +#define INT_OVERFLOW "struct integer overflow masking is deprecated" + static int get_wrapped_long(PyObject *v, long *p) { @@ -223,7 +225,7 @@ PyObject *wrapped; long x; PyErr_Clear(); - if (PyErr_Warn(PyExc_DeprecationWarning, "struct integer overflow masking is deprecated") < 0) + if (PyErr_WarnEx(PyExc_DeprecationWarning, INT_OVERFLOW, 2) < 0) return -1; wrapped = PyNumber_And(v, pylong_ulong_mask); if (wrapped == NULL) @@ -250,7 +252,7 @@ wrapped = PyNumber_And(v, pylong_ulong_mask); if (wrapped == NULL) return -1; - if (PyErr_Warn(PyExc_DeprecationWarning, "struct integer overflow masking is deprecated") < 0) { + if (PyErr_WarnEx(PyExc_DeprecationWarning, INT_OVERFLOW, 2) < 0) { Py_DECREF(wrapped); return -1; } @@ -345,8 +347,8 @@ Py_XDECREF(ptraceback); if (msg == NULL) return -1; - rval = PyErr_Warn(PyExc_DeprecationWarning, - PyString_AS_STRING(msg)); + rval = PyErr_WarnEx(PyExc_DeprecationWarning, + PyString_AS_STRING(msg), 2); Py_DECREF(msg); if (rval == 0) return 0; Modified: python/branches/bcannon-sandboxing/Modules/_testcapimodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_testcapimodule.c (original) +++ python/branches/bcannon-sandboxing/Modules/_testcapimodule.c Wed Aug 2 00:51:44 2006 @@ -294,6 +294,16 @@ #endif /* ifdef HAVE_LONG_LONG */ +/* Test tuple argument processing */ +static PyObject * +getargs_tuple(PyObject *self, PyObject *args) +{ + int a, b, c; + if (!PyArg_ParseTuple(args, "i(ii)", &a, &b, &c)) + return NULL; + return Py_BuildValue("iii", a, b, c); +} + /* Functions to call PyArg_ParseTuple with integer format codes, and return the result. */ @@ -707,6 +717,7 @@ {"test_null_strings", (PyCFunction)test_null_strings, METH_NOARGS}, {"test_string_from_format", (PyCFunction)test_string_from_format, METH_NOARGS}, + {"getargs_tuple", getargs_tuple, METH_VARARGS}, {"getargs_b", getargs_b, METH_VARARGS}, {"getargs_B", getargs_B, METH_VARARGS}, {"getargs_H", getargs_H, METH_VARARGS}, Modified: python/branches/bcannon-sandboxing/Modules/_tkinter.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/_tkinter.c (original) +++ python/branches/bcannon-sandboxing/Modules/_tkinter.c Wed Aug 2 00:51:44 2006 @@ -2104,8 +2104,8 @@ data = PyMem_NEW(PythonCmd_ClientData, 1); if (!data) return PyErr_NoMemory(); - Py_XINCREF(self); - Py_XINCREF(func); + Py_INCREF(self); + Py_INCREF(func); data->self = selfptr; data->func = func; Modified: python/branches/bcannon-sandboxing/Modules/bz2module.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/bz2module.c (original) +++ python/branches/bcannon-sandboxing/Modules/bz2module.c Wed Aug 2 00:51:44 2006 @@ -1311,7 +1311,11 @@ break; case 'U': +#ifdef __VMS + self->f_univ_newline = 0; +#else self->f_univ_newline = 1; +#endif break; default: @@ -1344,8 +1348,10 @@ #ifdef WITH_THREAD self->lock = PyThread_allocate_lock(); - if (!self->lock) + if (!self->lock) { + PyErr_SetString(PyExc_MemoryError, "unable to allocate lock"); goto error; + } #endif if (mode_char == 'r') @@ -1367,10 +1373,12 @@ return 0; error: - Py_DECREF(self->file); + Py_CLEAR(self->file); #ifdef WITH_THREAD - if (self->lock) + if (self->lock) { PyThread_free_lock(self->lock); + self->lock = NULL; + } #endif return -1; } @@ -1678,8 +1686,10 @@ #ifdef WITH_THREAD self->lock = PyThread_allocate_lock(); - if (!self->lock) + if (!self->lock) { + PyErr_SetString(PyExc_MemoryError, "unable to allocate lock"); goto error; + } #endif memset(&self->bzs, 0, sizeof(bz_stream)); @@ -1694,8 +1704,10 @@ return 0; error: #ifdef WITH_THREAD - if (self->lock) + if (self->lock) { PyThread_free_lock(self->lock); + self->lock = NULL; + } #endif return -1; } @@ -1890,8 +1902,10 @@ #ifdef WITH_THREAD self->lock = PyThread_allocate_lock(); - if (!self->lock) + if (!self->lock) { + PyErr_SetString(PyExc_MemoryError, "unable to allocate lock"); goto error; + } #endif self->unused_data = PyString_FromString(""); @@ -1911,10 +1925,12 @@ error: #ifdef WITH_THREAD - if (self->lock) + if (self->lock) { PyThread_free_lock(self->lock); + self->lock = NULL; + } #endif - Py_XDECREF(self->unused_data); + Py_CLEAR(self->unused_data); return -1; } Modified: python/branches/bcannon-sandboxing/Modules/cPickle.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/cPickle.c (original) +++ python/branches/bcannon-sandboxing/Modules/cPickle.c Wed Aug 2 00:51:44 2006 @@ -196,7 +196,7 @@ for (i = self->length, p = self->data + clearto; --i >= clearto; p++) { - Py_DECREF(*p); + Py_CLEAR(*p); } self->length = clearto; @@ -208,6 +208,7 @@ { int bigger; size_t nbytes; + PyObject **tmp; bigger = self->size << 1; if (bigger <= 0) /* was 0, or new value overflows */ @@ -217,14 +218,14 @@ nbytes = (size_t)bigger * sizeof(PyObject *); if (nbytes / sizeof(PyObject *) != (size_t)bigger) goto nomemory; - self->data = realloc(self->data, nbytes); - if (self->data == NULL) + tmp = realloc(self->data, nbytes); + if (tmp == NULL) goto nomemory; + self->data = tmp; self->size = bigger; return 0; nomemory: - self->size = 0; PyErr_NoMemory(); return -1; } @@ -2636,7 +2637,7 @@ if (ik >= lm || ik == 0) { PyErr_SetString(PicklingError, "Invalid get data"); - return NULL; + goto err; } if (have_get[ik]) /* with matching get */ rsize += ik < 256 ? 2 : 5; @@ -2648,7 +2649,7 @@ ) { PyErr_SetString(PicklingError, "Unexpected data in internal list"); - return NULL; + goto err; } else { /* put */ @@ -4163,6 +4164,7 @@ int list_len; slice=Pdata_popList(self->stack, x); + if (! slice) return -1; list_len = PyList_GET_SIZE(list); i=PyList_SetSlice(list, list_len, list_len, slice); Py_DECREF(slice); @@ -5167,6 +5169,9 @@ if (!( self->memo = PyDict_New())) goto err; + if (!self->stack) + goto err; + Py_INCREF(f); self->file = f; Modified: python/branches/bcannon-sandboxing/Modules/collectionsmodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/collectionsmodule.c (original) +++ python/branches/bcannon-sandboxing/Modules/collectionsmodule.c Wed Aug 2 00:51:44 2006 @@ -10,7 +10,7 @@ /* The block length may be set to any number over 1. Larger numbers * reduce the number of calls to the memory allocator but take more * memory. Ideally, BLOCKLEN should be set with an eye to the - * length of a cache line. + * length of a cache line. */ #define BLOCKLEN 62 @@ -22,9 +22,9 @@ * element is at d.leftblock[leftindex] and its last element is at * d.rightblock[rightindex]; note that, unlike as for Python slice * indices, these indices are inclusive on both ends. By being inclusive - * on both ends, algorithms for left and right operations become + * on both ends, algorithms for left and right operations become * symmetrical which simplifies the design. - * + * * The list of blocks is never empty, so d.leftblock and d.rightblock * are never equal to NULL. * @@ -37,11 +37,11 @@ * d.leftindex == CENTER+1; and d.rightindex == CENTER. * Checking for d.len == 0 is the intended way to see whether d is empty. * - * Whenever d.leftblock == d.rightblock, + * Whenever d.leftblock == d.rightblock, * d.leftindex + d.len - 1 == d.rightindex. - * + * * However, when d.leftblock != d.rightblock, d.leftindex and d.rightindex - * become indices into distinct blocks and either may be larger than the + * become indices into distinct blocks and either may be larger than the * other. */ @@ -381,7 +381,7 @@ int cmp = PyObject_RichCompareBool(item, value, Py_EQ); if (deque->len != n) { - PyErr_SetString(PyExc_IndexError, + PyErr_SetString(PyExc_IndexError, "deque mutated during remove()."); return NULL; } @@ -920,7 +920,7 @@ "deque mutated during iteration"); return NULL; } - assert (!(it->b == it->deque->rightblock && + assert (!(it->b == it->deque->rightblock && it->index > it->deque->rightindex)); item = it->b->data[it->index]; @@ -1016,7 +1016,7 @@ "deque mutated during iteration"); return NULL; } - assert (!(it->b == it->deque->leftblock && + assert (!(it->b == it->deque->leftblock && it->index < it->deque->leftindex)); item = it->b->data[it->index]; @@ -1117,7 +1117,7 @@ static PyObject * defdict_reduce(defdictobject *dd) { - /* __reduce__ must returns a 5-tuple as follows: + /* __reduce__ must return a 5-tuple as follows: - factory function - tuple of args for the factory function @@ -1155,6 +1155,7 @@ } result = PyTuple_Pack(5, dd->dict.ob_type, args, Py_None, Py_None, items); + Py_DECREF(items); Py_DECREF(args); return result; } Modified: python/branches/bcannon-sandboxing/Modules/config.c.in ============================================================================== --- python/branches/bcannon-sandboxing/Modules/config.c.in (original) +++ python/branches/bcannon-sandboxing/Modules/config.c.in Wed Aug 2 00:51:44 2006 @@ -28,6 +28,7 @@ extern void initimp(void); extern void initgc(void); extern void init_ast(void); +extern void init_types(void); struct _inittab _PyImport_Inittab[] = { @@ -42,6 +43,9 @@ /* This lives in Python/Python-ast.c */ {"_ast", init_ast}, + /* This lives in Python/_types.c */ + {"_types", init_types}, + /* These entries are here for sys.builtin_module_names */ {"__main__", NULL}, {"__builtin__", NULL}, Modified: python/branches/bcannon-sandboxing/Modules/cryptmodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/cryptmodule.c (original) +++ python/branches/bcannon-sandboxing/Modules/cryptmodule.c Wed Aug 2 00:51:44 2006 @@ -5,6 +5,9 @@ #include +#ifdef __VMS +#include +#endif /* Module crypt */ @@ -12,7 +15,9 @@ static PyObject *crypt_crypt(PyObject *self, PyObject *args) { char *word, *salt; +#ifndef __VMS extern char * crypt(const char *, const char *); +#endif if (!PyArg_ParseTuple(args, "ss:crypt", &word, &salt)) { return NULL; Modified: python/branches/bcannon-sandboxing/Modules/dlmodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/dlmodule.c (original) +++ python/branches/bcannon-sandboxing/Modules/dlmodule.c Wed Aug 2 00:51:44 2006 @@ -5,6 +5,10 @@ #include +#ifdef __VMS +#include +#endif + #ifndef RTLD_LAZY #define RTLD_LAZY 1 #endif @@ -186,6 +190,24 @@ PyErr_SetString(Dlerror, dlerror()); return NULL; } +#ifdef __VMS + /* Under OpenVMS dlopen doesn't do any check, just save the name + * for later use, so we have to check if the file is readable, + * the name can be a logical or a file from SYS$SHARE. + */ + if (access(name, R_OK)) { + char fname[strlen(name) + 20]; + strcpy(fname, "SYS$SHARE:"); + strcat(fname, name); + strcat(fname, ".EXE"); + if (access(fname, R_OK)) { + dlclose(handle); + PyErr_SetString(Dlerror, + "File not found or protection violation"); + return NULL; + } + } +#endif return newdlobject(handle); } Modified: python/branches/bcannon-sandboxing/Modules/expat/xmlparse.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/expat/xmlparse.c (original) +++ python/branches/bcannon-sandboxing/Modules/expat/xmlparse.c Wed Aug 2 00:51:44 2006 @@ -2552,8 +2552,6 @@ (int)(dataPtr - (ICHAR *)dataBuf)); if (s == next) break; - if (ps_parsing == XML_FINISHED || ps_parsing == XML_SUSPENDED) - break; *eventPP = s; } } Modified: python/branches/bcannon-sandboxing/Modules/fcntlmodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/fcntlmodule.c (original) +++ python/branches/bcannon-sandboxing/Modules/fcntlmodule.c Wed Aug 2 00:51:44 2006 @@ -290,7 +290,7 @@ "flock(fd, operation)\n\ \n\ Perform the lock operation op on file descriptor fd. See the Unix \n\ -manual flock(3) for details. (On some systems, this function is\n\ +manual page for flock(3) for details. (On some systems, this function is\n\ emulated using fcntl().)"); @@ -327,7 +327,7 @@ l.l_type = F_WRLCK; else { PyErr_SetString(PyExc_ValueError, - "unrecognized flock argument"); + "unrecognized lockf argument"); return NULL; } l.l_start = l.l_len = 0; Modified: python/branches/bcannon-sandboxing/Modules/fpectlmodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/fpectlmodule.c (original) +++ python/branches/bcannon-sandboxing/Modules/fpectlmodule.c Wed Aug 2 00:51:44 2006 @@ -70,6 +70,10 @@ #if defined(__FreeBSD__) # include +#elif defined(__VMS) +#define __NEW_STARLET +#include +#include #endif #ifndef WANT_SIGFPE_HANDLER @@ -190,6 +194,19 @@ /*-- DEC ALPHA VMS --------------------------------------------------------*/ #elif defined(__ALPHA) && defined(__VMS) + IEEE clrmsk; + IEEE setmsk; + clrmsk.ieee$q_flags = + IEEE$M_TRAP_ENABLE_UNF | IEEE$M_TRAP_ENABLE_INE | + IEEE$M_MAP_UMZ; + setmsk.ieee$q_flags = + IEEE$M_TRAP_ENABLE_INV | IEEE$M_TRAP_ENABLE_DZE | + IEEE$M_TRAP_ENABLE_OVF; + sys$ieee_set_fp_control(&clrmsk, &setmsk, 0); + PyOS_setsig(SIGFPE, handler); + +/*-- HP IA64 VMS --------------------------------------------------------*/ +#elif defined(__ia64) && defined(__VMS) PyOS_setsig(SIGFPE, handler); /*-- Cray Unicos ----------------------------------------------------------*/ @@ -244,6 +261,14 @@ #ifdef __FreeBSD__ fpresetsticky(fpgetsticky()); fpsetmask(0); +#elif defined(__VMS) + IEEE clrmsk; + clrmsk.ieee$q_flags = + IEEE$M_TRAP_ENABLE_UNF | IEEE$M_TRAP_ENABLE_INE | + IEEE$M_MAP_UMZ | IEEE$M_TRAP_ENABLE_INV | + IEEE$M_TRAP_ENABLE_DZE | IEEE$M_TRAP_ENABLE_OVF | + IEEE$M_INHERIT; + sys$ieee_set_fp_control(&clrmsk, 0, 0); #else fputs("Operation not implemented\n", stderr); #endif Modified: python/branches/bcannon-sandboxing/Modules/getpath.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/getpath.c (original) +++ python/branches/bcannon-sandboxing/Modules/getpath.c Wed Aug 2 00:51:44 2006 @@ -97,19 +97,19 @@ #ifndef VERSION -#if defined(__VMS) -#define VERSION "2_1" -#else #define VERSION "2.1" #endif -#endif #ifndef VPATH #define VPATH "." #endif #ifndef PREFIX -#define PREFIX "/usr/local" +# ifdef __VMS +# define PREFIX "" +# else +# define PREFIX "/usr/local" +# endif #endif #ifndef EXEC_PREFIX Modified: python/branches/bcannon-sandboxing/Modules/itertoolsmodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/itertoolsmodule.c (original) +++ python/branches/bcannon-sandboxing/Modules/itertoolsmodule.c Wed Aug 2 00:51:44 2006 @@ -357,7 +357,7 @@ { if (tdo->nextlink == NULL) tdo->nextlink = teedataobject_new(tdo->it); - Py_INCREF(tdo->nextlink); + Py_XINCREF(tdo->nextlink); return tdo->nextlink; } @@ -468,7 +468,7 @@ if (to->index >= LINKCELLS) { link = teedataobject_jumplink(to->dataobj); - Py_XDECREF(to->dataobj); + Py_DECREF(to->dataobj); to->dataobj = (teedataobject *)link; to->index = 0; } @@ -522,6 +522,12 @@ if (to == NULL) goto done; to->dataobj = (teedataobject *)teedataobject_new(it); + if (!to->dataobj) { + PyObject_GC_Del(to); + to = NULL; + goto done; + } + to->index = 0; to->weakreflist = NULL; PyObject_GC_Track(to); Modified: python/branches/bcannon-sandboxing/Modules/main.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/main.c (original) +++ python/branches/bcannon-sandboxing/Modules/main.c Wed Aug 2 00:51:44 2006 @@ -40,7 +40,7 @@ static int orig_argc; /* command line options */ -#define BASE_OPTS "c:dEhim:OQ:StuUvVW:xX" +#define BASE_OPTS "c:dEhim:OQ:StuUvVW:xX?" #ifndef RISCOS #define PROGRAM_OPTS BASE_OPTS @@ -62,7 +62,7 @@ -c cmd : program passed in as string (terminates option list)\n\ -d : debug output from parser (also PYTHONDEBUG=x)\n\ -E : ignore environment variables (such as PYTHONPATH)\n\ --h : print this help message and exit\n\ +-h : print this help message and exit (also --help)\n\ -i : inspect interactively after running script, (also PYTHONINSPECT=x)\n\ and force prompts, even if stdin does not appear to be a terminal\n\ "; @@ -78,7 +78,7 @@ static char *usage_3 = "\ see man page for details on internal buffering relating to '-u'\n\ -v : verbose (trace import statements) (also PYTHONVERBOSE=x)\n\ --V : print the Python version number and exit\n\ +-V : print the Python version number and exit (also --version)\n\ -W arg : warning control (arg is action:message:category:module:lineno)\n\ -x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\ file : program read from script file\n\ @@ -313,6 +313,7 @@ Py_UnicodeFlag++; break; case 'h': + case '?': help++; break; case 'V': Modified: python/branches/bcannon-sandboxing/Modules/posixmodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/posixmodule.c (original) +++ python/branches/bcannon-sandboxing/Modules/posixmodule.c Wed Aug 2 00:51:44 2006 @@ -1862,6 +1862,15 @@ Py_BEGIN_ALLOW_THREADS result = FindNextFileW(hFindFile, &wFileData); Py_END_ALLOW_THREADS + /* FindNextFile sets error to ERROR_NO_MORE_FILES if + it got to the end of the directory. */ + if (!result && GetLastError() != ERROR_NO_MORE_FILES) { + Py_DECREF(d); + win32_error_unicode("FindNextFileW", wnamebuf); + FindClose(hFindFile); + free(wnamebuf); + return NULL; + } } while (result == TRUE); if (FindClose(hFindFile) == FALSE) { @@ -1921,6 +1930,14 @@ Py_BEGIN_ALLOW_THREADS result = FindNextFile(hFindFile, &FileData); Py_END_ALLOW_THREADS + /* FindNextFile sets error to ERROR_NO_MORE_FILES if + it got to the end of the directory. */ + if (!result && GetLastError() != ERROR_NO_MORE_FILES) { + Py_DECREF(d); + win32_error("FindNextFile", namebuf); + FindClose(hFindFile); + return NULL; + } } while (result == TRUE); if (FindClose(hFindFile) == FALSE) { @@ -7882,6 +7899,42 @@ } #endif +#ifdef __VMS +/* Use openssl random routine */ +#include +PyDoc_STRVAR(vms_urandom__doc__, +"urandom(n) -> str\n\n\ +Return a string of n random bytes suitable for cryptographic use."); + +static PyObject* +vms_urandom(PyObject *self, PyObject *args) +{ + int howMany; + PyObject* result; + + /* Read arguments */ + if (! PyArg_ParseTuple(args, "i:urandom", &howMany)) + return NULL; + if (howMany < 0) + return PyErr_Format(PyExc_ValueError, + "negative argument not allowed"); + + /* Allocate bytes */ + result = PyString_FromStringAndSize(NULL, howMany); + if (result != NULL) { + /* Get random data */ + if (RAND_pseudo_bytes((unsigned char*) + PyString_AS_STRING(result), + howMany) < 0) { + Py_DECREF(result); + return PyErr_Format(PyExc_ValueError, + "RAND_pseudo_bytes"); + } + } + return result; +} +#endif + static PyMethodDef posix_methods[] = { {"access", posix_access, METH_VARARGS, posix_access__doc__}, #ifdef HAVE_TTYNAME @@ -8175,6 +8228,9 @@ #ifdef MS_WINDOWS {"urandom", win32_urandom, METH_VARARGS, win32_urandom__doc__}, #endif + #ifdef __VMS + {"urandom", vms_urandom, METH_VARARGS, vms_urandom__doc__}, + #endif {NULL, NULL} /* Sentinel */ }; Modified: python/branches/bcannon-sandboxing/Modules/pyexpat.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/pyexpat.c (original) +++ python/branches/bcannon-sandboxing/Modules/pyexpat.c Wed Aug 2 00:51:44 2006 @@ -238,6 +238,18 @@ return 0; } +/* Dummy character data handler used when an error (exception) has + been detected, and the actual parsing can be terminated early. + This is needed since character data handler can't be safely removed + from within the character data handler, but can be replaced. It is + used only from the character data handler trampoline, and must be + used right after `flag_error()` is called. */ +static void +noop_character_data_handler(void *userData, const XML_Char *data, int len) +{ + /* Do nothing. */ +} + static void flag_error(xmlparseobject *self) { @@ -457,6 +469,8 @@ if (temp == NULL) { Py_DECREF(args); flag_error(self); + XML_SetCharacterDataHandler(self->itself, + noop_character_data_handler); return -1; } PyTuple_SET_ITEM(args, 0, temp); @@ -469,6 +483,8 @@ Py_DECREF(args); if (temp == NULL) { flag_error(self); + XML_SetCharacterDataHandler(self->itself, + noop_character_data_handler); return -1; } Py_DECREF(temp); @@ -1542,8 +1558,22 @@ xmlhandler c_handler = NULL; PyObject *temp = self->handlers[handlernum]; - if (v == Py_None) + if (v == Py_None) { + /* If this is the character data handler, and a character + data handler is already active, we need to be more + careful. What we can safely do is replace the existing + character data handler callback function with a no-op + function that will refuse to call Python. The downside + is that this doesn't completely remove the character + data handler from the C layer if there's any callback + active, so Expat does a little more work than it + otherwise would, but that's really an odd case. A more + elaborate system of handlers and state could remove the + C handler more effectively. */ + if (handlernum == CharacterData && self->in_callback) + c_handler = noop_character_data_handler; v = NULL; + } else if (v != NULL) { Py_INCREF(v); c_handler = handler_info[handlernum].handler; Modified: python/branches/bcannon-sandboxing/Modules/readline.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/readline.c (original) +++ python/branches/bcannon-sandboxing/Modules/readline.c Wed Aug 2 00:51:44 2006 @@ -20,6 +20,12 @@ #include #endif +#ifdef SAVE_LOCALE +# define RESTORE_LOCALE(sl) { setlocale(LC_CTYPE, sl); free(sl); } +#else +# define RESTORE_LOCALE(sl) +#endif + /* GNU readline definitions */ #undef HAVE_CONFIG_H /* Else readline/chardefs.h includes strings.h */ #include @@ -723,10 +729,7 @@ */ rl_initialize(); -#ifdef SAVE_LOCALE - setlocale(LC_CTYPE, saved_locale); /* Restore locale */ - free(saved_locale); -#endif + RESTORE_LOCALE(saved_locale) } /* Wrapper around GNU readline that handles signals differently. */ @@ -864,7 +867,8 @@ p = readline_until_enter_or_signal(prompt, &signal); /* we got an interrupt signal */ - if(signal) { + if (signal) { + RESTORE_LOCALE(saved_locale) return NULL; } @@ -873,6 +877,7 @@ p = PyMem_Malloc(1); if (p != NULL) *p = '\0'; + RESTORE_LOCALE(saved_locale) return p; } @@ -905,10 +910,7 @@ p[n+1] = '\0'; } free(q); -#ifdef SAVE_LOCALE - setlocale(LC_CTYPE, saved_locale); /* Restore locale */ - free(saved_locale); -#endif + RESTORE_LOCALE(saved_locale) return p; } Modified: python/branches/bcannon-sandboxing/Modules/selectmodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/selectmodule.c (original) +++ python/branches/bcannon-sandboxing/Modules/selectmodule.c Wed Aug 2 00:51:44 2006 @@ -46,14 +46,14 @@ #endif #ifdef MS_WINDOWS -#include +# include #else -#ifdef __BEOS__ -#include -#define SOCKET int -#else -#define SOCKET int -#endif +# define SOCKET int +# ifdef __BEOS__ +# include +# elif defined(__VMS) +# include +# endif #endif @@ -668,7 +668,7 @@ that are ready.\n\ \n\ *** IMPORTANT NOTICE ***\n\ -On Windows, only sockets are supported; on Unix, all file descriptors."); +On Windows and OpenVMS, only sockets are supported; on Unix, all file descriptors."); static PyMethodDef select_methods[] = { {"select", select_select, METH_VARARGS, select_doc}, @@ -682,7 +682,7 @@ "This module supports asynchronous I/O on multiple file descriptors.\n\ \n\ *** IMPORTANT NOTICE ***\n\ -On Windows, only sockets are supported; on Unix, all file descriptors."); +On Windows and OpenVMS, only sockets are supported; on Unix, all file descriptors."); PyMODINIT_FUNC initselect(void) Modified: python/branches/bcannon-sandboxing/Modules/socketmodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/socketmodule.c (original) +++ python/branches/bcannon-sandboxing/Modules/socketmodule.c Wed Aug 2 00:51:44 2006 @@ -161,7 +161,8 @@ (this includes the getaddrinfo emulation) protect access with a lock. */ #if defined(WITH_THREAD) && (defined(__APPLE__) || \ (defined(__FreeBSD__) && __FreeBSD_version+0 < 503000) || \ - defined(__OpenBSD__) || defined(__NetBSD__) || !defined(HAVE_GETADDRINFO)) + defined(__OpenBSD__) || defined(__NetBSD__) || \ + defined(__VMS) || !defined(HAVE_GETADDRINFO)) #define USE_GETADDRINFO_LOCK #endif @@ -186,15 +187,8 @@ #endif #if defined(__VMS) -#if ! defined(_SOCKADDR_LEN) -# ifdef getaddrinfo -# undef getaddrinfo -# endif -# include "TCPIP_IOCTL_ROUTINE" -#else # include #endif -#endif #if defined(PYOS_OS2) # define INCL_DOS @@ -363,11 +357,6 @@ #define SOCKETCLOSE close #endif -#ifdef __VMS -/* TCP/IP Services for VMS uses a maximum send/revc buffer length of 65535 */ -#define SEGMENT_SIZE 65535 -#endif - #if defined(HAVE_BLUETOOTH_H) || defined(HAVE_BLUETOOTH_BLUETOOTH_H) #define USE_BLUETOOTH 1 #if defined(__FreeBSD__) @@ -378,6 +367,14 @@ #define _BT_SOCKADDR_MEMB(s, proto) &((s)->sock_addr) #define _BT_L2_MEMB(sa, memb) ((sa)->l2cap_##memb) #define _BT_RC_MEMB(sa, memb) ((sa)->rfcomm_##memb) +#elif defined(__NetBSD__) +#define sockaddr_l2 sockaddr_bt +#define sockaddr_rc sockaddr_bt +#define sockaddr_sco sockaddr_bt +#define _BT_SOCKADDR_MEMB(s, proto) &((s)->sock_addr) +#define _BT_L2_MEMB(sa, memb) ((sa)->bt_##memb) +#define _BT_RC_MEMB(sa, memb) ((sa)->bt_##memb) +#define _BT_SCO_MEMB(sa, memb) ((sa)->bt_##memb) #else #define _BT_SOCKADDR_MEMB(s, proto) (&((s)->sock_addr).bt_##proto) #define _BT_L2_MEMB(sa, memb) ((sa)->l2_##memb) @@ -386,6 +383,11 @@ #endif #endif +#ifdef __VMS +/* TCP/IP Services for VMS uses a maximum send/recv buffer length */ +#define SEGMENT_SIZE (32 * 1024 -1) +#endif + /* * Constants for getnameinfo() */ @@ -417,14 +419,24 @@ there has to be a circular reference. */ static PyTypeObject sock_type; -/* Can we call select() with this socket without a buffer overrun? */ +#if defined(HAVE_POLL_H) +#include +#elif defined(HAVE_SYS_POLL_H) +#include +#endif + #ifdef Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE /* Platform can select file descriptors beyond FD_SETSIZE */ #define IS_SELECTABLE(s) 1 +#elif defined(HAVE_POLL) +/* Instead of select(), we'll use poll() since poll() works on any fd. */ +#define IS_SELECTABLE(s) 1 +/* Can we call select() with this socket without a buffer overrun? */ #else /* POSIX says selecting file descriptors beyond FD_SETSIZE - has undefined behaviour. */ -#define IS_SELECTABLE(s) ((s)->sock_fd < FD_SETSIZE) + has undefined behaviour. If there's no timeout left, we don't have to + call select, so it's a safe, little white lie. */ +#define IS_SELECTABLE(s) ((s)->sock_fd < FD_SETSIZE || s->sock_timeout <= 0.0) #endif static PyObject* @@ -620,6 +632,30 @@ return NULL; } +#ifdef __VMS +/* Function to send in segments */ +static int +sendsegmented(int sock_fd, char *buf, int len, int flags) +{ + int n = 0; + int remaining = len; + + while (remaining > 0) { + unsigned int segment; + + segment = (remaining >= SEGMENT_SIZE ? SEGMENT_SIZE : remaining); + n = send(sock_fd, buf, segment, flags); + if (n < 0) { + return n; + } + remaining -= segment; + buf += segment; + } /* end while */ + + return len; +} +#endif + /* Function to perform the setting of socket blocking mode internally. block = (1 | 0). */ static int @@ -644,8 +680,8 @@ ioctl(s->sock_fd, FIONBIO, (caddr_t)&block, sizeof(block)); #elif defined(__VMS) block = !block; - ioctl(s->sock_fd, FIONBIO, (char *)&block); -#else /* !PYOS_OS2 && !_VMS */ + ioctl(s->sock_fd, FIONBIO, (unsigned int *)&block); +#else /* !PYOS_OS2 && !__VMS */ delay_flag = fcntl(s->sock_fd, F_GETFL, 0); if (block) delay_flag &= (~O_NONBLOCK); @@ -668,7 +704,7 @@ return 1; } -/* Do a select() on the socket, if necessary (sock_timeout > 0). +/* Do a select()/poll() on the socket, if necessary (sock_timeout > 0). The argument writing indicates the direction. This does not raise an exception; we'll let our caller do that after they've reacquired the interpreter lock. @@ -676,8 +712,6 @@ static int internal_select(PySocketSockObject *s, int writing) { - fd_set fds; - struct timeval tv; int n; /* Nothing to do unless we're in timeout mode (not non-blocking) */ @@ -688,17 +722,37 @@ if (s->sock_fd < 0) return 0; - /* Construct the arguments to select */ - tv.tv_sec = (int)s->sock_timeout; - tv.tv_usec = (int)((s->sock_timeout - tv.tv_sec) * 1e6); - FD_ZERO(&fds); - FD_SET(s->sock_fd, &fds); - - /* See if the socket is ready */ - if (writing) - n = select(s->sock_fd+1, NULL, &fds, NULL, &tv); - else - n = select(s->sock_fd+1, &fds, NULL, NULL, &tv); + /* Prefer poll, if available, since you can poll() any fd + * which can't be done with select(). */ +#ifdef HAVE_POLL + { + struct pollfd pollfd; + int timeout; + + pollfd.fd = s->sock_fd; + pollfd.events = writing ? POLLOUT : POLLIN; + + /* s->sock_timeout is in seconds, timeout in ms */ + timeout = (int)(s->sock_timeout * 1000 + 0.5); + n = poll(&pollfd, 1, timeout); + } +#else + { + /* Construct the arguments to select */ + fd_set fds; + struct timeval tv; + tv.tv_sec = (int)s->sock_timeout; + tv.tv_usec = (int)((s->sock_timeout - tv.tv_sec) * 1e6); + FD_ZERO(&fds); + FD_SET(s->sock_fd, &fds); + + /* See if the socket is ready */ + if (writing) + n = select(s->sock_fd+1, NULL, &fds, NULL, &tv); + else + n = select(s->sock_fd+1, &fds, NULL, NULL, &tv); + } +#endif if (n == 0) return 1; return 0; @@ -1725,6 +1779,8 @@ return PyInt_FromLong(flag); } #ifdef __VMS + /* socklen_t is unsigned so no negative test is needed, + test buflen == 0 is previously done */ if (buflen > 1024) { #else if (buflen <= 0 || buflen > 1024) { @@ -2251,7 +2307,7 @@ /* Call the guts */ outlen = sock_recv_guts(s, PyString_AS_STRING(buf), recvlen, flags); if (outlen < 0) { - /* An error occured, release the string and return an + /* An error occurred, release the string and return an error. */ Py_DECREF(buf); return NULL; @@ -2498,9 +2554,6 @@ { char *buf; int len, n = 0, flags = 0, timeout; -#ifdef __VMS - int send_length; -#endif if (!PyArg_ParseTuple(args, "s#|i:send", &buf, &len, &flags)) return NULL; @@ -2508,11 +2561,14 @@ if (!IS_SELECTABLE(s)) return select_error(); -#ifndef __VMS Py_BEGIN_ALLOW_THREADS timeout = internal_select(s, 1); if (!timeout) +#ifdef __VMS + n = sendsegmented(s->sock_fd, buf, len, flags); +#else n = send(s->sock_fd, buf, len, flags); +#endif Py_END_ALLOW_THREADS if (timeout) { @@ -2521,36 +2577,6 @@ } if (n < 0) return s->errorhandler(); -#else - /* Divide packet into smaller segments for */ - /* TCP/IP Services for OpenVMS */ - send_length = len; - while (send_length != 0) { - unsigned int segment; - - segment = send_length / SEGMENT_SIZE; - if (segment != 0) { - segment = SEGMENT_SIZE; - } - else { - segment = send_length; - } - Py_BEGIN_ALLOW_THREADS - timeout = internal_select(s, 1); - if (!timeout) - n = send(s->sock_fd, buf, segment, flags); - Py_END_ALLOW_THREADS - if (timeout) { - PyErr_SetString(socket_timeout, "timed out"); - return NULL; - } - if (n < 0) { - return s->errorhandler(); - } - send_length -= segment; - buf += segment; - } /* end while */ -#endif /* !__VMS */ return PyInt_FromLong((long)n); } @@ -2581,7 +2607,11 @@ timeout = internal_select(s, 1); if (timeout) break; +#ifdef __VMS + n = sendsegmented(s->sock_fd, buf, len, flags); +#else n = send(s->sock_fd, buf, len, flags); +#endif if (n < 0) break; buf += n; Modified: python/branches/bcannon-sandboxing/Modules/timemodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/timemodule.c (original) +++ python/branches/bcannon-sandboxing/Modules/timemodule.c Wed Aug 2 00:51:44 2006 @@ -406,13 +406,35 @@ indexing blindly into some array for a textual representation by some bad index (fixes bug #897625). - No check for year since handled in gettmarg(). + Also support values of zero from Python code for arguments in which + that is out of range by forcing that value to the lowest value that + is valid (fixed bug #1520914). + + Valid ranges based on what is allowed in struct tm: + + - tm_year: [0, max(int)] (1) + - tm_mon: [0, 11] (2) + - tm_mday: [1, 31] + - tm_hour: [0, 23] + - tm_min: [0, 59] + - tm_sec: [0, 60] + - tm_wday: [0, 6] (1) + - tm_yday: [0, 365] (2) + - tm_isdst: [-max(int), max(int)] + + (1) gettmarg() handles bounds-checking. + (2) Python's acceptable range is one greater than the range in C, + thus need to check against automatic decrement by gettmarg(). */ - if (buf.tm_mon < 0 || buf.tm_mon > 11) { + if (buf.tm_mon == -1) + buf.tm_mon = 0; + else if (buf.tm_mon < 0 || buf.tm_mon > 11) { PyErr_SetString(PyExc_ValueError, "month out of range"); return NULL; } - if (buf.tm_mday < 1 || buf.tm_mday > 31) { + if (buf.tm_mday == 0) + buf.tm_mday = 1; + else if (buf.tm_mday < 0 || buf.tm_mday > 31) { PyErr_SetString(PyExc_ValueError, "day of month out of range"); return NULL; } @@ -434,7 +456,9 @@ PyErr_SetString(PyExc_ValueError, "day of week out of range"); return NULL; } - if (buf.tm_yday < 0 || buf.tm_yday > 365) { + if (buf.tm_yday == -1) + buf.tm_yday = 0; + else if (buf.tm_yday < 0 || buf.tm_yday > 365) { PyErr_SetString(PyExc_ValueError, "day of year out of range"); return NULL; } Modified: python/branches/bcannon-sandboxing/Modules/unicodedata.c ============================================================================== --- python/branches/bcannon-sandboxing/Modules/unicodedata.c (original) +++ python/branches/bcannon-sandboxing/Modules/unicodedata.c Wed Aug 2 00:51:44 2006 @@ -395,6 +395,7 @@ PyUnicodeObject *v; char decomp[256]; int code, index, count, i; + unsigned int prefix_index; if (!PyArg_ParseTuple(args, "O!:decomposition", &PyUnicode_Type, &v)) @@ -428,9 +429,15 @@ /* XXX: could allocate the PyString up front instead (strlen(prefix) + 5 * count + 1 bytes) */ + /* Based on how index is calculated above and decomp_data is generated + from Tools/unicode/makeunicodedata.py, it should not be possible + to overflow decomp_prefix. */ + prefix_index = decomp_data[index] & 255; + assert(prefix_index < (sizeof(decomp_prefix)/sizeof(*decomp_prefix))); + /* copy prefix */ - i = strlen(decomp_prefix[decomp_data[index] & 255]); - memcpy(decomp, decomp_prefix[decomp_data[index] & 255], i); + i = strlen(decomp_prefix[prefix_index]); + memcpy(decomp, decomp_prefix[prefix_index], i); while (count-- > 0) { if (i) Modified: python/branches/bcannon-sandboxing/Objects/codeobject.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/codeobject.c (original) +++ python/branches/bcannon-sandboxing/Objects/codeobject.c Wed Aug 2 00:51:44 2006 @@ -556,6 +556,7 @@ the line increments here, treating them as byte increments gets confusing, to say the least. */ + bounds->ap_lower = 0; while (size > 0) { if (addr + *p > lasti) break; Modified: python/branches/bcannon-sandboxing/Objects/complexobject.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/complexobject.c (original) +++ python/branches/bcannon-sandboxing/Objects/complexobject.c Wed Aug 2 00:51:44 2006 @@ -275,16 +275,16 @@ { char format[32]; if (v->cval.real == 0.) { - PyOS_snprintf(format, 32, "%%.%ig", precision); - PyOS_ascii_formatd(buf, bufsz, format, v->cval.imag); - strncat(buf, "j", bufsz); + PyOS_snprintf(format, sizeof(format), "%%.%ig", precision); + PyOS_ascii_formatd(buf, bufsz - 1, format, v->cval.imag); + strncat(buf, "j", 1); } else { char re[64], im[64]; /* Format imaginary part with sign, real part without */ - PyOS_snprintf(format, 32, "%%.%ig", precision); - PyOS_ascii_formatd(re, 64, format, v->cval.real); - PyOS_snprintf(format, 32, "%%+.%ig", precision); - PyOS_ascii_formatd(im, 64, format, v->cval.imag); + PyOS_snprintf(format, sizeof(format), "%%.%ig", precision); + PyOS_ascii_formatd(re, sizeof(re), format, v->cval.real); + PyOS_snprintf(format, sizeof(format), "%%+.%ig", precision); + PyOS_ascii_formatd(im, sizeof(im), format, v->cval.imag); PyOS_snprintf(buf, bufsz, "(%s%sj)", re, im); } } Modified: python/branches/bcannon-sandboxing/Objects/dictobject.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/dictobject.c (original) +++ python/branches/bcannon-sandboxing/Objects/dictobject.c Wed Aug 2 00:51:44 2006 @@ -599,6 +599,8 @@ PyErr_BadInternalCall(); return -1; } + assert(key); + assert(value); mp = (dictobject *)op; if (PyString_CheckExact(key)) { hash = ((PyStringObject *)key)->ob_shash; @@ -647,6 +649,7 @@ PyErr_BadInternalCall(); return -1; } + assert(key); if (!PyString_CheckExact(key) || (hash = ((PyStringObject *) key)->ob_shash) == -1) { hash = PyObject_Hash(key); Modified: python/branches/bcannon-sandboxing/Objects/fileobject.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/fileobject.c (original) +++ python/branches/bcannon-sandboxing/Objects/fileobject.c Wed Aug 2 00:51:44 2006 @@ -103,6 +103,7 @@ fill_file_fields(PyFileObject *f, FILE *fp, PyObject *name, char *mode, int (*close)(FILE *)) { + assert(name != NULL); assert(f != NULL); assert(PyFile_Check(f)); assert(f->f_fp == NULL); @@ -111,7 +112,7 @@ Py_DECREF(f->f_mode); Py_DECREF(f->f_encoding); - Py_INCREF (name); + Py_INCREF(name); f->f_name = name; f->f_mode = PyString_FromString(mode); @@ -126,7 +127,7 @@ Py_INCREF(Py_None); f->f_encoding = Py_None; - if (f->f_name == NULL || f->f_mode == NULL) + if (f->f_mode == NULL) return NULL; f->f_fp = fp; f = dircheck(f); @@ -278,7 +279,9 @@ PyFileObject *f = (PyFileObject *)PyFile_Type.tp_new(&PyFile_Type, NULL, NULL); if (f != NULL) { - PyObject *o_name = PyString_FromString(name); + PyObject *o_name = PyString_FromString(name); + if (o_name == NULL) + return NULL; if (fill_file_fields(f, fp, o_name, mode, close) == NULL) { Py_DECREF(f); f = NULL; @@ -411,11 +414,11 @@ if (PyUnicode_Check(f->f_name)) { #ifdef Py_USING_UNICODE PyObject *ret = NULL; - PyObject *name; - name = PyUnicode_AsUnicodeEscapeString(f->f_name); + PyObject *name = PyUnicode_AsUnicodeEscapeString(f->f_name); + const char *name_str = name ? PyString_AsString(name) : "?"; ret = PyString_FromFormat("<%s file u'%s', mode '%s' at %p>", f->f_fp == NULL ? "closed" : "open", - PyString_AsString(name), + name_str, PyString_AsString(f->f_mode), f); Py_XDECREF(name); Modified: python/branches/bcannon-sandboxing/Objects/frameobject.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/frameobject.c (original) +++ python/branches/bcannon-sandboxing/Objects/frameobject.c Wed Aug 2 00:51:44 2006 @@ -642,6 +642,7 @@ f->f_trace = NULL; f->f_exc_type = f->f_exc_value = f->f_exc_traceback = NULL; } + f->f_stacktop = f->f_valuestack; f->f_builtins = builtins; Py_XINCREF(back); f->f_back = back; @@ -672,7 +673,6 @@ f->f_lineno = code->co_firstlineno; f->f_iblock = 0; - f->f_stacktop = f->f_valuestack; _PyObject_GC_TRACK(f); return f; } Modified: python/branches/bcannon-sandboxing/Objects/funcobject.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/funcobject.c (original) +++ python/branches/bcannon-sandboxing/Objects/funcobject.c Wed Aug 2 00:51:44 2006 @@ -109,8 +109,8 @@ } if (defaults == Py_None) defaults = NULL; - else if (PyTuple_Check(defaults)) { - Py_XINCREF(defaults); + else if (defaults && PyTuple_Check(defaults)) { + Py_INCREF(defaults); } else { PyErr_SetString(PyExc_SystemError, "non-tuple default args"); @@ -141,7 +141,7 @@ if (closure == Py_None) closure = NULL; else if (PyTuple_Check(closure)) { - Py_XINCREF(closure); + Py_INCREF(closure); } else { PyErr_Format(PyExc_SystemError, Modified: python/branches/bcannon-sandboxing/Objects/listsort.txt ============================================================================== --- python/branches/bcannon-sandboxing/Objects/listsort.txt (original) +++ python/branches/bcannon-sandboxing/Objects/listsort.txt Wed Aug 2 00:51:44 2006 @@ -494,7 +494,7 @@ 467-474, Austin, Texas, 25-27 January 1993. and it probably dates back to an earlier paper by Bentley and Yao. The -McIlory paper in particular has good analysis of a mergesort that's +McIlroy paper in particular has good analysis of a mergesort that's probably strongly related to this one in its galloping strategy. Modified: python/branches/bcannon-sandboxing/Objects/longobject.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/longobject.c (original) +++ python/branches/bcannon-sandboxing/Objects/longobject.c Wed Aug 2 00:51:44 2006 @@ -1203,7 +1203,7 @@ register PyLongObject *a = (PyLongObject *)aa; PyStringObject *str; Py_ssize_t i; - const Py_ssize_t size_a = ABS(a->ob_size); + Py_ssize_t size_a; char *p; int bits; char sign = '\0'; @@ -1213,6 +1213,7 @@ return NULL; } assert(base >= 2 && base <= 36); + size_a = ABS(a->ob_size); /* Compute a rough upper bound for the length of the string */ i = base; @@ -3149,9 +3150,8 @@ : MAX(size_a, size_b); z = _PyLong_New(size_z); if (z == NULL) { - Py_XDECREF(a); - Py_XDECREF(b); - Py_XDECREF(z); + Py_DECREF(a); + Py_DECREF(b); return NULL; } Modified: python/branches/bcannon-sandboxing/Objects/setobject.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/setobject.c (original) +++ python/branches/bcannon-sandboxing/Objects/setobject.c Wed Aug 2 00:51:44 2006 @@ -1380,12 +1380,12 @@ while (set_next(otherset, &pos, &entry)) { int rv = set_discard_entry(so, entry); if (rv == -1) { - Py_XDECREF(otherset); + Py_DECREF(otherset); return NULL; } if (rv == DISCARD_NOTFOUND) { if (set_add_entry(so, entry) == -1) { - Py_XDECREF(otherset); + Py_DECREF(otherset); return NULL; } } @@ -1797,7 +1797,7 @@ PyDoc_STRVAR(set_doc, "set(iterable) --> set object\n\ \n\ -Build an unordered collection."); +Build an unordered collection of unique elements."); PyTypeObject PySet_Type = { PyObject_HEAD_INIT(&PyType_Type) @@ -1892,7 +1892,7 @@ PyDoc_STRVAR(frozenset_doc, "frozenset(iterable) --> frozenset object\n\ \n\ -Build an immutable unordered collection."); +Build an immutable unordered collection of unique elements."); PyTypeObject PyFrozenSet_Type = { PyObject_HEAD_INIT(&PyType_Type) Modified: python/branches/bcannon-sandboxing/Objects/stringobject.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/stringobject.c (original) +++ python/branches/bcannon-sandboxing/Objects/stringobject.c Wed Aug 2 00:51:44 2006 @@ -1493,7 +1493,6 @@ j = i+pos; SPLIT_ADD(s, i, j); i = j + n; - } #else i = j = 0; @@ -1589,7 +1588,7 @@ return NULL; i = j = len-1; - + while (maxsplit-- > 0) { RSKIP_SPACE(s, i); if (i<0) break; @@ -2465,11 +2464,11 @@ } Py_LOCAL_INLINE(Py_ssize_t) -countchar(char *target, int target_len, char c, Py_ssize_t maxcount) +countchar(const char *target, int target_len, char c, Py_ssize_t maxcount) { Py_ssize_t count=0; - char *start=target; - char *end=target+target_len; + const char *start=target; + const char *end=target+target_len; while ( (start=findchar(start, end-start, c)) != NULL ) { count++; @@ -2481,8 +2480,8 @@ } Py_LOCAL(Py_ssize_t) -findstring(char *target, Py_ssize_t target_len, - char *pattern, Py_ssize_t pattern_len, +findstring(const char *target, Py_ssize_t target_len, + const char *pattern, Py_ssize_t pattern_len, Py_ssize_t start, Py_ssize_t end, int direction) @@ -2519,8 +2518,8 @@ } Py_LOCAL_INLINE(Py_ssize_t) -countstring(char *target, Py_ssize_t target_len, - char *pattern, Py_ssize_t pattern_len, +countstring(const char *target, Py_ssize_t target_len, + const char *pattern, Py_ssize_t pattern_len, Py_ssize_t start, Py_ssize_t end, int direction, Py_ssize_t maxcount) @@ -2573,22 +2572,21 @@ /* len(self)>=1, from="", len(to)>=1, maxcount>=1 */ Py_LOCAL(PyStringObject *) replace_interleave(PyStringObject *self, - PyStringObject *to, + const char *to_s, Py_ssize_t to_len, Py_ssize_t maxcount) { - char *self_s, *to_s, *result_s; - Py_ssize_t self_len, to_len, result_len; + char *self_s, *result_s; + Py_ssize_t self_len, result_len; Py_ssize_t count, i, product; PyStringObject *result; self_len = PyString_GET_SIZE(self); - to_len = PyString_GET_SIZE(to); - + /* 1 at the end plus 1 after every character */ count = self_len+1; if (maxcount < count) count = maxcount; - + /* Check for overflow */ /* result_len = count * to_len + self_len; */ product = count * to_len; @@ -2609,8 +2607,6 @@ return NULL; self_s = PyString_AS_STRING(self); - to_s = PyString_AS_STRING(to); - to_len = PyString_GET_SIZE(to); result_s = PyString_AS_STRING(result); /* TODO: special case single character, which doesn't need memcpy */ @@ -2671,25 +2667,24 @@ start = next+1; } Py_MEMCPY(result_s, start, end-start); - + return result; } /* len(self)>=1, len(from)>=2, to="", maxcount>=1 */ Py_LOCAL(PyStringObject *) -replace_delete_substring(PyStringObject *self, PyStringObject *from, +replace_delete_substring(PyStringObject *self, + const char *from_s, Py_ssize_t from_len, Py_ssize_t maxcount) { - char *self_s, *from_s, *result_s; + char *self_s, *result_s; char *start, *next, *end; - Py_ssize_t self_len, from_len, result_len; + Py_ssize_t self_len, result_len; Py_ssize_t count, offset; PyStringObject *result; self_len = PyString_GET_SIZE(self); self_s = PyString_AS_STRING(self); - from_len = PyString_GET_SIZE(from); - from_s = PyString_AS_STRING(from); count = countstring(self_s, self_len, from_s, from_len, @@ -2703,13 +2698,13 @@ result_len = self_len - (count * from_len); assert (result_len>=0); - + if ( (result = (PyStringObject *) PyString_FromStringAndSize(NULL, result_len)) == NULL ) return NULL; - + result_s = PyString_AS_STRING(result); - + start = self_s; end = self_s + self_len; while (count-- > 0) { @@ -2719,9 +2714,9 @@ if (offset == -1) break; next = start + offset; - + Py_MEMCPY(result_s, start, next-start); - + result_s += (next-start); start = next+from_len; } @@ -2738,31 +2733,31 @@ char *self_s, *result_s, *start, *end, *next; Py_ssize_t self_len; PyStringObject *result; - + /* The result string will be the same size */ self_s = PyString_AS_STRING(self); self_len = PyString_GET_SIZE(self); - + next = findchar(self_s, self_len, from_c); - + if (next == NULL) { /* No matches; return the original string */ return return_self(self); } - + /* Need to make a new string */ result = (PyStringObject *) PyString_FromStringAndSize(NULL, self_len); if (result == NULL) return NULL; result_s = PyString_AS_STRING(result); Py_MEMCPY(result_s, self_s, self_len); - + /* change everything in-place, starting with this one */ start = result_s + (next-self_s); *start = to_c; start++; end = result_s + self_len; - + while (--maxcount > 0) { next = findchar(start, end-start, from_c); if (next == NULL) @@ -2770,40 +2765,35 @@ *next = to_c; start = next+1; } - + return result; } /* len(self)>=1, len(from)==len(to)>=2, maxcount>=1 */ Py_LOCAL(PyStringObject *) replace_substring_in_place(PyStringObject *self, - PyStringObject *from, - PyStringObject *to, + const char *from_s, Py_ssize_t from_len, + const char *to_s, Py_ssize_t to_len, Py_ssize_t maxcount) { char *result_s, *start, *end; - char *self_s, *from_s, *to_s; - Py_ssize_t self_len, from_len, offset; + char *self_s; + Py_ssize_t self_len, offset; PyStringObject *result; - + /* The result string will be the same size */ - + self_s = PyString_AS_STRING(self); self_len = PyString_GET_SIZE(self); - - from_s = PyString_AS_STRING(from); - from_len = PyString_GET_SIZE(from); - to_s = PyString_AS_STRING(to); - + offset = findstring(self_s, self_len, from_s, from_len, 0, self_len, FORWARD); - if (offset == -1) { /* No matches; return the original string */ return return_self(self); } - + /* Need to make a new string */ result = (PyStringObject *) PyString_FromStringAndSize(NULL, self_len); if (result == NULL) @@ -2811,13 +2801,12 @@ result_s = PyString_AS_STRING(result); Py_MEMCPY(result_s, self_s, self_len); - /* change everything in-place, starting with this one */ start = result_s + offset; Py_MEMCPY(start, to_s, from_len); start += from_len; end = result_s + self_len; - + while ( --maxcount > 0) { offset = findstring(start, end-start, from_s, from_len, @@ -2827,7 +2816,7 @@ Py_MEMCPY(start+offset, to_s, from_len); start += offset+from_len; } - + return result; } @@ -2835,28 +2824,24 @@ Py_LOCAL(PyStringObject *) replace_single_character(PyStringObject *self, char from_c, - PyStringObject *to, + const char *to_s, Py_ssize_t to_len, Py_ssize_t maxcount) { - char *self_s, *to_s, *result_s; + char *self_s, *result_s; char *start, *next, *end; - Py_ssize_t self_len, to_len, result_len; + Py_ssize_t self_len, result_len; Py_ssize_t count, product; PyStringObject *result; - + self_s = PyString_AS_STRING(self); self_len = PyString_GET_SIZE(self); - + count = countchar(self_s, self_len, from_c, maxcount); - if (count == 0) { /* no matches, return unchanged */ return return_self(self); } - - to_s = PyString_AS_STRING(to); - to_len = PyString_GET_SIZE(to); - + /* use the difference between current and new, hence the "-1" */ /* result_len = self_len + count * (to_len-1) */ product = count * (to_len-1); @@ -2869,19 +2854,19 @@ PyErr_SetString(PyExc_OverflowError, "replace string is too long"); return NULL; } - + if ( (result = (PyStringObject *) PyString_FromStringAndSize(NULL, result_len)) == NULL) return NULL; result_s = PyString_AS_STRING(result); - + start = self_s; end = self_s + self_len; while (count-- > 0) { next = findchar(start, end-start, from_c); if (next == NULL) break; - + if (next == start) { /* replace with the 'to' */ Py_MEMCPY(result_s, to_s, to_len); @@ -2898,27 +2883,25 @@ } /* Copy the remainder of the remaining string */ Py_MEMCPY(result_s, start, end-start); - + return result; } /* len(self)>=1, len(from)>=2, len(to)>=2, maxcount>=1 */ Py_LOCAL(PyStringObject *) replace_substring(PyStringObject *self, - PyStringObject *from, - PyStringObject *to, + const char *from_s, Py_ssize_t from_len, + const char *to_s, Py_ssize_t to_len, Py_ssize_t maxcount) { - char *self_s, *from_s, *to_s, *result_s; + char *self_s, *result_s; char *start, *next, *end; - Py_ssize_t self_len, from_len, to_len, result_len; + Py_ssize_t self_len, result_len; Py_ssize_t count, offset, product; PyStringObject *result; - + self_s = PyString_AS_STRING(self); self_len = PyString_GET_SIZE(self); - from_s = PyString_AS_STRING(from); - from_len = PyString_GET_SIZE(from); - + count = countstring(self_s, self_len, from_s, from_len, 0, self_len, FORWARD, maxcount); @@ -2926,10 +2909,7 @@ /* no matches, return unchanged */ return return_self(self); } - - to_s = PyString_AS_STRING(to); - to_len = PyString_GET_SIZE(to); - + /* Check for overflow */ /* result_len = self_len + count * (to_len-from_len) */ product = count * (to_len-from_len); @@ -2942,12 +2922,12 @@ PyErr_SetString(PyExc_OverflowError, "replace string is too long"); return NULL; } - + if ( (result = (PyStringObject *) PyString_FromStringAndSize(NULL, result_len)) == NULL) return NULL; result_s = PyString_AS_STRING(result); - + start = self_s; end = self_s + self_len; while (count-- > 0) { @@ -2973,29 +2953,24 @@ } /* Copy the remainder of the remaining string */ Py_MEMCPY(result_s, start, end-start); - + return result; } Py_LOCAL(PyStringObject *) replace(PyStringObject *self, - PyStringObject *from, - PyStringObject *to, + const char *from_s, Py_ssize_t from_len, + const char *to_s, Py_ssize_t to_len, Py_ssize_t maxcount) { - Py_ssize_t from_len, to_len; - if (maxcount < 0) { maxcount = PY_SSIZE_T_MAX; } else if (maxcount == 0 || PyString_GET_SIZE(self) == 0) { /* nothing to do; return the original string */ return return_self(self); } - - from_len = PyString_GET_SIZE(from); - to_len = PyString_GET_SIZE(to); - + if (maxcount == 0 || (from_len == 0 && to_len == 0)) { /* nothing to do; return the original string */ @@ -3003,12 +2978,12 @@ } /* Handle zero-length special cases */ - + if (from_len == 0) { /* insert the 'to' string everywhere. */ /* >>> "Python".replace("", ".") */ /* '.P.y.t.h.o.n.' */ - return replace_interleave(self, to, maxcount); + return replace_interleave(self, to_s, to_len, maxcount); } /* Except for "".replace("", "A") == "A" there is no way beyond this */ @@ -3022,9 +2997,9 @@ /* delete all occurances of 'from' string */ if (from_len == 1) { return replace_delete_single_character( - self, PyString_AS_STRING(from)[0], maxcount); + self, from_s[0], maxcount); } else { - return replace_delete_substring(self, from, maxcount); + return replace_delete_substring(self, from_s, from_len, maxcount); } } @@ -3034,22 +3009,22 @@ if (from_len == 1) { return replace_single_character_in_place( self, - PyString_AS_STRING(from)[0], - PyString_AS_STRING(to)[0], + from_s[0], + to_s[0], maxcount); } else { return replace_substring_in_place( - self, from, to, maxcount); + self, from_s, from_len, to_s, to_len, maxcount); } } /* Otherwise use the more generic algorithms */ if (from_len == 1) { - return replace_single_character(self, PyString_AS_STRING(from)[0], - to, maxcount); + return replace_single_character(self, from_s[0], + to_s, to_len, maxcount); } else { /* len('from')>=2, len('to')>=1 */ - return replace_substring(self, from, to, maxcount); + return replace_substring(self, from_s, from_len, to_s, to_len, maxcount); } } @@ -3065,37 +3040,39 @@ { Py_ssize_t count = -1; PyObject *from, *to; - const char *tmp_s; - Py_ssize_t tmp_len; + const char *from_s, *to_s; + Py_ssize_t from_len, to_len; if (!PyArg_ParseTuple(args, "OO|n:replace", &from, &to, &count)) return NULL; if (PyString_Check(from)) { - /* Can this be made a '!check' after the Unicode check? */ + from_s = PyString_AS_STRING(from); + from_len = PyString_GET_SIZE(from); } #ifdef Py_USING_UNICODE if (PyUnicode_Check(from)) return PyUnicode_Replace((PyObject *)self, from, to, count); #endif - else if (PyObject_AsCharBuffer(from, &tmp_s, &tmp_len)) + else if (PyObject_AsCharBuffer(from, &from_s, &from_len)) return NULL; if (PyString_Check(to)) { - /* Can this be made a '!check' after the Unicode check? */ + to_s = PyString_AS_STRING(to); + to_len = PyString_GET_SIZE(to); } #ifdef Py_USING_UNICODE else if (PyUnicode_Check(to)) return PyUnicode_Replace((PyObject *)self, from, to, count); #endif - else if (PyObject_AsCharBuffer(to, &tmp_s, &tmp_len)) + else if (PyObject_AsCharBuffer(to, &to_s, &to_len)) return NULL; return (PyObject *)replace((PyStringObject *) self, - (PyStringObject *) from, - (PyStringObject *) to, count); + from_s, from_len, + to_s, to_len, count); } /** End DALKE **/ Modified: python/branches/bcannon-sandboxing/Objects/typeobject.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/typeobject.c (original) +++ python/branches/bcannon-sandboxing/Objects/typeobject.c Wed Aug 2 00:51:44 2006 @@ -3260,6 +3260,8 @@ if (PyDict_GetItemString(type->tp_dict, "__doc__") == NULL) { if (type->tp_doc != NULL) { PyObject *doc = PyString_FromString(type->tp_doc); + if (doc == NULL) + goto error; PyDict_SetItemString(type->tp_dict, "__doc__", doc); Py_DECREF(doc); } else { Modified: python/branches/bcannon-sandboxing/Objects/unicodeobject.c ============================================================================== --- python/branches/bcannon-sandboxing/Objects/unicodeobject.c (original) +++ python/branches/bcannon-sandboxing/Objects/unicodeobject.c Wed Aug 2 00:51:44 2006 @@ -7918,6 +7918,9 @@ unicode_freelist = NULL; unicode_freelist_size = 0; unicode_empty = _PyUnicode_New(0); + if (!unicode_empty) + return; + strcpy(unicode_default_encoding, "ascii"); for (i = 0; i < 256; i++) unicode_latin1[i] = NULL; Modified: python/branches/bcannon-sandboxing/PC/_winreg.c ============================================================================== --- python/branches/bcannon-sandboxing/PC/_winreg.c (original) +++ python/branches/bcannon-sandboxing/PC/_winreg.c Wed Aug 2 00:51:44 2006 @@ -960,7 +960,9 @@ return NULL; if (!PyHKEY_AsHKEY(obKey, &hKey, FALSE)) return NULL; + Py_BEGIN_ALLOW_THREADS rc = RegConnectRegistry(szCompName, hKey, &retKey); + Py_END_ALLOW_THREADS if (rc != ERROR_SUCCESS) return PyErr_SetFromWindowsErrWithFunction(rc, "ConnectRegistry"); Modified: python/branches/bcannon-sandboxing/PC/config.c ============================================================================== --- python/branches/bcannon-sandboxing/PC/config.c (original) +++ python/branches/bcannon-sandboxing/PC/config.c Wed Aug 2 00:51:44 2006 @@ -67,6 +67,7 @@ extern void init_subprocess(void); extern void init_lsprof(void); extern void init_ast(void); +extern void init_types(void); /* tools/freeze/makeconfig.py marker for additional "extern" */ /* -- ADDMODULE MARKER 1 -- */ @@ -161,6 +162,8 @@ {"__builtin__", NULL}, {"sys", NULL}, {"exceptions", NULL}, + + {"_types", init_types}, /* Sentinel */ {0, 0} Modified: python/branches/bcannon-sandboxing/PC/getpathp.c ============================================================================== --- python/branches/bcannon-sandboxing/PC/getpathp.c (original) +++ python/branches/bcannon-sandboxing/PC/getpathp.c Wed Aug 2 00:51:44 2006 @@ -297,6 +297,10 @@ } RegCloseKey(subKey); } + + /* return null if no path to return */ + if (dataSize == 0) goto done; + /* original datasize from RegQueryInfo doesn't include the \0 */ dataBuf = malloc((dataSize+1) * sizeof(TCHAR)); if (dataBuf) { Modified: python/branches/bcannon-sandboxing/PC/os2emx/Makefile ============================================================================== --- python/branches/bcannon-sandboxing/PC/os2emx/Makefile (original) +++ python/branches/bcannon-sandboxing/PC/os2emx/Makefile Wed Aug 2 00:51:44 2006 @@ -2,15 +2,15 @@ # # Top-Level Makefile for Building Python 2.4 for OS/2 using GCC/EMX # Originally written by Andrew Zabolotny, for Python 1.5.2 -# Modified by Andrew MacIntyre, for Python 2.4 +# Modified by Andrew MacIntyre, for Python 2.5 # # This makefile was developed for use with [P]GCC/EMX compiler any # version and GNU Make. # -# The output of the build is a largish Python24.DLL containing the +# The output of the build is a largish Python25.DLL containing the # essential modules of Python and a small Python.exe program to start # the interpreter. When embedding Python within another program, only -# Python24.DLL is needed. We also build python_s.a static library (which +# Python25.DLL is needed. We also build python_s.a static library (which # can be converted into OMF (.lib) format using emxomf tool) and both # python.a and python.lib import libraries. Then the optional # extension modules, which are OS/2 DLLs renamed with a PYD file extension. @@ -64,7 +64,7 @@ # === install locations === # default value of PYTHONHOME -LIB_DIR=C:/Python24 +LIB_DIR=C:/Python25 # default is to have everything in or under PYTHONHOME EXE_DIR=$(LIB_DIR) DLL_DIR=$(EXE_DIR) @@ -236,8 +236,8 @@ @echo STACKSIZE 2097152 >>$@ # Output file names -PYTHON_VER= 2.4 -PYTHON_LIB= python24 +PYTHON_VER= 2.5 +PYTHON_LIB= python25 PYTHON.LIB= $(PYTHON_LIB)_s$A PYTHON.IMPLIB= $(PYTHON_LIB)$A ifeq ($(EXEOMF),yes) @@ -295,20 +295,23 @@ Modules/dlmodule.c \ Modules/errnomodule.c \ Modules/fcntlmodule.c \ + Modules/_functoolsmodule.c \ Modules/_heapqmodule.c \ Modules/imageop.c \ Modules/itertoolsmodule.c \ Modules/_localemodule.c \ Modules/mathmodule.c \ - Modules/md5c.c \ + Modules/md5.c \ Modules/md5module.c \ Modules/operator.c \ Modules/_randommodule.c \ Modules/rgbimgmodule.c \ Modules/shamodule.c \ + Modules/sha256module.c \ + Modules/sha512module.c \ Modules/_sre.c \ Modules/stropmodule.c \ - Modules/structmodule.c \ + Modules/_struct.c \ Modules/symtablemodule.c \ Modules/termios.c \ Modules/timemodule.c \ @@ -331,6 +334,9 @@ SRC.PARSER= $(SRC.PARSE1) \ $(SRC.PARSE2) SRC.PYTHON= $(addprefix $(TOP), \ + Python/Python-ast.c \ + Python/asdl.c \ + Python/ast.c \ Python/bltinmodule.c \ Python/exceptions.c \ Python/ceval.c \ @@ -353,6 +359,7 @@ Python/modsupport.c \ Python/mysnprintf.c \ Python/mystrtoul.c \ + Python/pyarena.c \ Python/pyfpe.c \ Python/pystate.c \ Python/pystrtod.c \ @@ -371,6 +378,7 @@ Objects/cellobject.c \ Objects/classobject.c \ Objects/cobject.c \ + Objects/codeobject.c \ Objects/complexobject.c \ Objects/descrobject.c \ Objects/dictobject.c \ Modified: python/branches/bcannon-sandboxing/PC/os2emx/README.os2emx ============================================================================== --- python/branches/bcannon-sandboxing/PC/os2emx/README.os2emx (original) +++ python/branches/bcannon-sandboxing/PC/os2emx/README.os2emx Wed Aug 2 00:51:44 2006 @@ -612,22 +612,11 @@ test_posixpath should skip these tests on EMX. -24. I have had a report that attempting to use the Bittorrent package -(http://bitconjurer.org/BitTorrent/) with this port causes traps not -long after starting the download; this using the "headless" download -script on eCS v1.1. I have not been able to duplicate this myself, -but the indications I have suggest a failure in the 32 bit TCP/IP -stack (v4.3.2? on eCS v1.1) - on my v4.0 FP12 system with MPTS fixpack -WR8425 applied (16 bit TCP/IP stack v4.02), BitTorrent appears to work -normally in testing on a 100Mbit LAN. With the curses.panel fix (see -item 13 above), the BitTorrent curses downloader works too. I'd -appreciate any success or failure reports with BitTorrent, though -I've regretfully recommended that the person who reported the failure -take this up with eCS support. Since this report, I have received a -followup which suggests that the problem may be addressed by TCP/IP -fixes (IC35005+PJ29457, contained in NEWSTACK.ZIP in the Hobbes -archive). I think it suffices to say that BitTorrent is a fair stress -test of a system's networking capability. +24. I have reports of BitTorrent not working. It appears that the +EMX select() emulation, possibly in concert with bugs in the TCP/IP +stack, runs into problems under the stress imposed by this application. +I think it suffices to say that BitTorrent is a fair stress test of a +system's networking capability. 25. In the absence of an EMX implementation of the link() function, I've implemented a crude Python emulation, in the file @@ -659,14 +648,16 @@ 29. The default stack size for threads has been 64k. This is proving insufficient for some codebases, such as Zope. The thread stack size -still defaults to 64k, but this can now be increased by defining +still defaults to 64k, but this can now be increased via the stack_size() +function exposed by the threading & thread modules as well as by defining THREAD_STACK_SIZE to an appropriate value in the Makefile (which contains a commented out definition for 128kB thread stacks). I have seen references to heavy Zope/Plone usage requiring 1MB thread stacks on FreeBSD and Linux, but doubt that for most likely usage on OS/2 that more than 256kB is necessary. The size of the required stacks (main and thread) can vary significantly depending on which version of gcc -is used along with the compiler optimisations selected. +is used along with the compiler optimisations selected. Note that the +main thread stack size is set during linking and is currently 2MB. ... probably other issues that I've not encountered, or don't remember :-( @@ -707,4 +698,4 @@ E-mail: andymac at bullseye.apana.org.au, or andymac at pcug.org.au Web: http://www.andymac.org/ -17 February, 2005. +23 July, 2006. Modified: python/branches/bcannon-sandboxing/PC/os2emx/config.c ============================================================================== --- python/branches/bcannon-sandboxing/PC/os2emx/config.c (original) +++ python/branches/bcannon-sandboxing/PC/os2emx/config.c Wed Aug 2 00:51:44 2006 @@ -58,16 +58,19 @@ extern void initdl(); extern void initerrno(); extern void initfcntl(); +extern void init_functools(); extern void init_heapq(); extern void initimageop(); extern void inititertools(); extern void initmath(); -extern void initmd5(); +extern void init_md5(); extern void initoperator(); extern void initrgbimg(); -extern void initsha(); +extern void init_sha(); +extern void init_sha256(); +extern void init_sha512(); extern void initstrop(); -extern void initstruct(); +extern void init_struct(); extern void inittermios(); extern void inittime(); extern void inittiming(); @@ -121,16 +124,19 @@ {"dl", initdl}, {"errno", initerrno}, {"fcntl", initfcntl}, + {"_functools", init_functools}, {"_heapq", init_heapq}, {"imageop", initimageop}, {"itertools", inititertools}, {"math", initmath}, - {"md5", initmd5}, + {"_md5", init_md5}, {"operator", initoperator}, {"rgbimg", initrgbimg}, - {"sha", initsha}, + {"_sha", init_sha}, + {"_sha256", init_sha256}, + {"_sha512", init_sha512}, {"strop", initstrop}, - {"struct", initstruct}, + {"_struct", init_struct}, {"termios", inittermios}, {"time", inittime}, {"timing", inittiming}, Modified: python/branches/bcannon-sandboxing/PC/os2emx/pyconfig.h ============================================================================== --- python/branches/bcannon-sandboxing/PC/os2emx/pyconfig.h (original) +++ python/branches/bcannon-sandboxing/PC/os2emx/pyconfig.h Wed Aug 2 00:51:44 2006 @@ -46,6 +46,7 @@ #define TCPIPV4 1 #define USE_SOCKET 1 #define socklen_t int +#define FD_SETSIZE 1024 /* enable the Python object allocator */ #define WITH_PYMALLOC 1 @@ -61,6 +62,9 @@ #define PY_UNICODE_TYPE wchar_t #define Py_UNICODE_SIZE SIZEOF_SHORT +/* EMX defines ssize_t */ +#define HAVE_SSIZE_T 1 + /* system capabilities */ #define HAVE_TTYNAME 1 #define HAVE_WAIT 1 @@ -137,6 +141,9 @@ /* The number of bytes in a void *. */ #define SIZEOF_VOID_P 4 +/* The number of bytes in a size_t. */ +#define SIZEOF_SIZE_T 4 + /* Define if you have the alarm function. */ #define HAVE_ALARM 1 Deleted: /python/branches/bcannon-sandboxing/PC/os2emx/python24.def ============================================================================== --- /python/branches/bcannon-sandboxing/PC/os2emx/python24.def Wed Aug 2 00:51:44 2006 +++ (empty file) @@ -1,1173 +0,0 @@ -LIBRARY python24 INITINSTANCE TERMINSTANCE -DESCRIPTION "Python 2.4 Core DLL" -PROTMODE -DATA MULTIPLE NONSHARED -EXPORTS - -; From python24_s.lib(config) - "_PyImport_Inittab" - -; From python24_s.lib(dlfcn) -; "dlopen" -; "dlsym" -; "dlclose" -; "dlerror" - -; From python24_s.lib(getpathp) - "Py_GetProgramFullPath" - "Py_GetPrefix" - "Py_GetExecPrefix" - "Py_GetPath" - -; From python24_s.lib(getbuildinfo) - "Py_GetBuildInfo" - -; From python24_s.lib(main) - "Py_Main" - "Py_GetArgcArgv" - -; From python24_s.lib(acceler) - "PyGrammar_AddAccelerators" - "PyGrammar_RemoveAccelerators" - -; From python24_s.lib(grammar1) - "PyGrammar_FindDFA" - "PyGrammar_LabelRepr" - -; From python24_s.lib(listnode) - "PyNode_ListTree" - -; From python24_s.lib(node) - "PyNode_AddChild" - "PyNode_New" - "PyNode_Free" - -; From python24_s.lib(parser) - "PyParser_AddToken" - "PyParser_New" - "PyParser_Delete" - -; From python24_s.lib(parsetok) - "Py_TabcheckFlag" - "PyParser_ParseString" - "PyParser_ParseStringFlags" - "PyParser_ParseFile" - "PyParser_ParseFileFlags" - "PyParser_ParseStringFlagsFilename" - -; From python24_s.lib(bitset) - "_Py_newbitset" - "_Py_delbitset" - "_Py_addbit" - "_Py_samebitset" - "_Py_mergebitset" - -; From python24_s.lib(metagrammar) - "_Py_meta_grammar" - "Py_meta_grammar" - -; From python24_s.lib(tokenizer) - "PyToken_OneChar" - "PyToken_TwoChars" - "PyToken_ThreeChars" - "PyTokenizer_FromString" - "PyTokenizer_FromFile" - "PyTokenizer_Free" - "PyTokenizer_Get" - "_PyParser_TokenNames" - -; From python24_s.lib(myreadline) - "_PyOS_ReadlineTState" - "PyOS_ReadlineFunctionPointer" - "PyOS_StdioReadline" - "PyOS_Readline" - "PyOS_InputHook" - -; From python24_s.lib(abstract) - "PyObject_GetItem" - "PySequence_GetItem" - "PyObject_SetItem" - "PySequence_SetItem" - "PyObject_DelItem" - "PySequence_DelItem" - "PyNumber_Multiply" - "PyNumber_InPlaceAdd" - "PyNumber_InPlaceMultiply" - "PyNumber_Int" - "PyNumber_Long" - "PyNumber_Float" - "PySequence_GetSlice" - "PySequence_SetSlice" - "PySequence_Tuple" - "PyObject_GetIter" - "PyMapping_Size" - "PyIter_Next" - "_PySequence_IterSearch" - "PyObject_CallFunction" - "PyObject_CallMethod" - "PyObject_CallMethodObjArgs" - "PyObject_CallFunctionObjArgs" - "PyObject_Cmp" - "PyObject_Call" - "PyObject_CallObject" - "PyObject_Type" - "PyObject_Size" - "PyObject_Length" - "PyObject_DelItemString" - "PyObject_AsCharBuffer" - "PyObject_CheckReadBuffer" - "PyObject_AsReadBuffer" - "PyObject_AsWriteBuffer" - "PyNumber_Check" - "PyNumber_Add" - "PyNumber_Subtract" - "PyNumber_Divide" - "PyNumber_FloorDivide" - "PyNumber_TrueDivide" - "PyNumber_Remainder" - "PyNumber_Divmod" - "PyNumber_Power" - "PyNumber_Negative" - "PyNumber_Positive" - "PyNumber_Absolute" - "PyNumber_Invert" - "PyNumber_Lshift" - "PyNumber_Rshift" - "PyNumber_And" - "PyNumber_Xor" - "PyNumber_Or" - "PyNumber_InPlaceSubtract" - "PyNumber_InPlaceDivide" - "PyNumber_InPlaceFloorDivide" - "PyNumber_InPlaceTrueDivide" - "PyNumber_InPlaceRemainder" - "PyNumber_InPlacePower" - "PyNumber_InPlaceLshift" - "PyNumber_InPlaceRshift" - "PyNumber_InPlaceAnd" - "PyNumber_InPlaceXor" - "PyNumber_InPlaceOr" - "PySequence_Check" - "PySequence_Size" - "PySequence_Length" - "PySequence_Concat" - "PySequence_Repeat" - "PySequence_DelSlice" - "PySequence_List" - "PySequence_Fast" - "PySequence_Count" - "PySequence_Contains" - "PySequence_In" - "PySequence_Index" - "PySequence_InPlaceConcat" - "PySequence_InPlaceRepeat" - "PyMapping_Check" - "PyMapping_Length" - "PyMapping_HasKeyString" - "PyMapping_HasKey" - "PyMapping_GetItemString" - "PyMapping_SetItemString" - "PyObject_IsInstance" - "PyObject_IsSubclass" - -; From python24_s.lib(boolobject) - "PyBool_FromLong" - "PyBool_Type" - "_Py_ZeroStruct" - "_Py_TrueStruct" - -; From python24_s.lib(bufferobject) - "PyBuffer_FromObject" - "PyBuffer_FromReadWriteObject" - "PyBuffer_FromMemory" - "PyBuffer_FromReadWriteMemory" - "PyBuffer_New" - "PyBuffer_Type" - -; From python24_s.lib(cellobject) - "PyCell_New" - "PyCell_Get" - "PyCell_Set" - "PyCell_Type" - -; From python24_s.lib(classobject) - "PyClass_New" - "PyClass_IsSubclass" - "PyInstance_New" - "PyInstance_NewRaw" - "PyMethod_New" - "PyMethod_Function" - "PyMethod_Self" - "PyMethod_Class" - "_PyInstance_Lookup" - "PyMethod_Fini" - "PyClass_Type" - "PyInstance_Type" - "PyMethod_Type" - -; From python24_s.lib(cobject) - "PyCObject_FromVoidPtr" - "PyCObject_FromVoidPtrAndDesc" - "PyCObject_AsVoidPtr" - "PyCObject_GetDesc" - "PyCObject_Import" - "PyCObject_SetVoidPtr" - "PyCObject_Type" - -; From python24_s.lib(complexobject) - "_Py_c_pow" - "_Py_c_sum" - "_Py_c_diff" - "_Py_c_neg" - "_Py_c_prod" - "_Py_c_quot" - "PyComplex_FromCComplex" - "PyComplex_FromDoubles" - "PyComplex_RealAsDouble" - "PyComplex_ImagAsDouble" - "PyComplex_AsCComplex" - "PyComplex_Type" - -; From python24_s.lib(descrobject) - "PyWrapper_New" - "PyDescr_NewMethod" - "PyDescr_NewClassMethod" - "PyDescr_NewMember" - "PyDescr_NewGetSet" - "PyDescr_NewWrapper" - "PyDictProxy_New" - "PyWrapperDescr_Type" - "PyProperty_Type" - -; From python24_s.lib(dictobject) - "PyDict_New" - "PyDict_SetItem" - "PyDict_DelItem" - "PyDict_Clear" - "PyDict_MergeFromSeq2" - "PyDict_Merge" - "PyDict_Keys" - "PyDict_Values" - "PyDict_Contains" - "PyDict_GetItem" - "PyDict_Next" - "PyDict_Items" - "PyDict_Size" - "PyDict_Copy" - "PyDict_Update" - "PyDict_GetItemString" - "PyDict_SetItemString" - "PyDict_DelItemString" - "PyDict_Type" - "PyDictIterKey_Type" - "PyDictIterValue_Type" - "PyDictIterItem_Type" - -; From python24_s.lib(enumobject) - "PyEnum_Type" - "PyReversed_Type" - -; From python24_s.lib(fileobject) - "Py_UniversalNewlineFread" - "PyFile_GetLine" - "PyFile_SoftSpace" - "PyFile_WriteObject" - "PyFile_WriteString" - "PyObject_AsFileDescriptor" - "Py_UniversalNewlineFgets" - "PyFile_FromString" - "PyFile_SetBufSize" - "PyFile_SetEncoding" - "PyFile_FromFile" - "PyFile_AsFile" - "PyFile_Name" - "PyFile_Type" - -; From python24_s.lib(floatobject) - "PyFloat_FromString" - "PyFloat_AsDouble" - "PyFloat_Fini" - "_PyFloat_Pack4" - "_PyFloat_Pack8" - "PyFloat_FromDouble" - "PyFloat_AsReprString" - "PyFloat_AsString" - "_PyFloat_Unpack4" - "_PyFloat_Unpack8" - "PyFloat_AsStringEx" - "PyFloat_Type" - -; From python24_s.lib(frameobject) - "PyFrame_New" - "PyFrame_FastToLocals" - "PyFrame_LocalsToFast" - "_PyFrame_Init" - "PyFrame_Fini" - "PyFrame_BlockSetup" - "PyFrame_BlockPop" - "PyFrame_Type" - -; From python24_s.lib(funcobject) - "PyFunction_New" - "PyFunction_GetCode" - "PyFunction_GetGlobals" - "PyFunction_GetModule" - "PyFunction_GetDefaults" - "PyFunction_SetDefaults" - "PyFunction_GetClosure" - "PyFunction_SetClosure" - "PyClassMethod_New" - "PyStaticMethod_New" - "PyFunction_Type" - "PyClassMethod_Type" - "PyStaticMethod_Type" - -; From python24_s.lib(genobject) - "PyGen_New" - "PyGen_Type" - -; From python24_s.lib(intobject) - "PyInt_AsLong" - "PyInt_AsUnsignedLongMask" - "PyInt_AsUnsignedLongLongMask" - "PyInt_FromString" - "PyInt_Fini" - "PyInt_FromUnicode" - "PyInt_FromLong" - "PyInt_GetMax" - "_PyInt_Init" - "PyInt_Type" - -; From python24_s.lib(iterobject) - "PySeqIter_New" - "PyCallIter_New" - "PySeqIter_Type" - "PyCallIter_Type" - -; From python24_s.lib(listobject) - "PyList_New" - "PyList_Append" - "PyList_Size" - "PyList_GetItem" - "PyList_SetItem" - "PyList_Insert" - "PyList_GetSlice" - "PyList_SetSlice" - "PyList_Sort" - "PyList_Reverse" - "PyList_AsTuple" - "_PyList_Extend" - "PyList_Type" - "PyListIter_Type" - "PyListRevIter_Type" - -; From python24_s.lib(longobject) - "PyLong_FromDouble" - "PyLong_AsLong" - "PyLong_AsUnsignedLong" - "_PyLong_FromByteArray" - "_PyLong_AsByteArray" - "PyLong_AsDouble" - "PyLong_FromString" - "PyLong_FromLong" - "PyLong_FromUnsignedLong" - "PyLong_AsUnsignedLongMask" - "_PyLong_AsScaledDouble" - "PyLong_FromVoidPtr" - "PyLong_AsVoidPtr" - "PyLong_FromLongLong" - "PyLong_FromUnsignedLongLong" - "PyLong_AsLongLong" - "PyLong_AsUnsignedLongLong" - "PyLong_AsUnsignedLongLongMask" - "PyLong_FromUnicode" - "_PyLong_Sign" - "_PyLong_NumBits" - "_PyLong_New" - "_PyLong_Copy" - "PyLong_Type" - -; From python24_s.lib(methodobject) - "PyCFunction_Call" - "Py_FindMethodInChain" - "PyCFunction_GetFunction" - "PyCFunction_GetSelf" - "PyCFunction_GetFlags" - "Py_FindMethod" - "PyCFunction_NewEx" - "PyCFunction_Fini" - "PyCFunction_New" - "PyCFunction_Type" - -; From python24_s.lib(moduleobject) - "PyModule_New" - "_PyModule_Clear" - "PyModule_GetDict" - "PyModule_GetName" - "PyModule_GetFilename" - "PyModule_Type" - -; From python24_s.lib(object) - "Py_DivisionWarningFlag" - "PyObject_Str" - "PyObject_Repr" - "PyObject_Unicode" - "PyObject_GetAttr" - "PyObject_IsTrue" - "PyNumber_CoerceEx" - "PyObject_Compare" - "PyObject_RichCompare" - "_Py_HashDouble" - "PyObject_Hash" - "PyObject_SetAttr" - "PyObject_GenericGetAttr" - "PyObject_GenericSetAttr" - "PyCallable_Check" - "PyObject_Dir" - "PyMem_Malloc" - "PyMem_Realloc" - "PyMem_Free" - "PyObject_Print" - "_PyObject_Dump" - "PyObject_RichCompareBool" - "PyObject_GetAttrString" - "PyObject_SetAttrString" - "PyObject_HasAttrString" - "PyObject_HasAttr" - "_PyObject_GetDictPtr" - "PyObject_SelfIter" - "PyObject_Not" - "PyNumber_Coerce" - "Py_ReprEnter" - "Py_ReprLeave" - "_Py_HashPointer" - "Py_IncRef" - "Py_DecRef" - "_PyTrash_deposit_object" - "_PyTrash_destroy_chain" - "PyObject_Init" - "PyObject_InitVar" - "_PyObject_New" - "_PyObject_NewVar" - "_PyObject_Del" - "_Py_ReadyTypes" - "_Py_SwappedOp" - "_Py_NotImplementedStruct" - "_Py_NoneStruct" - "_Py_cobject_hack" - "_Py_abstract_hack" - "_PyTrash_delete_nesting" - "_PyTrash_delete_later" - -; From python24_s.lib(obmalloc) - "PyObject_Malloc" - "PyObject_Realloc" - "PyObject_Free" - -; From python24_s.lib(rangeobject) - "PyRange_New" - "PyRange_Type" - -; From python24_s.lib(setobject) - "PySet_Type" - "PyFrozenSet_Type" - -; From python24_s.lib(sliceobject) - "PySlice_GetIndices" - "PySlice_GetIndicesEx" - "PySlice_New" - "_Py_EllipsisObject" - "PySlice_Type" - -; From python24_s.lib(stringobject) - "PyString_FromStringAndSize" - "PyString_InternInPlace" - "PyString_FromString" - "PyString_FromFormatV" - "PyString_AsString" - "_PyString_Resize" - "PyString_FromFormat" - "PyString_AsDecodedString" - "PyString_AsEncodedString" - "PyString_DecodeEscape" - "PyString_Size" - "PyString_Repr" - "PyString_AsStringAndSize" - "_PyString_FormatLong" - "PyString_Format" - "_Py_ReleaseInternedStrings" - "PyString_Concat" - "PyString_ConcatAndDel" - "_PyString_Eq" - "PyString_InternImmortal" - "PyString_InternFromString" - "_PyString_Join" - "PyString_Decode" - "PyString_Encode" - "PyString_AsEncodedObject" - "PyString_AsDecodedObject" - "PyString_Fini" - "PyString_Type" - "PyBaseString_Type" - -; From python24_s.lib(structseq) - "PyStructSequence_InitType" - "PyStructSequence_New" - "PyStructSequence_UnnamedField" - -; From python24_s.lib(tupleobject) - "PyTuple_New" - "PyTuple_Pack" - "_PyTuple_Resize" - "PyTuple_Size" - "PyTuple_GetItem" - "PyTuple_SetItem" - "PyTuple_GetSlice" - "PyTuple_Fini" - "PyTuple_Type" - "PyTupleIter_Type" - -; From python24_s.lib(typeobject) - "PyType_IsSubtype" - "_PyType_Lookup" - "PyType_Ready" - "PyType_GenericAlloc" - "_PyObject_SlotCompare" - "PyType_GenericNew" - "PyType_Type" - "PyBaseObject_Type" - "PySuper_Type" - -; From python24_s.lib(unicodeobject) - "PyUnicodeUCS2_Resize" - "PyUnicodeUCS2_FromOrdinal" - "PyUnicodeUCS2_FromObject" - "PyUnicodeUCS2_FromEncodedObject" - "PyUnicodeUCS2_Decode" - "PyUnicodeUCS2_GetDefaultEncoding" - "PyUnicodeUCS2_DecodeUTF8" - "PyUnicodeUCS2_DecodeLatin1" - "PyUnicodeUCS2_DecodeASCII" - "PyUnicodeUCS2_AsEncodedString" - "PyUnicodeUCS2_AsUTF8String" - "PyUnicodeUCS2_AsLatin1String" - "PyUnicodeUCS2_AsASCIIString" - "PyUnicode_DecodeUTF7" - "PyUnicode_EncodeUTF7" - "PyUnicodeUCS2_DecodeUTF8Stateful" - "PyUnicodeUCS2_EncodeUTF8" - "PyUnicodeUCS2_DecodeUTF16Stateful" - "PyUnicodeUCS2_AsUTF16String" - "PyUnicodeUCS2_DecodeUnicodeEscape" - "PyUnicodeUCS2_DecodeRawUnicodeEscape" - "PyUnicodeUCS2_EncodeRawUnicodeEscape" - "PyUnicodeUCS2_DecodeCharmap" - "PyUnicodeUCS2_EncodeCharmap" - "PyUnicodeUCS2_TranslateCharmap" - "PyUnicodeUCS2_EncodeDecimal" - "PyUnicodeUCS2_Count" - "PyUnicodeUCS2_Find" - "PyUnicodeUCS2_Tailmatch" - "PyUnicodeUCS2_Join" - "PyUnicodeUCS2_Splitlines" - "PyUnicodeUCS2_Compare" - "PyUnicodeUCS2_Contains" - "PyUnicodeUCS2_Concat" - "_PyUnicode_XStrip" - "PyUnicodeUCS2_Replace" - "PyUnicodeUCS2_Split" - "PyUnicodeUCS2_RSplit" - "PyUnicodeUCS2_Format" - "_PyUnicodeUCS2_Fini" - "PyUnicodeUCS2_FromUnicode" - "PyUnicodeUCS2_AsUnicode" - "PyUnicodeUCS2_GetSize" - "PyUnicodeUCS2_GetMax" - "_PyUnicodeUCS2_AsDefaultEncodedString" - "PyUnicodeUCS2_SetDefaultEncoding" - "PyUnicodeUCS2_Encode" - "PyUnicodeUCS2_AsEncodedObject" - "PyUnicodeUCS2_DecodeUTF16" - "PyUnicodeUCS2_EncodeUTF16" - "PyUnicodeUCS2_AsUnicodeEscapeString" - "PyUnicodeUCS2_EncodeUnicodeEscape" - "PyUnicodeUCS2_AsRawUnicodeEscapeString" - "PyUnicodeUCS2_EncodeLatin1" - "PyUnicodeUCS2_EncodeASCII" - "PyUnicodeUCS2_AsCharmapString" - "PyUnicodeUCS2_Translate" - "PyUnicode_AsDecodedObject" - "_PyUnicodeUCS2_Init" - "PyUnicode_Type" - -; From python24_s.lib(unicodectype) - "_PyUnicode_TypeRecords" - "_PyUnicodeUCS2_ToNumeric" - "_PyUnicodeUCS2_IsLowercase" - "_PyUnicodeUCS2_IsUppercase" - "_PyUnicodeUCS2_IsTitlecase" - "_PyUnicodeUCS2_IsWhitespace" - "_PyUnicodeUCS2_IsLinebreak" - "_PyUnicodeUCS2_ToLowercase" - "_PyUnicodeUCS2_ToUppercase" - "_PyUnicodeUCS2_ToTitlecase" - "_PyUnicodeUCS2_ToDecimalDigit" - "_PyUnicodeUCS2_ToDigit" - "_PyUnicodeUCS2_IsDecimalDigit" - "_PyUnicodeUCS2_IsDigit" - "_PyUnicodeUCS2_IsNumeric" - "_PyUnicodeUCS2_IsAlpha" - -; From python24_s.lib(weakrefobject) - "PyWeakref_NewRef" - "PyWeakref_NewProxy" - "PyObject_ClearWeakRefs" - "PyWeakref_GetObject" - "_PyWeakref_GetWeakrefCount" - "_PyWeakref_ClearRef" - "_PyWeakref_RefType" - "_PyWeakref_ProxyType" - "_PyWeakref_CallableProxyType" - -; From python24_s.lib(bltinmodule) - "_PyBuiltin_Init" - "Py_FileSystemDefaultEncoding" - -; From python24_s.lib(exceptions) - "PyExc_Exception" - "PyExc_TypeError" - "PyExc_StopIteration" - "PyExc_StandardError" - "PyExc_SystemExit" - "PyExc_KeyboardInterrupt" - "PyExc_ImportError" - "PyExc_EnvironmentError" - "PyExc_IOError" - "PyExc_OSError" - "PyExc_EOFError" - "PyExc_RuntimeError" - "PyExc_NotImplementedError" - "PyExc_NameError" - "PyExc_UnboundLocalError" - "PyExc_AttributeError" - "PyExc_SyntaxError" - "PyExc_IndentationError" - "PyExc_TabError" - "PyExc_AssertionError" - "PyExc_LookupError" - "PyExc_IndexError" - "PyExc_KeyError" - "PyExc_ArithmeticError" - "PyExc_OverflowError" - "PyExc_ZeroDivisionError" - "PyExc_FloatingPointError" - "PyExc_ValueError" - "PyExc_UnicodeError" - "PyExc_UnicodeEncodeError" - "PyExc_UnicodeDecodeError" - "PyExc_UnicodeTranslateError" - "PyExc_ReferenceError" - "PyExc_SystemError" - "PyExc_MemoryError" - "PyExc_Warning" - "PyExc_UserWarning" - "PyExc_DeprecationWarning" - "PyExc_PendingDeprecationWarning" - "PyExc_SyntaxWarning" - "PyExc_OverflowWarning" - "PyExc_RuntimeWarning" - "PyExc_FutureWarning" - "PyExc_MemoryErrorInst" - "PyUnicodeEncodeError_GetStart" - "PyUnicodeDecodeError_GetStart" - "PyUnicodeEncodeError_GetEnd" - "PyUnicodeDecodeError_GetEnd" - "_PyExc_Init" - "_PyExc_Fini" - "PyUnicodeDecodeError_Create" - "PyUnicodeEncodeError_Create" - "PyUnicodeTranslateError_Create" - "PyUnicodeEncodeError_GetEncoding" - "PyUnicodeDecodeError_GetEncoding" - "PyUnicodeEncodeError_GetObject" - "PyUnicodeDecodeError_GetObject" - "PyUnicodeTranslateError_GetObject" - "PyUnicodeTranslateError_GetStart" - "PyUnicodeEncodeError_SetStart" - "PyUnicodeDecodeError_SetStart" - "PyUnicodeTranslateError_SetStart" - "PyUnicodeTranslateError_GetEnd" - "PyUnicodeEncodeError_SetEnd" - "PyUnicodeDecodeError_SetEnd" - "PyUnicodeTranslateError_SetEnd" - "PyUnicodeEncodeError_GetReason" - "PyUnicodeDecodeError_GetReason" - "PyUnicodeTranslateError_GetReason" - "PyUnicodeEncodeError_SetReason" - "PyUnicodeDecodeError_SetReason" - "PyUnicodeTranslateError_SetReason" - -; From python24_s.lib(ceval) - "PyEval_EvalFrame" - "PyEval_CallObjectWithKeywords" - "PyEval_EvalCodeEx" - "_PyEval_SliceIndex" - "PyEval_GetFrame" - "PyEval_CallObject" - "PyEval_SetProfile" - "PyEval_SetTrace" - "PyEval_GetBuiltins" - "PyEval_GetGlobals" - "PyEval_GetLocals" - "PyEval_GetRestricted" - "PyEval_MergeCompilerFlags" - "Py_FlushLine" - "Py_AddPendingCall" - "Py_MakePendingCalls" - "Py_SetRecursionLimit" - "Py_GetRecursionLimit" - "_Py_CheckRecursiveCall" - "PyEval_GetFuncName" - "PyEval_GetFuncDesc" - "PyEval_GetCallStats" - "PyEval_SaveThread" - "PyEval_RestoreThread" - "PyEval_InitThreads" - "PyEval_AcquireLock" - "PyEval_ReleaseLock" - "PyEval_AcquireThread" - "PyEval_ReleaseThread" - "PyEval_ReInitThreads" - "PyEval_EvalCode" - "_PyEval_CallTracing" - "_Py_CheckRecursionLimit" - "_Py_CheckInterval" - "_Py_Ticker" - -; From python24_s.lib(compile) - "PyCode_New" - "PySymtable_Free" - "PyNode_Compile" - "PyNode_CompileFlags" - "PyCode_Addr2Line" - "_Py_Mangle" - "PyNode_CompileSymtable" - "Py_OptimizeFlag" - "PyCode_Type" - -; From python24_s.lib(codecs) - "_PyCodec_Lookup" - "PyCodec_StreamReader" - "PyCodec_StreamWriter" - "PyCodec_Encode" - "PyCodec_Decode" - "PyCodec_IgnoreErrors" - "PyCodec_ReplaceErrors" - "PyCodec_XMLCharRefReplaceErrors" - "PyCodec_BackslashReplaceErrors" - "PyCodec_Register" - "PyCodec_Encoder" - "PyCodec_Decoder" - "PyCodec_RegisterError" - "PyCodec_LookupError" - "PyCodec_StrictErrors" - -; From python24_s.lib(errors) - "PyErr_SetNone" - "PyErr_SetString" - "PyErr_ExceptionMatches" - "PyErr_GivenExceptionMatches" - "PyErr_NormalizeException" - "PyErr_Fetch" - "PyErr_Clear" - "PyErr_NoMemory" - "PyErr_SetFromErrnoWithFilenameObject" - "PyErr_Format" - "PyErr_NewException" - "PyErr_WriteUnraisable" - "PyErr_SyntaxLocation" - "PyErr_ProgramText" - "PyErr_SetObject" - "PyErr_Occurred" - "PyErr_Restore" - "PyErr_BadArgument" - "PyErr_SetFromErrno" - "PyErr_SetFromErrnoWithFilename" - "PyErr_BadInternalCall" - "_PyErr_BadInternalCall" - "PyErr_Warn" - "PyErr_WarnExplicit" - -; From python24_s.lib(frozen) - "PyImport_FrozenModules" - -; From python24_s.lib(frozenmain) - "Py_FrozenMain" - -; From python24_s.lib(future) - "PyNode_Future" - -; From python24_s.lib(getargs) - "PyArg_Parse" - "PyArg_ParseTuple" - "PyArg_ParseTupleAndKeywords" - "PyArg_UnpackTuple" - "PyArg_VaParse" - "PyArg_VaParseTupleAndKeywords" - -; From python24_s.lib(getcompiler) - "Py_GetCompiler" - -; From python24_s.lib(getcopyright) - "Py_GetCopyright" - -; From python24_s.lib(getmtime) - "PyOS_GetLastModificationTime" - -; From python24_s.lib(getplatform) - "Py_GetPlatform" - -; From python24_s.lib(getversion) - "Py_GetVersion" - -; From python24_s.lib(graminit) - "_PyParser_Grammar" - -; From python24_s.lib(import) - "_PyImport_Init" - "_PyImportHooks_Init" - "PyImport_ImportModule" - "PyImport_Cleanup" - "_PyImport_FixupExtension" - "PyImport_AddModule" - "PyImport_ExecCodeModuleEx" - "PyImport_ImportFrozenModule" - "PyImport_ImportModuleEx" - "PyImport_ReloadModule" - "PyImport_Import" -; "initimp" - "_PyImport_Fini" - "PyImport_GetMagicNumber" - "PyImport_ExecCodeModule" - "PyImport_GetModuleDict" - "_PyImport_FindExtension" - "PyImport_AppendInittab" - "PyImport_ExtendInittab" - "PyImport_Inittab" - "_PyImport_Filetab" - -; From python24_s.lib(importdl) - "_PyImport_LoadDynamicModule" - -; From python24_s.lib(marshal) - "PyMarshal_ReadLongFromFile" - "PyMarshal_WriteObjectToString" - "PyMarshal_WriteLongToFile" - "PyMarshal_WriteObjectToFile" - "PyMarshal_ReadShortFromFile" - "PyMarshal_ReadObjectFromFile" - "PyMarshal_ReadLastObjectFromFile" - "PyMarshal_ReadObjectFromString" - "PyMarshal_Init" - -; From python24_s.lib(modsupport) - "Py_InitModule4" - "Py_BuildValue" - "Py_VaBuildValue" - "PyEval_CallFunction" - "PyEval_CallMethod" - "PyModule_AddObject" - "PyModule_AddIntConstant" - "PyModule_AddStringConstant" - "_Py_PackageContext" - -; From python24_s.lib(mysnprintf) - "PyOS_snprintf" - "PyOS_vsnprintf" - -; From python24_s.lib(mystrtoul) - "PyOS_strtoul" - "PyOS_strtol" - -; From python24_s.lib(pyfpe) - "PyFPE_dummy" - -; From python24_s.lib(pystate) - "PyInterpreterState_Clear" - "PyThreadState_Clear" - "PyGILState_Ensure" - "PyGILState_Release" - "PyInterpreterState_New" - "PyInterpreterState_Delete" - "PyThreadState_Delete" - "PyThreadState_New" - "PyThreadState_DeleteCurrent" - "PyThreadState_Get" - "PyThreadState_Swap" - "PyThreadState_GetDict" - "PyThreadState_SetAsyncExc" - "PyGILState_GetThisThreadState" - "PyInterpreterState_Head" - "PyInterpreterState_Next" - "PyInterpreterState_ThreadHead" - "PyThreadState_Next" - "_PyGILState_Init" - "_PyGILState_Fini" - "_PyThreadState_Current" - "_PyThreadState_GetFrame" - -; From python24_s.lib(pystrtod) - "PyOS_ascii_strtod" - "PyOS_ascii_formatd" - "PyOS_ascii_atof" - -; From python24_s.lib(pythonrun) - "Py_IgnoreEnvironmentFlag" - "Py_DebugFlag" - "Py_VerboseFlag" - "Py_NoSiteFlag" - "Py_InteractiveFlag" - "Py_FrozenFlag" - "Py_InitializeEx" - "Py_FatalError" - "Py_NewInterpreter" - "PyErr_Print" - "PyRun_InteractiveOneFlags" - "PyRun_SimpleFileExFlags" - "PyRun_FileExFlags" - "Py_Exit" - "PyErr_PrintEx" - "PyErr_Display" - "Py_SetProgramName" - "Py_GetProgramName" - "Py_SetPythonHome" - "Py_GetPythonHome" - "Py_Initialize" - "Py_Finalize" - "Py_IsInitialized" - "Py_EndInterpreter" - "PyRun_AnyFile" - "PyRun_AnyFileExFlags" - "PyRun_AnyFileEx" - "PyRun_AnyFileFlags" - "Py_FdIsInteractive" - "PyRun_InteractiveLoopFlags" - "PyRun_SimpleString" - "PyRun_SimpleStringFlags" - "PyRun_StringFlags" - "PyRun_SimpleFile" - "PyRun_SimpleFileEx" - "PyRun_InteractiveOne" - "PyRun_InteractiveLoop" - "PyParser_SimpleParseString" - "PyParser_SimpleParseFile" - "PyParser_SimpleParseStringFlags" - "PyParser_SimpleParseStringFlagsFilename" - "PyParser_SimpleParseFileFlags" - "PyRun_String" - "PyRun_File" - "PyRun_FileEx" - "PyRun_FileFlags" - "Py_CompileString" - "Py_CompileStringFlags" - "Py_SymtableString" - "Py_AtExit" - "PyOS_getsig" - "PyOS_setsig" - "PyParser_SetError" - "PyModule_GetWarningsModule" - "PyParser_SimpleParseStringFilename" - "Py_UseClassExceptionsFlag" - "Py_UnicodeFlag" - "_Py_QnewFlag" - -; From python24_s.lib(structmember) - "PyMember_Get" - "PyMember_GetOne" - "PyMember_SetOne" - "PyMember_Set" - -; From python24_s.lib(symtable) - "PySymtableEntry_New" - "PySymtableEntry_Type" - -; From python24_s.lib(sysmodule) - "_PySys_Init" - "PySys_SetPath" - "PySys_SetArgv" - "PySys_WriteStdout" - "PySys_WriteStderr" - "PySys_GetObject" - "PySys_SetObject" - "PySys_GetFile" - "PySys_ResetWarnOptions" - "PySys_AddWarnOption" - -; From python24_s.lib(traceback) - "PyTraceBack_Here" - "PyTraceBack_Print" - "PyTraceBack_Type" - -; From python24_s.lib(getopt) - "_PyOS_GetOpt" - "_PyOS_opterr" - "_PyOS_optind" - "_PyOS_optarg" - -; From python24_s.lib(dynload_shlib) - "_PyImport_DynLoadFiletab" - "_PyImport_GetDynLoadFunc" - -; From python24_s.lib(thread) - "PyThread_delete_key_value" - "PyThread_init_thread" - "PyThread_start_new_thread" - "PyThread_exit_thread" - "PyThread_get_thread_ident" - "PyThread_allocate_lock" - "PyThread_free_lock" - "PyThread_acquire_lock" - "PyThread_release_lock" - "PyThread_create_key" - "PyThread_delete_key" - "PyThread_set_key_value" - "PyThread_get_key_value" - "PyThread__exit_thread" - -; From python24_s.lib(gcmodule) -; "initgc" - "_PyObject_GC_New" - "_PyObject_GC_NewVar" - "PyGC_Collect" - "_PyObject_GC_Resize" - "_PyObject_GC_Malloc" - "PyObject_GC_Track" - "PyObject_GC_UnTrack" - "PyObject_GC_Del" - "_PyGC_Dump" - "_PyObject_GC_Track" - "_PyObject_GC_UnTrack" - "_PyObject_GC_Del" - "_PyGC_generation0" - -; From python24_s.lib(signalmodule) -; "initsignal" - "PyErr_CheckSignals" - "PyErr_SetInterrupt" - "PyOS_FiniInterrupts" - "PyOS_InterruptOccurred" - "PyOS_InitInterrupts" - "PyOS_AfterFork" - -; From python24_s.lib(posixmodule) -; "initos2" - -; From python24_s.lib(threadmodule) -; "initthread" - -; From python24_s.lib(arraymodule) -; "initarray" -; "array_methods" - -; From python24_s.lib(binascii) -; "initbinascii" - -; From python24_s.lib(cmathmodule) -; "initcmath" - -; From python24_s.lib(_codecsmodule) -; "init_codecs" - -; From python24_s.lib(collectionsmodule) -; "initcollections" - "dequeiter_type" - "dequereviter_type" - -; From python24_s.lib(cPickle) -; "initcPickle" -; "fast_save_leave" - -; From python24_s.lib(cStringIO) -; "initcStringIO" - -; From python24_s.lib(_csv) -; "init_csv" - -; From python24_s.lib(datetimemodule) -; "initdatetime" - -; From python24_s.lib(dlmodule) -; "initdl" - -; From python24_s.lib(errnomodule) -; "initerrno" - -; From python24_s.lib(fcntlmodule) -; "initfcntl" - -; From python24_s.lib(_heapqmodule) -; "init_heapq" - -; From python24_s.lib(imageop) -; "initimageop" - -; From python24_s.lib(itertoolsmodule) -; "inititertools" - -; From python24_s.lib(_localemodule) -; "init_locale" - -; From python24_s.lib(mathmodule) -; "initmath" - -; From python24_s.lib(md5c) -; "_Py_MD5Final" -; "_Py_MD5Init" -; "_Py_MD5Update" - -; From python24_s.lib(md5module) -; "initmd5" - -; From python24_s.lib(operator) -; "initoperator" - -; From python24_s.lib(_randommodule) -; "init_random" - -; From python24_s.lib(rgbimgmodule) -; "initrgbimg" - -; From python24_s.lib(shamodule) -; "initsha" - -; From python24_s.lib(_sre) -; "init_sre" - -; From python24_s.lib(stropmodule) -; "initstrop" - -; From python24_s.lib(structmodule) -; "initstruct" - -; From python24_s.lib(symtablemodule) -; "init_symtable" - -; From python24_s.lib(termios) -; "inittermios" - -; From python24_s.lib(timemodule) -; "inittime" - "_PyTime_DoubleToTimet" -; "inittimezone" - -; From python24_s.lib(timingmodule) -; "inittiming" - -; From python24_s.lib(_weakref) -; "init_weakref" - -; From python24_s.lib(xxsubtype) -; "initxxsubtype" - -; From python24_s.lib(zipimport) -; "initzipimport" Modified: python/branches/bcannon-sandboxing/PC/winsound.c ============================================================================== --- python/branches/bcannon-sandboxing/PC/winsound.c (original) +++ python/branches/bcannon-sandboxing/PC/winsound.c Wed Aug 2 00:51:44 2006 @@ -37,10 +37,10 @@ #include #include +#include #ifdef HAVE_CONIO_H #include /* port functions on Win9x */ #endif -#include PyDoc_STRVAR(sound_playsound_doc, "PlaySound(sound, flags) - a wrapper around the Windows PlaySound API\n" @@ -147,7 +147,7 @@ return NULL; } } -#ifdef _M_IX86 +#if defined(_M_IX86) && defined(HAVE_CONIO_H) else if (whichOS == Win9X) { int speaker_state; /* Force timer into oscillator mode via timer control port. */ @@ -172,7 +172,7 @@ /* Restore speaker control to original state. */ _outp(0x61, speaker_state); } -#endif /* _M_IX86 */ +#endif /* _M_IX86 && HAVE_CONIO_H */ else { assert(!"winsound's whichOS has insane value"); } Modified: python/branches/bcannon-sandboxing/PCbuild/_ssl.vcproj ============================================================================== --- python/branches/bcannon-sandboxing/PCbuild/_ssl.vcproj (original) +++ python/branches/bcannon-sandboxing/PCbuild/_ssl.vcproj Wed Aug 2 00:51:44 2006 @@ -21,8 +21,8 @@ ATLMinimizesCRunTimeLibraryUsage="FALSE"> @@ -35,8 +35,8 @@ ATLMinimizesCRunTimeLibraryUsage="FALSE"> @@ -49,8 +49,9 @@ ATLMinimizesCRunTimeLibraryUsage="FALSE"> Modified: python/branches/bcannon-sandboxing/PCbuild/build_ssl.py ============================================================================== --- python/branches/bcannon-sandboxing/PCbuild/build_ssl.py (original) +++ python/branches/bcannon-sandboxing/PCbuild/build_ssl.py Wed Aug 2 00:51:44 2006 @@ -84,9 +84,59 @@ print "Could not find an SSL directory in '%s'" % (sources,) return best_name +def run_32all_py(): + # ms\32all.bat will reconfigure OpenSSL and then try to build + # all outputs (debug/nondebug/dll/lib). So we filter the file + # to exclude any "nmake" commands and then execute. + tempname = "ms\\32all_py.bat" + + in_bat = open("ms\\32all.bat") + temp_bat = open(tempname,"w") + while 1: + cmd = in_bat.readline() + print 'cmd', repr(cmd) + if not cmd: break + if cmd.strip()[:5].lower() == "nmake": + continue + temp_bat.write(cmd) + in_bat.close() + temp_bat.close() + os.system(tempname) + try: + os.remove(tempname) + except: + pass + +def run_configure(configure, do_script): + os.system("perl Configure "+configure) + os.system(do_script) + def main(): - debug = "-d" in sys.argv build_all = "-a" in sys.argv + if sys.argv[1] == "Release": + arch = "x86" + debug = False + configure = "VC-WIN32" + makefile = "32.mak" + elif sys.argv[1] == "Debug": + arch = "x86" + debug = True + configure = "VC-WIN32" + makefile="d32.mak" + elif sys.argv[1] == "ReleaseItanium": + arch = "ia64" + debug = False + configure = "VC-WIN64I" + do_script = "ms\\do_win64i" + makefile = "ms\\nt.mak" + os.environ["VSEXTCOMP_USECL"] = "MS_ITANIUM" + elif sys.argv[1] == "ReleaseAMD64": + arch="amd64" + debug=False + configure = "VC-WIN64A" + do_script = "ms\\do_win64a" + makefile = "ms\\nt.mak" + os.environ["VSEXTCOMP_USECL"] = "MS_OPTERON" make_flags = "" if build_all: make_flags = "-a" @@ -107,49 +157,24 @@ try: os.chdir(ssl_dir) # If the ssl makefiles do not exist, we invoke Perl to generate them. - if not os.path.isfile(os.path.join(ssl_dir, "32.mak")) or \ - not os.path.isfile(os.path.join(ssl_dir, "d32.mak")): + if not os.path.isfile(makefile): print "Creating the makefiles..." # Put our working Perl at the front of our path os.environ["PATH"] = os.path.split(perl)[0] + \ os.pathsep + \ os.environ["PATH"] - # ms\32all.bat will reconfigure OpenSSL and then try to build - # all outputs (debug/nondebug/dll/lib). So we filter the file - # to exclude any "nmake" commands and then execute. - tempname = "ms\\32all_py.bat" - - in_bat = open("ms\\32all.bat") - temp_bat = open(tempname,"w") - while 1: - cmd = in_bat.readline() - print 'cmd', repr(cmd) - if not cmd: break - if cmd.strip()[:5].lower() == "nmake": - continue - temp_bat.write(cmd) - in_bat.close() - temp_bat.close() - os.system(tempname) - try: - os.remove(tempname) - except: - pass + if arch=="x86": + run_32all_py() + else: + run_configure(configure, do_script) # Now run make. print "Executing nmake over the ssl makefiles..." - if debug: - rc = os.system("nmake /nologo -f d32.mak") - if rc: - print "Executing d32.mak failed" - print rc - sys.exit(rc) - else: - rc = os.system("nmake /nologo -f 32.mak") - if rc: - print "Executing 32.mak failed" - print rc - sys.exit(rc) + rc = os.system("nmake /nologo -f "+makefile) + if rc: + print "Executing d32.mak failed" + print rc + sys.exit(rc) finally: os.chdir(old_cd) # And finally, we can build the _ssl module itself for Python. Modified: python/branches/bcannon-sandboxing/PCbuild/pythoncore.vcproj ============================================================================== --- python/branches/bcannon-sandboxing/PCbuild/pythoncore.vcproj (original) +++ python/branches/bcannon-sandboxing/PCbuild/pythoncore.vcproj Wed Aug 2 00:51:44 2006 @@ -344,9 +344,6 @@ RelativePath="..\Modules\_bisectmodule.c"> - - + + + + + + - - c_arena) : NULL); if (!args && n_args) - return NULL; /* Don't need to go to NULL; nothing allocated */ + return NULL; /* Don't need to goto error; no objects allocated */ defaults = (n_defaults ? asdl_seq_new(n_defaults, c->c_arena) : NULL); if (!defaults && n_defaults) - goto error; + return NULL; /* Don't need to goto error; no objects allocated */ /* fpdef: NAME | '(' fplist ')' fplist: fpdef (',' fpdef)* [','] @@ -638,8 +641,11 @@ anything other than EQUAL or a comma? */ /* XXX Should NCH(n) check be made a separate check? */ if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) { - asdl_seq_SET(defaults, j++, - ast_for_expr(c, CHILD(n, i + 2))); + expr_ty expression = ast_for_expr(c, CHILD(n, i + 2)); + if (!expression) + goto error; + assert(defaults != NULL); + asdl_seq_SET(defaults, j++, expression); i += 2; found_default = 1; } @@ -1484,6 +1490,57 @@ } static expr_ty +ast_for_factor(struct compiling *c, const node *n) +{ + node *pfactor, *ppower, *patom, *pnum; + expr_ty expression; + + /* If the unary - operator is applied to a constant, don't generate + a UNARY_NEGATIVE opcode. Just store the approriate value as a + constant. The peephole optimizer already does something like + this but it doesn't handle the case where the constant is + (sys.maxint - 1). In that case, we want a PyIntObject, not a + PyLongObject. + */ + if (TYPE(CHILD(n, 0)) == MINUS + && NCH(n) == 2 + && TYPE((pfactor = CHILD(n, 1))) == factor + && NCH(pfactor) == 1 + && TYPE((ppower = CHILD(pfactor, 0))) == power + && NCH(ppower) == 1 + && TYPE((patom = CHILD(ppower, 0))) == atom + && TYPE((pnum = CHILD(patom, 0))) == NUMBER) { + char *s = PyObject_MALLOC(strlen(STR(pnum)) + 2); + if (s == NULL) + return NULL; + s[0] = '-'; + strcpy(s + 1, STR(pnum)); + PyObject_FREE(STR(pnum)); + STR(pnum) = s; + return ast_for_atom(c, patom); + } + + expression = ast_for_expr(c, CHILD(n, 1)); + if (!expression) + return NULL; + + switch (TYPE(CHILD(n, 0))) { + case PLUS: + return UnaryOp(UAdd, expression, LINENO(n), n->n_col_offset, + c->c_arena); + case MINUS: + return UnaryOp(USub, expression, LINENO(n), n->n_col_offset, + c->c_arena); + case TILDE: + return UnaryOp(Invert, expression, LINENO(n), + n->n_col_offset, c->c_arena); + } + PyErr_Format(PyExc_SystemError, "unhandled factor: %d", + TYPE(CHILD(n, 0))); + return NULL; +} + +static expr_ty ast_for_power(struct compiling *c, const node *n) { /* power: atom trailer* ('**' factor)* @@ -1662,30 +1719,12 @@ } return Yield(exp, LINENO(n), n->n_col_offset, c->c_arena); } - case factor: { - expr_ty expression; - + case factor: if (NCH(n) == 1) { n = CHILD(n, 0); goto loop; } - - expression = ast_for_expr(c, CHILD(n, 1)); - if (!expression) - return NULL; - - switch (TYPE(CHILD(n, 0))) { - case PLUS: - return UnaryOp(UAdd, expression, LINENO(n), n->n_col_offset, c->c_arena); - case MINUS: - return UnaryOp(USub, expression, LINENO(n), n->n_col_offset, c->c_arena); - case TILDE: - return UnaryOp(Invert, expression, LINENO(n), n->n_col_offset, c->c_arena); - } - PyErr_Format(PyExc_SystemError, "unhandled factor: %d", - TYPE(CHILD(n, 0))); - break; - } + return ast_for_factor(c, n); case power: return ast_for_power(c, n); default: @@ -1893,20 +1932,19 @@ operator_ty newoperator; node *ch = CHILD(n, 0); - if (TYPE(ch) == testlist) - expr1 = ast_for_testlist(c, ch); - else - expr1 = Yield(ast_for_expr(c, CHILD(ch, 0)), LINENO(ch), n->n_col_offset, - c->c_arena); - + expr1 = ast_for_testlist(c, ch); if (!expr1) return NULL; - /* TODO(jhylton): Figure out why set_context() can't be used here. */ + /* TODO(nas): Remove duplicated error checks (set_context does it) */ switch (expr1->kind) { case GeneratorExp_kind: ast_error(ch, "augmented assignment to generator " "expression not possible"); return NULL; + case Yield_kind: + ast_error(ch, "augmented assignment to yield " + "expression not possible"); + return NULL; case Name_kind: { const char *var_name = PyString_AS_STRING(expr1->v.Name.id); if (var_name[0] == 'N' && !strcmp(var_name, "None")) { @@ -1923,12 +1961,13 @@ "assignment"); return NULL; } + set_context(expr1, Store, ch); ch = CHILD(n, 2); if (TYPE(ch) == testlist) expr2 = ast_for_testlist(c, ch); else - expr2 = Yield(ast_for_expr(c, ch), LINENO(ch), ch->n_col_offset, c->c_arena); + expr2 = ast_for_expr(c, ch); if (!expr2) return NULL; @@ -2142,7 +2181,14 @@ loop: switch (TYPE(n)) { case import_as_name: - str = (NCH(n) == 3) ? NEW_IDENTIFIER(CHILD(n, 2)) : NULL; + str = NULL; + if (NCH(n) == 3) { + if (strcmp(STR(CHILD(n, 1)), "as") != 0) { + ast_error(n, "must use 'as' in import"); + return NULL; + } + str = NEW_IDENTIFIER(CHILD(n, 2)); + } return alias(NEW_IDENTIFIER(CHILD(n, 0)), str, c->c_arena); case dotted_as_name: if (NCH(n) == 1) { @@ -2151,6 +2197,10 @@ } else { alias_ty a = alias_for_import_name(c, CHILD(n, 0)); + if (strcmp(STR(CHILD(n, 1)), "as") != 0) { + ast_error(n, "must use 'as' in import"); + return NULL; + } assert(!a->asname); a->asname = NEW_IDENTIFIER(CHILD(n, 2)); return a; @@ -2621,6 +2671,7 @@ asdl_seq *_target, *seq = NULL, *suite_seq; expr_ty expression; expr_ty target; + const node *node_target; /* for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] */ REQ(n, for_stmt); @@ -2630,10 +2681,13 @@ return NULL; } - _target = ast_for_exprlist(c, CHILD(n, 1), Store); + node_target = CHILD(n, 1); + _target = ast_for_exprlist(c, node_target, Store); if (!_target) return NULL; - if (asdl_seq_LEN(_target) == 1) + /* Check the # of children rather than the length of _target, since + for x, in ... has 1 element in _target, but still requires a Tuple. */ + if (NCH(node_target) == 1) target = (expr_ty)asdl_seq_GET(_target, 0); else target = Tuple(_target, Store, LINENO(n), n->n_col_offset, c->c_arena); Modified: python/branches/bcannon-sandboxing/Python/compile.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/compile.c (original) +++ python/branches/bcannon-sandboxing/Python/compile.c Wed Aug 2 00:51:44 2006 @@ -300,8 +300,11 @@ PyNode_Compile(struct _node *n, const char *filename) { PyCodeObject *co = NULL; + mod_ty mod; PyArena *arena = PyArena_New(); - mod_ty mod = PyAST_FromNode(n, NULL, filename, arena); + if (!arena) + return NULL; + mod = PyAST_FromNode(n, NULL, filename, arena); if (mod) co = PyAST_Compile(mod, filename, NULL, arena); PyArena_Free(arena); @@ -615,8 +618,10 @@ unsigned int *blocks = (unsigned int *)PyMem_Malloc(len*sizeof(int)); int i,j, opcode, blockcnt = 0; - if (blocks == NULL) + if (blocks == NULL) { + PyErr_NoMemory(); return NULL; + } memset(blocks, 0, len*sizeof(int)); /* Mark labels in the first pass */ @@ -1071,14 +1076,14 @@ PyObject_T_FREE("compiler", (void *)b); b = next; } - Py_XDECREF(u->u_ste); - Py_XDECREF(u->u_name); - Py_XDECREF(u->u_consts); - Py_XDECREF(u->u_names); - Py_XDECREF(u->u_varnames); - Py_XDECREF(u->u_freevars); - Py_XDECREF(u->u_cellvars); - Py_XDECREF(u->u_private); + Py_CLEAR(u->u_ste); + Py_CLEAR(u->u_name); + Py_CLEAR(u->u_consts); + Py_CLEAR(u->u_names); + Py_CLEAR(u->u_varnames); + Py_CLEAR(u->u_freevars); + Py_CLEAR(u->u_cellvars); + Py_CLEAR(u->u_private); PyObject_T_FREE("compiler", u); } @@ -1105,8 +1110,17 @@ u->u_name = name; u->u_varnames = list2dict(u->u_ste->ste_varnames); u->u_cellvars = dictbytype(u->u_ste->ste_symbols, CELL, 0, 0); + if (!u->u_varnames || !u->u_cellvars) { + compiler_unit_free(u); + return 0; + } + u->u_freevars = dictbytype(u->u_ste->ste_symbols, FREE, DEF_FREE_CLASS, PyDict_Size(u->u_cellvars)); + if (!u->u_freevars) { + compiler_unit_free(u); + return 0; + } u->u_blocks = NULL; u->u_tmpname = 0; @@ -1130,7 +1144,8 @@ /* Push the old compiler_unit on the stack. */ if (c->u) { PyObject *wrapper = PyCObject_FromVoidPtr(c->u, NULL); - if (PyList_Append(c->c_stack, wrapper) < 0) { + if (!wrapper || PyList_Append(c->c_stack, wrapper) < 0) { + Py_XDECREF(wrapper); compiler_unit_free(u); return 0; } @@ -1256,6 +1271,7 @@ sizeof(struct instr) * DEFAULT_BLOCK_SIZE); } else if (b->b_iused == b->b_ialloc) { + struct instr *tmp; size_t oldsize, newsize; oldsize = b->b_ialloc * sizeof(struct instr); newsize = oldsize << 1; @@ -1264,10 +1280,13 @@ return -1; } b->b_ialloc <<= 1; - b->b_instr = (struct instr *)PyObject_T_REALLOC("compiler", + tmp = (struct instr *)PyObject_T_REALLOC("compiler", (void *)b->b_instr, newsize); - if (b->b_instr == NULL) + if (tmp == NULL) { + PyErr_NoMemory(); return -1; + } + b->b_instr = tmp; memset((char *)b->b_instr + oldsize, 0, newsize - oldsize); } return b->b_iused++; @@ -1776,7 +1795,8 @@ if (!module) return NULL; } - if (!compiler_enter_scope(c, module, mod, 1)) + /* Use 0 for firstlineno initially, will fixup in assemble(). */ + if (!compiler_enter_scope(c, module, mod, 0)) return NULL; switch (mod->kind) { case Module_kind: @@ -3011,6 +3031,7 @@ return 0; s = e->v.BoolOp.values; n = asdl_seq_LEN(s) - 1; + assert(n >= 0); for (i = 0; i < n; ++i) { VISIT(c, expr, (expr_ty)asdl_seq_GET(s, i)); ADDOP_JREL(c, jumpi, end); @@ -3688,7 +3709,8 @@ VISIT(c, expr, auge); break; case Name_kind: - VISIT(c, expr, s->v.AugAssign.target); + if (!compiler_nameop(c, e->v.Name.id, Load)) + return 0; VISIT(c, expr, s->v.AugAssign.value); ADDOP(c, inplace_binop(c, s->v.AugAssign.op)); return compiler_nameop(c, e->v.Name.id, Store); @@ -4001,6 +4023,8 @@ b->b_startdepth = INT_MIN; entryblock = b; } + if (!entryblock) + return 0; return stackdepth_walk(c, entryblock, 0, 0); } @@ -4096,9 +4120,10 @@ In order for this to work, when the addr field increments by more than 255, the line # increment in each pair generated must be 0 until the remaining addr -increment is < 256. So, in the example above, com_set_lineno should not (as -was actually done until 2.2) expand 300, 300 to 255, 255, 45, 45, but to -255, 0, 45, 255, 0, 45. +increment is < 256. So, in the example above, assemble_lnotab (it used +to be called com_set_lineno) should not (as was actually done until 2.2) +expand 300, 300 to 255, 255, 45, 45, + but to 255, 0, 45, 255, 0, 45. */ static int @@ -4153,12 +4178,12 @@ } lnotab = (unsigned char *) PyString_AS_STRING(a->a_lnotab) + a->a_lnotab_off; - *lnotab++ = 255; *lnotab++ = d_bytecode; + *lnotab++ = 255; d_bytecode = 0; for (j = 1; j < ncodes; j++) { - *lnotab++ = 255; *lnotab++ = 0; + *lnotab++ = 255; } d_lineno -= ncodes * 255; a->a_lnotab_off += ncodes * 2; @@ -4445,6 +4470,13 @@ entryblock = b; } + /* Set firstlineno if it wasn't explicitly set. */ + if (!c->u->u_firstlineno) { + if (entryblock && entryblock->b_instr) + c->u->u_firstlineno = entryblock->b_instr->i_lineno; + else + c->u->u_firstlineno = 1; + } if (!assemble_init(&a, nblocks, c->u->u_firstlineno)) goto error; dfs(c, entryblock, &a); Modified: python/branches/bcannon-sandboxing/Python/errors.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/errors.c (original) +++ python/branches/bcannon-sandboxing/Python/errors.c Wed Aug 2 00:51:44 2006 @@ -632,7 +632,7 @@ /* Function to issue a warning message; may raise an exception. */ int -PyErr_Warn(PyObject *category, char *message) +PyErr_WarnEx(PyObject *category, const char *message, Py_ssize_t stack_level) { PyObject *dict, *func = NULL; PyObject *warnings_module = PyModule_GetWarningsModule(); @@ -650,7 +650,8 @@ if (category == NULL) category = PyExc_RuntimeWarning; - res = PyObject_CallFunction(func, "sO", message, category); + res = PyObject_CallFunction(func, "sOn", + message, category, stack_level); if (res == NULL) return -1; Py_DECREF(res); @@ -658,6 +659,16 @@ } } +/* PyErr_Warn is only for backwards compatability and will be removed. + Use PyErr_WarnEx instead. */ + +#undef PyErr_Warn + +int +PyErr_Warn(PyObject *category, char *message) +{ + return PyErr_WarnEx(category, message, 1); +} /* Warning with explicit origin */ int Modified: python/branches/bcannon-sandboxing/Python/future.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/future.c (original) +++ python/branches/bcannon-sandboxing/Python/future.c Wed Aug 2 00:51:44 2006 @@ -122,8 +122,10 @@ ff = (PyFutureFeatures *)PyObject_T_MALLOC("compiler", sizeof(PyFutureFeatures)); - if (ff == NULL) + if (ff == NULL) { + PyErr_NoMemory(); return NULL; + } ff->ff_features = 0; ff->ff_lineno = -1; Modified: python/branches/bcannon-sandboxing/Python/getargs.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/getargs.c (original) +++ python/branches/bcannon-sandboxing/Python/getargs.c Wed Aug 2 00:51:44 2006 @@ -351,8 +351,8 @@ "argument %d", iarg); i = 0; p += strlen(p); - while (levels[i] > 0 && (int)(p-buf) < 220) { - PyOS_snprintf(p, sizeof(buf) - (buf - p), + while (levels[i] > 0 && i < 32 && (int)(p-buf) < 220) { + PyOS_snprintf(p, sizeof(buf) - (p - buf), ", item %d", levels[i]-1); p += strlen(p); i++; @@ -439,6 +439,13 @@ char *msg; PyObject *item; item = PySequence_GetItem(arg, i); + if (item == NULL) { + PyErr_Clear(); + levels[0] = i+1; + levels[1] = 0; + strncpy(msgbuf, "is not retrievable", bufsize); + return msgbuf; + } msg = convertitem(item, &format, p_va, flags, levels+1, msgbuf, bufsize, freelist); /* PySequence_GetItem calls tp->sq_item, which INCREFs */ @@ -1509,6 +1516,7 @@ else { msg = skipitem(&format, p_va, flags); if (msg) { + levels[0] = 0; seterror(i+1, msg, levels, fname, message); return cleanreturn(0, freelist); } Modified: python/branches/bcannon-sandboxing/Python/getopt.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/getopt.c (original) +++ python/branches/bcannon-sandboxing/Python/getopt.c Wed Aug 2 00:51:44 2006 @@ -24,6 +24,9 @@ * davegottner at delphi.com. *---------------------------------------------------------------------------*/ +/* Modified to support --help and --version, as well as /? on Windows + * by Georg Brandl. */ + #include #include @@ -43,8 +46,17 @@ if (*opt_ptr == '\0') { - if (_PyOS_optind >= argc || argv[_PyOS_optind][0] != '-' || - argv[_PyOS_optind][1] == '\0' /* lone dash */ ) + if (_PyOS_optind >= argc) + return -1; +#ifdef MS_WINDOWS + else if (strcmp(argv[_PyOS_optind], "/?") == 0) { + ++_PyOS_optind; + return 'h'; + } +#endif + + else if (argv[_PyOS_optind][0] != '-' || + argv[_PyOS_optind][1] == '\0' /* lone dash */ ) return -1; else if (strcmp(argv[_PyOS_optind], "--") == 0) { @@ -52,6 +64,17 @@ return -1; } + else if (strcmp(argv[_PyOS_optind], "--help") == 0) { + ++_PyOS_optind; + return 'h'; + } + + else if (strcmp(argv[_PyOS_optind], "--version") == 0) { + ++_PyOS_optind; + return 'V'; + } + + opt_ptr = &argv[_PyOS_optind++][1]; } @@ -62,7 +85,7 @@ if (_PyOS_opterr) fprintf(stderr, "Unknown option: -%c\n", option); - return '?'; + return '_'; } if (*(ptr + 1) == ':') { @@ -76,7 +99,7 @@ if (_PyOS_opterr) fprintf(stderr, "Argument expected for the -%c option\n", option); - return '?'; + return '_'; } _PyOS_optarg = argv[_PyOS_optind++]; Modified: python/branches/bcannon-sandboxing/Python/import.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/import.c (original) +++ python/branches/bcannon-sandboxing/Python/import.c Wed Aug 2 00:51:44 2006 @@ -60,9 +60,11 @@ Python 2.5a0: 62081 (ast-branch) Python 2.5a0: 62091 (with) Python 2.5a0: 62092 (changed WITH_CLEANUP opcode) + Python 2.5b3: 62101 (fix wrong code: for x, in ...) + Python 2.5b3: 62111 (fix wrong code: x += yield) . */ -#define MAGIC (62092 | ((long)'\r'<<16) | ((long)'\n'<<24)) +#define MAGIC (62111 | ((long)'\r'<<16) | ((long)'\n'<<24)) /* Magic word as global; note that _PyImport_Init() can change the value of this global to accommodate for alterations of how the @@ -97,6 +99,8 @@ }; #endif +static PyTypeObject NullImporterType; /* Forward reference */ + /* Initialize things */ void @@ -115,6 +119,8 @@ for (scan = _PyImport_StandardFiletab; scan->suffix != NULL; ++scan) ++countS; filetab = PyMem_NEW(struct filedescr, countD + countS + 1); + if (filetab == NULL) + Py_FatalError("Can't initialize import file table."); memcpy(filetab, _PyImport_DynLoadFiletab, countD * sizeof(struct filedescr)); memcpy(filetab + countD, _PyImport_StandardFiletab, @@ -152,6 +158,8 @@ /* adding sys.path_hooks and sys.path_importer_cache, setting up zipimport */ + if (PyType_Ready(&NullImporterType) < 0) + goto error; if (Py_VerboseFlag) PySys_WriteStderr("# installing zipimport hook\n"); @@ -177,9 +185,11 @@ if (err) { error: PyErr_Print(); - Py_FatalError("initializing sys.meta_path, sys.path_hooks or " - "path_importer_cache failed"); + Py_FatalError("initializing sys.meta_path, sys.path_hooks, " + "path_importer_cache, or NullImporter failed" + ); } + zimpimport = PyImport_ImportModule("zipimport"); if (zimpimport == NULL) { PyErr_Clear(); /* No zip import module -- okay */ @@ -238,8 +248,11 @@ long me = PyThread_get_thread_ident(); if (me == -1) return; /* Too bad */ - if (import_lock == NULL) + if (import_lock == NULL) { import_lock = PyThread_allocate_lock(); + if (import_lock == NULL) + return; /* Nothing much we can do. */ + } if (import_lock_thread == me) { import_lock_level++; return; @@ -258,7 +271,7 @@ unlock_import(void) { long me = PyThread_get_thread_ident(); - if (me == -1) + if (me == -1 || import_lock == NULL) return 0; /* Too bad */ if (import_lock_thread != me) return -1; @@ -1052,9 +1065,18 @@ } PyErr_Clear(); } - if (importer == NULL) - importer = Py_None; - else if (importer != Py_None) { + if (importer == NULL) { + importer = PyObject_CallFunctionObjArgs( + (PyObject *)&NullImporterType, p, NULL + ); + if (importer == NULL) { + if (PyErr_ExceptionMatches(PyExc_ImportError)) { + PyErr_Clear(); + return Py_None; + } + } + } + if (importer != NULL) { int err = PyDict_SetItem(path_importer_cache, p, importer); Py_DECREF(importer); if (err != 0) @@ -1237,42 +1259,17 @@ importer = get_path_importer(path_importer_cache, path_hooks, v); - if (importer == NULL) - return NULL; - /* Note: importer is a borrowed reference */ - if (importer == Py_False) { - /* Cached as not being a valid dir. */ + if (importer == NULL) { Py_XDECREF(copy); - continue; - } - else if (importer == Py_True) { - /* Cached as being a valid dir, so just - * continue below. */ - } - else if (importer == Py_None) { - /* No importer was found, so it has to be a file. - * Check if the directory is valid. - * Note that the empty string is a valid path, but - * not stat'able, hence the check for len. */ -#ifdef HAVE_STAT - if (len && stat(buf, &statbuf) != 0) { - /* Directory does not exist. */ - PyDict_SetItem(path_importer_cache, - v, Py_False); - Py_XDECREF(copy); - continue; - } else { - PyDict_SetItem(path_importer_cache, - v, Py_True); - } -#endif + return NULL; } - else { - /* A real import hook importer was found. */ + /* Note: importer is a borrowed reference */ + if (importer != Py_None) { PyObject *loader; loader = PyObject_CallMethod(importer, "find_module", "s", fullname); + Py_XDECREF(copy); if (loader == NULL) return NULL; /* error */ if (loader != Py_None) { @@ -1281,7 +1278,6 @@ return &importhookdescr; } Py_DECREF(loader); - Py_XDECREF(copy); continue; } } @@ -1903,11 +1899,10 @@ if (co == NULL) return -1; if (!PyCode_Check(co)) { - Py_DECREF(co); PyErr_Format(PyExc_TypeError, "frozen object %.200s is not a code object", name); - return -1; + goto err_return; } if (ispackage) { /* Set __path__ to the package name */ @@ -1915,22 +1910,25 @@ int err; m = PyImport_AddModule(name); if (m == NULL) - return -1; + goto err_return; d = PyModule_GetDict(m); s = PyString_InternFromString(name); if (s == NULL) - return -1; + goto err_return; err = PyDict_SetItemString(d, "__path__", s); Py_DECREF(s); if (err != 0) - return err; + goto err_return; } m = PyImport_ExecCodeModuleEx(name, co, ""); - Py_DECREF(co); if (m == NULL) - return -1; + goto err_return; + Py_DECREF(co); Py_DECREF(m); return 1; +err_return: + Py_DECREF(co); + return -1; } @@ -2925,11 +2923,120 @@ return err; } +typedef struct { + PyObject_HEAD +} NullImporter; + +static int +NullImporter_init(NullImporter *self, PyObject *args, PyObject *kwds) +{ + char *path; + + if (!_PyArg_NoKeywords("NullImporter()", kwds)) + return -1; + + if (!PyArg_ParseTuple(args, "s:NullImporter", + &path)) + return -1; + + if (strlen(path) == 0) { + PyErr_SetString(PyExc_ImportError, "empty pathname"); + return -1; + } else { +#ifndef RISCOS + struct stat statbuf; + int rv; + + rv = stat(path, &statbuf); + if (rv == 0) { + /* it exists */ + if (S_ISDIR(statbuf.st_mode)) { + /* it's a directory */ + PyErr_SetString(PyExc_ImportError, + "existing directory"); + return -1; + } + } +#else + if (object_exists(path)) { + /* it exists */ + if (isdir(path)) { + /* it's a directory */ + PyErr_SetString(PyExc_ImportError, + "existing directory"); + return -1; + } + } +#endif + } + return 0; +} + +static PyObject * +NullImporter_find_module(NullImporter *self, PyObject *args) +{ + Py_RETURN_NONE; +} + +static PyMethodDef NullImporter_methods[] = { + {"find_module", (PyCFunction)NullImporter_find_module, METH_VARARGS, + "Always return None" + }, + {NULL} /* Sentinel */ +}; + + +static PyTypeObject NullImporterType = { + PyObject_HEAD_INIT(NULL) + 0, /*ob_size*/ + "imp.NullImporter", /*tp_name*/ + sizeof(NullImporter), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + 0, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 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, /*tp_flags*/ + "Null importer object", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + NullImporter_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)NullImporter_init, /* tp_init */ + 0, /* tp_alloc */ + PyType_GenericNew /* tp_new */ +}; + + PyMODINIT_FUNC initimp(void) { PyObject *m, *d; + if (PyType_Ready(&NullImporterType) < 0) + goto failure; + m = Py_InitModule4("imp", imp_methods, doc_imp, NULL, PYTHON_API_VERSION); if (m == NULL) @@ -2947,6 +3054,8 @@ if (setint(d, "PY_CODERESOURCE", PY_CODERESOURCE) < 0) goto failure; if (setint(d, "IMP_HOOK", IMP_HOOK) < 0) goto failure; + Py_INCREF(&NullImporterType); + PyModule_AddObject(m, "NullImporter", (PyObject *)&NullImporterType); failure: ; } Modified: python/branches/bcannon-sandboxing/Python/mactoolboxglue.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/mactoolboxglue.c (original) +++ python/branches/bcannon-sandboxing/Python/mactoolboxglue.c Wed Aug 2 00:51:44 2006 @@ -60,8 +60,9 @@ strncpy(buf, input, sizeof(buf) - 1); buf[sizeof(buf) - 1] = '\0'; } + Py_DECREF(rv); } - + Py_XDECREF(m); return buf; } Modified: python/branches/bcannon-sandboxing/Python/mystrtoul.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/mystrtoul.c (original) +++ python/branches/bcannon-sandboxing/Python/mystrtoul.c Wed Aug 2 00:51:44 2006 @@ -69,11 +69,22 @@ * calculated by [int(math.floor(math.log(2**32, i))) for i in range(2, 37)]. * Note that this is pessimistic if sizeof(long) > 4. */ +#if SIZEOF_LONG == 4 static int digitlimit[] = { 0, 0, 32, 20, 16, 13, 12, 11, 10, 10, /* 0 - 9 */ 9, 9, 8, 8, 8, 8, 8, 7, 7, 7, /* 10 - 19 */ 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, /* 20 - 29 */ 6, 6, 6, 6, 6, 6, 6}; /* 30 - 36 */ +#elif SIZEOF_LONG == 8 +/* [int(math.floor(math.log(2**64, i))) for i in range(2, 37)] */ +static int digitlimit[] = { + 0, 0, 64, 40, 32, 27, 24, 22, 21, 20, /* 0 - 9 */ + 19, 18, 17, 17, 16, 16, 16, 15, 15, 15, /* 10 - 19 */ + 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, /* 20 - 29 */ + 13, 12, 12, 12, 12, 12, 12}; /* 30 - 36 */ +#else +#error "Need table for SIZEOF_LONG" +#endif /* ** strtoul @@ -184,10 +195,19 @@ return (unsigned long)-1; } +/* Checking for overflow in PyOS_strtol is a PITA since C doesn't define + * anything about what happens when a signed integer operation overflows, + * and some compilers think they're doing you a favor by being "clever" + * then. Python assumes a 2's-complement representation, so that the bit + * pattern for the largest postive signed long is LONG_MAX, and for + * the smallest negative signed long is LONG_MAX + 1. + */ + long PyOS_strtol(char *str, char **ptr, int base) { long result; + unsigned long uresult; char sign; while (*str && isspace(Py_CHARMASK(*str))) @@ -197,17 +217,20 @@ if (sign == '+' || sign == '-') str++; - result = (long) PyOS_strtoul(str, ptr, base); + uresult = PyOS_strtoul(str, ptr, base); - /* Signal overflow if the result appears negative, - except for the largest negative integer */ - if (result < 0 && !(sign == '-' && result == -result)) { + if (uresult <= (unsigned long)LONG_MAX) { + result = (long)uresult; + if (sign == '-') + result = -result; + } + else if (sign == '-' && uresult == (unsigned long)LONG_MAX + 1) { + assert(LONG_MIN == -LONG_MAX-1); + result = LONG_MIN; + } + else { errno = ERANGE; - result = 0x7fffffff; + result = LONG_MAX; } - - if (sign == '-') - result = -result; - return result; } Modified: python/branches/bcannon-sandboxing/Python/pyarena.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/pyarena.c (original) +++ python/branches/bcannon-sandboxing/Python/pyarena.c Wed Aug 2 00:51:44 2006 @@ -132,19 +132,19 @@ { PyArena* arena = (PyArena *)malloc(sizeof(PyArena)); if (!arena) - return NULL; + return (PyArena*)PyErr_NoMemory(); arena->a_head = block_new(DEFAULT_BLOCK_SIZE); arena->a_cur = arena->a_head; if (!arena->a_head) { free((void *)arena); - return NULL; + return (PyArena*)PyErr_NoMemory(); } arena->a_objects = PyList_New(0); if (!arena->a_objects) { block_free(arena->a_head); free((void *)arena); - return NULL; + return (PyArena*)PyErr_NoMemory(); } #if defined(Py_DEBUG) arena->total_allocs = 0; @@ -191,7 +191,7 @@ { void *p = block_alloc(arena->a_cur, size); if (!p) - return NULL; + return PyErr_NoMemory(); #if defined(Py_DEBUG) arena->total_allocs++; arena->total_size += size; Modified: python/branches/bcannon-sandboxing/Python/pystate.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/pystate.c (original) +++ python/branches/bcannon-sandboxing/Python/pystate.c Wed Aug 2 00:51:44 2006 @@ -63,6 +63,10 @@ if (interp != NULL) { HEAD_INIT(); +#ifdef WITH_THREAD + if (head_mutex == NULL) + Py_FatalError("Can't initialize threads for interpreter"); +#endif interp->modules = NULL; interp->sysdict = NULL; interp->builtins = NULL; @@ -508,6 +512,53 @@ return tstate->next; } +/* The implementation of sys._current_frames(). This is intended to be + called with the GIL held, as it will be when called via + sys._current_frames(). It's possible it would work fine even without + the GIL held, but haven't thought enough about that. +*/ +PyObject * +_PyThread_CurrentFrames(void) +{ + PyObject *result; + PyInterpreterState *i; + + result = PyDict_New(); + if (result == NULL) + return NULL; + + /* for i in all interpreters: + * for t in all of i's thread states: + * if t's frame isn't NULL, map t's id to its frame + * Because these lists can mutute even when the GIL is held, we + * need to grab head_mutex for the duration. + */ + HEAD_LOCK(); + for (i = interp_head; i != NULL; i = i->next) { + PyThreadState *t; + for (t = i->tstate_head; t != NULL; t = t->next) { + PyObject *id; + int stat; + struct _frame *frame = t->frame; + if (frame == NULL) + continue; + id = PyInt_FromLong(t->thread_id); + if (id == NULL) + goto Fail; + stat = PyDict_SetItem(result, id, (PyObject *)frame); + Py_DECREF(id); + if (stat < 0) + goto Fail; + } + } + HEAD_UNLOCK(); + return result; + + Fail: + HEAD_UNLOCK(); + Py_DECREF(result); + return NULL; +} /* Python "auto thread state" API. */ #ifdef WITH_THREAD @@ -565,15 +616,15 @@ /* If autoTLSkey is 0, this must be the very first threadstate created in Py_Initialize(). Don't do anything for now (we'll be back here when _PyGILState_Init is called). */ - if (!autoTLSkey) + if (!autoTLSkey) return; - + /* Stick the thread state for this thread in thread local storage. The only situation where you can legitimately have more than one thread state for an OS level thread is when there are multiple interpreters, when: - + a) You shouldn't really be using the PyGILState_ APIs anyway, and: Modified: python/branches/bcannon-sandboxing/Python/pythonrun.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/pythonrun.c (original) +++ python/branches/bcannon-sandboxing/Python/pythonrun.c Wed Aug 2 00:51:44 2006 @@ -756,6 +756,11 @@ ps2 = PyString_AsString(w); } arena = PyArena_New(); + if (arena == NULL) { + Py_XDECREF(v); + Py_XDECREF(w); + return -1; + } mod = PyParser_ASTFromFile(fp, filename, Py_single_input, ps1, ps2, flags, &errcode, arena); @@ -1074,6 +1079,17 @@ } PyErr_Fetch(&exception2, &v2, &tb2); PyErr_NormalizeException(&exception2, &v2, &tb2); + /* It should not be possible for exception2 or v2 + to be NULL. However PyErr_Display() can't + tolerate NULLs, so just be safe. */ + if (exception2 == NULL) { + exception2 = Py_None; + Py_INCREF(exception2); + } + if (v2 == NULL) { + v2 = Py_None; + Py_INCREF(v2); + } if (Py_FlushLine()) PyErr_Clear(); fflush(stdout); @@ -1081,8 +1097,8 @@ PyErr_Display(exception2, v2, tb2); PySys_WriteStderr("\nOriginal exception was:\n"); PyErr_Display(exception, v, tb); - Py_XDECREF(exception2); - Py_XDECREF(v2); + Py_DECREF(exception2); + Py_DECREF(v2); Py_XDECREF(tb2); } Py_XDECREF(result); @@ -1202,9 +1218,12 @@ PyObject *locals, PyCompilerFlags *flags) { PyObject *ret = NULL; + mod_ty mod; PyArena *arena = PyArena_New(); - mod_ty mod = PyParser_ASTFromString(str, "", start, flags, - arena); + if (arena == NULL) + return NULL; + + mod = PyParser_ASTFromString(str, "", start, flags, arena); if (mod != NULL) ret = run_mod(mod, "", globals, locals, flags, arena); PyArena_Free(arena); @@ -1216,9 +1235,13 @@ PyObject *locals, int closeit, PyCompilerFlags *flags) { PyObject *ret; + mod_ty mod; PyArena *arena = PyArena_New(); - mod_ty mod = PyParser_ASTFromFile(fp, filename, start, 0, 0, - flags, NULL, arena); + if (arena == NULL) + return NULL; + + mod = PyParser_ASTFromFile(fp, filename, start, 0, 0, + flags, NULL, arena); if (mod == NULL) { PyArena_Free(arena); return NULL; @@ -1281,8 +1304,12 @@ PyCompilerFlags *flags) { PyCodeObject *co; + mod_ty mod; PyArena *arena = PyArena_New(); - mod_ty mod = PyParser_ASTFromString(str, filename, start, flags, arena); + if (arena == NULL) + return NULL; + + mod = PyParser_ASTFromString(str, filename, start, flags, arena); if (mod == NULL) { PyArena_Free(arena); return NULL; @@ -1301,8 +1328,12 @@ Py_SymtableString(const char *str, const char *filename, int start) { struct symtable *st; + mod_ty mod; PyArena *arena = PyArena_New(); - mod_ty mod = PyParser_ASTFromString(str, filename, start, NULL, arena); + if (arena == NULL) + return NULL; + + mod = PyParser_ASTFromString(str, filename, start, NULL, arena); if (mod == NULL) { PyArena_Free(arena); return NULL; Modified: python/branches/bcannon-sandboxing/Python/symtable.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/symtable.c (original) +++ python/branches/bcannon-sandboxing/Python/symtable.c Wed Aug 2 00:51:44 2006 @@ -221,8 +221,12 @@ return st; st->st_filename = filename; st->st_future = future; - symtable_enter_block(st, GET_IDENTIFIER(top), ModuleBlock, - (void *)mod, 0); + if (!symtable_enter_block(st, GET_IDENTIFIER(top), ModuleBlock, + (void *)mod, 0)) { + PySymtable_Free(st); + return NULL; + } + st->st_top = st->st_cur; st->st_cur->ste_unoptimized = OPT_TOPLEVEL; /* Any other top-level initialization? */ @@ -525,6 +529,8 @@ i = PyInt_AS_LONG(w); flags |= (i << SCOPE_OFF); u = PyInt_FromLong(flags); + if (!u) + return 0; if (PyDict_SetItem(symbols, name, u) < 0) { Py_DECREF(u); return 0; @@ -723,11 +729,13 @@ { Py_ssize_t end; - Py_DECREF(st->st_cur); + Py_CLEAR(st->st_cur); end = PyList_GET_SIZE(st->st_stack) - 1; if (end >= 0) { st->st_cur = (PySTEntryObject *)PyList_GET_ITEM(st->st_stack, end); + if (st->st_cur == NULL) + return 0; Py_INCREF(st->st_cur); if (PySequence_DelItem(st->st_stack, end) < 0) return 0; @@ -749,6 +757,8 @@ Py_DECREF(st->st_cur); } st->st_cur = PySTEntry_New(st, name, block, ast, lineno); + if (st->st_cur == NULL) + return 0; if (name == GET_IDENTIFIER(top)) st->st_global = st->st_cur->ste_symbols; if (prev) { Modified: python/branches/bcannon-sandboxing/Python/sysmodule.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/sysmodule.c (original) +++ python/branches/bcannon-sandboxing/Python/sysmodule.c Wed Aug 2 00:51:44 2006 @@ -660,6 +660,21 @@ return (PyObject*)f; } +PyDoc_STRVAR(current_frames_doc, +"_current_frames() -> dictionary\n\ +\n\ +Return a dictionary mapping each current thread T's thread id to T's\n\ +current stack frame.\n\ +\n\ +This function should be used for specialized purposes only." +); + +static PyObject * +sys_current_frames(PyObject *self, PyObject *noargs) +{ + return _PyThread_CurrentFrames(); +} + PyDoc_STRVAR(call_tracing_doc, "call_tracing(func, args) -> object\n\ \n\ @@ -722,6 +737,8 @@ /* Might as well keep this in alphabetic order */ {"callstats", (PyCFunction)PyEval_GetCallStats, METH_NOARGS, callstats_doc}, + {"_current_frames", sys_current_frames, METH_NOARGS, + current_frames_doc}, {"displayhook", sys_displayhook, METH_O, displayhook_doc}, {"exc_info", sys_exc_info, METH_NOARGS, exc_info_doc}, {"exc_clear", sys_exc_clear, METH_NOARGS, exc_clear_doc}, @@ -1123,41 +1140,38 @@ #elif PY_RELEASE_LEVEL == PY_RELEASE_LEVEL_FINAL s = "final"; #endif - PyDict_SetItemString(sysdict, "version_info", - v = Py_BuildValue("iiisi", PY_MAJOR_VERSION, + +#define SET_SYS_FROM_STRING(key, value) \ + v = value; \ + if (v != NULL) \ + PyDict_SetItemString(sysdict, key, v); \ + Py_XDECREF(v) + + SET_SYS_FROM_STRING("version_info", + Py_BuildValue("iiisi", PY_MAJOR_VERSION, PY_MINOR_VERSION, PY_MICRO_VERSION, s, PY_RELEASE_SERIAL)); - Py_XDECREF(v); - PyDict_SetItemString(sysdict, "api_version", - v = PyInt_FromLong(PYTHON_API_VERSION)); - Py_XDECREF(v); - PyDict_SetItemString(sysdict, "copyright", - v = PyString_FromString(Py_GetCopyright())); - Py_XDECREF(v); - PyDict_SetItemString(sysdict, "platform", - v = PyString_FromString(Py_GetPlatform())); - Py_XDECREF(v); - PyDict_SetItemString(sysdict, "executable", - v = PyString_FromString(Py_GetProgramFullPath())); - Py_XDECREF(v); - PyDict_SetItemString(sysdict, "prefix", - v = PyString_FromString(Py_GetPrefix())); - Py_XDECREF(v); - PyDict_SetItemString(sysdict, "exec_prefix", - v = PyString_FromString(Py_GetExecPrefix())); - Py_XDECREF(v); - PyDict_SetItemString(sysdict, "maxint", - v = PyInt_FromLong(PyInt_GetMax())); - Py_XDECREF(v); + SET_SYS_FROM_STRING("api_version", + PyInt_FromLong(PYTHON_API_VERSION)); + SET_SYS_FROM_STRING("copyright", + PyString_FromString(Py_GetCopyright())); + SET_SYS_FROM_STRING("platform", + PyString_FromString(Py_GetPlatform())); + SET_SYS_FROM_STRING("executable", + PyString_FromString(Py_GetProgramFullPath())); + SET_SYS_FROM_STRING("prefix", + PyString_FromString(Py_GetPrefix())); + SET_SYS_FROM_STRING("exec_prefix", + PyString_FromString(Py_GetExecPrefix())); + SET_SYS_FROM_STRING("maxint", + PyInt_FromLong(PyInt_GetMax())); #ifdef Py_USING_UNICODE - PyDict_SetItemString(sysdict, "maxunicode", - v = PyInt_FromLong(PyUnicode_GetMax())); - Py_XDECREF(v); + SET_SYS_FROM_STRING("maxunicode", + PyInt_FromLong(PyUnicode_GetMax())); #endif - PyDict_SetItemString(sysdict, "builtin_module_names", - v = list_builtin_module_names()); - Py_XDECREF(v); + SET_SYS_FROM_STRING("builtin_module_names", + list_builtin_module_names()); { /* Assumes that longs are at least 2 bytes long. Should be safe! */ @@ -1169,18 +1183,16 @@ value = "big"; else value = "little"; - PyDict_SetItemString(sysdict, "byteorder", - v = PyString_FromString(value)); - Py_XDECREF(v); + SET_SYS_FROM_STRING("byteorder", + PyString_FromString(value)); } #ifdef MS_COREDLL - PyDict_SetItemString(sysdict, "dllhandle", - v = PyLong_FromVoidPtr(PyWin_DLLhModule)); - Py_XDECREF(v); - PyDict_SetItemString(sysdict, "winver", - v = PyString_FromString(PyWin_DLLVersionString)); - Py_XDECREF(v); + SET_SYS_FROM_STRING("dllhandle", + PyLong_FromVoidPtr(PyWin_DLLhModule)); + SET_SYS_FROM_STRING("winver", + PyString_FromString(PyWin_DLLVersionString)); #endif +#undef SET_SYS_FROM_STRING if (warnoptions == NULL) { warnoptions = PyList_New(0); } Modified: python/branches/bcannon-sandboxing/Python/thread.c ============================================================================== --- python/branches/bcannon-sandboxing/Python/thread.c (original) +++ python/branches/bcannon-sandboxing/Python/thread.c Wed Aug 2 00:51:44 2006 @@ -267,6 +267,8 @@ struct key *p; long id = PyThread_get_thread_ident(); + if (!keymutex) + return NULL; PyThread_acquire_lock(keymutex, 1); for (p = keyhead; p != NULL; p = p->next) { if (p->id == id && p->key == key) Modified: python/branches/bcannon-sandboxing/Python/thread_os2.h ============================================================================== --- python/branches/bcannon-sandboxing/Python/thread_os2.h (original) +++ python/branches/bcannon-sandboxing/Python/thread_os2.h Wed Aug 2 00:51:44 2006 @@ -35,21 +35,18 @@ long PyThread_start_new_thread(void (*func)(void *), void *arg) { - int aThread; - int success = 0; + int thread_id; - aThread = _beginthread(func, + thread_id = _beginthread(func, NULL, OS2_STACKSIZE(_pythread_stacksize), arg); - if (aThread == -1) { - success = -1; - fprintf(stderr, "aThread failed == %d", aThread); + if (thread_id == -1) { dprintf(("_beginthread failed. return %ld\n", errno)); } - return success; + return thread_id; } long Modified: python/branches/bcannon-sandboxing/README ============================================================================== --- python/branches/bcannon-sandboxing/README (original) +++ python/branches/bcannon-sandboxing/README Wed Aug 2 00:51:44 2006 @@ -1,4 +1,4 @@ -This is Python version 2.5 alpha 1 +This is Python version 2.5 beta 2 ================================== Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. @@ -226,13 +226,13 @@ Unsupported systems ------------------- -XXX This section is out of date! - -A number of features are not supported in Python 2.3 anymore. Some -support code is still present, but will be removed in Python 2.4. +A number of features are not supported in Python 2.5 anymore. Some +support code is still present, but will be removed in Python 2.6. If you still need to use current Python versions on these systems, please send a message to python-dev at python.org indicating that you -volunteer to support this system. +volunteer to support this system. For a more detailed discussion +regarding no-longer-supported and resupporting platforms, as well +as a list of platforms that became or will be unsupported, see PEP 11. More specifically, the following systems are not supported any longer: @@ -240,6 +240,7 @@ - DYNIX - dgux - Minix +- NeXT - Irix 4 and --with-sgi-dl - Linux 1 - Systems defining __d6_pthread_create (configure.in) @@ -247,6 +248,25 @@ or PY_PTHREAD_D7 in thread_pthread.h - Systems using --with-dl-dld - Systems using --without-universal-newlines +- MacOS 9 + +The following systems are still supported in Python 2.5, but +support will be dropped in 2.6: +- Systems using --with-wctype-functions +- Win9x, WinME + +Warning on install in Windows 98 and Windows Me +----------------------------------------------- + +Following Microsoft's closing of Extended Support for +Windows 98/ME (July 11, 2006), Python 2.6 will stop +supporting these platforms. Python development and +maintainability becomes easier (and more reliable) when +platform specific code targeting OSes with few users +and no dedicated expert developers is taken out. The +vendor also warns that the OS versions listed above +"can expose customers to security risks" and recommends +upgrade. Platform specific notes ----------------------- @@ -426,14 +446,6 @@ thread may interrupt system calls in others). Therefore, test_math and tests involving threads will fail until those problems are fixed. -SunOS 4.x: When using the SunPro C compiler, you may want to use the - '-Xa' option instead of '-Xc', to enable some needed non-ANSI - Sunisms. - THIS SYSTEM IS NO LONGER SUPPORTED. - -NeXT: Not supported anymore. Start with the MacOSX/Darwin code if you - want to revive it. - QNX: Chris Herborth (chrish at qnx.com) writes: configure works best if you use GNU bash; a port is available on ftp.qnx.com in /usr/free. I used the following process to build, Modified: python/branches/bcannon-sandboxing/Tools/buildbot/kill_python.c ============================================================================== --- python/branches/bcannon-sandboxing/Tools/buildbot/kill_python.c (original) +++ python/branches/bcannon-sandboxing/Tools/buildbot/kill_python.c Wed Aug 2 00:51:44 2006 @@ -42,8 +42,19 @@ _strlwr(path); /* printf("%s\n", path); */ + + /* Check if we are running a buildbot version of Python. + + On Windows, this will always be a debug build from the + PCbuild directory. build\\PCbuild\\python_d.exe + + On Cygwin, the pathname is similar to other Unixes. + Use \\build\\python.exe to ensure we don't match + PCbuild\\python.exe which could be a normal instance + of Python running on vanilla Windows. + */ if ((strstr(path, "build\\pcbuild\\python_d.exe") != NULL) || - (strstr(path, "build\\python.exe") != NULL)) { + (strstr(path, "\\build\\python.exe") != NULL)) { printf("Terminating %s (pid %d)\n", path, pids[i]); if (!TerminateProcess(hProcess, 1)) { printf("Termination failed: %d\n", GetLastError()); Modified: python/branches/bcannon-sandboxing/Tools/faqwiz/faqw.py ============================================================================== --- python/branches/bcannon-sandboxing/Tools/faqwiz/faqw.py (original) +++ python/branches/bcannon-sandboxing/Tools/faqwiz/faqw.py Wed Aug 2 00:51:44 2006 @@ -27,7 +27,7 @@ except SystemExit, n: sys.exit(n) except: - t, v, tb = sys.exc_type, sys.exc_value, sys.exc_traceback + t, v, tb = sys.exc_info() print import cgi cgi.print_exception(t, v, tb) Modified: python/branches/bcannon-sandboxing/Tools/msi/msi.py ============================================================================== --- python/branches/bcannon-sandboxing/Tools/msi/msi.py (original) +++ python/branches/bcannon-sandboxing/Tools/msi/msi.py Wed Aug 2 00:51:44 2006 @@ -367,7 +367,7 @@ ("VerdanaRed9", "Verdana", 9, 255, 0), ]) - compileargs = r"-Wi [TARGETDIR]Lib\compileall.py -f -x bad_coding|badsyntax|site-packages [TARGETDIR]Lib" + compileargs = r'-Wi "[TARGETDIR]Lib\compileall.py" -f -x bad_coding|badsyntax|site-packages "[TARGETDIR]Lib"' # See "CustomAction Table" add_data(db, "CustomAction", [ # msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty @@ -962,6 +962,14 @@ continue dlls.append(f) lib.add_file(f) + # Add sqlite + if msilib.msi_type=="Intel64;1033": + sqlite_arch = "/ia64" + elif msilib.msi_type=="x64;1033": + sqlite_arch = "/amd64" + else: + sqlite_arch = "" + lib.add_file(srcdir+"/"+sqlite_dir+sqlite_arch+"/sqlite3.dll") if have_tcl: if not os.path.exists(srcdir+"/PCBuild/_tkinter.pyd"): print "WARNING: Missing _tkinter.pyd" @@ -972,14 +980,6 @@ tcldir = os.path.normpath(srcdir+"/../tcltk/bin") for f in glob.glob1(tcldir, "*.dll"): lib.add_file(f, src=os.path.join(tcldir, f)) - # Add sqlite - if msilib.msi_type=="Intel64;1033": - sqlite_arch = "/ia64" - elif msilib.msi_type=="x64;1033": - sqlite_arch = "/amd64" - else: - sqlite_arch = "" - lib.add_file(srcdir+"/"+sqlite_dir+sqlite_arch+"/sqlite3.dll") # check whether there are any unknown extensions for f in glob.glob1(srcdir+"/PCBuild", "*.pyd"): if f.endswith("_d.pyd"): continue # debug version Modified: python/branches/bcannon-sandboxing/Tools/msi/uuids.py ============================================================================== --- python/branches/bcannon-sandboxing/Tools/msi/uuids.py (original) +++ python/branches/bcannon-sandboxing/Tools/msi/uuids.py Wed Aug 2 00:51:44 2006 @@ -27,6 +27,7 @@ '2.5.103': '{73dcd966-ffec-415f-bb39-8342c1f47017}', # 2.5a3 '2.5.111': '{c797ecf8-a8e6-4fec-bb99-526b65f28626}', # 2.5b1 '2.5.112': '{32beb774-f625-439d-b587-7187487baf15}', # 2.5b2 + '2.5.113': '{89f23918-11cf-4f08-be13-b9b2e6463fd9}', # 2.5b3 '2.5.121': '{8e9321bc-6b24-48a3-8fd4-c95f8e531e5f}', # 2.5c1 '2.5.122': '{a6cd508d-9599-45da-a441-cbffa9f7e070}', # 2.5c2 '2.5.150': '{0a2c5854-557e-48c8-835a-3b9f074bdcaa}', # 2.5.0 Modified: python/branches/bcannon-sandboxing/Tools/scripts/README ============================================================================== --- python/branches/bcannon-sandboxing/Tools/scripts/README (original) +++ python/branches/bcannon-sandboxing/Tools/scripts/README Wed Aug 2 00:51:44 2006 @@ -27,7 +27,6 @@ fixnotice.py Fix the copyright notice in source files fixps.py Fix Python scripts' first line (if #!) ftpmirror.py FTP mirror script -gencodec.py Create Python codecs from Unicode mapping files google.py Open a webbrowser with Google. gprof2html.py Transform gprof(1) output into useful HTML. h2py.py Translate #define's into Python assignments @@ -53,14 +52,14 @@ ptags.py Create vi tags file for Python modules pydoc Python documentation browser. pysource.py Find Python source files -redemo.py Basic regular expression demostration facility +redemo.py Basic regular expression demonstration facility reindent.py Change .py files to use 4-space indents. rgrep.py Reverse grep through a file (useful for big logfiles) setup.py Install all scripts listed here. suff.py Sort a list of files by suffix +svneol.py Sets svn:eol-style on all files in directory. texcheck.py Validate Python LaTeX formatting (Raymond Hettinger) texi2html.py Convert GNU texinfo files into HTML -trace.py Trace Python program or function execution treesync.py Synchronize source trees (very ideosyncratic) untabify.py Replace tabs with spaces in argument files which.py Find a program in $PATH Modified: python/branches/bcannon-sandboxing/Tools/webchecker/webchecker.py ============================================================================== --- python/branches/bcannon-sandboxing/Tools/webchecker/webchecker.py (original) +++ python/branches/bcannon-sandboxing/Tools/webchecker/webchecker.py Wed Aug 2 00:51:44 2006 @@ -760,7 +760,8 @@ try: names = os.listdir(path) except os.error, msg: - raise IOError, msg, sys.exc_traceback + exc_type, exc_value, exc_tb = sys.exc_info() + raise IOError, msg, exc_tb names.sort() s = MyStringIO("file:"+url, {'content-type': 'text/html'}) s.write('\n' % Modified: python/branches/bcannon-sandboxing/configure ============================================================================== --- python/branches/bcannon-sandboxing/configure (original) +++ python/branches/bcannon-sandboxing/configure Wed Aug 2 00:51:44 2006 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 50892 . +# From configure.in Revision: 51009 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for python 2.5. # @@ -14915,6 +14915,15 @@ fi +case $ac_sys_system/$ac_sys_release in +Darwin/*) + _CUR_CFLAGS="${CFLAGS}" + _CUR_LDFLAGS="${LDFLAGS}" + CFLAGS="${CFLAGS} -Wl,-search_paths_first" + LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib" + ;; +esac + echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 echo $ECHO_N "checking for inflateCopy in -lz... $ECHO_C" >&6 if test "${ac_cv_lib_z_inflateCopy+set}" = set; then @@ -14987,6 +14996,13 @@ fi +case $ac_sys_system/$ac_sys_release in +Darwin/*) + CFLAGS="${_CUR_CFLAGS}" + LDFLAGS="${_CUR_LDFLAGS}" + ;; +esac + echo "$as_me:$LINENO: checking for hstrerror" >&5 echo $ECHO_N "checking for hstrerror... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF @@ -21870,38 +21886,55 @@ echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 echo $ECHO_N "checking for /dev/ptmx... $ECHO_C" >&6 - -if test -e /dev/ptmx -then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if test "${ac_cv_file__dev_ptmx+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + test "$cross_compiling" = yes && + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } +if test -r "/dev/ptmx"; then + ac_cv_file__dev_ptmx=yes +else + ac_cv_file__dev_ptmx=no +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_file__dev_ptmx" >&5 +echo "${ECHO_T}$ac_cv_file__dev_ptmx" >&6 +if test $ac_cv_file__dev_ptmx = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTMX 1 _ACEOF -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 fi echo "$as_me:$LINENO: checking for /dev/ptc" >&5 echo $ECHO_N "checking for /dev/ptc... $ECHO_C" >&6 - -if test -e /dev/ptc -then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if test "${ac_cv_file__dev_ptc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + test "$cross_compiling" = yes && + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } +if test -r "/dev/ptc"; then + ac_cv_file__dev_ptc=yes +else + ac_cv_file__dev_ptc=no +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_file__dev_ptc" >&5 +echo "${ECHO_T}$ac_cv_file__dev_ptc" >&6 +if test $ac_cv_file__dev_ptc = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTC 1 _ACEOF -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 fi + echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6 if test "$cross_compiling" = yes; then Modified: python/branches/bcannon-sandboxing/configure.in ============================================================================== --- python/branches/bcannon-sandboxing/configure.in (original) +++ python/branches/bcannon-sandboxing/configure.in Wed Aug 2 00:51:44 2006 @@ -2374,8 +2374,34 @@ ) dnl Check if system zlib has *Copy() functions +dnl +dnl On MacOSX the linker will search for dylibs on the entire linker path +dnl before searching for static libraries. setup.py adds -Wl,-search_paths_first +dnl to revert to a more traditional unix behaviour and make it possible to +dnl override the system libz with a local static library of libz. Temporarily +dnl add that flag to our CFLAGS as well to ensure that we check the version +dnl of libz that will be used by setup.py. +dnl The -L/usr/local/lib is needed as wel to get the same compilation +dnl environment as setup.py (and leaving it out can cause configure to use the +dnl wrong version of the library) +case $ac_sys_system/$ac_sys_release in +Darwin/*) + _CUR_CFLAGS="${CFLAGS}" + _CUR_LDFLAGS="${LDFLAGS}" + CFLAGS="${CFLAGS} -Wl,-search_paths_first" + LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib" + ;; +esac + AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_ZLIB_COPY, 1, Define if the zlib library has inflateCopy)) +case $ac_sys_system/$ac_sys_release in +Darwin/*) + CFLAGS="${_CUR_CFLAGS}" + LDFLAGS="${_CUR_LDFLAGS}" + ;; +esac + AC_MSG_CHECKING(for hstrerror) AC_TRY_LINK([ #include "confdefs.h" @@ -3338,27 +3364,8 @@ AC_MSG_RESULT(no) ) -AC_MSG_CHECKING(for /dev/ptmx) - -if test -e /dev/ptmx -then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_DEV_PTMX, 1, - [Define if we have /dev/ptmx.]) -else - AC_MSG_RESULT(no) -fi - -AC_MSG_CHECKING(for /dev/ptc) - -if test -e /dev/ptc -then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_DEV_PTC, 1, - [Define if we have /dev/ptc.]) -else - AC_MSG_RESULT(no) -fi +AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if we have /dev/ptmx.])) +AC_CHECK_FILE(/dev/ptc, AC_DEFINE(HAVE_DEV_PTC, 1, [Define if we have /dev/ptc.])) AC_MSG_CHECKING(for %zd printf() format support) AC_TRY_RUN([#include From python-checkins at python.org Wed Aug 2 05:27:47 2006 From: python-checkins at python.org (tim.peters) Date: Wed, 2 Aug 2006 05:27:47 +0200 (CEST) Subject: [Python-checkins] r51031 - python/trunk/Lib/test/test_subprocess.py Message-ID: <20060802032747.125681E4010@bag.python.org> Author: tim.peters Date: Wed Aug 2 05:27:46 2006 New Revision: 51031 Modified: python/trunk/Lib/test/test_subprocess.py Log: Whitespace normalization. Modified: python/trunk/Lib/test/test_subprocess.py ============================================================================== --- python/trunk/Lib/test/test_subprocess.py (original) +++ python/trunk/Lib/test/test_subprocess.py Wed Aug 2 05:27:46 2006 @@ -497,7 +497,7 @@ resource.setrlimit(resource.RLIMIT_CORE, old_limit) except (ImportError, ValueError, resource.error): return - + def test_run_abort(self): # returncode handles signal termination old_limit = self._suppress_core_files() From python-checkins at python.org Wed Aug 2 06:12:37 2006 From: python-checkins at python.org (tim.peters) Date: Wed, 2 Aug 2006 06:12:37 +0200 (CEST) Subject: [Python-checkins] r51032 - python/trunk/Lib/gzip.py Message-ID: <20060802041237.752F61E400A@bag.python.org> Author: tim.peters Date: Wed Aug 2 06:12:36 2006 New Revision: 51032 Modified: python/trunk/Lib/gzip.py Log: Try to squash struct.pack warnings on the "amd64 gentoo trunk" buildbot (& possibly other 64-bit boxes) during test_gzip. The native zlib crc32 function returns an unsigned 32-bit integer, which the Python wrapper implicitly casts to C long. Therefore the same crc can "look negative" on a 32-bit box but "look positive" on a 64-bit box. This patch papers over that platform difference when writing the crc to file. It may be better to change the Python wrapper, either to make the result "look positive" on all platforms (which means it may have to return a Python long at times on a 32-bit box), or to keep the sign the same across boxes. But that would be a visible change in what users see, while the current hack changes no visible behavior (well, apart from stopping the struct deprecation warning). Note that the module-level write32() function is no longer used. Modified: python/trunk/Lib/gzip.py ============================================================================== --- python/trunk/Lib/gzip.py (original) +++ python/trunk/Lib/gzip.py Wed Aug 2 06:12:36 2006 @@ -315,7 +315,13 @@ def close(self): if self.mode == WRITE: self.fileobj.write(self.compress.flush()) - write32(self.fileobj, self.crc) + # The native zlib crc is an unsigned 32-bit integer, but + # the Python wrapper implicitly casts that to a signed C + # long. So, on a 32-bit box self.crc may "look negative", + # while the same crc on a 64-bit box may "look positive". + # To avoid irksome warnings from the `struct` module, force + # it to look positive on all boxes. + write32u(self.fileobj, LOWU32(self.crc)) # self.size may exceed 2GB, or even 4GB write32u(self.fileobj, LOWU32(self.size)) self.fileobj = None From python-checkins at python.org Wed Aug 2 06:27:21 2006 From: python-checkins at python.org (neal.norwitz) Date: Wed, 2 Aug 2006 06:27:21 +0200 (CEST) Subject: [Python-checkins] r51033 - python/trunk/Modules/cPickle.c Message-ID: <20060802042721.E7B371E400A@bag.python.org> Author: neal.norwitz Date: Wed Aug 2 06:27:11 2006 New Revision: 51033 Modified: python/trunk/Modules/cPickle.c Log: Prevent memory leak on error. Reported by Klocwork #36 Modified: python/trunk/Modules/cPickle.c ============================================================================== --- python/trunk/Modules/cPickle.c (original) +++ python/trunk/Modules/cPickle.c Wed Aug 2 06:27:11 2006 @@ -3401,11 +3401,11 @@ /********************************************/ str = PyString_DecodeEscape(p, len, NULL, 0, NULL); + free(s); if (str) { PDATA_PUSH(self->stack, str, -1); res = 0; } - free(s); return res; insecure: From python-checkins at python.org Wed Aug 2 07:20:09 2006 From: python-checkins at python.org (tim.peters) Date: Wed, 2 Aug 2006 07:20:09 +0200 (CEST) Subject: [Python-checkins] r51034 - python/trunk/Lib/tarfile.py Message-ID: <20060802052009.0A8521E4004@bag.python.org> Author: tim.peters Date: Wed Aug 2 07:20:08 2006 New Revision: 51034 Modified: python/trunk/Lib/tarfile.py Log: _Stream.close(): Try to kill struct.pack() warnings when writing the crc to file on the "PPC64 Debian trunk" buildbot when running test_tarfile. This is again a case where the native zlib crc is an unsigned 32-bit int, but the Python wrapper implicitly casts it to signed C long, so that "the sign bit looks different" on different platforms. Modified: python/trunk/Lib/tarfile.py ============================================================================== --- python/trunk/Lib/tarfile.py (original) +++ python/trunk/Lib/tarfile.py Wed Aug 2 07:20:08 2006 @@ -417,7 +417,13 @@ self.fileobj.write(self.buf) self.buf = "" if self.comptype == "gz": - self.fileobj.write(struct.pack(" Author: ronald.oussoren Date: Wed Aug 2 08:10:10 2006 New Revision: 51035 Modified: python/trunk/Mac/BuildScript/README.txt Log: Updated documentation for the script that builds the OSX installer. Modified: python/trunk/Mac/BuildScript/README.txt ============================================================================== --- python/trunk/Mac/BuildScript/README.txt (original) +++ python/trunk/Mac/BuildScript/README.txt Wed Aug 2 08:10:10 2006 @@ -8,15 +8,47 @@ an Installer package from the installation plus other files in ``resources`` and ``scripts`` and placed that on a ``.dmg`` disk image. -Here are the steps you ned to follow to build a MacPython installer: +Prerequisites +------------- -- Run ``./build-installer.py``. Optionally you can pass a number of arguments - to specify locations of various files. Please see the top of +* A MacOS X 10.4 (or later) + +* XCode 2.2 (or later), with the universal SDK + +* No Fink (in ``/sw``) or DarwinPorts (in ``/opt/local``), those could + interfere with the build. + +* The documentation for the release must be available on python.org + because it is included in the installer. + + +The Recipe +---------- + +Here are the steps you need to follow to build a MacPython installer: + +* Run ``./build-installer.py``. Optionally you can pass a number of arguments + to specify locations of various files. Please see the top of ``build-installer.py`` for its usage. -- When done the script will tell you where the DMG image is. -The script needs to be run on Mac OS X 10.4 with Xcode 2.2 or later and -the 10.4u SDK. + Running this script takes some time, I will not only build Python itself + but also some 3th-party libraries that are needed for extensions. + +* When done the script will tell you where the DMG image is (by default + somewhere in ``/tmp/_py``). + +Testing +------- + +The resulting binaries should work on MacOSX 10.3.9 or later. I usually run +the installer on a 10.3.9, a 10.4.x PPC and a 10.4.x Intel system and then +run the testsuite to make sure. + + +Announcements +------------- + +(This is mostly of historic interest) When all is done, announcements can be posted to at least the following places: From python-checkins at python.org Wed Aug 2 08:14:22 2006 From: python-checkins at python.org (neal.norwitz) Date: Wed, 2 Aug 2006 08:14:22 +0200 (CEST) Subject: [Python-checkins] r51036 - in python/trunk: Include/weakrefobject.h Misc/NEWS Modules/_weakref.c Objects/weakrefobject.c Message-ID: <20060802061422.00CAB1E4004@bag.python.org> Author: neal.norwitz Date: Wed Aug 2 08:14:22 2006 New Revision: 51036 Modified: python/trunk/Include/weakrefobject.h python/trunk/Misc/NEWS python/trunk/Modules/_weakref.c python/trunk/Objects/weakrefobject.c Log: _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t instead of long. Modified: python/trunk/Include/weakrefobject.h ============================================================================== --- python/trunk/Include/weakrefobject.h (original) +++ python/trunk/Include/weakrefobject.h Wed Aug 2 08:14:22 2006 @@ -62,7 +62,7 @@ PyObject *callback); PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref); -PyAPI_FUNC(long) _PyWeakref_GetWeakrefCount(PyWeakReference *head); +PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head); PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self); Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 2 08:14:22 2006 @@ -12,6 +12,9 @@ Core and builtins ----------------- +- _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t, it previously + returned a long (see PEP 353). + - Bug #1515471: string.replace() accepts character buffers again. - Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn(). Modified: python/trunk/Modules/_weakref.c ============================================================================== --- python/trunk/Modules/_weakref.c (original) +++ python/trunk/Modules/_weakref.c Wed Aug 2 08:14:22 2006 @@ -17,7 +17,7 @@ if (PyType_SUPPORTS_WEAKREFS(object->ob_type)) { PyWeakReference **list = GET_WEAKREFS_LISTPTR(object); - result = PyInt_FromLong(_PyWeakref_GetWeakrefCount(*list)); + result = PyInt_FromSsize_t(_PyWeakref_GetWeakrefCount(*list)); } else result = PyInt_FromLong(0); @@ -37,12 +37,12 @@ if (PyType_SUPPORTS_WEAKREFS(object->ob_type)) { PyWeakReference **list = GET_WEAKREFS_LISTPTR(object); - long count = _PyWeakref_GetWeakrefCount(*list); + Py_ssize_t count = _PyWeakref_GetWeakrefCount(*list); result = PyList_New(count); if (result != NULL) { PyWeakReference *current = *list; - long i; + Py_ssize_t i; for (i = 0; i < count; ++i) { PyList_SET_ITEM(result, i, (PyObject *) current); Py_INCREF(current); Modified: python/trunk/Objects/weakrefobject.c ============================================================================== --- python/trunk/Objects/weakrefobject.c (original) +++ python/trunk/Objects/weakrefobject.c Wed Aug 2 08:14:22 2006 @@ -6,10 +6,10 @@ ((PyWeakReference **) PyObject_GET_WEAKREFS_LISTPTR(o)) -long +Py_ssize_t _PyWeakref_GetWeakrefCount(PyWeakReference *head) { - long count = 0; + Py_ssize_t count = 0; while (head != NULL) { ++count; From python-checkins at python.org Wed Aug 2 08:15:10 2006 From: python-checkins at python.org (neal.norwitz) Date: Wed, 2 Aug 2006 08:15:10 +0200 (CEST) Subject: [Python-checkins] r51037 - python/trunk/Modules/spwdmodule.c Message-ID: <20060802061510.A6F5A1E4004@bag.python.org> Author: neal.norwitz Date: Wed Aug 2 08:15:10 2006 New Revision: 51037 Modified: python/trunk/Modules/spwdmodule.c Log: v is already checked for NULL, so just DECREF it Modified: python/trunk/Modules/spwdmodule.c ============================================================================== --- python/trunk/Modules/spwdmodule.c (original) +++ python/trunk/Modules/spwdmodule.c Wed Aug 2 08:15:10 2006 @@ -91,7 +91,7 @@ #undef SETI if (PyErr_Occurred()) { - Py_XDECREF(v); + Py_DECREF(v); return NULL; } From python-checkins at python.org Wed Aug 2 08:19:19 2006 From: python-checkins at python.org (neal.norwitz) Date: Wed, 2 Aug 2006 08:19:19 +0200 (CEST) Subject: [Python-checkins] r51038 - python/trunk/Lib/test/test_signal.py Message-ID: <20060802061919.B81281E4004@bag.python.org> Author: neal.norwitz Date: Wed Aug 2 08:19:19 2006 New Revision: 51038 Modified: python/trunk/Lib/test/test_signal.py Log: Let us know when there was a problem and the child had to kill the parent Modified: python/trunk/Lib/test/test_signal.py ============================================================================== --- python/trunk/Lib/test/test_signal.py (original) +++ python/trunk/Lib/test/test_signal.py Wed Aug 2 08:19:19 2006 @@ -87,6 +87,7 @@ # time for the normal sequence of events to occur. This is # just a stop-gap to prevent the test from hanging. time.sleep(MAX_DURATION + 5) + print >> sys.__stdout__, ' child should not have to kill parent' for i in range(3): os.kill(pid, signal.SIGALARM) finally: From python-checkins at python.org Wed Aug 2 08:46:23 2006 From: python-checkins at python.org (neal.norwitz) Date: Wed, 2 Aug 2006 08:46:23 +0200 (CEST) Subject: [Python-checkins] r51039 - in python/trunk: Lib/test/test_socket.py Misc/ACKS Misc/NEWS Modules/socketmodule.c Message-ID: <20060802064623.34EE81E4004@bag.python.org> Author: neal.norwitz Date: Wed Aug 2 08:46:21 2006 New Revision: 51039 Modified: python/trunk/Lib/test/test_socket.py python/trunk/Misc/ACKS python/trunk/Misc/NEWS python/trunk/Modules/socketmodule.c Log: Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during a socket operation on a socket with a timeout, the exception will be caught correctly. Previously, the exception was not caught. Modified: python/trunk/Lib/test/test_socket.py ============================================================================== --- python/trunk/Lib/test/test_socket.py (original) +++ python/trunk/Lib/test/test_socket.py Wed Aug 2 08:46:21 2006 @@ -11,6 +11,7 @@ import sys import array from weakref import proxy +import signal PORT = 50007 HOST = 'localhost' @@ -817,6 +818,37 @@ if not ok: self.fail("accept() returned success when we did not expect it") + def testInterruptedTimeout(self): + # XXX I don't know how to do this test on MSWindows or any other + # plaform that doesn't support signal.alarm() or os.kill(), though + # the bug should have existed on all platforms. + if not hasattr(signal, "alarm"): + return # can only test on *nix + self.serv.settimeout(5.0) # must be longer than alarm + class Alarm(Exception): + pass + def alarm_handler(signal, frame): + raise Alarm + old_alarm = signal.signal(signal.SIGALRM, alarm_handler) + try: + signal.alarm(2) # POSIX allows alarm to be up to 1 second early + try: + foo = self.serv.accept() + except socket.timeout: + self.fail("caught timeout instead of Alarm") + except Alarm: + pass + except: + self.fail("caught other exception instead of Alarm") + else: + self.fail("nothing caught") + signal.alarm(0) # shut off alarm + except Alarm: + self.fail("got Alarm in wrong place") + finally: + # no alarm can be pending. Safe to restore old handler. + signal.signal(signal.SIGALRM, old_alarm) + class UDPTimeoutTest(SocketTCPTest): def testUDPTimeout(self): Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Wed Aug 2 08:46:21 2006 @@ -435,6 +435,7 @@ Takahiro Nakayama Travers Naran Fredrik Nehr +Tony Nelson Chad Netzer Max Neunhöffer George Neville-Neil Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 2 08:46:21 2006 @@ -140,6 +140,10 @@ Extension Modules ----------------- +- Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during + a socket operation on a socket with a timeout, the exception will be + caught correctly. Previously, the exception was not caught. + - Patch #1529514: The _ctypes extension is now compiled on more openbsd target platforms. Modified: python/trunk/Modules/socketmodule.c ============================================================================== --- python/trunk/Modules/socketmodule.c (original) +++ python/trunk/Modules/socketmodule.c Wed Aug 2 08:46:21 2006 @@ -708,7 +708,7 @@ The argument writing indicates the direction. This does not raise an exception; we'll let our caller do that after they've reacquired the interpreter lock. - Returns 1 on timeout, 0 otherwise. */ + Returns 1 on timeout, -1 on error, 0 otherwise. */ static int internal_select(PySocketSockObject *s, int writing) { @@ -753,6 +753,9 @@ n = select(s->sock_fd+1, &fds, NULL, NULL, &tv); } #endif + + if (n < 0) + return -1; if (n == 0) return 1; return 0; @@ -1552,7 +1555,7 @@ &addrlen); Py_END_ALLOW_THREADS - if (timeout) { + if (timeout == 1) { PyErr_SetString(socket_timeout, "timed out"); return NULL; } @@ -1923,9 +1926,15 @@ if (s->sock_timeout > 0.0) { if (res < 0 && errno == EINPROGRESS && IS_SELECTABLE(s)) { timeout = internal_select(s, 1); - res = connect(s->sock_fd, addr, addrlen); - if (res < 0 && errno == EISCONN) - res = 0; + if (timeout == 0) { + res = connect(s->sock_fd, addr, addrlen); + if (res < 0 && errno == EISCONN) + res = 0; + } + else if (timeout == -1) + res = errno; /* had error */ + else + res = EWOULDBLOCK; /* timed out */ } } @@ -1955,7 +1964,7 @@ res = internal_connect(s, addr, addrlen, &timeout); Py_END_ALLOW_THREADS - if (timeout) { + if (timeout == 1) { PyErr_SetString(socket_timeout, "timed out"); return NULL; } @@ -1989,6 +1998,13 @@ res = internal_connect(s, addr, addrlen, &timeout); Py_END_ALLOW_THREADS + /* Signals are not errors (though they may raise exceptions). Adapted + from PyErr_SetFromErrnoWithFilenameObject(). */ +#ifdef EINTR + if (res == EINTR && PyErr_CheckSignals()) + return NULL; +#endif + return PyInt_FromLong((long) res); } @@ -2209,10 +2225,10 @@ static ssize_t sock_recv_guts(PySocketSockObject *s, char* cbuf, int len, int flags) { - ssize_t outlen = 0; + ssize_t outlen = -1; int timeout; #ifdef __VMS - int remaining, nread; + int remaining; char *read_buf; #endif @@ -2228,7 +2244,7 @@ outlen = recv(s->sock_fd, cbuf, len, flags); Py_END_ALLOW_THREADS - if (timeout) { + if (timeout == 1) { PyErr_SetString(socket_timeout, "timed out"); return -1; } @@ -2243,6 +2259,7 @@ remaining = len; while (remaining != 0) { unsigned int segment; + int nread = -1; segment = remaining /SEGMENT_SIZE; if (segment != 0) { @@ -2258,7 +2275,7 @@ nread = recv(s->sock_fd, read_buf, segment, flags); Py_END_ALLOW_THREADS - if (timeout) { + if (timeout == 1) { PyErr_SetString(socket_timeout, "timed out"); return -1; } @@ -2406,7 +2423,7 @@ { sock_addr_t addrbuf; int timeout; - ssize_t n = 0; + ssize_t n = -1; socklen_t addrlen; *addr = NULL; @@ -2438,7 +2455,7 @@ } Py_END_ALLOW_THREADS - if (timeout) { + if (timeout == 1) { PyErr_SetString(socket_timeout, "timed out"); return -1; } @@ -2553,7 +2570,7 @@ sock_send(PySocketSockObject *s, PyObject *args) { char *buf; - int len, n = 0, flags = 0, timeout; + int len, n = -1, flags = 0, timeout; if (!PyArg_ParseTuple(args, "s#|i:send", &buf, &len, &flags)) return NULL; @@ -2571,7 +2588,7 @@ #endif Py_END_ALLOW_THREADS - if (timeout) { + if (timeout == 1) { PyErr_SetString(socket_timeout, "timed out"); return NULL; } @@ -2594,7 +2611,7 @@ sock_sendall(PySocketSockObject *s, PyObject *args) { char *buf; - int len, n = 0, flags = 0, timeout; + int len, n = -1, flags = 0, timeout; if (!PyArg_ParseTuple(args, "s#|i:sendall", &buf, &len, &flags)) return NULL; @@ -2605,6 +2622,7 @@ Py_BEGIN_ALLOW_THREADS do { timeout = internal_select(s, 1); + n = -1; if (timeout) break; #ifdef __VMS @@ -2619,7 +2637,7 @@ } while (len > 0); Py_END_ALLOW_THREADS - if (timeout) { + if (timeout == 1) { PyErr_SetString(socket_timeout, "timed out"); return NULL; } @@ -2647,7 +2665,7 @@ PyObject *addro; char *buf; struct sockaddr *addr; - int addrlen, len, n = 0, flags, timeout; + int addrlen, len, n = -1, flags, timeout; flags = 0; if (!PyArg_ParseTuple(args, "s#O:sendto", &buf, &len, &addro)) { @@ -2669,7 +2687,7 @@ n = sendto(s->sock_fd, buf, len, flags, addr, addrlen); Py_END_ALLOW_THREADS - if (timeout) { + if (timeout == 1) { PyErr_SetString(socket_timeout, "timed out"); return NULL; } From nnorwitz at gmail.com Wed Aug 2 08:48:37 2006 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 1 Aug 2006 23:48:37 -0700 Subject: [Python-checkins] r51039 - in python/trunk: Lib/test/test_socket.py Misc/ACKS Misc/NEWS Modules/socketmodule.c In-Reply-To: <20060802064623.34EE81E4004@bag.python.org> References: <20060802064623.34EE81E4004@bag.python.org> Message-ID: I forgot to mention that this is a backport candidate if anyone would like to backport. On 8/1/06, neal.norwitz wrote: > Author: neal.norwitz > Date: Wed Aug 2 08:46:21 2006 > New Revision: 51039 > > Modified: > python/trunk/Lib/test/test_socket.py > python/trunk/Misc/ACKS > python/trunk/Misc/NEWS > python/trunk/Modules/socketmodule.c > Log: > Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during > a socket operation on a socket with a timeout, the exception will be > caught correctly. Previously, the exception was not caught. > > > > Modified: python/trunk/Lib/test/test_socket.py > ============================================================================== > --- python/trunk/Lib/test/test_socket.py (original) > +++ python/trunk/Lib/test/test_socket.py Wed Aug 2 08:46:21 2006 > @@ -11,6 +11,7 @@ > import sys > import array > from weakref import proxy > +import signal > > PORT = 50007 > HOST = 'localhost' > @@ -817,6 +818,37 @@ > if not ok: > self.fail("accept() returned success when we did not expect it") > > + def testInterruptedTimeout(self): > + # XXX I don't know how to do this test on MSWindows or any other > + # plaform that doesn't support signal.alarm() or os.kill(), though > + # the bug should have existed on all platforms. > + if not hasattr(signal, "alarm"): > + return # can only test on *nix > + self.serv.settimeout(5.0) # must be longer than alarm > + class Alarm(Exception): > + pass > + def alarm_handler(signal, frame): > + raise Alarm > + old_alarm = signal.signal(signal.SIGALRM, alarm_handler) > + try: > + signal.alarm(2) # POSIX allows alarm to be up to 1 second early > + try: > + foo = self.serv.accept() > + except socket.timeout: > + self.fail("caught timeout instead of Alarm") > + except Alarm: > + pass > + except: > + self.fail("caught other exception instead of Alarm") > + else: > + self.fail("nothing caught") > + signal.alarm(0) # shut off alarm > + except Alarm: > + self.fail("got Alarm in wrong place") > + finally: > + # no alarm can be pending. Safe to restore old handler. > + signal.signal(signal.SIGALRM, old_alarm) > + > class UDPTimeoutTest(SocketTCPTest): > > def testUDPTimeout(self): > > Modified: python/trunk/Misc/ACKS > ============================================================================== > --- python/trunk/Misc/ACKS (original) > +++ python/trunk/Misc/ACKS Wed Aug 2 08:46:21 2006 > @@ -435,6 +435,7 @@ > Takahiro Nakayama > Travers Naran > Fredrik Nehr > +Tony Nelson > Chad Netzer > Max Neunh?ffer > George Neville-Neil > > Modified: python/trunk/Misc/NEWS > ============================================================================== > --- python/trunk/Misc/NEWS (original) > +++ python/trunk/Misc/NEWS Wed Aug 2 08:46:21 2006 > @@ -140,6 +140,10 @@ > Extension Modules > ----------------- > > +- Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs during > + a socket operation on a socket with a timeout, the exception will be > + caught correctly. Previously, the exception was not caught. > + > - Patch #1529514: The _ctypes extension is now compiled on more > openbsd target platforms. > > > Modified: python/trunk/Modules/socketmodule.c > ============================================================================== > --- python/trunk/Modules/socketmodule.c (original) > +++ python/trunk/Modules/socketmodule.c Wed Aug 2 08:46:21 2006 > @@ -708,7 +708,7 @@ > The argument writing indicates the direction. > This does not raise an exception; we'll let our caller do that > after they've reacquired the interpreter lock. > - Returns 1 on timeout, 0 otherwise. */ > + Returns 1 on timeout, -1 on error, 0 otherwise. */ > static int > internal_select(PySocketSockObject *s, int writing) > { > @@ -753,6 +753,9 @@ > n = select(s->sock_fd+1, &fds, NULL, NULL, &tv); > } > #endif > + > + if (n < 0) > + return -1; > if (n == 0) > return 1; > return 0; > @@ -1552,7 +1555,7 @@ > &addrlen); > Py_END_ALLOW_THREADS > > - if (timeout) { > + if (timeout == 1) { > PyErr_SetString(socket_timeout, "timed out"); > return NULL; > } > @@ -1923,9 +1926,15 @@ > if (s->sock_timeout > 0.0) { > if (res < 0 && errno == EINPROGRESS && IS_SELECTABLE(s)) { > timeout = internal_select(s, 1); > - res = connect(s->sock_fd, addr, addrlen); > - if (res < 0 && errno == EISCONN) > - res = 0; > + if (timeout == 0) { > + res = connect(s->sock_fd, addr, addrlen); > + if (res < 0 && errno == EISCONN) > + res = 0; > + } > + else if (timeout == -1) > + res = errno; /* had error */ > + else > + res = EWOULDBLOCK; /* timed out */ > } > } > > @@ -1955,7 +1964,7 @@ > res = internal_connect(s, addr, addrlen, &timeout); > Py_END_ALLOW_THREADS > > - if (timeout) { > + if (timeout == 1) { > PyErr_SetString(socket_timeout, "timed out"); > return NULL; > } > @@ -1989,6 +1998,13 @@ > res = internal_connect(s, addr, addrlen, &timeout); > Py_END_ALLOW_THREADS > > + /* Signals are not errors (though they may raise exceptions). Adapted > + from PyErr_SetFromErrnoWithFilenameObject(). */ > +#ifdef EINTR > + if (res == EINTR && PyErr_CheckSignals()) > + return NULL; > +#endif > + > return PyInt_FromLong((long) res); > } > > @@ -2209,10 +2225,10 @@ > static ssize_t > sock_recv_guts(PySocketSockObject *s, char* cbuf, int len, int flags) > { > - ssize_t outlen = 0; > + ssize_t outlen = -1; > int timeout; > #ifdef __VMS > - int remaining, nread; > + int remaining; > char *read_buf; > #endif > > @@ -2228,7 +2244,7 @@ > outlen = recv(s->sock_fd, cbuf, len, flags); > Py_END_ALLOW_THREADS > > - if (timeout) { > + if (timeout == 1) { > PyErr_SetString(socket_timeout, "timed out"); > return -1; > } > @@ -2243,6 +2259,7 @@ > remaining = len; > while (remaining != 0) { > unsigned int segment; > + int nread = -1; > > segment = remaining /SEGMENT_SIZE; > if (segment != 0) { > @@ -2258,7 +2275,7 @@ > nread = recv(s->sock_fd, read_buf, segment, flags); > Py_END_ALLOW_THREADS > > - if (timeout) { > + if (timeout == 1) { > PyErr_SetString(socket_timeout, "timed out"); > return -1; > } > @@ -2406,7 +2423,7 @@ > { > sock_addr_t addrbuf; > int timeout; > - ssize_t n = 0; > + ssize_t n = -1; > socklen_t addrlen; > > *addr = NULL; > @@ -2438,7 +2455,7 @@ > } > Py_END_ALLOW_THREADS > > - if (timeout) { > + if (timeout == 1) { > PyErr_SetString(socket_timeout, "timed out"); > return -1; > } > @@ -2553,7 +2570,7 @@ > sock_send(PySocketSockObject *s, PyObject *args) > { > char *buf; > - int len, n = 0, flags = 0, timeout; > + int len, n = -1, flags = 0, timeout; > > if (!PyArg_ParseTuple(args, "s#|i:send", &buf, &len, &flags)) > return NULL; > @@ -2571,7 +2588,7 @@ > #endif > Py_END_ALLOW_THREADS > > - if (timeout) { > + if (timeout == 1) { > PyErr_SetString(socket_timeout, "timed out"); > return NULL; > } > @@ -2594,7 +2611,7 @@ > sock_sendall(PySocketSockObject *s, PyObject *args) > { > char *buf; > - int len, n = 0, flags = 0, timeout; > + int len, n = -1, flags = 0, timeout; > > if (!PyArg_ParseTuple(args, "s#|i:sendall", &buf, &len, &flags)) > return NULL; > @@ -2605,6 +2622,7 @@ > Py_BEGIN_ALLOW_THREADS > do { > timeout = internal_select(s, 1); > + n = -1; > if (timeout) > break; > #ifdef __VMS > @@ -2619,7 +2637,7 @@ > } while (len > 0); > Py_END_ALLOW_THREADS > > - if (timeout) { > + if (timeout == 1) { > PyErr_SetString(socket_timeout, "timed out"); > return NULL; > } > @@ -2647,7 +2665,7 @@ > PyObject *addro; > char *buf; > struct sockaddr *addr; > - int addrlen, len, n = 0, flags, timeout; > + int addrlen, len, n = -1, flags, timeout; > > flags = 0; > if (!PyArg_ParseTuple(args, "s#O:sendto", &buf, &len, &addro)) { > @@ -2669,7 +2687,7 @@ > n = sendto(s->sock_fd, buf, len, flags, addr, addrlen); > Py_END_ALLOW_THREADS > > - if (timeout) { > + if (timeout == 1) { > PyErr_SetString(socket_timeout, "timed out"); > return NULL; > } > > > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > > > From python-checkins at python.org Wed Aug 2 09:09:33 2006 From: python-checkins at python.org (neal.norwitz) Date: Wed, 2 Aug 2006 09:09:33 +0200 (CEST) Subject: [Python-checkins] r51040 - python/trunk/Misc/README.coverity python/trunk/Misc/README.klocwork Message-ID: <20060802070933.2AC5B1E400A@bag.python.org> Author: neal.norwitz Date: Wed Aug 2 09:09:32 2006 New Revision: 51040 Added: python/trunk/Misc/README.coverity (contents, props changed) python/trunk/Misc/README.klocwork (contents, props changed) Log: Add some explanation about Klocwork and Coverity static analysis Added: python/trunk/Misc/README.coverity ============================================================================== --- (empty file) +++ python/trunk/Misc/README.coverity Wed Aug 2 09:09:32 2006 @@ -0,0 +1,22 @@ + +Coverity has a static analysis tool (Prevent) which is similar to Klocwork. +They run their tool on the Python source code (SVN head) on a daily basis. +The results are available at: + + http://scan.coverity.com/ + +About 20 people have access to the analysis reports. Other +people can be added by request. + +Prevent was first run on the Python 2.5 source code in March 2006. +There were originally about 100 defects reported. Some of these +were false positives. Over 70 issues were uncovered. + +Each warning has a unique id and comments that can be made on it. +When checking in changes due to a warning, the unique id +as reported by the tool was added to the SVN commit message. + +False positives were annotated so that the comments can +be reviewed and reversed if the analysis was incorrect. + +Contact python-dev at python.org for more information. Added: python/trunk/Misc/README.klocwork ============================================================================== --- (empty file) +++ python/trunk/Misc/README.klocwork Wed Aug 2 09:09:32 2006 @@ -0,0 +1,26 @@ + +Klocwork has a static analysis tool (K7) which is similar to Coverity. +They will run their tool on the Python source code on demand. +The results are available at: + + https://opensource.klocwork.com/ + +Currently, only Neal Norwitz has access to the analysis reports. Other +people can be added by request. + +K7 was first run on the Python 2.5 source code in mid-July 2006. +This is after Coverity had been making their results available. +There were originally 175 defects reported. Most of these +were false positives. However, there were numerous real issues +also uncovered. + +Each warning has a unique id and comments that can be made on it. +When checking in changes due to a K7 report, the unique id +as reported by the tool was added to the SVN commit message. +A comment was added to the K7 warning indicating the SVN revision +in addition to any analysis. + +False positives were also annotated so that the comments can +be reviewed and reversed if the analysis was incorrect. + +Contact python-dev at python.org for more information. From python-checkins at python.org Wed Aug 2 09:43:11 2006 From: python-checkins at python.org (anthony.baxter) Date: Wed, 2 Aug 2006 09:43:11 +0200 (CEST) Subject: [Python-checkins] r51041 - in python/trunk: Doc/commontex/boilerplate.tex Include/patchlevel.h Lib/idlelib/NEWS.txt Lib/idlelib/idlever.py Misc/NEWS Misc/RPM/python-2.5.spec README Message-ID: <20060802074311.394F11E400A@bag.python.org> Author: anthony.baxter Date: Wed Aug 2 09:43:09 2006 New Revision: 51041 Modified: python/trunk/Doc/commontex/boilerplate.tex python/trunk/Include/patchlevel.h python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/idlever.py python/trunk/Misc/NEWS python/trunk/Misc/RPM/python-2.5.spec python/trunk/README Log: pre-release machinations Modified: python/trunk/Doc/commontex/boilerplate.tex ============================================================================== --- python/trunk/Doc/commontex/boilerplate.tex (original) +++ python/trunk/Doc/commontex/boilerplate.tex Wed Aug 2 09:43:09 2006 @@ -5,5 +5,5 @@ Email: \email{docs at python.org} } -\date{11th July, 2006} % XXX update before final release! +\date{3rd August, 2006} % XXX update before final release! \input{patchlevel} % include Python version information Modified: python/trunk/Include/patchlevel.h ============================================================================== --- python/trunk/Include/patchlevel.h (original) +++ python/trunk/Include/patchlevel.h Wed Aug 2 09:43:09 2006 @@ -23,10 +23,10 @@ #define PY_MINOR_VERSION 5 #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA -#define PY_RELEASE_SERIAL 2 +#define PY_RELEASE_SERIAL 3 /* Version as a string */ -#define PY_VERSION "2.5b2" +#define PY_VERSION "2.5b3" /* Subversion Revision number of this file (not of the repository) */ #define PY_PATCHLEVEL_REVISION "$Revision$" Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Wed Aug 2 09:43:09 2006 @@ -1,7 +1,7 @@ -What's New in IDLE 1.2c1? +What's New in IDLE 1.2b3? ========================= -*Release date: XX-XXX-2006* +*Release date: 03-AUG-2006* - EditorWindow.test() was failing. Bug 1417598 Modified: python/trunk/Lib/idlelib/idlever.py ============================================================================== --- python/trunk/Lib/idlelib/idlever.py (original) +++ python/trunk/Lib/idlelib/idlever.py Wed Aug 2 09:43:09 2006 @@ -1 +1 @@ -IDLE_VERSION = "1.2b2" +IDLE_VERSION = "1.2b3" Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 2 09:43:09 2006 @@ -7,7 +7,7 @@ What's New in Python 2.5 beta 3? ================================ -*Release date: XX-AUG-2006* +*Release date: 03-AUG-2006* Core and builtins ----------------- Modified: python/trunk/Misc/RPM/python-2.5.spec ============================================================================== --- python/trunk/Misc/RPM/python-2.5.spec (original) +++ python/trunk/Misc/RPM/python-2.5.spec Wed Aug 2 09:43:09 2006 @@ -33,7 +33,7 @@ ################################# %define name python -%define version 2.5b2 +%define version 2.5b3 %define libvers 2.5 %define release 1pydotorg %define __prefix /usr Modified: python/trunk/README ============================================================================== --- python/trunk/README (original) +++ python/trunk/README Wed Aug 2 09:43:09 2006 @@ -1,5 +1,5 @@ -This is Python version 2.5 beta 2 -================================== +This is Python version 2.5 beta 3 +================================= Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. All rights reserved. From python-checkins at python.org Wed Aug 2 13:35:32 2006 From: python-checkins at python.org (thomas.heller) Date: Wed, 2 Aug 2006 13:35:32 +0200 (CEST) Subject: [Python-checkins] r51043 - python/trunk/Doc/lib/libctypes.tex Message-ID: <20060802113532.A626D1E4007@bag.python.org> Author: thomas.heller Date: Wed Aug 2 13:35:31 2006 New Revision: 51043 Modified: python/trunk/Doc/lib/libctypes.tex Log: A few nore words about what ctypes does. Document that using the wrong calling convention can also raise 'ValueError: Procedure called with the wrong number of arguments'. Modified: python/trunk/Doc/lib/libctypes.tex ============================================================================== --- python/trunk/Doc/lib/libctypes.tex (original) +++ python/trunk/Doc/lib/libctypes.tex Wed Aug 2 13:35:31 2006 @@ -6,13 +6,13 @@ \modulesynopsis{A foreign function library for Python.} \versionadded{2.5} -\code{ctypes} is a foreign function library for Python. +\code{ctypes} is a foreign function library for Python. It provides C +compatible data types, and allows to call functions in dlls/shared +libraries. It can be used to wrap these libraries in pure Python. \subsection{ctypes tutorial\label{ctypes-ctypes-tutorial}} -This tutorial describes version 0.9.9 of \code{ctypes}. - Note: The code samples in this tutorial uses \code{doctest} to make sure that they actually work. Since some code samples behave differently under Linux, Windows, or Mac OS X, they contain doctest directives in @@ -150,8 +150,10 @@ \end{verbatim} \code{ctypes} tries to protect you from calling functions with the wrong -number of arguments. Unfortunately this only works on Windows. It -does this by examining the stack after the function returns: +number of arguments or the wrong calling convention. Unfortunately +this only works on Windows, for \code{stdcall} functions. It does this +by examining the stack after the function returns, so although an +error is raised the function \emph{has} been called: \begin{verbatim} >>> windll.kernel32.GetModuleHandleA() # doctest: +WINDOWS Traceback (most recent call last): @@ -164,6 +166,25 @@ >>> \end{verbatim} +The same exception is raised when you call an \code{stdcall} function +with the \code{cdecl} calling convention, or vice versa: +\begin{verbatim} +>>> cdll.kernel32.GetModuleHandleA(None) # doctest: +WINDOWS +Traceback (most recent call last): + File "", line 1, in ? +ValueError: Procedure probably called with not enough arguments (4 bytes missing) +>>> + +>>> windll.msvcrt.printf("spam") # doctest: +WINDOWS +Traceback (most recent call last): + File "", line 1, in ? +ValueError: Procedure probably called with too many arguments (4 bytes in excess) +>>> +\end{verbatim} + +To find out the correct calling convention you have to look into the C +header file or the documentation for the function you want to call. + On Windows, \code{ctypes} uses win32 structured exception handling to prevent crashes from general protection faults when functions are called with invalid argument values: @@ -1805,8 +1826,8 @@ \begin{verbatim} WINUSERAPI BOOL WINAPI GetWindowRect( - HWND hWnd, - LPRECT lpRect); + HWND hWnd, + LPRECT lpRect); \end{verbatim} Here is the wrapping with \code{ctypes}: From python-checkins at python.org Wed Aug 2 14:00:15 2006 From: python-checkins at python.org (thomas.heller) Date: Wed, 2 Aug 2006 14:00:15 +0200 (CEST) Subject: [Python-checkins] r51045 - python/trunk/Doc/lib/libctypes.tex Message-ID: <20060802120015.0D74F1E4016@bag.python.org> Author: thomas.heller Date: Wed Aug 2 14:00:13 2006 New Revision: 51045 Modified: python/trunk/Doc/lib/libctypes.tex Log: Fix a mistake. Modified: python/trunk/Doc/lib/libctypes.tex ============================================================================== --- python/trunk/Doc/lib/libctypes.tex (original) +++ python/trunk/Doc/lib/libctypes.tex Wed Aug 2 14:00:13 2006 @@ -151,9 +151,9 @@ \code{ctypes} tries to protect you from calling functions with the wrong number of arguments or the wrong calling convention. Unfortunately -this only works on Windows, for \code{stdcall} functions. It does this -by examining the stack after the function returns, so although an -error is raised the function \emph{has} been called: +this only works on Windows. It does this by examining the stack after +the function returns, so although an error is raised the function +\emph{has} been called: \begin{verbatim} >>> windll.kernel32.GetModuleHandleA() # doctest: +WINDOWS Traceback (most recent call last): From anthony at interlink.com.au Wed Aug 2 14:29:44 2006 From: anthony at interlink.com.au (Anthony Baxter) Date: Wed, 2 Aug 2006 22:29:44 +1000 Subject: [Python-checkins] TRUNK FREEZE 2006-07-03, 00:00 UTC for 2.5b3 Message-ID: <200608022229.46957.anthony@interlink.com.au> The trunk is FROZEN from 00:00 UTC/GMT on 03 July 2006. That's in about 12 hours from now. This is for the third (and final, hopefully!) beta of 2.5. Please help the release team out by not making checkins on the trunk after that time until I send out an email that the release is done. Thanks, Anthony -- Anthony Baxter It's never too late to have a happy childhood. From mal at egenix.com Wed Aug 2 15:13:08 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 02 Aug 2006 15:13:08 +0200 Subject: [Python-checkins] r50978 - in python/trunk: Lib/distutils/__init__.py Misc/NEWS In-Reply-To: <200607310429.17373.anthony@interlink.com.au> References: <20060730131405.C470B1E4009@bag.python.org> <44CCD84A.4010706@egenix.com> <44CCDFD9.2030606@v.loewis.de> <200607310429.17373.anthony@interlink.com.au> Message-ID: <44D0A4E4.7050703@egenix.com> Anthony Baxter wrote: > On Monday 31 July 2006 02:35, Martin v. L?wis wrote: >> M.-A. Lemburg schrieb: >>> I agree with Nick. The patch isn't all that helpful. >> So we are stuck. Anthony Baxter wants this automatically >> synchronized. > > I want less places in the Python standard library that contain version > numbers that have to be updated constantly. If you (or anyone else) > wants to cut a standalone release of distutils, you should take care > to update the version number in the standalone code appropriately. Could we please revert the patch to have the distutils version number generated rather than being a fixed literal before b3 and then have a proper discussion about this whole issue on either the distutils SIG list or python-dev ? Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 02 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From theller at python.net Wed Aug 2 15:24:06 2006 From: theller at python.net (Thomas Heller) Date: Wed, 02 Aug 2006 15:24:06 +0200 Subject: [Python-checkins] r50978 - in python/trunk: Lib/distutils/__init__.py Misc/NEWS In-Reply-To: <44D0A4E4.7050703@egenix.com> References: <20060730131405.C470B1E4009@bag.python.org> <44CCD84A.4010706@egenix.com> <44CCDFD9.2030606@v.loewis.de> <200607310429.17373.anthony@interlink.com.au> <44D0A4E4.7050703@egenix.com> Message-ID: M.-A. Lemburg schrieb: > Anthony Baxter wrote: >> On Monday 31 July 2006 02:35, Martin v. L?wis wrote: >>> M.-A. Lemburg schrieb: >>>> I agree with Nick. The patch isn't all that helpful. >>> So we are stuck. Anthony Baxter wants this automatically >>> synchronized. >> >> I want less places in the Python standard library that contain version >> numbers that have to be updated constantly. If you (or anyone else) >> wants to cut a standalone release of distutils, you should take care >> to update the version number in the standalone code appropriately. > > Could we please revert the patch to have the distutils version > number generated rather than being a fixed literal before b3 > and then have a proper discussion about this whole issue > on either the distutils SIG list or python-dev ? I would like to support MaL on this issue. Thomas From python-checkins at python.org Wed Aug 2 15:53:57 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 2 Aug 2006 15:53:57 +0200 (CEST) Subject: [Python-checkins] r51046 - in python/trunk: Lib/encodings/mbcs.py Misc/NEWS Modules/_codecsmodule.c Message-ID: <20060802135357.37C501E4010@bag.python.org> Author: martin.v.loewis Date: Wed Aug 2 15:53:55 2006 New Revision: 51046 Modified: python/trunk/Lib/encodings/mbcs.py python/trunk/Misc/NEWS python/trunk/Modules/_codecsmodule.c Log: Correction of patch #1455898: In the mbcs decoder, set final=False for stream decoder, but final=True for the decode function. Modified: python/trunk/Lib/encodings/mbcs.py ============================================================================== --- python/trunk/Lib/encodings/mbcs.py (original) +++ python/trunk/Lib/encodings/mbcs.py Wed Aug 2 15:53:55 2006 @@ -15,39 +15,31 @@ ### Codec APIs -class Codec(codecs.Codec): +encode = mbcs_encode - # Note: Binding these as C functions will result in the class not - # converting them to methods. This is intended. - encode = mbcs_encode - decode = mbcs_decode +def decode(input, errors='strict'): + return mbcs_decode(input, errors, True) class IncrementalEncoder(codecs.IncrementalEncoder): def encode(self, input, final=False): - return mbcs_encode(input,self.errors)[0] + return mbcs_encode(input, self.errors)[0] class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - def _buffer_decode(self, input, errors, final): - return mbcs_decode(input,self.errors,final) - -class StreamWriter(Codec,codecs.StreamWriter): - pass + _buffer_decode = mbcs_decode -class StreamReader(Codec,codecs.StreamReader): - pass - -class StreamConverter(StreamWriter,StreamReader): +class StreamWriter(codecs.StreamWriter): + encode = mbcs_encode - encode = codecs.mbcs_decode - decode = codecs.mbcs_encode +class StreamReader(codecs.StreamReader): + decode = mbcs_decode ### encodings module API def getregentry(): return codecs.CodecInfo( name='mbcs', - encode=Codec.encode, - decode=Codec.decode, + encode=encode, + decode=decode, incrementalencoder=IncrementalEncoder, incrementaldecoder=IncrementalDecoder, streamreader=StreamReader, Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 2 15:53:55 2006 @@ -64,6 +64,9 @@ Library ------- +- Correction of patch #1455898: In the mbcs decoder, set final=False + for stream decoder, but final=True for the decode function. + - os.urandom no longer masks unrelated exceptions like SystemExit or KeyboardInterrupt. Modified: python/trunk/Modules/_codecsmodule.c ============================================================================== --- python/trunk/Modules/_codecsmodule.c (original) +++ python/trunk/Modules/_codecsmodule.c Wed Aug 2 15:53:55 2006 @@ -481,7 +481,7 @@ const char *data; Py_ssize_t size, consumed; const char *errors = NULL; - int final = 1; + int final = 0; PyObject *decoded; if (!PyArg_ParseTuple(args, "t#|zi:mbcs_decode", From buildbot at python.org Wed Aug 2 16:30:13 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 02 Aug 2006 14:30:13 +0000 Subject: [Python-checkins] buildbot warnings in ppc Debian unstable trunk Message-ID: <20060802143013.29C561E4016@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%2520Debian%2520unstable%2520trunk/builds/1052 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis,thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 2 19:08:49 2006 From: python-checkins at python.org (mateusz.rukowicz) Date: Wed, 2 Aug 2006 19:08:49 +0200 (CEST) Subject: [Python-checkins] r51047 - sandbox/trunk/decimal-c/_decimal.c sandbox/trunk/decimal-c/decimal.h Message-ID: <20060802170849.754141E400F@bag.python.org> Author: mateusz.rukowicz Date: Wed Aug 2 19:08:45 2006 New Revision: 51047 Modified: sandbox/trunk/decimal-c/_decimal.c sandbox/trunk/decimal-c/decimal.h Log: Get rid of 'digits' array. Some minor fixes. Modified: sandbox/trunk/decimal-c/_decimal.c ============================================================================== --- sandbox/trunk/decimal-c/_decimal.c (original) +++ sandbox/trunk/decimal-c/_decimal.c Wed Aug 2 19:08:45 2006 @@ -1305,8 +1305,6 @@ res = _new_decimalobj(type, thing->ob_size, sign, exp_from_i(0)); if (!res) return NULL; - for (i = 0; i < thing->ob_size; i++) - res->digits[i] = thing->digits[i]; /* DELETE */ for (i = 0; i< res->limb_count;i++) res->limbs[i] = thing->limbs[i]; @@ -1419,8 +1417,6 @@ res = _new_decimalobj(type, ctx->prec, lsign, exp_sub_i(ctx->Emax, ctx->prec - 1)); if (res) { - for (i = 0; i < ctx->prec; i++) - res->digits[i] = 9; _limb_fill(res->limbs, ctx->prec, 9); return res; } @@ -1432,8 +1428,6 @@ res = _new_decimalobj(type, ctx->prec, lsign, exp_sub_i(ctx->Emax, ctx->prec - 1)); if (res) { - for (i = 0; i < ctx->prec; i++) - res->digits[i] = 9; _limb_fill(res->limbs, ctx->prec, 9); return res; } @@ -1475,11 +1469,6 @@ return NULL; } - arr = PyObject_MALLOC(ndigits); - if (!arr) { - PyErr_NoMemory(); - goto err; - } arr2 = PyObject_MALLOC(limb_c * sizeof(long)); @@ -1493,7 +1482,6 @@ new->sign = sign; new->exp = exp; new->ob_size = ndigits; - new->digits = arr; new->limb_count = limb_c; new->limbs = arr2; return new; @@ -1604,8 +1592,6 @@ long i; decimalobject *new = _NEW_decimalobj(prec, self->sign, exp_add(self->exp, expdiff)); if (!new) return NULL; - for (i = 0; i < prec; i++) - new->digits[i] = self->digits[i]; _limb_first_n_digits(self->limbs, self->ob_size, 0, new->limbs, prec); return new; @@ -1619,8 +1605,6 @@ decimalobject *new = _NEW_decimalobj(prec, self->sign, exp_add(self->exp, expdiff)); decimalobject *new2 = NULL; if (!new) return NULL; - for (i = 0; i < prec; i++) - new->digits[i] = self->digits[i]; _limb_first_n_digits(self->limbs, self->ob_size, 0, new->limbs, prec); for (i = prec; i < self->ob_size; i++) @@ -1676,8 +1660,6 @@ assert(exp_g_i(expdiff, 0)); tmp = _NEW_decimalobj(prec, self->sign, exp_add(self->exp, expdiff)); if (!tmp) return NULL; - for (i = 0; i < prec; i++) - tmp->digits[i] = self->digits[i]; last = _limb_first_n_digits(self->limbs, self->ob_size, 0, tmp->limbs, prec); if (last == 5) { @@ -1700,8 +1682,6 @@ assert(exp_g_i(expdiff, 0)); tmp = _NEW_decimalobj(prec, self->sign, exp_add(self->exp, expdiff)); if (!tmp) return NULL; - for (i = 0; i < prec; i++) - tmp->digits[i] = self->digits[i]; last = _limb_first_n_digits(self->limbs, self->ob_size, 0, tmp->limbs, prec); if (last == 5) { for (i = prec+1; i < self->ob_size; i++) { @@ -1722,8 +1702,6 @@ long i; tmp = _NEW_decimalobj(prec, self->sign, exp_add(self->exp, expdiff)); if (!tmp) return NULL; - for (i = 0; i < prec; i++) - tmp->digits[i] = self->digits[i]; _limb_first_n_digits(self->limbs, self->ob_size, 0, tmp->limbs, prec); return _do_round_half_up(self, prec, expdiff, ctx, tmp); } @@ -1794,8 +1772,6 @@ new = _NEW_decimalobj(i, self->sign, exp_add_i(self->exp, self->ob_size - prec)); if (!new) return NULL; - while (i--) - new->digits[i] = 0; _limb_fill(new->limbs, new->ob_size,0); if (handle_Rounded(ctx, NULL) != 0) { @@ -1808,17 +1784,12 @@ if (prec == 0) { new = _NEW_decimalobj(self->ob_size+1, self->sign, self->exp); if (!new) return NULL; - new->digits[0] = 0; - for (i = 1; i < new->ob_size; i++) - new->digits[i] = self->digits[i-1]; _limb_first_n_digits(self->limbs, self->ob_size, -1, new->limbs, new->ob_size); prec = 1; } else if (prec < 0) { new = _NEW_decimalobj(2, self->sign, exp_add_i(self->exp, self->ob_size - prec - 1)); if (!new) return NULL; - new->digits[0] = 0; - new->digits[1] = 1; new->limbs[0] = 1; prec = 1; } else { @@ -1838,12 +1809,6 @@ Py_DECREF(new); return NULL; } - for (i = 0; i < new->ob_size; i++) { - new2->digits[i] = new->digits[i]; - } - for (i = new->ob_size; i < new2->ob_size; i++) { - new2->digits[i] = 0; - } _limb_first_n_digits(new->limbs, new->ob_size, 0, new2->limbs, new2->ob_size); Py_DECREF(new); @@ -1935,7 +1900,6 @@ ans = _NEW_decimalobj(1, self->sign, exp); if (!ans) return NULL; - ans->digits[0] = 0; ans->limbs[0] = 0; return ans; } @@ -1952,17 +1916,12 @@ ans = _NEW_decimalobj(2, self->sign, exp_sub_i(self->exp, digits)); if (!ans) return NULL; - ans->digits[0] = 0; - ans->digits[1] = 1; ans->limbs[0] = 1; digits = 1; } else { /* SLOW */ ans = _NEW_decimalobj(self->ob_size+1, self->sign, self->exp); if (!ans) return NULL; - for (i = 0; i < self->ob_size; i++) - ans->digits[i+1] = self->digits[i]; - ans->digits[0] = 0; for(i=0;ilimb_count;i++) ans->limbs[i] = 0; _limb_first_n_digits(self->limbs, self->ob_size, 0, ans->limbs, ans->ob_size-1); @@ -1975,8 +1934,6 @@ if(_limb_get_digit(tmp -> limbs, tmp->ob_size, 0) == 0 && tmp->ob_size > 1){ /* We need one digit less, just clobber tmp. */ - for (i = 0; i < tmp->ob_size-1; i++) - tmp->digits[i] = tmp->digits[i+1]; /* TODO make last digit 0 */ tmp->ob_size--; tmp->limb_count = (tmp->ob_size + LOG -1)/LOG; } @@ -2055,6 +2012,7 @@ } if (handle_Subnormal(ctx, NULL) != 0) goto err; + /* TODO actually, it needs fixing */ if (_is_flag_set(ctx->flags, S_INEXACT)) { if (handle_Underflow(ctx, NULL) != 0) goto err; @@ -3407,8 +3365,6 @@ new = _NEW_decimalobj(self->ob_size, self->sign, self->exp); if (!new) return NULL; - for (i = 0; i < self->ob_size; i++) - new->digits[i] = self->digits[i]; for (i = 0;i < new->limb_count;i++) new->limbs[i] = self->limbs[i]; return new; @@ -5010,7 +4966,6 @@ sign = other->sign; res = _new_decimalobj(self->ob_type, 1, sign, exp); if (!res) return NULL; - res->digits[0] = 0; res->limbs[0] = 0; ret = _decimal_fix(res, ctx); Py_DECREF(res); @@ -5631,7 +5586,7 @@ /* we take context precision or size of self if greater * and add some constant */ ctx2->prec = ctx->prec > self->ob_size ? ctx->prec : self->ob_size; - ctx2->prec += 10; + ctx2->prec += 14; ret = _do_decimal__ln(self, ctx2); if (!ret) { @@ -5737,7 +5692,7 @@ } firstprec = ctx->prec; - ctx->prec += 1; + ctx->prec += 2; { long t = n; if(!t) @@ -5749,9 +5704,6 @@ t/=10; } } - /* when n < 0 we need to extend precision - then every tests pass =] */ - if (n<0) - ctx->prec += 1; /* TODO shouldn't it be Invalid_Context ? */ if (!mod && exp_l_i(PyDecimal_DefaultContext->Emax, ctx->prec)) { @@ -6161,7 +6113,6 @@ static void decimal_dealloc(decimalobject *d) { - PyObject_FREE(d->digits); PyObject_FREE(d->limbs); d->ob_type->tp_free(d); } @@ -6222,8 +6173,6 @@ new = _new_decimalobj(type, size, sign, exp_from_i(0)); if (!new) return NULL; - for (i = 0; i < size; i++) - new->digits[i] = *(start+i) -48; for(i=0;ilimb_count;i++) new->limbs[i] = 0; @@ -6272,7 +6221,6 @@ new = _new_decimalobj(type, 1, sign, exp_from_i(0)); if (!new) return NULL; - new->digits[0] = 0; new->limbs[0] = 0; return new; } @@ -6468,7 +6416,6 @@ if (value == 0) { new = _new_decimalobj(type, 1, 0, exp_from_i(0)); if (!new) return NULL; - new->digits[0] = 0; new->limbs[0] = 0; return (PyObject *)new; } else if (value < 0) { @@ -6486,11 +6433,6 @@ new = _new_decimalobj(type, ndigits, (neg ? SIGN_NEG : SIGN_POS), exp_from_i(0)); if (!new) return NULL; - while (value) { - new->digits[ndigits-i-1] = value % 10; - value /= 10; - i++; - } for(i=0; i < new->limb_count; i++) { @@ -6548,29 +6490,6 @@ goto err; } new = _new_decimalobj(type, PyTuple_GET_SIZE(digtup), sign, exp); - for (i = 0; i < new->ob_size; i++) { - item = PyTuple_GET_ITEM(digtup, i); - long x; - if (PyInt_Check(item)) { - x = PyInt_AsLong(item); - } else if (PyLong_Check(item)) { - x = PyLong_AsLong(item); - if (x == -1 && PyErr_Occurred()) - goto err; - } else { - PyErr_SetString(PyExc_ValueError, "The second value in the tuple " - "must be composed of non negative integer elements."); - goto err; - } - - if(x < 0 || x > 9) - { - PyErr_Format(PyExc_ValueError, "Invalid digit: %ld", x); - goto err; - } - - new->digits[i] = x; - } /* this loop will go out soon XXX */ for(i = 0;i < new->limb_count;i++) new->limbs[i] = 0; @@ -6674,7 +6593,6 @@ if (value == NULL) { decimalobject *new = _new_decimalobj(type, 1, 0, exp_from_i(0)); if (!new) return NULL; - new->digits[0] = 0; new->limbs[0] = 0; return (PyObject *)new; } @@ -6830,6 +6748,7 @@ static int _decimal_set_int(decimalobject *self, PyObject *value) { + /* long i, size, val; char *arr; PyObject *item; @@ -6862,7 +6781,7 @@ PyObject_FREE(self->digits); self->ob_size = size; self->digits = arr; - return 0; + return 0; TODO */ } static PyObject * Modified: sandbox/trunk/decimal-c/decimal.h ============================================================================== --- sandbox/trunk/decimal-c/decimal.h (original) +++ sandbox/trunk/decimal-c/decimal.h Wed Aug 2 19:08:45 2006 @@ -13,7 +13,7 @@ #ifdef BIG_EXP /* At the moment this has significant speed effect, since * there is many exp_t copied */ -#define EXP_LIMB_COUNT 10 /* maximal number of limbs per exp */ +#define EXP_LIMB_COUNT 5 /* maximal number of limbs per exp */ typedef struct { long limbs[EXP_LIMB_COUNT]; int sign; @@ -23,9 +23,9 @@ #define exp_t long #endif -#define BASE 1000 /* biggest value of limb power of 10 */ -#define LOG 3 /* number of digits per limb LOG = log10(BASE) */ -#define LOG_STR "3" /* any ideas how to avoid that? :P */ +#define BASE 10000 /* biggest value of limb power of 10 */ +#define LOG 4 /* number of digits per limb LOG = log10(BASE) */ +#define LOG_STR "4" /* any ideas how to avoid that? :P */ /* decimalobject struct ******************************************************/ typedef struct { @@ -33,7 +33,7 @@ long ob_size; /* number of digits */ unsigned int sign; /* see sign contstants above */ exp_t exp; - signed char *digits; /* digits are stored as the actual numbers 0-9 */ +/* signed char *digits;*/ /* digits are stored as the actual numbers 0-9 */ long limb_count; /* number of limbs */ long *limbs; } PyDecimalObject; From python-checkins at python.org Wed Aug 2 20:19:35 2006 From: python-checkins at python.org (tim.peters) Date: Wed, 2 Aug 2006 20:19:35 +0200 (CEST) Subject: [Python-checkins] r51049 - in python/trunk: Lib/test/crashers/README Misc/README.OpenBSD Modules/zlib/README Message-ID: <20060802181935.AC5351E400C@bag.python.org> Author: tim.peters Date: Wed Aug 2 20:19:35 2006 New Revision: 51049 Modified: python/trunk/Lib/test/crashers/README (props changed) python/trunk/Misc/README.OpenBSD (props changed) python/trunk/Modules/zlib/README (props changed) Log: Add missing svn:eol-style property to text files. From martin at v.loewis.de Wed Aug 2 20:46:40 2006 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Wed, 02 Aug 2006 20:46:40 +0200 Subject: [Python-checkins] r50978 - in python/trunk: Lib/distutils/__init__.py Misc/NEWS In-Reply-To: <44D0A4E4.7050703@egenix.com> References: <20060730131405.C470B1E4009@bag.python.org> <44CCD84A.4010706@egenix.com> <44CCDFD9.2030606@v.loewis.de> <200607310429.17373.anthony@interlink.com.au> <44D0A4E4.7050703@egenix.com> Message-ID: <44D0F310.2050403@v.loewis.de> M.-A. Lemburg schrieb: > Could we please revert the patch to have the distutils version > number generated rather than being a fixed literal before b3 > and then have a proper discussion about this whole issue > on either the distutils SIG list or python-dev ? Not sure who "we" is; I personally won't revert it, as I think it is the right thing to do (I spent already too much time on it, and if I hadn't acted, the version number would still falsely be 2.4.0). I don't see the need to revert it now even if some consensus arrives that it should be changed back after b3, or even after 2.5.0 is released: it's possible to change it back at any time without breaking anything. Regards, Martin From mal at egenix.com Wed Aug 2 20:59:36 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 02 Aug 2006 20:59:36 +0200 Subject: [Python-checkins] r50978 - in python/trunk: Lib/distutils/__init__.py Misc/NEWS In-Reply-To: <44D0F310.2050403@v.loewis.de> References: <20060730131405.C470B1E4009@bag.python.org> <44CCD84A.4010706@egenix.com> <44CCDFD9.2030606@v.loewis.de> <200607310429.17373.anthony@interlink.com.au> <44D0A4E4.7050703@egenix.com> <44D0F310.2050403@v.loewis.de> Message-ID: <44D0F618.4070002@egenix.com> Martin v. L?wis wrote: > M.-A. Lemburg schrieb: >> Could we please revert the patch to have the distutils version >> number generated rather than being a fixed literal before b3 >> and then have a proper discussion about this whole issue >> on either the distutils SIG list or python-dev ? > > Not sure who "we" is; I personally won't revert it, as I think > it is the right thing to do (I spent already too much time on it, > and if I hadn't acted, the version number would still falsely > be 2.4.0). > > I don't see the need to revert it now even if some consensus > arrives that it should be changed back after b3, or even after > 2.5.0 is released: it's possible to change it back at any time > without breaking anything. We have had three responses from people seeing a problem with the patch: from Nick, Thomas and myself. I think that warrants backing out the change again. I don't really see maintaining the version number as string literal as such a big problem to have long discussions over it. I also mentioned that I would volunteer to take care of bumping the version number as necessary. If Anthony gives the OK, I'll revert the patch and change the attribute back to the '2.5.0' string literal. This will then not break anything. In a sense, making the version number dynamic is adding a new controversial feature. IMHO, that's a no-no this late in the release process and should be left untouched until the next release - with a chance to have a proper discussion first. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 02 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From buildbot at python.org Wed Aug 2 22:40:05 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 02 Aug 2006 20:40:05 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian 2.4 Message-ID: <20060802204005.94F2E1E4009@bag.python.org> The Buildbot has detected a new failure of alpha Debian 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%25202.4/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: andrew.kuchling,barry.warsaw,georg.brandl,gregory.p.smith,martin.v.loewis,tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Thu Aug 3 01:25:29 2006 From: python-checkins at python.org (brett.cannon) Date: Thu, 3 Aug 2006 01:25:29 +0200 (CEST) Subject: [Python-checkins] r51065 - python/branches/bcannon-sandboxing/PEP.txt Message-ID: <20060802232529.1277F1E4009@bag.python.org> Author: brett.cannon Date: Thu Aug 3 01:25:28 2006 New Revision: 51065 Added: python/branches/bcannon-sandboxing/PEP.txt Log: Add a rough draft for a PEP to add a memory tracking API. Added: python/branches/bcannon-sandboxing/PEP.txt ============================================================================== --- (empty file) +++ python/branches/bcannon-sandboxing/PEP.txt Thu Aug 3 01:25:28 2006 @@ -0,0 +1,243 @@ +PEP: XXX +Title: Support Tracking Low-Level Memory Usage in CPython +Version: $Revision$ +Last-Modified: $Date$ +Author: Brett Cannon +Status: Draft +Type: Standards Track +Content-Type: text/x-rst +Created: XX-XXX-2006 +Post-History: + + +Abstract +========= + +When running Python programs that involve C extension modules, it is +not always apparent where one's memory usage is. When debugging +extension modules it would be helpful to know where the used memory is +going to help find memory leaks along with simple memory profiling. +At the moment there is no support for providing such information. + +This PEP proposes adding such support. By tagging all memory +allocations and deallocations with the purpose of the memory the basic +usage of all memory in Python can be traced. With this provided at +the Python and C level one can then profile memory usage. You could +also keep an eye on long-running processes and its memory usage. + + +Rationale +========== + +Currently, at the Python level, you have no idea how much memory is +being used by the Python process beyond what the operating system +tells you. Even worse, the number from the operating system is going +to be a monolithic number that tells you nothing about the general +usage of that memory. This does not help in either profiling the +memory usage of your program nor debugging C code that uses Python. + +One can find out what objects are still alive using +``gc.get_objects()``, but that is not terribly helpful [#gc-module]_. +It does not tell you anything about the actual memory usage of any of +the objects it returns. Plus it does not reveal any details about +memory that is not tracked by the garbage collector. + +It would be far more useful to provide an overall memory usage count +for the entire Python process along with a breakdown per type. This +would allow one to not only keep an eye on a long-running process' +memory usage, but help find out what type(s) are using the most amount +of memory for debugging purposes. + + +New API +======== + +Support for this needs to be provided at the C level for tracking +memory usage and then the proper exposure at the Python level of the +collected data. Specifying ``-with-memory-tracking`` when configuring +Python will cause the ``Py_TRACK_MEMORY`` C macro to be defined to a +true value. All actions involving memory take a ``const char *`` +argument that specifies what the memory is meant for. + +For tracking memory usage, there are six new functions: + +* Py_TrackMemory(const char *, size_t) + Track ``size_t`` bytes of memory as specified by the + ``const char *`` type. +* Py_AdjustTrackedMemory(const char *, size_t) + Adjust the amount of memory being tracked for ``const char *`` + type by ``size_t``. +* PY_UntrackMemory(const char *, size_t) + Stop tracking memory for ``const char *`` type by ``size_t`` + amount. +* PyObject_TrackedMalloc(const char *, size_t) + Allocate ``size_t`` bytes and track for the purposes of + ``const char *``. +* PyObject_TrackedRealloc(const char *, void *, size_t) + Reallocate the memory used by the ``const char *`` type as pointed + to by ``void *`` to the new size of ``size_t``. +* PyObject_TrackedFree(const char *, void *) + Free ``void *`` that was used for ``const char *``. + +To hide the direct usage of the API for when ``Py_TRACK_MEMORY`` is +not defined, the following macros are defined and to be what user code +calls directly: + +* PyObject_T_MALLOC(const char *, size_t) +* PyObject_T_REALLOC(const char *, void *, size_t) +* PyObject_T_FREE(const char *, void *) + +For those cases where compilation requires that there be no chance +that the memory tracking API is called (e.g., the code for Python's +parser since it cannot work with Python types), three new macros are +provided: + +* PyObject_RAW_MALLOC(size_t) +* PyObject_RAW_REALLOC(void *, size_t) +* PyObject_RAW_FREE(void *) + +For exposure at the Python level, two new methods are provided in the +``sys`` module [#sys-module]_: + +* total_memory_used() + Return the total memory used by the Python process. +* type_memory_usage() + Return a dict with keys as the string names of the types being + tracked and values of the amount of memory being used by the type. + +There is also the requirement of being able to know how much memory is +allocated by each allocation request. If the memory is managed by +Python's allocator directly, then this is easy to tell. But when +``malloc()`` is used, then it is not so easy. Some C libraries +provide a function or specification for finding out how much memory is +being used (e.g., ``mallinfo()`` or ``malloc_usable_size()``). For +those platforms, accurate tracking can be provided. But for those +platforms that do not, the memory tracking is essentially worthless +from a lack of knowledge, and thus should not be supported for memory +tracking. A compilation error will be raised if ``Py_TRACK_MEMORY`` +is specified but no way to know how much memory ``malloc()`` returned +is provided. + + +Transitioning Existing APIs +============================ + +Python's C API provides six different ways allocating memory if you +ignore the C library's ``malloc()`` function: + +* PyObject_NEW() +* PyObject_New() +* Pyobject_GC_New() +* PyObject_MALLOC() +* PyObject_Malloc() +* PyMem_MALLOC() +* PyMem_Malloc() + +In order for the tracking to be effective, as much memory +allocation/deallocation needs to be tracked, even if it is anonymous. +To do this, the memory API needs to be funnelled through the memory +tracking API transparently where possible. + +For ``PyObject_NEW()``, ``PyObject_New()``, and ``PyObject_GC_New()``, +their implementation can be changed to called ``PyObject_T_MALLOC()`` +for memory, using their arguments ``tp_name`` field to specify the use +of the memory. + +``PyObject_MALLOC()``, ``PyMem_MALLOC()``, and ``PyMem_Malloc()`` can +be changed with a C macro that replaces them with a call to +``Pyobject_T_MALLOC("", size_t)``, using a default, anonymous use type +of the memory. As time progresses these functions and macros can be +replaced with direct uses of ``PyObject_T_MALLOC()`` with a proper use +type specified. + +``PyObject_Malloc()`` will go untouched. Being a performance-critical +API along with having no external dependencies requires it to not +require it be changed to track memory. + +Code internal to Python should be transitioned over to using +``Pyobject_T_MALLOC()`` over time. This will allow for much more +specific memory tracking. It will also possibly help lead to a +pruning down of the overall public API for memory usage in the future. + + +Implementation +=============== + +The ``bcannon-sandboxing`` branch in Python's code repository has a +proof-of-concept implementation [#bcannon-sandboxing]_. By no way +perfect (pressing Enter at the interpreter prompt always adds 24 bytes +of used memory) or optimized (usage is tracked in a linked list with +no optimizations on searching for an entry), it does show that this +tracking is possible and that the transitioning of the existing API is +possible. + +Currently the function in the ``sys`` module for getting the dict of +memory usage is bound to ``memoryusage()`` and the total memory usage +has not been created yet. + +Here is a transcript of some basic usage of the memory tracking: + +>>> class Foo(object): pass +... +[27270 refs] +[872312 bytes used] +>>> a = [Foo() for x in xrange(1000)] +[29275 refs] +[917112 bytes used] +>>> from sys import memoryusage +[29277 refs] +[917152 bytes used] +>>> memoryusage() +{'imp.NullImporter': 16L, 'code': 30800L, 'unicode': 64L, 'iterator': +0L, 'CodecInfo': 56L, 'xrange': 0L, 'frame': 33752L, 'module': 1184L, +'char': 3216L, '': 259672L, 'set': 120L, 'file': 240L, +'symtable entry': 0L, 'listiterator': 0L, 'Foo': 40000L, +'member_descriptor': 3040L, 'method_descriptor': 6400L, +'exceptions.NameError': 0L, 'generator': 0L, 'traceback': 0L, +'exceptions.TypeError': 0L, 'long': 1120L, 'cell': 32L, 'instance': +120L, 'dict': 35424L, 'type': 16056L, 'exceptions.ImportError': 0L, +'function': 24128L, 'method-wrapper': 0L, 'zipimport.zipimporter': 0L, +'tuple': 77176L, 'buffer': 0L, 'Quitter': 80L, 'PyCObject': 0L, +'instancemethod': 720L, '_Printer': 120L, 'posix.stat_result': 0L, +'super': 0L, 'compiler': 5376L, '_sre.SRE_Pattern': 280L, +'getset_descriptor': 1520L, 'builtin_function_or_method': 12520L, +'classobj': 1008L, 'classmethod': 32L, 'dictproxy': 0L, +'classmethod_descriptor': 40L, 'list': 2880L, 'weakref': 4896L, +'rangeiterator': 0L, 'exceptions.AttributeError': 0L, '_Helper': 40L, +'staticmethod': 32L, 'str': 341656L, 'exceptions.MemoryError': 40L, +'_TemplateMetaclass': 472L, 'tupleiterator': 0L, 'wrapper_descriptor': +14448L, 'exceptions.OSError': 0L} +[29468 refs] +[921984 bytes used] +>>> + +The key code changes can be found in Objects/trackedmalloc.c +Include/objimpl.h, and Include/pymem.h . Multiple places within the +code has also been changed over to use the memory tracking API. + + +Open Issues +============ + +XXX + + +Future Considerations +====================== + +It might be reasonable to keep track of other stats about memory usage +at a future point. For instance, one could keep track of the maximum +amount of memory used at any one point, or the number of active +allocations (as calculated by raising the count on +``Py_TrackMemory()`` calls and lowering it on ``Py_UntrackMemory()`` +calls). + + +References +=========== + +.. [#gc-module] XXX + +.. [#sys-module] XXX + +.. [#bcannon-sandboxing] XXX From anthony at interlink.com.au Thu Aug 3 02:06:59 2006 From: anthony at interlink.com.au (Anthony Baxter) Date: Thu, 3 Aug 2006 10:06:59 +1000 Subject: [Python-checkins] =?iso-8859-1?q?r50978_-_in_python/trunk=3A=09Li?= =?iso-8859-1?q?b/distutils/=5F=5Finit=5F=5F=2Epy_Misc/NEWS?= In-Reply-To: <44D0F618.4070002@egenix.com> References: <20060730131405.C470B1E4009@bag.python.org> <44D0F310.2050403@v.loewis.de> <44D0F618.4070002@egenix.com> Message-ID: <200608031007.01428.anthony@interlink.com.au> On Thursday 03 August 2006 04:59, M.-A. Lemburg wrote: > If Anthony gives the OK, I'll revert the patch and change > the attribute back to the '2.5.0' string literal. This > will then not break anything. It's not going to break anything. If you want to cut a separate release, set the version number. That's hardly an issue. Really, you should be checking for functionality, not individual version numbers - in the same way as duck-typing for objects. > In a sense, making the version number dynamic is adding > a new controversial feature. IMHO, that's a no-no this > late in the release process and should be left untouched > until the next release - with a chance to have a proper > discussion first. I'm not changing it now. If the consensus is that having fiddly version numbers strewn through the standard library is a good idea, it can be changed before c1. Anthony -- Anthony Baxter It's never too late to have a happy childhood. From python-checkins at python.org Thu Aug 3 02:21:45 2006 From: python-checkins at python.org (anthony.baxter) Date: Thu, 3 Aug 2006 02:21:45 +0200 (CEST) Subject: [Python-checkins] r51066 - python/tags/r25b3 Message-ID: <20060803002145.EF0281E4009@bag.python.org> Author: anthony.baxter Date: Thu Aug 3 02:21:45 2006 New Revision: 51066 Added: python/tags/r25b3/ - copied from r51065, python/trunk/ Log: Tagging for release of Python 2.5b3 From mal at egenix.com Thu Aug 3 10:18:02 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Thu, 03 Aug 2006 10:18:02 +0200 Subject: [Python-checkins] r50978 - in python/trunk: Lib/distutils/__init__.py Misc/NEWS In-Reply-To: <200608031007.01428.anthony@interlink.com.au> References: <20060730131405.C470B1E4009@bag.python.org> <44D0F310.2050403@v.loewis.de> <44D0F618.4070002@egenix.com> <200608031007.01428.anthony@interlink.com.au> Message-ID: <44D1B13A.80100@egenix.com> Anthony Baxter wrote: > On Thursday 03 August 2006 04:59, M.-A. Lemburg wrote: >> If Anthony gives the OK, I'll revert the patch and change >> the attribute back to the '2.5.0' string literal. This >> will then not break anything. > > It's not going to break anything. If you want to cut a separate release, set > the version number. That's hardly an issue. Really, you should be checking > for functionality, not individual version numbers - in the same way as > duck-typing for objects. Oh, come on, that's just silly and you know that. We're not talking about a single object that you can test for a feature and besides, how are you going to check for bugs in the code when you don't have a version number to test against ? If it were that simple, we might as well drop the whole concept of version numbers in Python altogether. BTW, one of the key complaints about distutils is that it doesn't have dependency checking based on version numbers... >> In a sense, making the version number dynamic is adding >> a new controversial feature. IMHO, that's a no-no this >> late in the release process and should be left untouched >> until the next release - with a chance to have a proper >> discussion first. > > I'm not changing it now. If the consensus is that having fiddly version > numbers strewn through the standard library is a good idea, it can be changed > before c1. Fair enough, then we'll change it back for c1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 03 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From anthony at interlink.com.au Fri Aug 4 06:43:39 2006 From: anthony at interlink.com.au (Anthony Baxter) Date: Fri, 4 Aug 2006 14:43:39 +1000 Subject: [Python-checkins] TRUNK is UNFROZEN In-Reply-To: <200608022229.46957.anthony@interlink.com.au> References: <200608022229.46957.anthony@interlink.com.au> Message-ID: <200608041443.40668.anthony@interlink.com.au> The trunk is unfrozen now. Sorry about the delay - combination of a laptop motherboard replacement and a DSL provider with a network that was .. ahem... slightly slow. I'm still planning to branch at 2.5c1, the next release. That then opens the trunk up for all the bad craziness that's planned for 2.6. Anthony From python-checkins at python.org Fri Aug 4 06:50:22 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 4 Aug 2006 06:50:22 +0200 (CEST) Subject: [Python-checkins] r51079 - in python/trunk: Lib/test/test_traceback.py Lib/traceback.py Misc/NEWS Message-ID: <20060804045022.BC8A31E4002@bag.python.org> Author: neal.norwitz Date: Fri Aug 4 06:50:21 2006 New Revision: 51079 Modified: python/trunk/Lib/test/test_traceback.py python/trunk/Lib/traceback.py python/trunk/Misc/NEWS Log: Bug #1531405, format_exception no longer raises an exception if str(exception) raised an exception. Modified: python/trunk/Lib/test/test_traceback.py ============================================================================== --- python/trunk/Lib/test/test_traceback.py (original) +++ python/trunk/Lib/test/test_traceback.py Fri Aug 4 06:50:21 2006 @@ -130,15 +130,24 @@ def test_string_exception1(self): str_type = "String Exception" err = traceback.format_exception_only(str_type, None) - self.assert_(len(err) == 1) - self.assert_(err[0] == str_type + '\n') + self.assertEqual(len(err), 1) + self.assertEqual(err[0], str_type + '\n') def test_string_exception2(self): str_type = "String Exception" str_value = "String Value" err = traceback.format_exception_only(str_type, str_value) - self.assert_(len(err) == 1) - self.assert_(err[0] == str_type + ': ' + str_value + '\n') + self.assertEqual(len(err), 1) + self.assertEqual(err[0], str_type + ': ' + str_value + '\n') + + def test_format_exception_only_bad__str__(self): + class X(Exception): + def __str__(self): + 1/0 + err = traceback.format_exception_only(X, X()) + self.assertEqual(len(err), 1) + str_value = '' % X.__name__ + self.assertEqual(err[0], X.__name__ + ': ' + str_value + '\n') def test_main(): Modified: python/trunk/Lib/traceback.py ============================================================================== --- python/trunk/Lib/traceback.py (original) +++ python/trunk/Lib/traceback.py Fri Aug 4 06:50:21 2006 @@ -202,7 +202,12 @@ def _format_final_exc_line(etype, value): """Return a list of a single line -- normal case for format_exception_only""" - if value is None or not str(value): + try: + printable = value is None or not str(value) + except: + printable = False + + if printable: line = "%s\n" % etype else: line = "%s: %s\n" % (etype, _some_str(value)) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 4 06:50:21 2006 @@ -4,6 +4,38 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 2.5 release candidate 1? +============================================= + +*Release date: XX-AUG-2006* + +Core and builtins +----------------- + + +Library +------- + +- Bug #1531405, format_exception no longer raises an exception if + str(exception) raised an exception. + + +Extension Modules +----------------- + + +Tests +----- + + +Build +----- + + +Mac +--- + + What's New in Python 2.5 beta 3? ================================ From python-checkins at python.org Fri Aug 4 06:58:49 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 4 Aug 2006 06:58:49 +0200 (CEST) Subject: [Python-checkins] r51080 - in python/trunk: Lib/test/test_trace.py Misc/NEWS Python/compile.c Python/import.c Message-ID: <20060804045849.DBFE61E4002@bag.python.org> Author: neal.norwitz Date: Fri Aug 4 06:58:47 2006 New Revision: 51080 Modified: python/trunk/Lib/test/test_trace.py python/trunk/Misc/NEWS python/trunk/Python/compile.c python/trunk/Python/import.c Log: Bug #1191458: tracing over for loops now produces a line event on each iteration. I'm not positive this is the best way to handle this. I'm also not sure that there aren't other cases where the lnotab is generated incorrectly. It would be great if people that use pdb or tracing could test heavily. Also: * Remove dead/duplicated code that wasn't used/necessary because we already handled the docstring prior to entering the loop. * add some debugging code into the compiler (#if 0'd out). Modified: python/trunk/Lib/test/test_trace.py ============================================================================== --- python/trunk/Lib/test/test_trace.py (original) +++ python/trunk/Lib/test/test_trace.py Fri Aug 4 06:58:47 2006 @@ -244,8 +244,8 @@ self.run_test(one_instr_line) def test_04_no_pop_blocks(self): self.run_test(no_pop_blocks) -## def test_05_no_pop_tops(self): -## self.run_test(no_pop_tops) + def test_05_no_pop_tops(self): + self.run_test(no_pop_tops) def test_06_call(self): self.run_test(call) def test_07_raise(self): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 4 06:58:47 2006 @@ -12,6 +12,11 @@ Core and builtins ----------------- +- Bug #1191458: tracing over for loops now produces a line event + on each iteration. Fixing this problem required changing the .pyc + magic number. This means that .pyc files generated before 2.5c1 + will be regenerated. + Library ------- @@ -83,7 +88,7 @@ - Bug #1520864: unpacking singleton tuples in a 'for' loop (for x, in) works again. Fixing this problem required changing the .pyc magic number. - This means that .pyc files generated before 2.5c1 will be regenerated. + This means that .pyc files generated before 2.5b3 will be regenerated. - Bug #1524317: Compiling Python ``--without-threads`` failed. The Python core compiles again then, and, in a build without threads, the Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Fri Aug 4 06:58:47 2006 @@ -143,7 +143,7 @@ PyFutureFeatures *c_future; /* pointer to module's __future__ */ PyCompilerFlags *c_flags; - int c_interactive; + int c_interactive; /* true if in interactive mode */ int c_nestlevel; struct compiler_unit *u; /* compiler state for current block */ @@ -1990,11 +1990,8 @@ n = asdl_seq_LEN(s->v.FunctionDef.body); /* if there was a docstring, we need to skip the first statement */ for (i = docstring; i < n; i++) { - stmt_ty s2 = (stmt_ty)asdl_seq_GET(s->v.FunctionDef.body, i); - if (i == 0 && s2->kind == Expr_kind && - s2->v.Expr.value->kind == Str_kind) - continue; - VISIT_IN_SCOPE(c, stmt, s2); + st = (stmt_ty)asdl_seq_GET(s->v.FunctionDef.body, i); + VISIT_IN_SCOPE(c, stmt, st); } co = assemble(c, 1); compiler_exit_scope(c); @@ -2217,6 +2214,10 @@ VISIT(c, expr, s->v.For.iter); ADDOP(c, GET_ITER); compiler_use_next_block(c, start); + /* XXX(nnorwitz): is there a better way to handle this? + for loops are special, we want to be able to trace them + each time around, so we need to set an extra line number. */ + c->u->u_lineno_set = false; ADDOP_JREL(c, FOR_ITER, cleanup); VISIT(c, expr, s->v.For.target); VISIT_SEQ(c, stmt, s->v.For.body); @@ -4139,7 +4140,10 @@ assert(d_bytecode >= 0); assert(d_lineno >= 0); - if (d_lineno == 0) + /* XXX(nnorwitz): is there a better way to handle this? + for loops are special, we want to be able to trace them + each time around, so we need to set an extra line number. */ + if (d_lineno == 0 && i->i_opcode != FOR_ITER) return 1; if (d_bytecode > 255) { @@ -4444,6 +4448,41 @@ return co; } + +/* For debugging purposes only */ +#if 0 +static void +dump_instr(const struct instr *i) +{ + const char *jrel = i->i_jrel ? "jrel " : ""; + const char *jabs = i->i_jabs ? "jabs " : ""; + char arg[128]; + + *arg = '\0'; + if (i->i_hasarg) + sprintf(arg, "arg: %d ", i->i_oparg); + + fprintf(stderr, "line: %d, opcode: %d %s%s%s\n", + i->i_lineno, i->i_opcode, arg, jabs, jrel); +} + +static void +dump_basicblock(const basicblock *b) +{ + const char *seen = b->b_seen ? "seen " : ""; + const char *b_return = b->b_return ? "return " : ""; + fprintf(stderr, "used: %d, depth: %d, offset: %d %s%s\n", + b->b_iused, b->b_startdepth, b->b_offset, seen, b_return); + if (b->b_instr) { + int i; + for (i = 0; i < b->b_iused; i++) { + fprintf(stderr, " [%02d] ", i); + dump_instr(b->b_instr + i); + } + } +} +#endif + static PyCodeObject * assemble(struct compiler *c, int addNone) { Modified: python/trunk/Python/import.c ============================================================================== --- python/trunk/Python/import.c (original) +++ python/trunk/Python/import.c Fri Aug 4 06:58:47 2006 @@ -62,9 +62,10 @@ Python 2.5a0: 62092 (changed WITH_CLEANUP opcode) Python 2.5b3: 62101 (fix wrong code: for x, in ...) Python 2.5b3: 62111 (fix wrong code: x += yield) + Python 2.5c1: 62121 (fix wrong lnotab with for loops) . */ -#define MAGIC (62111 | ((long)'\r'<<16) | ((long)'\n'<<24)) +#define MAGIC (62121 | ((long)'\r'<<16) | ((long)'\n'<<24)) /* Magic word as global; note that _PyImport_Init() can change the value of this global to accommodate for alterations of how the From python-checkins at python.org Fri Aug 4 07:09:32 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 4 Aug 2006 07:09:32 +0200 (CEST) Subject: [Python-checkins] r51081 - in python/trunk: Lib/test/test_code.py Misc/NEWS Python/compile.c Message-ID: <20060804050932.45B601E4019@bag.python.org> Author: neal.norwitz Date: Fri Aug 4 07:09:28 2006 New Revision: 51081 Modified: python/trunk/Lib/test/test_code.py python/trunk/Misc/NEWS python/trunk/Python/compile.c Log: Bug #1333982: string/number constants were inappropriately stored in the byte code and co_consts even if they were not used, ie immediately popped off the stack. Modified: python/trunk/Lib/test/test_code.py ============================================================================== --- python/trunk/Lib/test/test_code.py (original) +++ python/trunk/Lib/test/test_code.py Fri Aug 4 07:09:28 2006 @@ -61,6 +61,23 @@ flags: 67 consts: ('None',) +>>> def optimize_away(): +... 'doc string' +... 'not a docstring' +... 53 +... 53L + +>>> dump(optimize_away.func_code) +name: optimize_away +argcount: 0 +names: () +varnames: () +cellvars: () +freevars: () +nlocals: 0 +flags: 67 +consts: ("'doc string'", 'None') + """ def consts(t): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 4 07:09:28 2006 @@ -17,6 +17,10 @@ magic number. This means that .pyc files generated before 2.5c1 will be regenerated. +- Bug #1333982: string/number constants were inappropriately stored + in the byte code and co_consts even if they were not used, ie + immediately popped off the stack. + Library ------- Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Fri Aug 4 07:09:28 2006 @@ -2745,11 +2745,13 @@ case Global_kind: break; case Expr_kind: - VISIT(c, expr, s->v.Expr.value); if (c->c_interactive && c->c_nestlevel <= 1) { + VISIT(c, expr, s->v.Expr.value); ADDOP(c, PRINT_EXPR); } - else { + else if (s->v.Expr.value->kind != Str_kind && + s->v.Expr.value->kind != Num_kind) { + VISIT(c, expr, s->v.Expr.value); ADDOP(c, POP_TOP); } break; From python-checkins at python.org Fri Aug 4 07:12:19 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 4 Aug 2006 07:12:19 +0200 (CEST) Subject: [Python-checkins] r51082 - python/trunk/Python/import.c Message-ID: <20060804051219.8F0681E4005@bag.python.org> Author: neal.norwitz Date: Fri Aug 4 07:12:19 2006 New Revision: 51082 Modified: python/trunk/Python/import.c Log: There were really two issues Modified: python/trunk/Python/import.c ============================================================================== --- python/trunk/Python/import.c (original) +++ python/trunk/Python/import.c Fri Aug 4 07:12:19 2006 @@ -62,7 +62,8 @@ Python 2.5a0: 62092 (changed WITH_CLEANUP opcode) Python 2.5b3: 62101 (fix wrong code: for x, in ...) Python 2.5b3: 62111 (fix wrong code: x += yield) - Python 2.5c1: 62121 (fix wrong lnotab with for loops) + Python 2.5c1: 62121 (fix wrong lnotab with for loops and + storing constants that should have been removed) . */ #define MAGIC (62121 | ((long)'\r'<<16) | ((long)'\n'<<24)) From python-checkins at python.org Fri Aug 4 07:16:04 2006 From: python-checkins at python.org (fred.drake) Date: Fri, 4 Aug 2006 07:16:04 +0200 (CEST) Subject: [Python-checkins] r51083 - python/branches/release24-maint/Objects/typeobject.c Message-ID: <20060804051604.EF9E51E4002@bag.python.org> Author: fred.drake Date: Fri Aug 4 07:16:04 2006 New Revision: 51083 Modified: python/branches/release24-maint/Objects/typeobject.c Log: SF patch #1534048 (bug #1531003): fix typo in error message Modified: python/branches/release24-maint/Objects/typeobject.c ============================================================================== --- python/branches/release24-maint/Objects/typeobject.c (original) +++ python/branches/release24-maint/Objects/typeobject.c Fri Aug 4 07:16:04 2006 @@ -1458,7 +1458,7 @@ if (obj->ob_type->tp_weaklistoffset == 0) { PyErr_SetString(PyExc_AttributeError, - "This object has no __weaklist__"); + "This object has no __weakref__"); return NULL; } assert(obj->ob_type->tp_weaklistoffset > 0); From python-checkins at python.org Fri Aug 4 07:17:21 2006 From: python-checkins at python.org (fred.drake) Date: Fri, 4 Aug 2006 07:17:21 +0200 (CEST) Subject: [Python-checkins] r51084 - python/trunk/Objects/typeobject.c Message-ID: <20060804051721.E7D001E4002@bag.python.org> Author: fred.drake Date: Fri Aug 4 07:17:21 2006 New Revision: 51084 Modified: python/trunk/Objects/typeobject.c Log: SF patch #1534048 (bug #1531003): fix typo in error message Modified: python/trunk/Objects/typeobject.c ============================================================================== --- python/trunk/Objects/typeobject.c (original) +++ python/trunk/Objects/typeobject.c Fri Aug 4 07:17:21 2006 @@ -1490,7 +1490,7 @@ if (obj->ob_type->tp_weaklistoffset == 0) { PyErr_SetString(PyExc_AttributeError, - "This object has no __weaklist__"); + "This object has no __weakref__"); return NULL; } assert(obj->ob_type->tp_weaklistoffset > 0); From python-checkins at python.org Fri Aug 4 07:17:47 2006 From: python-checkins at python.org (gregory.p.smith) Date: Fri, 4 Aug 2006 07:17:47 +0200 (CEST) Subject: [Python-checkins] r51085 - python/trunk/Doc/lib/libinspect.tex Message-ID: <20060804051747.C134A1E4002@bag.python.org> Author: gregory.p.smith Date: Fri Aug 4 07:17:47 2006 New Revision: 51085 Modified: python/trunk/Doc/lib/libinspect.tex Log: fix typos Modified: python/trunk/Doc/lib/libinspect.tex ============================================================================== --- python/trunk/Doc/lib/libinspect.tex (original) +++ python/trunk/Doc/lib/libinspect.tex Fri Aug 4 07:17:47 2006 @@ -291,18 +291,18 @@ \end{funcdesc} \begin{funcdesc}{formatargspec}{args\optional{, varargs, varkw, defaults, - argformat, varargsformat, varkwformat, defaultformat}} + formatarg, formatvarargs, formatvarkw, formatvalue, join}} Format a pretty argument spec from the four values returned by - \function{getargspec()}. The other four arguments are the + \function{getargspec()}. The format* arguments are the corresponding optional formatting functions that are called to turn names and values into strings. \end{funcdesc} \begin{funcdesc}{formatargvalues}{args\optional{, varargs, varkw, locals, - argformat, varargsformat, varkwformat, valueformat}} + formatarg, formatvarargs, formatvarkw, formatvalue, join}} Format a pretty argument spec from the four values returned by - \function{getargvalues()}. The other four arguments are the + \function{getargvalues()}. The format* arguments are the corresponding optional formatting functions that are called to turn names and values into strings. \end{funcdesc} From python-checkins at python.org Fri Aug 4 07:25:40 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 4 Aug 2006 07:25:40 +0200 (CEST) Subject: [Python-checkins] r51086 - peps/trunk/pep-0356.txt Message-ID: <20060804052540.ACE071E4005@bag.python.org> Author: neal.norwitz Date: Fri Aug 4 07:25:40 2006 New Revision: 51086 Modified: peps/trunk/pep-0356.txt Log: b3 is out, update schedule to current, best guess. some bugs have been fixed. add new unicode issue Modified: peps/trunk/pep-0356.txt ============================================================================== --- peps/trunk/pep-0356.txt (original) +++ peps/trunk/pep-0356.txt Fri Aug 4 07:25:40 2006 @@ -36,9 +36,9 @@ alpha 2: April 27, 2006 [completed] beta 1: June 20, 2006 [completed] beta 2: July 11, 2006 [completed] - beta 3: August 1, 2006 [planned] - rc 1: August ??, 2006 [planned] - final: August ??, 2006 [planned] + beta 3: August 3, 2006 [completed] + rc 1: August 18, 2006 [planned] + final: September 12, 2006 [planned] Completed features for 2.5 @@ -147,35 +147,22 @@ Open issues - Bugs that need resolving before release, ie, they block release: - http://python.org/sf/1530559 - struct rejecting floats - http://python.org/sf/1333982 - AST - http://python.org/sf/1191458 - AST (test_trace issue mentioned below) + http://python.org/sf/1530559 - struct rejecting floats (patch pending) http://mail.python.org/pipermail/python-dev/2006-July/067774.html - Problem with __index__ + Problem with __index__ (patch pending) + + http://mail.python.org/pipermail/python-dev/2006-August/067926.html + str/unicode dict keys can raise an exception - Bugs that ought to be resolved before release (all exist in 2.4): http://python.org/sf/1526585 - SystemError concat long strings http://python.org/sf/1523610 - PyArg_ParseTupleAndKeywords potential core dump - http://python.org/sf/1519025 - socket timeout crash when receive signal http://python.org/sf/1517042 - Fix crashers/gc_inspection.py http://python.org/sf/1475523 - gettext.py bug (owner: Martin v. Loewis) http://python.org/sf/1467929 - %-formatting and dicts - - AST compiler problems - (Owner: Jeremy Hylton) - * string constants that are not assigned are in byte code - def foo(): - "docstring" - "not a docstring" - the constant (not a docstring) should not be stored in co_consts - - * test_trace tests that were commented out for AST must be fixed - only test_05_no_pop_tops remains outstanding - (Owner: Jeremy Hylton) - http://python.org/sf/1191458 - - The PEP 302 changes to (at least) pkgutil, runpy and pydoc must be documented. From python-checkins at python.org Fri Aug 4 08:03:56 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 4 Aug 2006 08:03:56 +0200 (CEST) Subject: [Python-checkins] r51087 - python/trunk/Objects/descrobject.c Message-ID: <20060804060356.79C761E4005@bag.python.org> Author: georg.brandl Date: Fri Aug 4 08:03:53 2006 New Revision: 51087 Modified: python/trunk/Objects/descrobject.c Log: Fix bug caused by first decrefing, then increfing. Modified: python/trunk/Objects/descrobject.c ============================================================================== --- python/trunk/Objects/descrobject.c (original) +++ python/trunk/Objects/descrobject.c Fri Aug 4 08:03:53 2006 @@ -1176,7 +1176,6 @@ property_init(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *get = NULL, *set = NULL, *del = NULL, *doc = NULL; - PyObject *get_doc = NULL; static char *kwlist[] = {"fget", "fset", "fdel", "doc", 0}; propertyobject *gs = (propertyobject *)self; @@ -1194,16 +1193,16 @@ /* if no docstring given and the getter has one, use that one */ if ((doc == NULL || doc == Py_None) && get != NULL && PyObject_HasAttrString(get, "__doc__")) { - if (!(get_doc = PyObject_GetAttrString(get, "__doc__"))) + doc = PyObject_GetAttrString(get, "__doc__"); + if (doc == NULL) return -1; - Py_DECREF(get_doc); /* it is INCREF'd again below */ - doc = get_doc; + } else { + Py_XINCREF(doc); } Py_XINCREF(get); Py_XINCREF(set); Py_XINCREF(del); - Py_XINCREF(doc); gs->prop_get = get; gs->prop_set = set; From theller at python.net Fri Aug 4 10:15:41 2006 From: theller at python.net (Thomas Heller) Date: Fri, 04 Aug 2006 10:15:41 +0200 Subject: [Python-checkins] r50969 - in python/trunk: Include/pyerrors.h Misc/NEWS Modules/_struct.c Python/errors.c In-Reply-To: <20060730065548.D39B31E4008@bag.python.org> References: <20060730065548.D39B31E4008@bag.python.org> Message-ID: neal.norwitz schrieb: > Author: neal.norwitz > Date: Sun Jul 30 08:55:48 2006 > New Revision: 50969 > > Modified: > python/trunk/Include/pyerrors.h > python/trunk/Misc/NEWS > python/trunk/Modules/_struct.c > python/trunk/Python/errors.c > Log: > Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn(). > This provides the proper warning for struct.pack(). > PyErr_Warn() is now deprecated in favor of PyErr_WarnEx(). > As mentioned by Tim Peters on python-dev. > > > Modified: python/trunk/Include/pyerrors.h > ============================================================================== > --- python/trunk/Include/pyerrors.h (original) > +++ python/trunk/Include/pyerrors.h Sun Jul 30 08:55:48 2006 > @@ -225,10 +225,14 @@ > PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *); > > /* Issue a warning or exception */ > -PyAPI_FUNC(int) PyErr_Warn(PyObject *, char *); > +PyAPI_FUNC(int) PyErr_WarnEx(PyObject *category, const char *msg, > + Py_ssize_t stack_level); > PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, > const char *, int, > const char *, PyObject *); > +/* PyErr_Warn is only for backwards compatability and will be removed. > + Use PyErr_WarnEx instead. */ > +#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1) > This change removed (on Windows) the PyErr_Warn *exported* function from the python25.dll. As a result, extensions compiled with earlier beta versions of python 2.5 cannot be loaded any more; for example the win32com extensions from Mark Hammond - but of course any other extensions that use this function. Btw: Shouldn't the PYTHON_API_VERSION (or how it's called) have also been changed? I'm unsure what to do: - Implement PyErr_Warn as a function again (this was also done with other functions, see also #1465834). Would this require another beta ;-)? - Leave it as it is, and require that extensions needs to be rebuilt with 2.5b3 (plus change the PYTHON_API_VERSION, ...) Anyway, it seems to me that *some* policy regarding changes to exported functions should be established. Thomas From mal at egenix.com Fri Aug 4 10:58:26 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Fri, 04 Aug 2006 10:58:26 +0200 Subject: [Python-checkins] r50969 - in python/trunk: Include/pyerrors.h Misc/NEWS Modules/_struct.c Python/errors.c In-Reply-To: References: <20060730065548.D39B31E4008@bag.python.org> Message-ID: <44D30C32.6010906@egenix.com> Thomas Heller wrote: > neal.norwitz schrieb: >> Author: neal.norwitz >> Date: Sun Jul 30 08:55:48 2006 >> New Revision: 50969 >> >> Modified: >> python/trunk/Include/pyerrors.h >> python/trunk/Misc/NEWS >> python/trunk/Modules/_struct.c >> python/trunk/Python/errors.c >> Log: >> Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn(). >> This provides the proper warning for struct.pack(). >> PyErr_Warn() is now deprecated in favor of PyErr_WarnEx(). >> As mentioned by Tim Peters on python-dev. >> >> >> Modified: python/trunk/Include/pyerrors.h >> ============================================================================== >> --- python/trunk/Include/pyerrors.h (original) >> +++ python/trunk/Include/pyerrors.h Sun Jul 30 08:55:48 2006 >> @@ -225,10 +225,14 @@ >> PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *); >> >> /* Issue a warning or exception */ >> -PyAPI_FUNC(int) PyErr_Warn(PyObject *, char *); >> +PyAPI_FUNC(int) PyErr_WarnEx(PyObject *category, const char *msg, >> + Py_ssize_t stack_level); >> PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, >> const char *, int, >> const char *, PyObject *); >> +/* PyErr_Warn is only for backwards compatability and will be removed. >> + Use PyErr_WarnEx instead. */ >> +#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1) >> > > This change removed (on Windows) the PyErr_Warn *exported* function from > the python25.dll. As a result, extensions compiled with earlier beta versions > of python 2.5 cannot be loaded any more; for example the win32com extensions > from Mark Hammond - but of course any other extensions that use this function. > > Btw: Shouldn't the PYTHON_API_VERSION (or how it's called) have also been changed? > > I'm unsure what to do: > - Implement PyErr_Warn as a function again (this was also done with other functions, > see also #1465834). Would this require another beta ;-)? > - Leave it as it is, and require that extensions needs to be rebuilt with 2.5b3 > (plus change the PYTHON_API_VERSION, ...) > > Anyway, it seems to me that *some* policy regarding changes to exported functions > should be established. In the past we've always kept a stub function around that was exported when converting a function to a macro. I guess this ought to happen in this case as well. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 04 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From python-checkins at python.org Fri Aug 4 16:54:56 2006 From: python-checkins at python.org (jackilyn.hoxworth) Date: Fri, 4 Aug 2006 16:54:56 +0200 (CEST) Subject: [Python-checkins] r51104 - python/branches/hoxworth-stdlib_logging-soc/fakesocket.py python/branches/hoxworth-stdlib_logging-soc/new_soc_logging_test.py Message-ID: <20060804145456.AE8F91E4003@bag.python.org> Author: jackilyn.hoxworth Date: Fri Aug 4 16:54:56 2006 New Revision: 51104 Modified: python/branches/hoxworth-stdlib_logging-soc/fakesocket.py python/branches/hoxworth-stdlib_logging-soc/new_soc_logging_test.py Log: Modified: python/branches/hoxworth-stdlib_logging-soc/fakesocket.py ============================================================================== --- python/branches/hoxworth-stdlib_logging-soc/fakesocket.py (original) +++ python/branches/hoxworth-stdlib_logging-soc/fakesocket.py Fri Aug 4 16:54:56 2006 @@ -1,11 +1,16 @@ import socket +from socket import * +import fakesocket as self +import socket as origsocket -def getaddrinfo(host,port, *args): +def getaddrinfo(host, port, *args): """no real addr info -- but the test data is copied from 'port' to 'sa' for a bit of control over the resulting mock socket. - >>> getaddrinfo("MOCK", "Raise: connection prohibited") - ("af", "socktype", "proto", "cannonname", "Raise: connection prohibited") - """ + + getaddrinfo("MOCK", "Raise: connection prohibited") + ("af", "socktype", "proto", "cannonname", "Raise: connection prohibited")""" + + host = "MOCK" if host != "MOCK": raise ValueError("Faked Socket Module for testing only") @@ -17,7 +22,9 @@ class socket(object): """Mock socket object""" + def __init__(self, af, socktype, proto): pass + def connect(self, sa): """Raise if the argument says raise, otherwise sa is treated as the response. Wouldn't hurt to put doctests in here, too... @@ -26,8 +33,12 @@ raise error(sa) else: self.incoming_msg = sa + def close(self): pass + def sendall(self, msg): self.gotsent = msg + def makefile(self, mode, bufsize): - return cStringIO(self.incoming_msg) \ No newline at end of file + return cStringIO(self.incoming_msg) + \ No newline at end of file Modified: python/branches/hoxworth-stdlib_logging-soc/new_soc_logging_test.py ============================================================================== --- python/branches/hoxworth-stdlib_logging-soc/new_soc_logging_test.py (original) +++ python/branches/hoxworth-stdlib_logging-soc/new_soc_logging_test.py Fri Aug 4 16:54:56 2006 @@ -1,4 +1,5 @@ import httplib +reload(httplib) import fakesocket import logging from cStringIO import StringIO @@ -26,7 +27,7 @@ print "Debug level is > 0" myconn.connect() -myconn.putrequest("GET", "/search?q=Jackilyn+Hoxworth") +myconn.putrequest("GET", "/search?q=python") myconn.getresponse() print stringLog.getvalue() # For testing purposes From python-checkins at python.org Fri Aug 4 18:20:31 2006 From: python-checkins at python.org (neil.schemenauer) Date: Fri, 4 Aug 2006 18:20:31 +0200 (CEST) Subject: [Python-checkins] r51109 - in python/trunk: Lib/compiler/pycodegen.py Lib/test/test_compiler.py Misc/NEWS Message-ID: <20060804162031.EFD601E4003@bag.python.org> Author: neil.schemenauer Date: Fri Aug 4 18:20:30 2006 New Revision: 51109 Modified: python/trunk/Lib/compiler/pycodegen.py python/trunk/Lib/test/test_compiler.py python/trunk/Misc/NEWS Log: Fix the 'compiler' package to generate correct code for MAKE_CLOSURE. In the 2.5 development cycle, MAKE_CLOSURE as changed to take free variables as a tuple rather than as individual items on the stack. Closes patch #1534084. Modified: python/trunk/Lib/compiler/pycodegen.py ============================================================================== --- python/trunk/Lib/compiler/pycodegen.py (original) +++ python/trunk/Lib/compiler/pycodegen.py Fri Aug 4 18:20:30 2006 @@ -382,16 +382,7 @@ self.set_lineno(node) for default in node.defaults: self.visit(default) - frees = gen.scope.get_free_vars() - if frees: - for name in frees: - self.emit('LOAD_CLOSURE', name) - self.emit('LOAD_CONST', gen) - self.emit('MAKE_CLOSURE', len(node.defaults)) - else: - self.emit('LOAD_CONST', gen) - self.emit('MAKE_FUNCTION', len(node.defaults)) - + self._makeClosure(gen, len(node.defaults)) for i in range(ndecorators): self.emit('CALL_FUNCTION', 1) @@ -405,14 +396,7 @@ for base in node.bases: self.visit(base) self.emit('BUILD_TUPLE', len(node.bases)) - frees = gen.scope.get_free_vars() - for name in frees: - self.emit('LOAD_CLOSURE', name) - self.emit('LOAD_CONST', gen) - if frees: - self.emit('MAKE_CLOSURE', 0) - else: - self.emit('MAKE_FUNCTION', 0) + self._makeClosure(gen, 0) self.emit('CALL_FUNCTION', 0) self.emit('BUILD_CLASS') self.storeName(node.name) @@ -644,22 +628,25 @@ self.newBlock() self.emit('POP_TOP') - def visitGenExpr(self, node): - gen = GenExprCodeGenerator(node, self.scopes, self.class_name, - self.get_module()) - walk(node.code, gen) - gen.finish() - self.set_lineno(node) + def _makeClosure(self, gen, args): frees = gen.scope.get_free_vars() if frees: for name in frees: self.emit('LOAD_CLOSURE', name) + self.emit('BUILD_TUPLE', len(frees)) self.emit('LOAD_CONST', gen) - self.emit('MAKE_CLOSURE', 0) + self.emit('MAKE_CLOSURE', args) else: self.emit('LOAD_CONST', gen) - self.emit('MAKE_FUNCTION', 0) + self.emit('MAKE_FUNCTION', args) + def visitGenExpr(self, node): + gen = GenExprCodeGenerator(node, self.scopes, self.class_name, + self.get_module()) + walk(node.code, gen) + gen.finish() + self.set_lineno(node) + self._makeClosure(gen, 0) # precomputation of outmost iterable self.visit(node.code.quals[0].iter) self.emit('GET_ITER') Modified: python/trunk/Lib/test/test_compiler.py ============================================================================== --- python/trunk/Lib/test/test_compiler.py (original) +++ python/trunk/Lib/test/test_compiler.py Fri Aug 4 18:20:30 2006 @@ -104,6 +104,19 @@ self.assertEquals(flatten([1, [2]]), [1, 2]) self.assertEquals(flatten((1, (2,))), [1, 2]) + def testNestedScope(self): + c = compiler.compile('def g():\n' + ' a = 1\n' + ' def f(): return a + 2\n' + ' return f()\n' + 'result = g()', + '', + 'exec') + dct = {} + exec c in dct + self.assertEquals(dct.get('result'), 3) + + NOLINENO = (compiler.ast.Module, compiler.ast.Stmt, compiler.ast.Discard) ############################################################################### Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 4 18:20:30 2006 @@ -28,6 +28,9 @@ - Bug #1531405, format_exception no longer raises an exception if str(exception) raised an exception. +- Fix a bug in the ``compiler`` package that caused invalid code to be + generated for nested functions. + Extension Modules ----------------- From buildbot at python.org Fri Aug 4 19:12:45 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 04 Aug 2006 17:12:45 +0000 Subject: [Python-checkins] buildbot warnings in x86 cygwin trunk Message-ID: <20060804171245.5D4651E4005@bag.python.org> The Buildbot has detected a new failure of x86 cygwin trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520cygwin%2520trunk/builds/1065 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neil.schemenauer Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 4 19:13:44 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 04 Aug 2006 17:13:44 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060804171344.8CC9B1E4003@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1030 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neil.schemenauer Build Had Warnings: warnings test sincerely, -The Buildbot From nnorwitz at gmail.com Fri Aug 4 19:33:28 2006 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 4 Aug 2006 10:33:28 -0700 Subject: [Python-checkins] r50969 - in python/trunk: Include/pyerrors.h Misc/NEWS Modules/_struct.c Python/errors.c In-Reply-To: <44D30C32.6010906@egenix.com> References: <20060730065548.D39B31E4008@bag.python.org> <44D30C32.6010906@egenix.com> Message-ID: On 8/4/06, M.-A. Lemburg wrote: > > > > This change removed (on Windows) the PyErr_Warn *exported* function from > > the python25.dll. As a result, extensions compiled with earlier beta versions > > of python 2.5 cannot be loaded any more; for example the win32com extensions > > from Mark Hammond - but of course any other extensions that use this function. > > > > Btw: Shouldn't the PYTHON_API_VERSION (or how it's called) have also been changed? > > > > I'm unsure what to do: > > - Implement PyErr_Warn as a function again (this was also done with other functions, > > see also #1465834). Would this require another beta ;-)? > > - Leave it as it is, and require that extensions needs to be rebuilt with 2.5b3 > > (plus change the PYTHON_API_VERSION, ...) > > > > Anyway, it seems to me that *some* policy regarding changes to exported functions > > should be established. > > In the past we've always kept a stub function around that > was exported when converting a function to a macro. > > I guess this ought to happen in this case as well. That was my intent. I thought I left it in the C file so it would be in a library, but any newly compiled code would use the new API. Thomas if you can work up a patch, that would be great. I will try to take a look at it later. n From python-checkins at python.org Fri Aug 4 20:03:38 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 4 Aug 2006 20:03:38 +0200 (CEST) Subject: [Python-checkins] r51110 - in python/trunk: Lib/test/test_descr.py Misc/NEWS Modules/_testcapimodule.c Objects/descrobject.c Message-ID: <20060804180338.AD01E1E400D@bag.python.org> Author: georg.brandl Date: Fri Aug 4 20:03:37 2006 New Revision: 51110 Modified: python/trunk/Lib/test/test_descr.py python/trunk/Misc/NEWS python/trunk/Modules/_testcapimodule.c python/trunk/Objects/descrobject.c Log: Change fix for segfaulting property(), add a NEWS entry and a test. Modified: python/trunk/Lib/test/test_descr.py ============================================================================== --- python/trunk/Lib/test/test_descr.py (original) +++ python/trunk/Lib/test/test_descr.py Fri Aug 4 20:03:37 2006 @@ -2024,6 +2024,16 @@ prop2 = property(fset=setter) vereq(prop2.__doc__, None) + # this segfaulted in 2.5b2 + try: + import _testcapi + except ImportError: + pass + else: + class X(object): + p = property(_testcapi.test_with_docstring) + + def supers(): if verbose: print "Testing super..." Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 4 20:03:37 2006 @@ -21,6 +21,8 @@ in the byte code and co_consts even if they were not used, ie immediately popped off the stack. +- Fixed a reference-counting problem in property(). + Library ------- Modified: python/trunk/Modules/_testcapimodule.c ============================================================================== --- python/trunk/Modules/_testcapimodule.c (original) +++ python/trunk/Modules/_testcapimodule.c Fri Aug 4 20:03:37 2006 @@ -706,6 +706,13 @@ #undef CHECK_1_FORMAT } +/* This is here to provide a docstring for test_descr. */ +static PyObject * +test_with_docstring(PyObject *self) +{ + Py_RETURN_NONE; +} + static PyMethodDef TestMethods[] = { {"raise_exception", raise_exception, METH_VARARGS}, {"test_config", (PyCFunction)test_config, METH_NOARGS}, @@ -716,6 +723,8 @@ {"test_k_code", (PyCFunction)test_k_code, METH_NOARGS}, {"test_null_strings", (PyCFunction)test_null_strings, METH_NOARGS}, {"test_string_from_format", (PyCFunction)test_string_from_format, METH_NOARGS}, + {"test_with_docstring", (PyCFunction)test_with_docstring, METH_NOARGS, + PyDoc_STR("This is a pretty normal docstring.")}, {"getargs_tuple", getargs_tuple, METH_VARARGS}, {"getargs_b", getargs_b, METH_VARARGS}, Modified: python/trunk/Objects/descrobject.c ============================================================================== --- python/trunk/Objects/descrobject.c (original) +++ python/trunk/Objects/descrobject.c Fri Aug 4 20:03:37 2006 @@ -1190,19 +1190,21 @@ if (del == Py_None) del = NULL; - /* if no docstring given and the getter has one, use that one */ - if ((doc == NULL || doc == Py_None) && get != NULL && - PyObject_HasAttrString(get, "__doc__")) { - doc = PyObject_GetAttrString(get, "__doc__"); - if (doc == NULL) - return -1; - } else { - Py_XINCREF(doc); - } - Py_XINCREF(get); Py_XINCREF(set); Py_XINCREF(del); + Py_XINCREF(doc); + + /* if no docstring given and the getter has one, use that one */ + if ((doc == NULL || doc == Py_None) && get != NULL) { + PyObject *get_doc = PyObject_GetAttrString(get, "__doc__"); + if (get_doc != NULL) { + Py_XDECREF(doc); + doc = get_doc; /* get_doc already INCREF'd by GetAttr */ + } else { + PyErr_Clear(); + } + } gs->prop_get = get; gs->prop_set = set; From python-checkins at python.org Fri Aug 4 20:07:34 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 4 Aug 2006 20:07:34 +0200 (CEST) Subject: [Python-checkins] r51111 - python/trunk/Lib/traceback.py Message-ID: <20060804180734.B96091E4003@bag.python.org> Author: georg.brandl Date: Fri Aug 4 20:07:34 2006 New Revision: 51111 Modified: python/trunk/Lib/traceback.py Log: Better fix for bug #1531405, not executing str(value) twice. Modified: python/trunk/Lib/traceback.py ============================================================================== --- python/trunk/Lib/traceback.py (original) +++ python/trunk/Lib/traceback.py Fri Aug 4 20:07:34 2006 @@ -202,15 +202,11 @@ def _format_final_exc_line(etype, value): """Return a list of a single line -- normal case for format_exception_only""" - try: - printable = value is None or not str(value) - except: - printable = False - - if printable: + valuestr = _some_str(value) + if value is None or not valuestr: line = "%s\n" % etype else: - line = "%s: %s\n" % (etype, _some_str(value)) + line = "%s: %s\n" % (etype, valuestr) return line def _some_str(value): From theller at python.net Fri Aug 4 19:46:52 2006 From: theller at python.net (Thomas Heller) Date: Fri, 04 Aug 2006 19:46:52 +0200 Subject: [Python-checkins] r50969 - in python/trunk: Include/pyerrors.h Misc/NEWS Modules/_struct.c Python/errors.c In-Reply-To: References: <20060730065548.D39B31E4008@bag.python.org> <44D30C32.6010906@egenix.com> Message-ID: <44D3880C.6090402@python.net> Neal Norwitz schrieb: > On 8/4/06, M.-A. Lemburg wrote: >> > >> > This change removed (on Windows) the PyErr_Warn *exported* function from >> > the python25.dll. As a result, extensions compiled with earlier beta versions >> > of python 2.5 cannot be loaded any more; for example the win32com extensions >> > from Mark Hammond - but of course any other extensions that use this function. >> > >> > Btw: Shouldn't the PYTHON_API_VERSION (or how it's called) have also been changed? >> > >> > I'm unsure what to do: >> > - Implement PyErr_Warn as a function again (this was also done with other functions, >> > see also #1465834). Would this require another beta ;-)? >> > - Leave it as it is, and require that extensions needs to be rebuilt with 2.5b3 >> > (plus change the PYTHON_API_VERSION, ...) >> > >> > Anyway, it seems to me that *some* policy regarding changes to exported functions >> > should be established. >> >> In the past we've always kept a stub function around that >> was exported when converting a function to a macro. >> >> I guess this ought to happen in this case as well. > > That was my intent. I thought I left it in the C file so it would be > in a library, but any newly compiled code would use the new API. Ah, I didn't look into Python/errors.h. The function must be marked PyAPI_FUNC to be exported from the dll. > Thomas if you can work up a patch, that would be great. I will try to > take a look at it later. Index: errors.c =================================================================== --- errors.c (Revision 51087) +++ errors.c (Arbeitskopie) @@ -664,7 +664,7 @@ #undef PyErr_Warn -int +PyAPI_FUNC(int) PyErr_Warn(PyObject *category, char *message) { return PyErr_WarnEx(category, message, 1); Just for fun: with ctypes, testing for this is trivial. First, Python 2.5b3: Python 2.5b3 (r25b3:51041, Aug 3 2006, 09:35:06) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes import * >>> pythonapi.PyErr_Warn Traceback (most recent call last): File "", line 1, in File "c:\svn\theller\ctypes\ctypes\__init__.py", line 328, in __getattr__ func = self.__getitem__(name) File "c:\svn\theller\ctypes\ctypes\__init__.py", line 333, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: function 'PyErr_Warn' not found >>> ^Z Then, Python SVN trunk with this patch: Python 2.5b3 (trunk:51087M, Aug 4 2006, 19:43:25) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes import * >>> pythonapi.PyErr_Warn <_FuncPtr object at 0x009E6E40> >>> ^Z Thomas From nnorwitz at gmail.com Fri Aug 4 20:10:13 2006 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 4 Aug 2006 11:10:13 -0700 Subject: [Python-checkins] r50969 - in python/trunk: Include/pyerrors.h Misc/NEWS Modules/_struct.c Python/errors.c In-Reply-To: <44D3880C.6090402@python.net> References: <20060730065548.D39B31E4008@bag.python.org> <44D30C32.6010906@egenix.com> <44D3880C.6090402@python.net> Message-ID: On 8/4/06, Thomas Heller wrote: > > Ah, I didn't look into Python/errors.h. The function must be marked PyAPI_FUNC > to be exported from the dll. Thanks, I didn't know that! > > Thomas if you can work up a patch, that would be great. I will try to > > take a look at it later. Can you check that in and make an entry in Misc/NEWS? Thanks, n From python-checkins at python.org Fri Aug 4 20:17:41 2006 From: python-checkins at python.org (thomas.heller) Date: Fri, 4 Aug 2006 20:17:41 +0200 (CEST) Subject: [Python-checkins] r51112 - in python/trunk: Misc/NEWS Python/errors.c Message-ID: <20060804181741.3A82F1E4009@bag.python.org> Author: thomas.heller Date: Fri Aug 4 20:17:40 2006 New Revision: 51112 Modified: python/trunk/Misc/NEWS python/trunk/Python/errors.c Log: On Windows, make PyErr_Warn an exported function again. Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 4 20:17:40 2006 @@ -12,6 +12,9 @@ Core and builtins ----------------- +- On Windows, the PyErr_Warn function is now exported from + the Python dll again. + - Bug #1191458: tracing over for loops now produces a line event on each iteration. Fixing this problem required changing the .pyc magic number. This means that .pyc files generated before 2.5c1 Modified: python/trunk/Python/errors.c ============================================================================== --- python/trunk/Python/errors.c (original) +++ python/trunk/Python/errors.c Fri Aug 4 20:17:40 2006 @@ -664,7 +664,7 @@ #undef PyErr_Warn -int +PyAPI_FUNC(int) PyErr_Warn(PyObject *category, char *message) { return PyErr_WarnEx(category, message, 1); From python-checkins at python.org Fri Aug 4 20:57:35 2006 From: python-checkins at python.org (thomas.heller) Date: Fri, 4 Aug 2006 20:57:35 +0200 (CEST) Subject: [Python-checkins] r51113 - in python/trunk: Misc/NEWS setup.py Message-ID: <20060804185735.77EAD1E4003@bag.python.org> Author: thomas.heller Date: Fri Aug 4 20:57:34 2006 New Revision: 51113 Modified: python/trunk/Misc/NEWS python/trunk/setup.py Log: Fix #1530448 - fix ctypes build failure on solaris 10. The '-mimpure-text' linker flag is required when linking _ctypes.so. Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 4 20:57:34 2006 @@ -48,6 +48,8 @@ Build ----- +- Bug #1530448, ctypes buld failure on Solaris 10 was fixed. + Mac --- Modified: python/trunk/setup.py ============================================================================== --- python/trunk/setup.py (original) +++ python/trunk/setup.py Fri Aug 4 20:57:34 2006 @@ -1349,6 +1349,7 @@ self.use_system_libffi = False include_dirs = [] extra_compile_args = [] + extra_link_args = [] sources = ['_ctypes/_ctypes.c', '_ctypes/callbacks.c', '_ctypes/callproc.c', @@ -1363,9 +1364,13 @@ # XXX Is this still needed? ## extra_link_args.extend(['-read_only_relocs', 'warning']) + elif sys.platform == 'sunos5': + extra_link_args.append('-mimpure-text') + ext = Extension('_ctypes', include_dirs=include_dirs, extra_compile_args=extra_compile_args, + extra_link_args=extra_link_args, libraries=[], sources=sources, depends=depends) From buildbot at python.org Fri Aug 4 21:25:16 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 04 Aug 2006 19:25:16 +0000 Subject: [Python-checkins] buildbot warnings in sparc solaris10 gcc trunk Message-ID: <20060804192516.27B171E4003@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520solaris10%2520gcc%2520trunk/builds/1311 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Fri Aug 4 21:49:32 2006 From: python-checkins at python.org (thomas.heller) Date: Fri, 4 Aug 2006 21:49:32 +0200 (CEST) Subject: [Python-checkins] r51114 - in python/trunk: Misc/NEWS PCbuild/_msi.vcproj Message-ID: <20060804194932.B8A5E1E4003@bag.python.org> Author: thomas.heller Date: Fri Aug 4 21:49:31 2006 New Revision: 51114 Modified: python/trunk/Misc/NEWS python/trunk/PCbuild/_msi.vcproj Log: Fix #1534738: win32 debug version of _msi must be _msi_d.pyd, not _msi.pyd. Fix the name of the pdb file as well. Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 4 21:49:31 2006 @@ -48,6 +48,8 @@ Build ----- +- Bug #1534738, win32 debug version of _msi should be _msi_d.pyd. + - Bug #1530448, ctypes buld failure on Solaris 10 was fixed. Modified: python/trunk/PCbuild/_msi.vcproj ============================================================================== --- python/trunk/PCbuild/_msi.vcproj (original) +++ python/trunk/PCbuild/_msi.vcproj Fri Aug 4 21:49:31 2006 @@ -36,11 +36,11 @@ From theller at python.net Fri Aug 4 21:52:46 2006 From: theller at python.net (Thomas Heller) Date: Fri, 04 Aug 2006 21:52:46 +0200 Subject: [Python-checkins] r51114 - in python/trunk: Misc/NEWS PCbuild/_msi.vcproj In-Reply-To: <20060804194932.B8A5E1E4003@bag.python.org> References: <20060804194932.B8A5E1E4003@bag.python.org> Message-ID: thomas.heller schrieb: > Author: thomas.heller > Date: Fri Aug 4 21:49:31 2006 > New Revision: 51114 > > Modified: > python/trunk/Misc/NEWS > python/trunk/PCbuild/_msi.vcproj > Log: > Fix #1534738: win32 debug version of _msi must be _msi_d.pyd, not _msi.pyd. > Fix the name of the pdb file as well. Someone with Visual Studio 2005 should probably fix the PCBuild8 project file. > Modified: python/trunk/Misc/NEWS > ============================================================================== > --- python/trunk/Misc/NEWS (original) > +++ python/trunk/Misc/NEWS Fri Aug 4 21:49:31 2006 > @@ -48,6 +48,8 @@ > Build > ----- > > +- Bug #1534738, win32 debug version of _msi should be _msi_d.pyd. > + > - Bug #1530448, ctypes buld failure on Solaris 10 was fixed. > > > > Modified: python/trunk/PCbuild/_msi.vcproj > ============================================================================== > --- python/trunk/PCbuild/_msi.vcproj (original) > +++ python/trunk/PCbuild/_msi.vcproj Fri Aug 4 21:49:31 2006 > @@ -36,11 +36,11 @@ > Name="VCLinkerTool" > AdditionalDependencies="fci.lib msi.lib rpcrt4.lib" > - OutputFile="./_msi.pyd" > + OutputFile="./_msi_d.pyd" > LinkIncremental="1" > SuppressStartupBanner="TRUE" > GenerateDebugInformation="TRUE" > - ProgramDatabaseFile=".\./_msi.pdb" > + ProgramDatabaseFile=".\./_msi_d.pdb" > BaseAddress="0x1D160000" > ImportLibrary=".\./_msi.lib" > TargetMachine="1"/> From python-checkins at python.org Fri Aug 4 22:37:43 2006 From: python-checkins at python.org (andrew.kuchling) Date: Fri, 4 Aug 2006 22:37:43 +0200 (CEST) Subject: [Python-checkins] r51115 - python/trunk/Objects/dictnotes.txt python/trunk/Objects/dictobject.c Message-ID: <20060804203743.EDA941E4003@bag.python.org> Author: andrew.kuchling Date: Fri Aug 4 22:37:43 2006 New Revision: 51115 Modified: python/trunk/Objects/dictnotes.txt python/trunk/Objects/dictobject.c Log: Typo fixes Modified: python/trunk/Objects/dictnotes.txt ============================================================================== --- python/trunk/Objects/dictnotes.txt (original) +++ python/trunk/Objects/dictnotes.txt Fri Aug 4 22:37:43 2006 @@ -243,7 +243,7 @@ Caching Lookups --------------- The idea is to exploit key access patterns by anticipating future lookups -based of previous lookups. +based on previous lookups. The simplest incarnation is to save the most recently accessed entry. This gives optimal performance for use cases where every get is followed Modified: python/trunk/Objects/dictobject.c ============================================================================== --- python/trunk/Objects/dictobject.c (original) +++ python/trunk/Objects/dictobject.c Fri Aug 4 22:37:43 2006 @@ -532,7 +532,7 @@ /* Note that, for historical reasons, PyDict_GetItem() suppresses all errors * that may occur (originally dicts supported only string keys, and exceptions * weren't possible). So, while the original intent was that a NULL return - * meant the key wasn't present, it reality it can mean that, or that an error + * meant the key wasn't present, in reality it can mean that, or that an error * (suppressed) occurred while computing the key's hash, or that some error * (suppressed) occurred when comparing keys in the dict's internal probe * sequence. A nasty example of the latter is when a Python-coded comparison From python-checkins at python.org Fri Aug 4 23:10:04 2006 From: python-checkins at python.org (andrew.kuchling) Date: Fri, 4 Aug 2006 23:10:04 +0200 (CEST) Subject: [Python-checkins] r51116 - python/trunk/Doc/lib/liblinecache.tex Message-ID: <20060804211004.4DF691E4003@bag.python.org> Author: andrew.kuchling Date: Fri Aug 4 23:10:03 2006 New Revision: 51116 Modified: python/trunk/Doc/lib/liblinecache.tex Log: Fix mangled sentence Modified: python/trunk/Doc/lib/liblinecache.tex ============================================================================== --- python/trunk/Doc/lib/liblinecache.tex (original) +++ python/trunk/Doc/lib/liblinecache.tex Fri Aug 4 23:10:03 2006 @@ -38,7 +38,7 @@ \begin{funcdesc}{checkcache}{\optional{filename}} Check the cache for validity. Use this function if files in the cache may have changed on disk, and you require the updated version. If -\var{filename} is omitted, it will check the whole cache entries. +\var{filename} is omitted, it will check all the entries in the cache. \end{funcdesc} Example: From python-checkins at python.org Fri Aug 4 23:14:22 2006 From: python-checkins at python.org (andrew.kuchling) Date: Fri, 4 Aug 2006 23:14:22 +0200 (CEST) Subject: [Python-checkins] r51117 - python/branches/release24-maint/Doc/lib/liblinecache.tex Message-ID: <20060804211422.9EDF01E4003@bag.python.org> Author: andrew.kuchling Date: Fri Aug 4 23:14:22 2006 New Revision: 51117 Modified: python/branches/release24-maint/Doc/lib/liblinecache.tex Log: Fix mangled sentence Modified: python/branches/release24-maint/Doc/lib/liblinecache.tex ============================================================================== --- python/branches/release24-maint/Doc/lib/liblinecache.tex (original) +++ python/branches/release24-maint/Doc/lib/liblinecache.tex Fri Aug 4 23:14:22 2006 @@ -34,7 +34,7 @@ \begin{funcdesc}{checkcache}{\optional{filename}} Check the cache for validity. Use this function if files in the cache may have changed on disk, and you require the updated version. If -\var{filename} is omitted, it will check the whole cache entries. +\var{filename} is omitted, it will check all the entries in the cache. \end{funcdesc} Example: From python-checkins at python.org Sat Aug 5 00:00:36 2006 From: python-checkins at python.org (tim.peters) Date: Sat, 5 Aug 2006 00:00:36 +0200 (CEST) Subject: [Python-checkins] r51118 - python/trunk/Lib/test/test_compiler.py Message-ID: <20060804220036.14F691E400D@bag.python.org> Author: tim.peters Date: Sat Aug 5 00:00:35 2006 New Revision: 51118 Modified: python/trunk/Lib/test/test_compiler.py Log: Whitespace normalization. Modified: python/trunk/Lib/test/test_compiler.py ============================================================================== --- python/trunk/Lib/test/test_compiler.py (original) +++ python/trunk/Lib/test/test_compiler.py Sat Aug 5 00:00:35 2006 @@ -116,7 +116,7 @@ exec c in dct self.assertEquals(dct.get('result'), 3) - + NOLINENO = (compiler.ast.Module, compiler.ast.Stmt, compiler.ast.Discard) ############################################################################### From buildbot at python.org Sat Aug 5 00:49:23 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 04 Aug 2006 22:49:23 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) trunk Message-ID: <20060804224923.1CE6B1E4003@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%2520trunk/builds/875 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sat Aug 5 01:59:22 2006 From: python-checkins at python.org (bob.ippolito) Date: Sat, 5 Aug 2006 01:59:22 +0200 (CEST) Subject: [Python-checkins] r51119 - in python/trunk: Lib/test/test_struct.py Misc/NEWS Modules/_struct.c Message-ID: <20060804235922.CB4C41E4003@bag.python.org> Author: bob.ippolito Date: Sat Aug 5 01:59:21 2006 New Revision: 51119 Modified: python/trunk/Lib/test/test_struct.py python/trunk/Misc/NEWS python/trunk/Modules/_struct.c Log: Fix #1530559, struct.pack raises TypeError where it used to convert. Passing float arguments to struct.pack when integers are expected now triggers a DeprecationWarning. Modified: python/trunk/Lib/test/test_struct.py ============================================================================== --- python/trunk/Lib/test/test_struct.py (original) +++ python/trunk/Lib/test/test_struct.py Sat Aug 5 01:59:21 2006 @@ -15,9 +15,11 @@ except ImportError: PY_STRUCT_RANGE_CHECKING = 0 PY_STRUCT_OVERFLOW_MASKING = 1 + PY_STRUCT_FLOAT_COERCE = 2 else: - PY_STRUCT_RANGE_CHECKING = _struct._PY_STRUCT_RANGE_CHECKING - PY_STRUCT_OVERFLOW_MASKING = _struct._PY_STRUCT_OVERFLOW_MASKING + PY_STRUCT_RANGE_CHECKING = getattr(_struct, '_PY_STRUCT_RANGE_CHECKING', 0) + PY_STRUCT_OVERFLOW_MASKING = getattr(_struct, '_PY_STRUCT_OVERFLOW_MASKING', 0) + PY_STRUCT_FLOAT_COERCE = getattr(_struct, '_PY_STRUCT_FLOAT_COERCE', 0) def string_reverse(s): return "".join(reversed(s)) @@ -46,33 +48,40 @@ raise TestFailed, "%s%s did not raise error" % ( func.__name__, args) +def with_warning_restore(func): + def _with_warning_restore(*args, **kw): + # The `warnings` module doesn't have an advertised way to restore + # its filter list. Cheat. + save_warnings_filters = warnings.filters[:] + # Grrr, we need this function to warn every time. Without removing + # the warningregistry, running test_tarfile then test_struct would fail + # on 64-bit platforms. + globals = func.func_globals + if '__warningregistry__' in globals: + del globals['__warningregistry__'] + warnings.filterwarnings("error", r"""^struct.*""", DeprecationWarning) + warnings.filterwarnings("error", r""".*format requires.*""", + DeprecationWarning) + try: + return func(*args, **kw) + finally: + warnings.filters[:] = save_warnings_filters[:] + return _with_warning_restore + def deprecated_err(func, *args): - # The `warnings` module doesn't have an advertised way to restore - # its filter list. Cheat. - save_warnings_filters = warnings.filters[:] - # Grrr, we need this function to warn every time. Without removing - # the warningregistry, running test_tarfile then test_struct would fail - # on 64-bit platforms. - globals = func.func_globals - if '__warningregistry__' in globals: - del globals['__warningregistry__'] - warnings.filterwarnings("error", r"""^struct.*""", DeprecationWarning) - warnings.filterwarnings("error", r""".*format requires.*""", - DeprecationWarning) try: - try: - func(*args) - except (struct.error, TypeError): - pass - except DeprecationWarning: - if not PY_STRUCT_OVERFLOW_MASKING: - raise TestFailed, "%s%s expected to raise struct.error" % ( - func.__name__, args) - else: - raise TestFailed, "%s%s did not raise error" % ( + func(*args) + except (struct.error, TypeError): + pass + except DeprecationWarning: + if not PY_STRUCT_OVERFLOW_MASKING: + raise TestFailed, "%s%s expected to raise struct.error" % ( func.__name__, args) - finally: - warnings.filters[:] = save_warnings_filters[:] + else: + raise TestFailed, "%s%s did not raise error" % ( + func.__name__, args) +deprecated_err = with_warning_restore(deprecated_err) + simple_err(struct.calcsize, 'Z') @@ -475,6 +484,9 @@ test_705836() +########################################################################### +# SF bug 1229380. No struct.pack exception for some out of range integers + def test_1229380(): import sys for endian in ('', '>', '<'): @@ -491,6 +503,37 @@ if PY_STRUCT_RANGE_CHECKING: test_1229380() +########################################################################### +# SF bug 1530559. struct.pack raises TypeError where it used to convert. + +def check_float_coerce(format, number): + if PY_STRUCT_FLOAT_COERCE == 2: + # Test for pre-2.5 struct module + packed = struct.pack(format, number) + floored = struct.unpack(format, packed)[0] + if floored != int(number): + raise TestFailed("did not correcly coerce float to int") + return + try: + func(*args) + except (struct.error, TypeError): + if PY_STRUCT_FLOAT_COERCE: + raise TestFailed("expected DeprecationWarning for float coerce") + except DeprecationWarning: + if not PY_STRUCT_FLOAT_COERCE: + raise TestFailed("expected to raise struct.error for float coerce") + else: + raise TestFailed("did not raise error for float coerce") + +check_float_coerce = with_warning_restore(deprecated_err) + +def test_1530559(): + for endian in ('', '>', '<'): + for fmt in ('B', 'H', 'I', 'L', 'b', 'h', 'i', 'l'): + check_float_coerce(endian + fmt, 1.0) + check_float_coerce(endian + fmt, 1.5) + +test_1530559() ########################################################################### # Packing and unpacking to/from buffers. Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Aug 5 01:59:21 2006 @@ -40,6 +40,10 @@ Extension Modules ----------------- +- Bug #1530559, struct.pack raises TypeError where it used to convert. + Passing float arguments to struct.pack when integers are expected + now triggers a DeprecationWarning. + Tests ----- Modified: python/trunk/Modules/_struct.c ============================================================================== --- python/trunk/Modules/_struct.c (original) +++ python/trunk/Modules/_struct.c Sat Aug 5 01:59:21 2006 @@ -31,6 +31,17 @@ static PyObject *pyint_zero = NULL; #endif +/* If PY_STRUCT_FLOAT_COERCE is defined, the struct module will allow float + arguments for integer formats with a warning for backwards + compatibility. */ + +#define PY_STRUCT_FLOAT_COERCE 1 + +#ifdef PY_STRUCT_FLOAT_COERCE +#define FLOAT_COERCE "integer argument expected, got float" +#endif + + /* The translation function for each format character is table driven */ typedef struct _formatdef { char format; @@ -135,6 +146,21 @@ { long x = PyInt_AsLong(v); if (x == -1 && PyErr_Occurred()) { +#ifdef PY_STRUCT_FLOAT_COERCE + if (PyFloat_Check(v)) { + PyObject *o; + int res; + PyErr_Clear(); + if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) + return -1; + o = PyNumber_Int(v); + if (o == NULL) + return -1; + res = get_long(o, p); + Py_DECREF(o); + return res; + } +#endif if (PyErr_ExceptionMatches(PyExc_TypeError)) PyErr_SetString(StructError, "required argument is not an integer"); @@ -225,6 +251,21 @@ PyObject *wrapped; long x; PyErr_Clear(); +#ifdef PY_STRUCT_FLOAT_COERCE + if (PyFloat_Check(v)) { + PyObject *o; + int res; + PyErr_Clear(); + if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) + return -1; + o = PyNumber_Int(v); + if (o == NULL) + return -1; + res = get_wrapped_long(o, p); + Py_DECREF(o); + return res; + } +#endif if (PyErr_WarnEx(PyExc_DeprecationWarning, INT_OVERFLOW, 2) < 0) return -1; wrapped = PyNumber_And(v, pylong_ulong_mask); @@ -249,6 +290,21 @@ if (x == -1 && PyErr_Occurred()) { PyObject *wrapped; PyErr_Clear(); +#ifdef PY_STRUCT_FLOAT_COERCE + if (PyFloat_Check(v)) { + PyObject *o; + int res; + PyErr_Clear(); + if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) + return -1; + o = PyNumber_Int(v); + if (o == NULL) + return -1; + res = get_wrapped_ulong(o, p); + Py_DECREF(o); + return res; + } +#endif wrapped = PyNumber_And(v, pylong_ulong_mask); if (wrapped == NULL) return -1; @@ -1815,4 +1871,8 @@ #ifdef PY_STRUCT_OVERFLOW_MASKING PyModule_AddIntConstant(m, "_PY_STRUCT_OVERFLOW_MASKING", 1); #endif +#ifdef PY_STRUCT_FLOAT_COERCE + PyModule_AddIntConstant(m, "_PY_STRUCT_FLOAT_COERCE", 1); +#endif + } From python-checkins at python.org Sat Aug 5 02:44:54 2006 From: python-checkins at python.org (mateusz.rukowicz) Date: Sat, 5 Aug 2006 02:44:54 +0200 (CEST) Subject: [Python-checkins] r51120 - sandbox/trunk/decimal-c/_decimal.c Message-ID: <20060805004454.035711E4003@bag.python.org> Author: mateusz.rukowicz Date: Sat Aug 5 02:44:53 2006 New Revision: 51120 Modified: sandbox/trunk/decimal-c/_decimal.c Log: Added log10 and comparetotal functions, there are still some things to do. Modified: sandbox/trunk/decimal-c/_decimal.c ============================================================================== --- sandbox/trunk/decimal-c/_decimal.c (original) +++ sandbox/trunk/decimal-c/_decimal.c Sat Aug 5 02:44:53 2006 @@ -4785,7 +4785,244 @@ DECIMAL_UNARY_FUNC(ln); +static PyObject * +_do_decimal_log10(decimalobject *self, contextobject *ctx) { + decimalobject *ret; + long prec; + contextobject *ctx2; + PyObject *flags; + + if (!ctx) + ctx = getcontext(); + if (!ctx) + return NULL; + + if (ISSPECIAL(self)) { + decimalobject *nan; + if (_check_nans(self, NULL, ctx, &nan) != 0) + return nan; + + if (ISINF(self)) { + if (self->sign &1) + return handle_InvalidOperation(self->ob_type, ctx, "log10(-inf)", NULL); + else + return _decimal_get_copy(self); + } + } + + + if (self->sign &1 && decimal_nonzero(self)) + return handle_InvalidOperation(self->ob_type, ctx, "log10(-x)", NULL); + + /* first, check if self is power of 10*/ + + if (_limb_get_digit(self->limbs, self->ob_size, 0) == 1) { + /* SLOW */ + int i; + for (i=1;iob_size;i++) { + if (_limb_get_digit(self->limbs, self->ob_size, i)) + break; + } + /* self is power of 10 */ + if (i == self->ob_size) { + decimalobject *fixed; + /* TODO what about big exp? */ + ret = decimal_from_long(self->ob_type, exp_to_i(ADJUSTED(self))); + if (!ret) + return NULL; + + fixed = _decimal_fix(ret, ctx); + Py_DECREF(ret); + return fixed; + } + } + + /* we use context precision, or self->ob_size + 6 (biggest size of exponent) + * + 3 as precision */ + prec = self->ob_size + 6 > ctx->prec ? self->ob_size+9: ctx->prec+3; + + ctx2 = context_shallow_copy(ctx); + if (!ctx2) + return NULL; + + ctx2->prec = prec; + ctx2->Emax = exp_from_i(MAX_MATH); + ctx2->Emin = exp_from_i(-MAX_MATH); + + { + decimalobject *a; /* ln(self) */ + decimalobject *ten; /* Decimal(10) */ + decimalobject *ln10; /* ln(10) */ + + a = _do_decimal__ln(self, ctx2); + if (!a) { + Py_DECREF(ctx2); + return NULL; + } + + ten = _NEW_decimalobj(2, 0, exp_from_i(0)); + if (!ten) { + Py_DECREF(a); + Py_DECREF(ctx2); + return NULL; + } + ten->limbs[0] = 10; + flags = context_ignore_all_flags(ctx2); + if (!flags) { + Py_DECREF(a); + Py_DECREF(ctx2); + Py_DECREF(ten); + return NULL; + } + ctx2->prec = ctx->prec + 3; + + ln10 = _do_decimal__ln(ten, ctx2); + Py_DECREF(ten); + + if (!ln10) { + Py_DECREF(a); + Py_DECREF(ctx2); + Py_DECREF(flags); + return NULL; + } + + { + PyObject *tmp = context_regard_flags(ctx2, flags); + Py_DECREF(flags); + if (!tmp) { + Py_DECREF(a); + Py_DECREF(ctx2); + return NULL; + } + Py_DECREF(tmp); + } + + /* log10 = ln(self)/ln(10) */ + ret = _do_decimal__divide(a, ln10, 0, ctx); + Py_DECREF(a); + Py_DECREF(ln10); + + return ret; + + } +} +DECIMAL_UNARY_FUNC(log10); + +static int +_do_real_decimal_comparetotal(decimalobject *self, decimalobject *other, contextobject *ctx) { + exp_t adj_self; + exp_t adj_other; + if (!ctx) + ctx = getcontext(); + if (!ctx) + return 0; + + if (ISSPECIAL(self) || ISSPECIAL(other)) { + + if (GETNAN(self) || GETNAN(other)) { + if (!GETNAN(other)) + return 1; + if (!GETNAN(self)) + return -1; + if ((self->sign &1) && !(other->sign&1)) + return -1; + if ((other->sign&1) && !(self->sign&1)) + return 1; + if (GETNAN(other) == GETNAN(self)) { + return 0; + } + + + if (GETNAN(other) == 2) + return (1 ^ self->sign&1) * 2 -1; + if (GETNAN(self) == 2) + return (0 ^ self->sign&1) * 2 -1; + } + + if (ISINF(self) || ISINF(other)) { + if (ISINF(self) == ISINF(other)) + return 0; + else + return ISINF(self) > ISINF(other) ? 1 : -1; + } + } + + if (!decimal_nonzero(self) && !decimal_nonzero(other)) { + if ((self->sign&1) && !(other->sign&1)) + return -1; + if ((other->sign&1) && !(self->sign&1)) + return 1; + + if (exp_eq(self->exp, other->exp)) + return 0; + + return (((exp_l(other->exp, self->exp) ? 1 : 0) ^ (self->sign&1)) * 2) -1; + } + + /* pretty obvious */ + if ((other->sign &1) && !(self->sign&1)) + return 1; + if ((self->sign &1) && !(other->sign&1)) + return -1; + + adj_self = ADJUSTED(self); + adj_other = ADJUSTED(other); + + if (exp_eq(adj_self, adj_other)) { + long digits = self->ob_size > other->ob_size ? self->ob_size : other->ob_size; + long i; + long ret; + /* SLOW */ + + for (i=0;ilimbs, self->ob_size, i); + d_o = _limb_get_digit(other->limbs, other->ob_size, i); + if (d_s != d_o) { + ret = d_s > d_o; + if (ret ^ (self->sign&1)) + return 1; + else + return -1; + } + } + + if (exp_eq(self->exp, other->exp)) { + return 0; + } + else if (exp_g(self->exp, other->exp)) + { + return (1 ^ self->sign&1) * 2 -1; + } + else return (0 ^ self->sign&1) * 2 -1; + } + + if (exp_g(adj_self, adj_other)) + return (1 ^ self->sign &1) * 2 -1; + else + return (0 ^ self->sign &1) * 2 -1; + +} + +static decimalobject * +_do_decimal_comparetotal(decimalobject *self, decimalobject *other, contextobject *ctx) +{ + int res; + + res = _do_real_decimal_comparetotal(self, other, ctx); + return decimal_from_long(self->ob_type, res); +} + +DECIMAL_BINARY_FUNC(comparetotal); + static PyMethodDef decimal_methods[] = { + {"comparetotal", (PyCFunction)decimal_comparetotal, + METH_VARARGS | METH_KEYWORDS, + PyDoc_STR("TODO")}, + {"log10", (PyCFunction)decimal_log10, + METH_VARARGS | METH_KEYWORDS, + PyDoc_STR("TODO")}, {"ln", (PyCFunction)decimal_ln, METH_VARARGS | METH_KEYWORDS, PyDoc_STR("TODO")}, @@ -7168,6 +7405,8 @@ CONTEXT_UNARY_FUNC(to_eng_string, to_eng_string) CONTEXT_UNARY_FUNC(exp, exp) CONTEXT_UNARY_FUNC(ln, ln); +CONTEXT_UNARY_FUNC(log10, log10); +CONTEXT_BINARY_FUNC(comparetotal, comparetotal); /* Unfortunately, the following methods are non-standard and can't @@ -7694,6 +7933,10 @@ METH_O}, {"ln", (PyCFunction)context_ln, METH_O}, + {"log10", (PyCFunction)context_log10, + METH_O}, + {"comparetotal", (PyCFunction)context_comparetotal, + METH_VARARGS}, {"subtract", (PyCFunction)context_subtract, METH_VARARGS}, {"to_eng_string", (PyCFunction)context_to_eng_string, From buildbot at python.org Sat Aug 5 02:51:25 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 05 Aug 2006 00:51:25 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060805005125.F26CC1E4003@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1036 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: bob.ippolito Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sat Aug 5 04:02:59 2006 From: python-checkins at python.org (mateusz.rukowicz) Date: Sat, 5 Aug 2006 04:02:59 +0200 (CEST) Subject: [Python-checkins] r51121 - sandbox/trunk/decimal-c/_decimal.c Message-ID: <20060805020259.C49081E4003@bag.python.org> Author: mateusz.rukowicz Date: Sat Aug 5 04:02:58 2006 New Revision: 51121 Modified: sandbox/trunk/decimal-c/_decimal.c Log: Some minor fixes, trim function added. Modified: sandbox/trunk/decimal-c/_decimal.c ============================================================================== --- sandbox/trunk/decimal-c/_decimal.c (original) +++ sandbox/trunk/decimal-c/_decimal.c Sat Aug 5 04:02:58 2006 @@ -2535,6 +2535,7 @@ } /* strip trailing 0s from dup */ + /* SLOW */ while(_limb_get_digit(dup->limbs, dup->ob_size, dup->ob_size -1) == 0){ _limb_cut_one_digit(dup->limbs,dup->ob_size); dup->ob_size --; @@ -2544,6 +2545,49 @@ } DECIMAL_UNARY_FUNC(normalize) +/* strip trailing 0s that are right to the dot */ +static decimalobject * +_do_decimal_trim(decimalobject *self, contextobject *ctx) { + decimalobject *new; + if (ISSPECIAL(self)) { + Py_INCREF(self); + return self; + } + + if (!decimal_nonzero(self)) { + new = _NEW_decimalobj(1, self->sign, exp_from_i(0)); + if (!new) + return NULL; + new->limbs[0] = 0; + return new; + } + new = _decimal_get_copy(self); + if (!new) + return NULL; + + + /* SLOW */ + if (exp_le_i(new->exp, 0)) + while (_limb_get_digit(new->limbs, new->ob_size, new->ob_size - 1) == 0 && + exp_l_i(new->exp, 0)) { + _limb_cut_one_digit(new->limbs, new->ob_size); + new->ob_size --; + exp_inc(&(new->exp)); + + } + else + while (_limb_get_digit(new->limbs, new->ob_size, new->ob_size - 1) == 0) { + _limb_cut_one_digit(new->limbs, new->ob_size); + new->ob_size --; + exp_inc(&(new->exp)); + } + + return new; + + +} + +DECIMAL_UNARY_FUNC(trim) /* Quantize self so that its exponent is the same as the exponent of another. */ static decimalobject * @@ -4247,6 +4291,16 @@ return (PyObject*) _do_decimal__divide(self, other, divmod, ctx); } +static int * +check_ctx(decimalobject *self, contextobject *ctx) { + + if (ctx->prec > MAX_MATH || + exp_g_i(ctx->Emax, MAX_MATH) || + exp_l_i(ctx->Emin,-1 * MAX_MATH)) + return 0; + + return 1; +} /* The idea is as follows, we need to calculate e^x (self = x), * we use series e^x = x^0/0! + x^1/1! + x^2/2! ... @@ -4537,13 +4591,13 @@ if (!ctx) return NULL; - if (ctx->prec > MAX_MATH || - exp_g_i(ctx->Emax, MAX_MATH) || - exp_l_i(ctx->Emin,-1 * MAX_MATH)) - handle_InvalidContext(self->ob_type, ctx, NULL); + if (!check_ctx(self, ctx)) + return handle_InvalidContext(self->ob_type, ctx, NULL); return _do_decimal_exponent(self, ctx); } +DECIMAL_UNARY_FUNC(exp); + int ln_lookup[] = {9016, 8652, 8316, 8008, 7724, 7456, 7208, 6972, 6748, 6540, 6340, 6148, 5968, 5792, 5628, 5464, 5312, 5164, 5020, 4884, 4748, 4620, 4496, 4376, 4256, 4144, 4032, @@ -4780,6 +4834,8 @@ static PyObject * _do_decimal_ln(decimalobject *self, contextobject *ctx) { + if (!check_ctx(self, ctx)) + return handle_InvalidContext(self->ob_type, ctx, NULL); return _do_decimal__ln(self, ctx); } @@ -4797,6 +4853,8 @@ if (!ctx) return NULL; + if (!check_ctx(self, ctx)) + return handle_InvalidContext(self->ob_type, ctx, NULL); if (ISSPECIAL(self)) { decimalobject *nan; if (_check_nans(self, NULL, ctx, &nan) != 0) @@ -4896,6 +4954,7 @@ } Py_DECREF(tmp); } + Py_DECREF(ctx2); /* log10 = ln(self)/ln(10) */ ret = _do_decimal__divide(a, ln10, 0, ctx); @@ -5029,7 +5088,7 @@ {"_ln", (PyCFunction)decimal__ln, METH_VARARGS | METH_KEYWORDS, PyDoc_STR("TODO")}, - {"exp", (PyCFunction)decimal_exponent, + {"exp", (PyCFunction)decimal_exp, METH_VARARGS | METH_KEYWORDS, PyDoc_STR("TODO")}, {"_exponent", (PyCFunction)decimal_exponent, @@ -5071,6 +5130,9 @@ METH_VARARGS | METH_KEYWORDS, PyDoc_STR("Normalize- strip trailing 0s, change anything equal" "to 0 to 0e0")}, + {"trim", (PyCFunction)decimal_trim, + METH_VARARGS | METH_KEYWORDS, + PyDoc_STR("TODO")}, {"quantize", (PyCFunction)decimal_quantize, METH_VARARGS | METH_KEYWORDS, PyDoc_STR("Quantize self so its exponent is the same as that of exp.\n\n" @@ -5809,6 +5871,8 @@ /* non-integer case */ /* we calculate it using exp(ln(self) * other) */ if (use_exp) { + if (!check_ctx(self, ctx)) + return handle_InvalidContext(self->ob_type, ctx, NULL); decimalobject *tmp; contextobject *ctx2; ctx2 = context_shallow_copy(ctx); @@ -7400,6 +7464,7 @@ CONTEXT_BINARY_FUNC(min, min) CONTEXT_BINARY_FUNC(max, max) CONTEXT_UNARY_FUNC(normalize, normalize) +CONTEXT_UNARY_FUNC(trim, trim) CONTEXT_BINARY_FUNC(remainder_near, remainder_near) CONTEXT_UNARY_FUNC(sqrt, sqrt) CONTEXT_UNARY_FUNC(to_eng_string, to_eng_string) @@ -7915,6 +7980,8 @@ METH_VARARGS}, {"normalize", (PyCFunction)context_normalize, METH_O}, + {"trim", (PyCFunction)context_trim, + METH_O}, {"plus", (PyCFunction)context_plus, METH_O}, {"power", (PyCFunction)context_power, From python-checkins at python.org Sat Aug 5 05:08:03 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 5 Aug 2006 05:08:03 +0200 (CEST) Subject: [Python-checkins] r51122 - peps/trunk/pep-0356.txt Message-ID: <20060805030803.0B7A91E4003@bag.python.org> Author: neal.norwitz Date: Sat Aug 5 05:07:51 2006 New Revision: 51122 Modified: peps/trunk/pep-0356.txt Log: Remove an issue that is lower priority Modified: peps/trunk/pep-0356.txt ============================================================================== --- peps/trunk/pep-0356.txt (original) +++ peps/trunk/pep-0356.txt Sat Aug 5 05:07:51 2006 @@ -159,7 +159,6 @@ http://python.org/sf/1526585 - SystemError concat long strings http://python.org/sf/1523610 - PyArg_ParseTupleAndKeywords potential core dump - http://python.org/sf/1517042 - Fix crashers/gc_inspection.py http://python.org/sf/1475523 - gettext.py bug (owner: Martin v. Loewis) http://python.org/sf/1467929 - %-formatting and dicts From python-checkins at python.org Sat Aug 5 08:10:56 2006 From: python-checkins at python.org (georg.brandl) Date: Sat, 5 Aug 2006 08:10:56 +0200 (CEST) Subject: [Python-checkins] r51123 - in python/trunk: Doc/lib/libunittest.tex Misc/NEWS Message-ID: <20060805061056.548C31E4003@bag.python.org> Author: georg.brandl Date: Sat Aug 5 08:10:54 2006 New Revision: 51123 Modified: python/trunk/Doc/lib/libunittest.tex python/trunk/Misc/NEWS Log: Patch #1534922: correct and enhance unittest docs. Modified: python/trunk/Doc/lib/libunittest.tex ============================================================================== --- python/trunk/Doc/lib/libunittest.tex (original) +++ python/trunk/Doc/lib/libunittest.tex Sat Aug 5 08:10:54 2006 @@ -10,19 +10,19 @@ \versionadded{2.1} -The Python unit testing framework, often referred to as ``PyUnit,'' is +The Python unit testing framework, sometimes referred to as ``PyUnit,'' is a Python language version of JUnit, by Kent Beck and Erich Gamma. JUnit is, in turn, a Java version of Kent's Smalltalk testing framework. Each is the de facto standard unit testing framework for its respective language. -PyUnit supports test automation, sharing of setup and shutdown code -for tests, aggregation of tests into collections, and independence of +\module{unittest} supports test automation, sharing of setup and shutdown +code for tests, aggregation of tests into collections, and independence of the tests from the reporting framework. The \module{unittest} module provides classes that make it easy to support these qualities for a set of tests. -To achieve this, PyUnit supports some important concepts: +To achieve this, \module{unittest} supports some important concepts: \begin{definitions} \term{test fixture} @@ -33,10 +33,9 @@ \term{test case} A \dfn{test case} is the smallest unit of testing. It checks for a -specific response to a particular set of inputs. PyUnit provides a -base class, \class{TestCase}, which may be used to create new test -cases. You may provide your own implementation that does not subclass -from \class{TestCase}, of course. +specific response to a particular set of inputs. \module{unittest} +provides a base class, \class{TestCase}, which may be used to create +new test cases. \term{test suite} A \dfn{test suite} is a collection of test cases, test suites, or @@ -54,8 +53,8 @@ The test case and test fixture concepts are supported through the \class{TestCase} and \class{FunctionTestCase} classes; the former should be used when creating new tests, and the latter can be used when -integrating existing test code with a PyUnit-driven framework. When -building test fixtures using \class{TestCase}, the \method{setUp()} +integrating existing test code with a \module{unittest}-driven framework. +When building test fixtures using \class{TestCase}, the \method{setUp()} and \method{tearDown()} methods can be overridden to provide initialization and cleanup for the fixture. With \class{FunctionTestCase}, existing functions can be passed to the @@ -74,19 +73,17 @@ A test runner is an object that provides a single method, \method{run()}, which accepts a \class{TestCase} or \class{TestSuite} object as a parameter, and returns a result object. The class -\class{TestResult} is provided for use as the result object. PyUnit -provide the \class{TextTestRunner} as an example test runner which -reports test results on the standard error stream by default. -Alternate runners can be implemented for other environments (such as -graphical environments) without any need to derive from a specific -class. +\class{TestResult} is provided for use as the result object. +\module{unittest} provides the \class{TextTestRunner} as an example +test runner which reports test results on the standard error stream by +default. Alternate runners can be implemented for other environments +(such as graphical environments) without any need to derive from a +specific class. \begin{seealso} \seemodule{doctest}{Another test-support module with a very different flavor.} - \seetitle[http://pyunit.sourceforge.net/]{PyUnit Web Site}{The - source for further information on PyUnit.} \seetitle[http://www.XProgramming.com/testfram.htm]{Simple Smalltalk Testing: With Patterns}{Kent Beck's original paper on testing frameworks using the pattern shared by @@ -166,7 +163,7 @@ with: \begin{verbatim} -suite = unittest.makeSuite(TestSequenceFunctions) +suite = unittest.TestLoader().loadTestsFromTestCase(TestSequenceFunctions) unittest.TextTestRunner(verbosity=2).run(suite) \end{verbatim} @@ -194,8 +191,8 @@ The basic building blocks of unit testing are \dfn{test cases} --- single scenarios that must be set up and checked for correctness. In -PyUnit, test cases are represented by instances of the -\class{TestCase} class in the \refmodule{unittest} module. To make +\module{unittest}, test cases are represented by instances of +\module{unittest}'s \class{TestCase} class. To make your own test cases you must write subclasses of \class{TestCase}, or use \class{FunctionTestCase}. @@ -207,7 +204,7 @@ self contained, such that it can be run either in isolation or in arbitrary combination with any number of other test cases. -The simplest test case subclass will simply override the +The simplest \class{TestCase} subclass will simply override the \method{runTest()} method in order to perform specific testing code: \begin{verbatim} @@ -221,12 +218,13 @@ Note that in order to test something, we use the one of the \method{assert*()} or \method{fail*()} methods provided by the -\class{TestCase} base class. If the test fails when the test case -runs, an exception will be raised, and the testing framework will -identify the test case as a \dfn{failure}. Other exceptions that do -not arise from checks made through the \method{assert*()} and -\method{fail*()} methods are identified by the testing framework as -\dfn{errors}. +\class{TestCase} base class. If the test fails, an exception will be +raised, and \module{unittest} will identify the test case as a +\dfn{failure}. Any other exceptions will be treated as \dfn{errors}. +This helps you identify where the problem is: \dfn{failures} are caused by +incorrect results - a 5 where you expected a 6. \dfn{Errors} are caused by +incorrect code - e.g., a \exception{TypeError} caused by an incorrect +function call. The way to run a test case will be described later. For now, note that to construct an instance of such a test case, we call its @@ -237,7 +235,7 @@ \end{verbatim} Now, such test cases can be numerous, and their set-up can be -repetitive. In the above case, constructing a ``Widget'' in each of +repetitive. In the above case, constructing a \class{Widget} in each of 100 Widget test case subclasses would mean unsightly duplication. Luckily, we can factor out such set-up code by implementing a method @@ -283,7 +281,7 @@ \end{verbatim} If \method{setUp()} succeeded, the \method{tearDown()} method will be -run regardless of whether or not \method{runTest()} succeeded. +run whether \method{runTest()} succeeded or not. Such a working environment for the testing code is called a \dfn{fixture}. @@ -292,8 +290,8 @@ we would end up subclassing \class{SimpleWidgetTestCase} into many small one-method classes such as \class{DefaultWidgetSizeTestCase}. This is time-consuming and -discouraging, so in the same vein as JUnit, PyUnit provides a simpler -mechanism: +discouraging, so in the same vein as JUnit, \module{unittest} provides +a simpler mechanism: \begin{verbatim} import unittest @@ -329,9 +327,9 @@ \end{verbatim} Test case instances are grouped together according to the features -they test. PyUnit provides a mechanism for this: the \class{test -suite}, represented by the class \class{TestSuite} in the -\refmodule{unittest} module: +they test. \module{unittest} provides a mechanism for this: the +\dfn{test suite}, represented by \module{unittest}'s \class{TestSuite} +class: \begin{verbatim} widgetTestSuite = unittest.TestSuite() @@ -354,28 +352,30 @@ or even: \begin{verbatim} -class WidgetTestSuite(unittest.TestSuite): - def __init__(self): - unittest.TestSuite.__init__(self,map(WidgetTestCase, - ("testDefaultSize", - "testResize"))) -\end{verbatim} +def suite(): + tests = ["testDefaultSize", "testResize"] -(The latter is admittedly not for the faint-hearted!) + return unittest.TestSuite(map(WidgetTestCase, tests)) +\end{verbatim} Since it is a common pattern to create a \class{TestCase} subclass -with many similarly named test functions, there is a convenience -function called \function{makeSuite()} that constructs a test suite -that comprises all of the test cases in a test case class: +with many similarly named test functions, \module{unittest} provides a +\class{TestLoader} class that can be used to automate the process of +creating a test suite and populating it with individual tests. +For example, \begin{verbatim} -suite = unittest.makeSuite(WidgetTestCase) +suite = unittest.TestLoader().loadTestsFromTestCase(WidgetTestCase) \end{verbatim} -Note that when using the \function{makeSuite()} function, the order in -which the various test cases will be run by the test suite is the -order determined by sorting the test function names using the -\function{cmp()} built-in function. +will create a test suite that will run +\code{WidgetTestCase.testDefaultSize()} and \code{WidgetTestCase.testResize}. +\class{TestLoader} uses the \code{'test'} method name prefix to identify +test methods automatically. + +Note that the order in which the various test cases will be run is +determined by sorting the test function names with the built-in +\function{cmp()} function. Often it is desirable to group suites of test cases together, so as to run tests for the whole system at once. This is easy, since @@ -385,13 +385,13 @@ \begin{verbatim} suite1 = module1.TheTestSuite() suite2 = module2.TheTestSuite() -alltests = unittest.TestSuite((suite1, suite2)) +alltests = unittest.TestSuite([suite1, suite2]) \end{verbatim} You can place the definitions of test cases and test suites in the same modules as the code they are to test (such as \file{widget.py}), but there are several advantages to placing the test code in a -separate module, such as \file{widgettests.py}: +separate module, such as \file{test_widget.py}: \begin{itemize} \item The test module can be run standalone from the command line. @@ -412,13 +412,12 @@ \label{legacy-unit-tests}} Some users will find that they have existing test code that they would -like to run from PyUnit, without converting every old test function to -a \class{TestCase} subclass. +like to run from \module{unittest}, without converting every old test +function to a \class{TestCase} subclass. -For this reason, PyUnit provides a \class{FunctionTestCase} class. -This subclass of \class{TestCase} can be used to wrap an existing test -function. Set-up and tear-down functions can also optionally be -wrapped. +For this reason, \module{unittest} provides a \class{FunctionTestCase} +class. This subclass of \class{TestCase} can be used to wrap an existing +test function. Set-up and tear-down functions can also be provided. Given the following test function: @@ -436,7 +435,8 @@ \end{verbatim} If there are additional set-up and tear-down methods that should be -called as part of the test case's operation, they can also be provided: +called as part of the test case's operation, they can also be provided +like so: \begin{verbatim} testcase = unittest.FunctionTestCase(testSomething, @@ -444,9 +444,19 @@ tearDown=deleteSomethingDB) \end{verbatim} -\note{PyUnit supports the use of \exception{AssertionError} -as an indicator of test failure, but does not recommend it. Future -versions may treat \exception{AssertionError} differently.} +To make migrating existing test suites easier, \module{unittest} +supports tests raising \exception{AssertionError} to indicate test failure. +However, it is recommended that you use the explicit +\method{TestCase.fail*()} and \method{TestCase.assert*()} methods instead, +as future versions of \module{unittest} may treat \exception{AssertionError} +differently. + +\note{Even though \class{FunctionTestCase} can be used to quickly convert +an existing test base over to a \module{unittest}-based system, this +approach is not recommended. Taking the time to set up proper +\class{TestCase} subclasses will make future test refactorings infinitely +easier.} + \subsection{Classes and functions @@ -454,11 +464,12 @@ \begin{classdesc}{TestCase}{} Instances of the \class{TestCase} class represent the smallest - testable units in a set of tests. This class is intended to be used - as a base class, with specific tests being implemented by concrete - subclasses. This class implements the interface needed by the test - runner to allow it to drive the test, and methods that the test code - can use to check for and report various kinds of failures. + testable units in the \module{unittest} universe. This class is + intended to be used as a base class, with specific tests being + implemented by concrete subclasses. This class implements the + interface needed by the test runner to allow it to drive the + test, and methods that the test code can use to check for and + report various kinds of failure. \end{classdesc} \begin{classdesc}{FunctionTestCase}{testFunc\optional{, @@ -474,33 +485,33 @@ \begin{classdesc}{TestSuite}{\optional{tests}} This class represents an aggregation of individual tests cases and test suites. The class presents the interface needed by the test - runner to allow it to be run as any other test case, but all the - contained tests and test suites are executed. Additional methods - are provided to add test cases and suites to the aggregation. If - \var{tests} is given, it must be a sequence of individual tests that - will be added to the suite. + runner to allow it to be run as any other test case. Running a + \class{TestSuite} instance is the same as iterating over the suite, + running each test individually. + + If \var{tests} is given, it must be an iterable of individual test cases or + other test suites that will be used to build the suite initially. + Additional methods are provided to add test cases and suites to the + collection later on. \end{classdesc} \begin{classdesc}{TestLoader}{} This class is responsible for loading tests according to various criteria and returning them wrapped in a \class{TestSuite}. It can load all tests within a given module or \class{TestCase} - class. When loading from a module, it considers all - \class{TestCase}-derived classes. For each such class, it creates - an instance for each method with a name beginning with the string - \samp{test}. + subclass. \end{classdesc} \begin{datadesc}{defaultTestLoader} - Instance of the \class{TestLoader} class which can be shared. If no + Instance of the \class{TestLoader} class intended to be shared. If no customization of the \class{TestLoader} is needed, this instance can - always be used instead of creating new instances. + be used instead of repeatedly creating new instances. \end{datadesc} \begin{classdesc}{TextTestRunner}{\optional{stream\optional{, descriptions\optional{, verbosity}}}} A basic test runner implementation which prints results on standard - output. It has a few configurable parameters, but is essentially + error. It has a few configurable parameters, but is essentially very simple. Graphical applications which run test suites should provide alternate implementations. \end{classdesc} @@ -510,7 +521,8 @@ testRunner\optional{, testRunner}}}}}} A command-line program that runs a set of tests; this is primarily for making test modules conveniently executable. The simplest use - for this function is: + for this function is to include the following line at the end of a + test script: \begin{verbatim} if __name__ == '__main__': @@ -518,10 +530,11 @@ \end{verbatim} \end{funcdesc} -In some cases, the existing tests may have be written using the +In some cases, the existing tests may have been written using the \refmodule{doctest} module. If so, that module provides a \class{DocTestSuite} class that can automatically build -\class{unittest.TestSuite} instances from the existing test code. +\class{unittest.TestSuite} instances from the existing +\module{doctest}-based tests. \versionadded{2.3} @@ -538,7 +551,7 @@ check conditions and report failures, and some inquiry methods allowing information about the test itself to be gathered. -Methods in the first group are: +Methods in the first group (running the test) are: \begin{methoddesc}[TestCase]{setUp}{} Method called to prepare the test fixture. This is called @@ -562,8 +575,10 @@ Run the test, collecting the result into the test result object passed as \var{result}. If \var{result} is omitted or \constant{None}, a temporary result object is created and used, but is not made - available to the caller. This is equivalent to simply calling the - \class{TestCase} instance. + available to the caller. + + The same effect may be had by simply calling the \class{TestCase} + instance. \end{methoddesc} \begin{methoddesc}[TestCase]{debug}{} @@ -664,10 +679,8 @@ information on the test: \begin{methoddesc}[TestCase]{countTestCases}{} - Return the number of tests represented by the this test object. For - \class{TestCase} instances, this will always be \code{1}, but this - method is also implemented by the \class{TestSuite} class, which can - return larger values. + Return the number of tests represented by this test object. For + \class{TestCase} instances, this will always be \code{1}. \end{methoddesc} \begin{methoddesc}[TestCase]{defaultTestResult}{} @@ -678,7 +691,7 @@ \begin{methoddesc}[TestCase]{id}{} Return a string identifying the specific test case. This is usually the full name of the test method, including the module and class - names. + name. \end{methoddesc} \begin{methoddesc}[TestCase]{shortDescription}{} @@ -694,21 +707,23 @@ \class{TestSuite} objects behave much like \class{TestCase} objects, except they do not actually implement a test. Instead, they are used -to aggregate tests into groups that should be run together. Some -additional methods are available to add tests to \class{TestSuite} +to aggregate tests into groups of tests that should be run together. +Some additional methods are available to add tests to \class{TestSuite} instances: \begin{methoddesc}[TestSuite]{addTest}{test} - Add a \class{TestCase} or \class{TestSuite} to the set of tests that - make up the suite. + Add a \class{TestCase} or \class{TestSuite} to the suite. \end{methoddesc} \begin{methoddesc}[TestSuite]{addTests}{tests} - Add all the tests from a sequence of \class{TestCase} and + Add all the tests from an iterable of \class{TestCase} and \class{TestSuite} instances to this test suite. + + This is equivalent to iterating over \var{tests}, calling + \method{addTest()} for each element. \end{methoddesc} -The \method{run()} method is also slightly different: +\class{TestSuite} shares the following methods with \class{TestCase}: \begin{methoddesc}[TestSuite]{run}{result} Run the tests associated with this suite, collecting the result into @@ -717,6 +732,17 @@ result object to be passed in. \end{methoddesc} +\begin{methoddesc}[TestSuite]{debug}{} + Run the tests associated with this suite without collecting the result. + This allows exceptions raised by the test to be propagated to the caller + and can be used to support running tests under a debugger. +\end{methoddesc} + +\begin{methoddesc}[TestSuite]{countTestCases}{} + Return the number of tests represented by this test object, including + all individual tests and sub-suites. +\end{methoddesc} + In the typical usage of a \class{TestSuite} object, the \method{run()} method is invoked by a \class{TestRunner} rather than by the end-user test harness. @@ -727,7 +753,7 @@ A \class{TestResult} object stores the results of a set of tests. The \class{TestCase} and \class{TestSuite} classes ensure that results are -properly stored; test authors do not need to worry about recording the +properly recorded; test authors do not need to worry about recording the outcome of tests. Testing frameworks built on top of \refmodule{unittest} may want @@ -745,28 +771,41 @@ be of interest when inspecting the results of running a set of tests: \begin{memberdesc}[TestResult]{errors} - A list containing pairs of \class{TestCase} instances and the - formatted tracebacks for tests which raised an exception but did not - signal a test failure. + A list containing 2-tuples of \class{TestCase} instances and + formatted tracebacks. Each tuple represents a test which raised an + unexpected exception. \versionchanged[Contains formatted tracebacks instead of \function{sys.exc_info()} results]{2.2} \end{memberdesc} \begin{memberdesc}[TestResult]{failures} - A list containing pairs of \class{TestCase} instances and the - formatted tracebacks for tests which signalled a failure in the code - under test. + A list containing 2-tuples of \class{TestCase} instances and + formatted tracebacks. Each tuple represents a test where a failure + was explicitly signalled using the \method{TestCase.fail*()} or + \method{TestCase.assert*()} methods. \versionchanged[Contains formatted tracebacks instead of \function{sys.exc_info()} results]{2.2} \end{memberdesc} \begin{memberdesc}[TestResult]{testsRun} - The number of tests which have been started. + The total number of tests run so far. \end{memberdesc} \begin{methoddesc}[TestResult]{wasSuccessful}{} - Returns true if all tests run so far have passed, otherwise returns - false. + Returns \constant{True} if all tests run so far have passed, + otherwise returns \constant{False}. +\end{methoddesc} + +\begin{methoddesc}[TestResult]{stop}{} + This method can be called to signal that the set of tests being run + should be aborted by setting the \class{TestResult}'s \code{shouldStop} + attribute to \constant{True}. \class{TestRunner} objects should respect + this flag and return without running any additional tests. + + For example, this feature is used by the \class{TextTestRunner} class + to stop the test framework when the user signals an interrupt from + the keyboard. Interactive tools which provide \class{TestRunner} + implementations can use this in a similar manner. \end{methoddesc} @@ -786,10 +825,9 @@ \end{methoddesc} \begin{methoddesc}[TestResult]{addError}{test, err} - Called when the test case \var{test} raises an exception without - signalling a test failure. \var{err} is a tuple of the form - returned by \function{sys.exc_info()}: \code{(\var{type}, - \var{value}, \var{traceback})}. + Called when the test case \var{test} raises an unexpected exception + \var{err} is a tuple of the form returned by \function{sys.exc_info()}: + \code{(\var{type}, \var{value}, \var{traceback})}. \end{methoddesc} \begin{methoddesc}[TestResult]{addFailure}{test, err} @@ -800,23 +838,10 @@ \end{methoddesc} \begin{methoddesc}[TestResult]{addSuccess}{test} - This method is called for a test that does not fail; \var{test} is - the test case object. + Called when the test case \var{test} succeeds. \end{methoddesc} -One additional method is available for \class{TestResult} objects: - -\begin{methoddesc}[TestResult]{stop}{} - This method can be called to signal that the set of tests being run - should be aborted. Once this has been called, the - \class{TestRunner} object return to its caller without running any - additional tests. This is used by the \class{TextTestRunner} class - to stop the test framework when the user signals an interrupt from - the keyboard. Interactive tools which provide runners can use this - in a similar manner. -\end{methoddesc} - \subsection{TestLoader Objects \label{testloader-objects}} @@ -824,15 +849,15 @@ The \class{TestLoader} class is used to create test suites from classes and modules. Normally, there is no need to create an instance of this class; the \refmodule{unittest} module provides an instance -that can be shared as the \code{defaultTestLoader} module attribute. -Using a subclass or instance would allow customization of some +that can be shared as \code{unittest.defaultTestLoader}. +Using a subclass or instance, however, allows customization of some configurable properties. \class{TestLoader} objects have the following methods: \begin{methoddesc}[TestLoader]{loadTestsFromTestCase}{testCaseClass} Return a suite of all tests cases contained in the - \class{TestCase}-derived class \class{testCaseClass}. + \class{TestCase}-derived \class{testCaseClass}. \end{methoddesc} \begin{methoddesc}[TestLoader]{loadTestsFromModule}{module} @@ -842,7 +867,7 @@ method defined for the class. \warning{While using a hierarchy of - \class{Testcase}-derived classes can be convenient in sharing + \class{TestCase}-derived classes can be convenient in sharing fixtures and helper functions, defining test methods on base classes that are not intended to be instantiated directly does not play well with this method. Doing so, however, can be useful when the @@ -853,21 +878,23 @@ Return a suite of all tests cases given a string specifier. The specifier \var{name} is a ``dotted name'' that may resolve - either to a module, a test case class, a test method within a test - case class, or a callable object which returns a \class{TestCase} or - \class{TestSuite} instance. For example, if you have a module - \module{SampleTests} containing a \class{TestCase}-derived class - \class{SampleTestCase} with three test methods (\method{test_one()}, - \method{test_two()}, and \method{test_three()}), the specifier - \code{'SampleTests.SampleTestCase'} would cause this method to - return a suite which will run all three test methods. Using the - specifier \code{'SampleTests.SampleTestCase.test_two'} would cause - it to return a test suite which will run only the + either to a module, a test case class, a \class{TestSuite} instance, + a test method within a test case class, or a callable object which + returns a \class{TestCase} or \class{TestSuite} instance. + + For example, if you have a module \module{SampleTests} containing a + \class{TestCase}-derived class \class{SampleTestCase} with three test + methods (\method{test_one()}, \method{test_two()}, and + \method{test_three()}), the specifier \code{'SampleTests.SampleTestCase'} + would cause this method to return a suite which will run all three test + methods. Using the specifier \code{'SampleTests.SampleTestCase.test_two'} + would cause it to return a test suite which will run only the \method{test_two()} test method. The specifier can refer to modules and packages which have not been imported; they will be imported as a side-effect. - The method optionally resolves \var{name} relative to a given module. + The method optionally resolves \var{name} relative to the given + \var{module}. \end{methoddesc} \begin{methoddesc}[TestLoader]{loadTestsFromNames}{names\optional{, module}} @@ -888,17 +915,22 @@ \begin{memberdesc}[TestLoader]{testMethodPrefix} String giving the prefix of method names which will be interpreted as test methods. The default value is \code{'test'}. + + This affects \method{getTestCaseNames()} and all the + \method{loadTestsFrom*()} methods. \end{memberdesc} \begin{memberdesc}[TestLoader]{sortTestMethodsUsing} Function to be used to compare method names when sorting them in - \method{getTestCaseNames()}. The default value is the built-in - \function{cmp()} function; it can be set to \constant{None} to disable - the sort. + \method{getTestCaseNames()} and all the \method{loadTestsFrom*()} methods. + The default value is the built-in \function{cmp()} function; the attribute + can also be set to \constant{None} to disable the sort. \end{memberdesc} \begin{memberdesc}[TestLoader]{suiteClass} Callable object that constructs a test suite from a list of tests. No methods on the resulting object are needed. The default value is the \class{TestSuite} class. + + This affects all the \method{loadTestsFrom*()} methods. \end{memberdesc} Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Aug 5 08:10:54 2006 @@ -49,6 +49,12 @@ ----- +Documentation +------------- + +- Patch #1534922: unittest docs were corrected and enhanced. + + Build ----- @@ -433,6 +439,7 @@ - Patch #1504046: Add documentation for xml.etree. + What's New in Python 2.5 beta 1? ================================ From python-checkins at python.org Sun Aug 6 02:24:51 2006 From: python-checkins at python.org (mateusz.rukowicz) Date: Sun, 6 Aug 2006 02:24:51 +0200 (CEST) Subject: [Python-checkins] r51124 - sandbox/trunk/decimal-c/_decimal.c Message-ID: <20060806002451.15DB51E4003@bag.python.org> Author: mateusz.rukowicz Date: Sun Aug 6 02:24:49 2006 New Revision: 51124 Modified: sandbox/trunk/decimal-c/_decimal.c Log: Now every function work properly and passes most actual tests (except some powering tests, which cannot be passed - making code passing them, will make it unable to pass others). Modified: sandbox/trunk/decimal-c/_decimal.c ============================================================================== --- sandbox/trunk/decimal-c/_decimal.c (original) +++ sandbox/trunk/decimal-c/_decimal.c Sun Aug 6 02:24:49 2006 @@ -1919,14 +1919,52 @@ ans->limbs[0] = 1; digits = 1; } else { /* SLOW */ + ans = _decimal_get_copy(self); ans = _NEW_decimalobj(self->ob_size+1, self->sign, self->exp); if (!ans) return NULL; - for(i=0;ilimb_count;i++) - ans->limbs[i] = 0; - _limb_first_n_digits(self->limbs, self->ob_size, 0, ans->limbs, ans->ob_size-1); + ans->limbs[ans->limb_count-1] = 0; + for (i=0 ; i < self->limb_count;i++) + ans->limbs[i] = self->limbs[i]; } + /* if watchexp, we need to check if after rounding ob_size is still <= prec + * there might be faster and easier solution I cannot see */ + if (watchexp && digits > ctx->prec) { + PyObject *flags; + PyObject *r; + flags = context_ignore_all_flags(ctx); + if (!flags) { + Py_DECREF(ans); + return NULL; + } + + tmp = _decimal_round(ans, digits, ctx, rounding); + if (!tmp) { + r = context_regard_flags(ctx, flags); + Py_DECREF(flags); + Py_XDECREF(r); + Py_DECREF(ans); + return NULL; + } + r = context_regard_flags(ctx, flags); + Py_DECREF(flags); + if (!r) { + Py_DECREF(ans); + Py_DECREF(tmp); + return NULL; + } + if (_limb_get_digit(tmp->limbs, tmp->ob_size, 0) == 0 && tmp->ob_size > 1) + tmp->ob_size --; + + if (tmp->ob_size > ctx->prec) { + Py_DECREF(tmp); + Py_DECREF(ans); + return handle_InvalidOperation(self->ob_type, ctx, + "Rescale > prec", NULL); + } + Py_DECREF(tmp); + } tmp = _decimal_round(ans, digits, ctx, rounding); Py_DECREF(ans); if (!tmp) @@ -4967,62 +5005,68 @@ } DECIMAL_UNARY_FUNC(log10); + +/* due to some nasty special cases, this code looks quite ugly */ static int _do_real_decimal_comparetotal(decimalobject *self, decimalobject *other, contextobject *ctx) { exp_t adj_self; exp_t adj_other; + /* what should we return when less, greater, equal ie: + * when both are > 0 and aren't special then l = -1 g = 1 eq = 0 + * when both are < 0 and aren't special then l = 1 g = -1 eq = 0 + * when self is sNaN and other is NaN then l and g are as above, but eq = -1 + * etc ... */ + int when_l; + int when_g; + int cmp; /* comparison of abs(self) and abs(other) (remember, abs(NaN50) = 50 ) */ if (!ctx) ctx = getcontext(); if (!ctx) return 0; + /* sign is most important */ + if ((other->sign &1) && !(self->sign&1)) + return 1; + if ((self->sign &1) && !(other->sign&1)) + return -1; + + if (self->sign &1) { + when_l = 1; + when_g = -1; + } + else { + when_l = -1; + when_g = 1; + } - if (ISSPECIAL(self) || ISSPECIAL(other)) { - - if (GETNAN(self) || GETNAN(other)) { - if (!GETNAN(other)) - return 1; - if (!GETNAN(self)) - return -1; - if ((self->sign &1) && !(other->sign&1)) - return -1; - if ((other->sign&1) && !(self->sign&1)) - return 1; - if (GETNAN(other) == GETNAN(self)) { - return 0; - } - - - if (GETNAN(other) == 2) - return (1 ^ self->sign&1) * 2 -1; - if (GETNAN(self) == 2) - return (0 ^ self->sign&1) * 2 -1; - } - - if (ISINF(self) || ISINF(other)) { - if (ISINF(self) == ISINF(other)) - return 0; + /* abs(nan) always greater than abs(non-nan) */ + if (GETNAN(self) && !GETNAN(other)) + return when_g; + if (GETNAN(other) && !GETNAN(self)) + return when_l; + + /* both are nans */ + if (GETNAN(self)) { + /* one is sNaN, and one NaN, in this case, when abs(sNaN) == abs(NaN) + * then NaN is greater if both signs are + and is less, if both signs + * are - */ + if (GETNAN(self) != GETNAN(other)) { + if (GETNAN(self) == 2) + return when_l; else - return ISINF(self) > ISINF(other) ? 1 : -1; + return when_g; + /* now 'add' sign to this */ } } - if (!decimal_nonzero(self) && !decimal_nonzero(other)) { - if ((self->sign&1) && !(other->sign&1)) - return -1; - if ((other->sign&1) && !(self->sign&1)) - return 1; - - if (exp_eq(self->exp, other->exp)) + if (ISINF(self) || ISINF(other)) { + if (ISINF(self) && ISINF(other)) return 0; - - return (((exp_l(other->exp, self->exp) ? 1 : 0) ^ (self->sign&1)) * 2) -1; + if (ISINF(self) && !ISINF(other)) + return when_g; + return when_l; } - /* pretty obvious */ - if ((other->sign &1) && !(self->sign&1)) - return 1; - if ((self->sign &1) && !(other->sign&1)) - return -1; + /* we now know that self->sign == other->sign, and everything is just fine ;P */ adj_self = ADJUSTED(self); adj_other = ADJUSTED(other); @@ -5039,29 +5083,40 @@ d_s = _limb_get_digit(self->limbs, self->ob_size, i); d_o = _limb_get_digit(other->limbs, other->ob_size, i); if (d_s != d_o) { - ret = d_s > d_o; - if (ret ^ (self->sign&1)) - return 1; + if (d_s > d_o) + cmp = 1; else - return -1; + cmp = -1; + break; } } - if (exp_eq(self->exp, other->exp)) { - return 0; - } - else if (exp_g(self->exp, other->exp)) - { - return (1 ^ self->sign&1) * 2 -1; + /* equal */ + /* abs(0.0000) > abs(0.0) */ + if (i == digits) { + if (exp_eq(self->exp, other->exp)) { + cmp = 0; + } + else if (exp_g(self->exp, other->exp)) + cmp = 1; + else cmp = -1; } - else return (0 ^ self->sign&1) * 2 -1; } - if (exp_g(adj_self, adj_other)) - return (1 ^ self->sign &1) * 2 -1; + else if (exp_g(adj_self, adj_other)) + cmp = 1; else - return (0 ^ self->sign &1) * 2 -1; + cmp = -1; + + switch (cmp) { + case 1: return when_g; + break; + case 0: return 0; + break; + case -1: return when_l; + break; + } } static decimalobject * From python-checkins at python.org Sun Aug 6 03:40:27 2006 From: python-checkins at python.org (mateusz.rukowicz) Date: Sun, 6 Aug 2006 03:40:27 +0200 (CEST) Subject: [Python-checkins] r51125 - sandbox/trunk/decimal-c/_decimal.c Message-ID: <20060806014027.4F54B1E4003@bag.python.org> Author: mateusz.rukowicz Date: Sun Aug 6 03:40:26 2006 New Revision: 51125 Modified: sandbox/trunk/decimal-c/_decimal.c Log: Some minor fixes, Context should now be safe for subclassing. Modified: sandbox/trunk/decimal-c/_decimal.c ============================================================================== --- sandbox/trunk/decimal-c/_decimal.c (original) +++ sandbox/trunk/decimal-c/_decimal.c Sun Aug 6 03:40:26 2006 @@ -1918,8 +1918,7 @@ return NULL; ans->limbs[0] = 1; digits = 1; - } else { /* SLOW */ - ans = _decimal_get_copy(self); + } else { ans = _NEW_decimalobj(self->ob_size+1, self->sign, self->exp); if (!ans) return NULL; @@ -1954,6 +1953,7 @@ Py_DECREF(tmp); return NULL; } + Py_DECREF(r); if (_limb_get_digit(tmp->limbs, tmp->ob_size, 0) == 0 && tmp->ob_size > 1) tmp->ob_size --; @@ -1998,15 +1998,17 @@ static char *kwlist[] = {"exp", "rounding", "context", "watchexp", 0}; contextobject *ctx = NULL; exp_t exp; - long tmp_exp; + PyObject *tmp_exp; int rounding = -1, watchexp = 1; - /* TODO big exp*/ - if(!PyArg_ParseTupleAndKeywords(args,kwds,"l|iOi:_rescale",kwlist, + if(!PyArg_ParseTupleAndKeywords(args,kwds,"O|iOi:_rescale",kwlist, &tmp_exp, &rounding, &ctx, &watchexp)) return NULL; - exp = exp_from_i(tmp_exp); + + exp = exp_from_pyobj(tmp_exp); + if (PyErr_Occurred()) + return NULL; if(ctx == NULL) if(!(ctx = getcontext())) return NULL; @@ -6816,7 +6818,7 @@ int sign; long i; exp_t exp; - long tmp_exp; + PyObject *tmp_exp; if (PyTuple_Check(seq)) { tup = seq; @@ -6832,10 +6834,12 @@ goto err; } - /* TODO big exponents reading */ - if (!PyArg_ParseTuple(tup, "iOl", &sign, &digits, &tmp_exp)) + if (!PyArg_ParseTuple(tup, "iOO", &sign, &digits, &tmp_exp)) + goto err; + exp = exp_from_pyobj(tmp_exp); + if (PyErr_Occurred()) goto err; - exp = exp_from_i(tmp_exp); + if (sign < 0 || sign > 7) { PyErr_SetString(PyExc_ValueError, "Invalid sign"); goto err; @@ -7104,40 +7108,52 @@ static int _decimal_set_int(decimalobject *self, PyObject *value) { - /* + long i, size, val; - char *arr; + long mul, limb; + long *limbs; PyObject *item; if (!PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "_int must be a tuple"); return -1; } size = PyTuple_GET_SIZE(value); - arr = PyObject_MALLOC(size); - if (!arr) { + limbs = PyObject_MALLOC(((size + LOG -1)/LOG) * sizeof(long)); + if (!limbs) { PyErr_NoMemory(); return -1; } - for (i = 0; i < size; i++) { + mul = 1; + limb = 0; + limbs[0] = 0; + for (i = size-1; i >= 0; i--) { item = PyTuple_GET_ITEM(value, i); if (!PyInt_Check(item)) { - PyObject_FREE(arr); + PyObject_FREE(limbs); PyErr_SetString(PyExc_TypeError, "_int must consist of ints"); return -1; } val = PyInt_AsLong(item); if (val < 0 || val > 9) { - PyObject_FREE(arr); + PyObject_FREE(limbs); PyErr_SetString(PyExc_TypeError, "_int digits must be 0-9"); return -1; } - arr[i] = val; + limbs[limb] += mul * val; + mul *= 10; + if (mul == BASE) { + limb ++; + mul = 1; + if (i > 0) + limbs[limb] = 0; + } } - PyObject_FREE(self->digits); + PyObject_FREE(self->limbs); self->ob_size = size; - self->digits = arr; - return 0; TODO */ + self->limb_count = (size + LOG-1)/LOG; + self->limbs = limbs; + return 0; } static PyObject * @@ -7314,18 +7330,17 @@ /* Context object ************************************************************/ -/* XXX: This is not safe for subclassing yet. */ - static contextobject * -_new_contextobj(long prec, int rounding, int rounding_dec, PyObject *traps, +_new_contextobj(PyTypeObject *type, long prec, int rounding, int rounding_dec, PyObject *traps, PyObject *flags, exp_t Emin, exp_t Emax, int capitals, int clamp, PyObject *ignored, int copy_dicts) { contextobject *new; PyObject *f = NULL, *t = NULL, *i = NULL; - new = (contextobject *)PyObject_NEW(contextobject, - &PyDecimal_DecimalContextType); +/* new = (contextobject *)PyObject_NEW(contextobject, + &PyDecimal_DecimalContextType); */ + new = (contextobject*) type->tp_alloc(type, 0); if (new == NULL) return NULL; @@ -7378,6 +7393,7 @@ return NULL; } + /* Context methods ************************************************************/ static PyObject * @@ -7394,7 +7410,7 @@ static contextobject * context_shallow_copy(contextobject *ctx) { - return _new_contextobj(ctx->prec, ctx->rounding, ctx->rounding_dec, + return _new_contextobj(ctx->ob_type, ctx->prec, ctx->rounding, ctx->rounding_dec, ctx->traps, ctx->flags, ctx->Emin, ctx->Emax, ctx->capitals, ctx->clamp, ctx->ignored, 0); } @@ -7403,7 +7419,7 @@ static contextobject * context_copy(contextobject *ctx) { - return _new_contextobj(ctx->prec, ctx->rounding, ctx->rounding_dec, + return _new_contextobj(ctx->ob_type, ctx->prec, ctx->rounding, ctx->rounding_dec, ctx->traps, ctx->flags, ctx->Emin, ctx->Emax, ctx->capitals, ctx->clamp, ctx->ignored, 1); /* Note the difference: ^ */ @@ -8366,7 +8382,7 @@ clamp = clamp & 1; - res = (PyObject *)_new_contextobj(prec, rounding, rounding_dec, _traps, + res = (PyObject *)_new_contextobj(type, prec, rounding, rounding_dec, _traps, _flags, Emin, Emax, capitals, clamp, _ignored, 0); err: @@ -8617,7 +8633,8 @@ _set_flag(traps, S_DIV_BY_ZERO, 1); _set_flag(traps, S_OVERFLOW, 1); _set_flag(traps, S_INV_OPERATION, 1); - PyDecimal_DefaultContext = _new_contextobj(28, ROUND_HALF_EVEN, ALWAYS_ROUND, + PyDecimal_DefaultContext = _new_contextobj(&PyDecimal_DecimalContextType, + 28, ROUND_HALF_EVEN, ALWAYS_ROUND, traps, NULL, exp_from_i(-999999999L), exp_from_i(999999999L), 1, 0, NULL, 1); @@ -8631,7 +8648,8 @@ _set_flag(traps, S_CLAMPED, 1); _set_flag(traps, S_UNDERFLOW, 1); - PyDecimal_BasicContext = _new_contextobj(9, ROUND_HALF_UP, ALWAYS_ROUND, + PyDecimal_BasicContext = _new_contextobj(&PyDecimal_DecimalContextType, + 9, ROUND_HALF_UP, ALWAYS_ROUND, traps, NULL, exp_from_i(-999999999L), exp_from_i(999999999L), 1, 0, NULL, 1); @@ -8641,7 +8659,8 @@ (PyObject *)PyDecimal_BasicContext) < 0) return; - PyDecimal_ExtendedContext = _new_contextobj(9, ROUND_HALF_EVEN, ALWAYS_ROUND, + PyDecimal_ExtendedContext = _new_contextobj(&PyDecimal_DecimalContextType, + 9, ROUND_HALF_EVEN, ALWAYS_ROUND, NULL, NULL, exp_from_i(-999999999L), exp_from_i(999999999L), 1, 0, NULL, 1); From python-checkins at python.org Sun Aug 6 09:06:34 2006 From: python-checkins at python.org (georg.brandl) Date: Sun, 6 Aug 2006 09:06:34 +0200 (CEST) Subject: [Python-checkins] r51126 - in python/trunk: Lib/test/test_bz2.py Misc/NEWS Message-ID: <20060806070634.ABDDC1E4002@bag.python.org> Author: georg.brandl Date: Sun Aug 6 09:06:33 2006 New Revision: 51126 Modified: python/trunk/Lib/test/test_bz2.py python/trunk/Misc/NEWS Log: Bug #1535182: really test the xreadlines() method of bz2 objects. Modified: python/trunk/Lib/test/test_bz2.py ============================================================================== --- python/trunk/Lib/test/test_bz2.py (original) +++ python/trunk/Lib/test/test_bz2.py Sun Aug 6 09:06:33 2006 @@ -258,7 +258,7 @@ bz2f = BZ2File(self.filename) xlines = list(bz2f.xreadlines()) bz2f.close() - self.assertEqual(lines, ['Test']) + self.assertEqual(xlines, ['Test']) class BZ2CompressorTest(BaseTest): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Aug 6 09:06:33 2006 @@ -48,6 +48,8 @@ Tests ----- +- Bug #1535182: really test the xreadlines() method of bz2 objects. + Documentation ------------- From python-checkins at python.org Sun Aug 6 09:08:16 2006 From: python-checkins at python.org (georg.brandl) Date: Sun, 6 Aug 2006 09:08:16 +0200 (CEST) Subject: [Python-checkins] r51127 - in python/branches/release24-maint: Lib/test/test_bz2.py Misc/NEWS Message-ID: <20060806070816.D97F51E4002@bag.python.org> Author: georg.brandl Date: Sun Aug 6 09:08:16 2006 New Revision: 51127 Modified: python/branches/release24-maint/Lib/test/test_bz2.py python/branches/release24-maint/Misc/NEWS Log: Bug #1535182: really test the xreadlines() method of bz2 objects. (backport from rev. 51126) Modified: python/branches/release24-maint/Lib/test/test_bz2.py ============================================================================== --- python/branches/release24-maint/Lib/test/test_bz2.py (original) +++ python/branches/release24-maint/Lib/test/test_bz2.py Sun Aug 6 09:08:16 2006 @@ -258,7 +258,7 @@ bz2f = BZ2File(self.filename) xlines = list(bz2f.xreadlines()) bz2f.close() - self.assertEqual(lines, ['Test']) + self.assertEqual(xlines, ['Test']) class BZ2CompressorTest(BaseTest): Modified: python/branches/release24-maint/Misc/NEWS ============================================================================== --- python/branches/release24-maint/Misc/NEWS (original) +++ python/branches/release24-maint/Misc/NEWS Sun Aug 6 09:08:16 2006 @@ -164,6 +164,8 @@ Tests ----- +- Bug #1535182: really test the xreadlines() method of bz2 objects. + - Patch #1529686: test_iterlen and test_email_codecs are now actually run by regrtest.py. From python-checkins at python.org Sun Aug 6 09:26:22 2006 From: python-checkins at python.org (georg.brandl) Date: Sun, 6 Aug 2006 09:26:22 +0200 (CEST) Subject: [Python-checkins] r51128 - python/trunk/Modules/Setup.dist Message-ID: <20060806072622.3FBD11E4002@bag.python.org> Author: georg.brandl Date: Sun Aug 6 09:26:21 2006 New Revision: 51128 Modified: python/trunk/Modules/Setup.dist Log: Bug #1535081: A leading underscore has been added to the names of the md5 and sha modules, so add it in Modules/Setup.dist too. Modified: python/trunk/Modules/Setup.dist ============================================================================== --- python/trunk/Modules/Setup.dist (original) +++ python/trunk/Modules/Setup.dist Sun Aug 6 09:26:21 2006 @@ -59,7 +59,7 @@ # # In addition, *static* explicitly declares the following modules to # be static. Lines containing "*static*" and "*shared*" may thus -# alternate thoughout this file. +# alternate throughout this file. # NOTE: As a standard policy, as many modules as can be supported by a # platform should be present. The distribution comes with all modules @@ -234,16 +234,19 @@ #rgbimg rgbimgmodule.c # Read SGI RGB image files (but coded portably) -# The md5 module implements the RSA Data Security, Inc. MD5 +# Note that the _md5 and _sha modules are normally only built if the +# system does not have the OpenSSL libs containing an optimized version. + +# The _md5 module implements the RSA Data Security, Inc. MD5 # Message-Digest Algorithm, described in RFC 1321. The necessary files # md5.c and md5.h are included here. -#md5 md5module.c md5.c +#_md5 md5module.c md5.c -# The sha module implements the SHA checksum algorithm. +# The _sha module implements the SHA checksum algorithm. # (NIST's Secure Hash Algorithm.) -#sha shamodule.c +#_sha shamodule.c # SGI IRIX specific modules -- off by default. From python-checkins at python.org Sun Aug 6 10:23:55 2006 From: python-checkins at python.org (georg.brandl) Date: Sun, 6 Aug 2006 10:23:55 +0200 (CEST) Subject: [Python-checkins] r51129 - in python/trunk: Lib/test/test_builtin.py Misc/NEWS Python/bltinmodule.c Message-ID: <20060806082355.867231E4002@bag.python.org> Author: georg.brandl Date: Sun Aug 6 10:23:54 2006 New Revision: 51129 Modified: python/trunk/Lib/test/test_builtin.py python/trunk/Misc/NEWS python/trunk/Python/bltinmodule.c Log: Bug #1535165: fixed a segfault in input() and raw_input() when sys.stdin is closed. Modified: python/trunk/Lib/test/test_builtin.py ============================================================================== --- python/trunk/Lib/test/test_builtin.py (original) +++ python/trunk/Lib/test/test_builtin.py Sun Aug 6 10:23:54 2006 @@ -1432,6 +1432,14 @@ self.assertEqual(input('testing\n'), 2) self.assertEqual(raw_input(), 'The quick brown fox jumps over the lazy dog.') self.assertEqual(raw_input('testing\n'), 'Dear John') + + # SF 1535165: don't segfault on closed stdin + # sys.stdout must be a regular file for triggering + sys.stdout = savestdout + sys.stdin.close() + self.assertRaises(ValueError, input, 'prompt') + + sys.stdout = BitBucket() sys.stdin = cStringIO.StringIO("NULL\0") self.assertRaises(TypeError, input, 42, 42) sys.stdin = cStringIO.StringIO(" 'whitespace'") Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Aug 6 10:23:54 2006 @@ -12,6 +12,9 @@ Core and builtins ----------------- +- Bug #1535165: fixed a segfault in input() and raw_input() when + sys.stdin is closed. + - On Windows, the PyErr_Warn function is now exported from the Python dll again. Modified: python/trunk/Python/bltinmodule.c ============================================================================== --- python/trunk/Python/bltinmodule.c (original) +++ python/trunk/Python/bltinmodule.c Sun Aug 6 10:23:54 2006 @@ -1725,7 +1725,7 @@ if (PyFile_WriteString(" ", fout) != 0) return NULL; } - if (PyFile_Check(fin) && PyFile_Check(fout) + if (PyFile_AsFile(fin) && PyFile_AsFile(fout) && isatty(fileno(PyFile_AsFile(fin))) && isatty(fileno(PyFile_AsFile(fout)))) { PyObject *po; From python-checkins at python.org Sun Aug 6 10:24:00 2006 From: python-checkins at python.org (georg.brandl) Date: Sun, 6 Aug 2006 10:24:00 +0200 (CEST) Subject: [Python-checkins] r51130 - in python/branches/release24-maint: Lib/test/test_builtin.py Misc/NEWS Python/bltinmodule.c Message-ID: <20060806082400.6B6571E4002@bag.python.org> Author: georg.brandl Date: Sun Aug 6 10:23:59 2006 New Revision: 51130 Modified: python/branches/release24-maint/Lib/test/test_builtin.py python/branches/release24-maint/Misc/NEWS python/branches/release24-maint/Python/bltinmodule.c Log: Bug #1535165: fixed a segfault in input() and raw_input() when sys.stdin is closed. (backport from rev. 51129) Modified: python/branches/release24-maint/Lib/test/test_builtin.py ============================================================================== --- python/branches/release24-maint/Lib/test/test_builtin.py (original) +++ python/branches/release24-maint/Lib/test/test_builtin.py Sun Aug 6 10:23:59 2006 @@ -1039,6 +1039,14 @@ self.assertEqual(input('testing\n'), 2) self.assertEqual(raw_input(), 'The quick brown fox jumps over the lazy dog.') self.assertEqual(raw_input('testing\n'), 'Dear John') + + # SF 1535165: don't segfault on closed stdin + # sys.stdout must be a regular file for triggering + sys.stdout = savestdout + sys.stdin.close() + self.assertRaises(ValueError, input, 'prompt') + + sys.stdout = BitBucket() sys.stdin = cStringIO.StringIO("NULL\0") self.assertRaises(TypeError, input, 42, 42) sys.stdin = cStringIO.StringIO(" 'whitespace'") Modified: python/branches/release24-maint/Misc/NEWS ============================================================================== --- python/branches/release24-maint/Misc/NEWS (original) +++ python/branches/release24-maint/Misc/NEWS Sun Aug 6 10:23:59 2006 @@ -12,6 +12,9 @@ Core and builtins ----------------- +- Bug #1535165: fixed a segfault in input() and raw_input() when + sys.stdin is closed. + - Bug #1524310: Properly report errors from FindNextFile in os.listdir. - Bug #927248: Recursive method-wrapper objects can now safely Modified: python/branches/release24-maint/Python/bltinmodule.c ============================================================================== --- python/branches/release24-maint/Python/bltinmodule.c (original) +++ python/branches/release24-maint/Python/bltinmodule.c Sun Aug 6 10:23:59 2006 @@ -1609,7 +1609,7 @@ if (PyFile_WriteString(" ", fout) != 0) return NULL; } - if (PyFile_Check(fin) && PyFile_Check(fout) + if (PyFile_AsFile(fin) && PyFile_AsFile(fout) && isatty(fileno(PyFile_AsFile(fin))) && isatty(fileno(PyFile_AsFile(fout)))) { PyObject *po; From buildbot at python.org Sun Aug 6 10:28:45 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 08:28:45 +0000 Subject: [Python-checkins] buildbot warnings in x86 cygwin 2.4 Message-ID: <20060806082845.92ABA1E4002@bag.python.org> The Buildbot has detected a new failure of x86 cygwin 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520cygwin%25202.4/builds/139 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: andrew.kuchling,georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 10:32:42 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 08:32:42 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian 2.4 Message-ID: <20060806083243.13F7E1E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%25202.4/builds/47 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: andrew.kuchling,georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 10:45:39 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 08:45:39 +0000 Subject: [Python-checkins] buildbot warnings in x86 W2k trunk Message-ID: <20060806084539.520321E400D@bag.python.org> The Buildbot has detected a new failure of x86 W2k trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%2520trunk/builds/1369 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 10:46:23 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 08:46:23 +0000 Subject: [Python-checkins] buildbot warnings in x86 gentoo trunk Message-ID: <20060806084623.5ADFB1E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520gentoo%2520trunk/builds/1462 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 10:47:31 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 08:47:31 +0000 Subject: [Python-checkins] buildbot warnings in amd64 gentoo trunk Message-ID: <20060806084731.EB9931E4002@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%2520gentoo%2520trunk/builds/1378 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 10:58:53 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 08:58:53 +0000 Subject: [Python-checkins] buildbot warnings in x86 W2k 2.4 Message-ID: <20060806085854.0C3041E4002@bag.python.org> The Buildbot has detected a new failure of x86 W2k 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%25202.4/builds/187 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 11:00:24 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 09:00:24 +0000 Subject: [Python-checkins] buildbot warnings in x86 gentoo 2.4 Message-ID: <20060806090024.00B681E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520gentoo%25202.4/builds/201 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 11:00:39 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 09:00:39 +0000 Subject: [Python-checkins] buildbot warnings in amd64 gentoo 2.4 Message-ID: <20060806090039.1D4481E4002@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%2520gentoo%25202.4/builds/202 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 11:03:14 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 09:03:14 +0000 Subject: [Python-checkins] buildbot warnings in x86 OpenBSD trunk Message-ID: <20060806090315.042AA1E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%2520trunk/builds/1141 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 11:04:04 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 09:04:04 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP 2.4 Message-ID: <20060806090404.95BDA1E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%25202.4/builds/189 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 11:04:20 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 09:04:20 +0000 Subject: [Python-checkins] buildbot warnings in S-390 Debian trunk Message-ID: <20060806090421.1B28C1E4002@bag.python.org> The Buildbot has detected a new failure of S-390 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%2520Debian%2520trunk/builds/301 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,bob.ippolito,georg.brandl,neil.schemenauer,thomas.heller,tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sun Aug 6 11:17:16 2006 From: python-checkins at python.org (georg.brandl) Date: Sun, 6 Aug 2006 11:17:16 +0200 (CEST) Subject: [Python-checkins] r51131 - python/trunk/Lib/test/test_builtin.py Message-ID: <20060806091716.8AA2E1E4003@bag.python.org> Author: georg.brandl Date: Sun Aug 6 11:17:16 2006 New Revision: 51131 Modified: python/trunk/Lib/test/test_builtin.py Log: Don't produce output in test_builtin. Modified: python/trunk/Lib/test/test_builtin.py ============================================================================== --- python/trunk/Lib/test/test_builtin.py (original) +++ python/trunk/Lib/test/test_builtin.py Sun Aug 6 11:17:16 2006 @@ -1432,12 +1432,12 @@ self.assertEqual(input('testing\n'), 2) self.assertEqual(raw_input(), 'The quick brown fox jumps over the lazy dog.') self.assertEqual(raw_input('testing\n'), 'Dear John') - + # SF 1535165: don't segfault on closed stdin # sys.stdout must be a regular file for triggering sys.stdout = savestdout sys.stdin.close() - self.assertRaises(ValueError, input, 'prompt') + self.assertRaises(ValueError, input) sys.stdout = BitBucket() sys.stdin = cStringIO.StringIO("NULL\0") From python-checkins at python.org Sun Aug 6 11:17:23 2006 From: python-checkins at python.org (georg.brandl) Date: Sun, 6 Aug 2006 11:17:23 +0200 (CEST) Subject: [Python-checkins] r51132 - python/branches/release24-maint/Lib/test/test_builtin.py Message-ID: <20060806091723.0F3601E4005@bag.python.org> Author: georg.brandl Date: Sun Aug 6 11:17:22 2006 New Revision: 51132 Modified: python/branches/release24-maint/Lib/test/test_builtin.py Log: Don't produce output in test_builtin. (backport from rev. 51131) Modified: python/branches/release24-maint/Lib/test/test_builtin.py ============================================================================== --- python/branches/release24-maint/Lib/test/test_builtin.py (original) +++ python/branches/release24-maint/Lib/test/test_builtin.py Sun Aug 6 11:17:22 2006 @@ -1039,12 +1039,12 @@ self.assertEqual(input('testing\n'), 2) self.assertEqual(raw_input(), 'The quick brown fox jumps over the lazy dog.') self.assertEqual(raw_input('testing\n'), 'Dear John') - + # SF 1535165: don't segfault on closed stdin # sys.stdout must be a regular file for triggering sys.stdout = savestdout sys.stdin.close() - self.assertRaises(ValueError, input, 'prompt') + self.assertRaises(ValueError, input) sys.stdout = BitBucket() sys.stdin = cStringIO.StringIO("NULL\0") From buildbot at python.org Sun Aug 6 11:17:28 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 09:17:28 +0000 Subject: [Python-checkins] buildbot warnings in ppc Debian unstable 2.4 Message-ID: <20060806091728.26EF21E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%2520Debian%2520unstable%25202.4/builds/128 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 11:20:07 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 09:20:07 +0000 Subject: [Python-checkins] buildbot warnings in x86 OpenBSD 2.4 Message-ID: <20060806092007.82E111E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%25202.4/builds/145 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 11:28:36 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 09:28:36 +0000 Subject: [Python-checkins] buildbot warnings in g4 osx.4 2.4 Message-ID: <20060806092836.CD0C01E4002@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/g4%2520osx.4%25202.4/builds/193 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 11:35:43 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 09:35:43 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP trunk Message-ID: <20060806093543.550B61E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%2520trunk/builds/1319 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 11:48:35 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 09:48:35 +0000 Subject: [Python-checkins] buildbot warnings in ppc Debian unstable trunk Message-ID: <20060806094835.8EEBC1E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%2520Debian%2520unstable%2520trunk/builds/1065 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 11:48:43 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 09:48:43 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060806094843.E402B1E4002@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1038 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 11:54:22 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 09:54:22 +0000 Subject: [Python-checkins] buildbot warnings in sparc solaris10 gcc trunk Message-ID: <20060806095422.5287B1E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520solaris10%2520gcc%2520trunk/builds/1319 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 11:54:48 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 09:54:48 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) trunk Message-ID: <20060806095449.06E741E4002@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%2520trunk/builds/879 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 12:08:05 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 10:08:05 +0000 Subject: [Python-checkins] buildbot warnings in g4 osx.4 trunk Message-ID: <20060806100805.B7F8E1E4002@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/g4%2520osx.4%2520trunk/builds/1308 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 12:08:20 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 10:08:20 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian trunk Message-ID: <20060806100820.447A91E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%2520trunk/builds/367 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 12:27:39 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 10:27:39 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 2.4 Message-ID: <20060806102739.434E71E4002@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%25202.4/builds/151 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 12:51:05 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 10:51:05 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian 2.4 Message-ID: <20060806105105.E18981E4002@bag.python.org> The Buildbot has detected a new failure of alpha Debian 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%25202.4/builds/2 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: andrew.kuchling,georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sun Aug 6 14:37:04 2006 From: python-checkins at python.org (andrew.macintyre) Date: Sun, 6 Aug 2006 14:37:04 +0200 (CEST) Subject: [Python-checkins] r51133 - in python/trunk: Lib/test/test_threading.py Misc/NEWS Message-ID: <20060806123704.8E3F01E4002@bag.python.org> Author: andrew.macintyre Date: Sun Aug 6 14:37:03 2006 New Revision: 51133 Modified: python/trunk/Lib/test/test_threading.py python/trunk/Misc/NEWS Log: test_threading now skips testing alternate thread stack sizes on platforms that don't support changing thread stack size. Modified: python/trunk/Lib/test/test_threading.py ============================================================================== --- python/trunk/Lib/test/test_threading.py (original) +++ python/trunk/Lib/test/test_threading.py Sun Aug 6 14:37:03 2006 @@ -89,7 +89,12 @@ def test_various_ops_small_stack(self): if verbose: print 'with 256kB thread stack size...' - threading.stack_size(262144) + try: + threading.stack_size(262144) + except thread.error: + if verbose: + print 'platform does not support changing thread stack size' + return self.test_various_ops() threading.stack_size(0) @@ -97,7 +102,12 @@ def test_various_ops_large_stack(self): if verbose: print 'with 1MB thread stack size...' - threading.stack_size(0x100000) + try: + threading.stack_size(0x100000) + except thread.error: + if verbose: + print 'platform does not support changing thread stack size' + return self.test_various_ops() threading.stack_size(0) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Aug 6 14:37:03 2006 @@ -53,6 +53,9 @@ - Bug #1535182: really test the xreadlines() method of bz2 objects. +- test_threading now skips testing alternate thread stack sizes on + platforms that don't support changing thread stack size. + Documentation ------------- From buildbot at python.org Sun Aug 6 14:43:29 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 12:43:29 +0000 Subject: [Python-checkins] buildbot warnings in MIPS Debian 2.4 Message-ID: <20060806124330.10C211E4002@bag.python.org> The Buildbot has detected a new failure of MIPS Debian 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/MIPS%2520Debian%25202.4/builds/66 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: andrew.kuchling,georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 15:28:44 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 13:28:44 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060806132844.EDC4A1E4002@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1040 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.macintyre Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 19:01:06 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 17:01:06 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060806170106.D7DA91E4002@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/472 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.macintyre Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sun Aug 6 23:02:40 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 21:02:40 +0000 Subject: [Python-checkins] buildbot warnings in MIPS Debian trunk Message-ID: <20060806210240.3177B1E4002@bag.python.org> The Buildbot has detected a new failure of MIPS Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/MIPS%2520Debian%2520trunk/builds/331 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.macintyre Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Mon Aug 7 00:07:05 2006 From: python-checkins at python.org (andrew.kuchling) Date: Mon, 7 Aug 2006 00:07:05 +0200 (CEST) Subject: [Python-checkins] r51134 - python/trunk/setup.py Message-ID: <20060806220705.2654C1E4018@bag.python.org> Author: andrew.kuchling Date: Mon Aug 7 00:07:04 2006 New Revision: 51134 Modified: python/trunk/setup.py Log: [Patch #1464056] Ensure that we use the panelw library when linking with ncursesw. Once I see how the buildbots react, I'll backport this to 2.4. Modified: python/trunk/setup.py ============================================================================== --- python/trunk/setup.py (original) +++ python/trunk/setup.py Mon Aug 7 00:07:04 2006 @@ -902,8 +902,12 @@ # Curses support, requiring the System V version of curses, often # provided by the ncurses library. + panel_library = 'panel' if (self.compiler.find_library_file(lib_dirs, 'ncursesw')): curses_libs = ['ncursesw'] + # Bug 1464056: If _curses.so links with ncursesw, + # _curses_panel.so must link with panelw. + panel_library = 'panelw' exts.append( Extension('_curses', ['_cursesmodule.c'], libraries = curses_libs) ) elif (self.compiler.find_library_file(lib_dirs, 'ncurses')): @@ -926,9 +930,9 @@ # If the curses module is enabled, check for the panel module if (module_enabled(exts, '_curses') and - self.compiler.find_library_file(lib_dirs, 'panel')): + self.compiler.find_library_file(lib_dirs, panel_library)): exts.append( Extension('_curses_panel', ['_curses_panel.c'], - libraries = ['panel'] + curses_libs) ) + libraries = [panel_library] + curses_libs) ) # Andrew Kuchling's zlib module. Note that some versions of zlib From python-checkins at python.org Mon Aug 7 00:10:11 2006 From: python-checkins at python.org (andrew.kuchling) Date: Mon, 7 Aug 2006 00:10:11 +0200 (CEST) Subject: [Python-checkins] r51135 - python/branches/release24-maint/Doc/whatsnew/whatsnew24.tex Message-ID: <20060806221011.DDAD61E4002@bag.python.org> Author: andrew.kuchling Date: Mon Aug 7 00:10:11 2006 New Revision: 51135 Modified: python/branches/release24-maint/Doc/whatsnew/whatsnew24.tex Log: Update status of relative import Modified: python/branches/release24-maint/Doc/whatsnew/whatsnew24.tex ============================================================================== --- python/branches/release24-maint/Doc/whatsnew/whatsnew24.tex (original) +++ python/branches/release24-maint/Doc/whatsnew/whatsnew24.tex Mon Aug 7 00:10:11 2006 @@ -799,8 +799,8 @@ The PEP also proposes that all \keyword{import} statements be absolute imports, with a leading \samp{.} character to indicate a relative -import. This part of the PEP is not yet implemented, and will have to -wait for Python 2.5 or some other future version. +import. This part of the PEP was not implemented for Python 2.4, +but was completed for Python 2.5. \begin{seealso} \seepep{328}{Imports: Multi-Line and Absolute/Relative} From buildbot at python.org Mon Aug 7 01:27:43 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 06 Aug 2006 23:27:43 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) trunk Message-ID: <20060806232743.A2A271E4002@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%2520trunk/builds/882 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Mon Aug 7 02:37:20 2006 From: python-checkins at python.org (andrew.kuchling) Date: Mon, 7 Aug 2006 02:37:20 +0200 (CEST) Subject: [Python-checkins] r51136 - python/branches/release24-maint/setup.py Message-ID: <20060807003720.116311E4002@bag.python.org> Author: andrew.kuchling Date: Mon Aug 7 02:37:19 2006 New Revision: 51136 Modified: python/branches/release24-maint/setup.py Log: [Patch #1464056] Ensure that we use the panelw library when linking with ncursesw Modified: python/branches/release24-maint/setup.py ============================================================================== --- python/branches/release24-maint/setup.py (original) +++ python/branches/release24-maint/setup.py Mon Aug 7 02:37:19 2006 @@ -681,8 +681,12 @@ # Curses support, requiring the System V version of curses, often # provided by the ncurses library. + panel_library = 'panel' if (self.compiler.find_library_file(lib_dirs, 'ncursesw')): curses_libs = ['ncursesw'] + # Bug 1464056: If _curses.so links with ncursesw, + # _curses_panel.so must link with panelw. + panel_library = 'panelw' exts.append( Extension('_curses', ['_cursesmodule.c'], libraries = curses_libs) ) elif (self.compiler.find_library_file(lib_dirs, 'ncurses')): @@ -705,9 +709,9 @@ # If the curses module is enabled, check for the panel module if (module_enabled(exts, '_curses') and - self.compiler.find_library_file(lib_dirs, 'panel')): + self.compiler.find_library_file(lib_dirs, panel_library)): exts.append( Extension('_curses_panel', ['_curses_panel.c'], - libraries = ['panel'] + curses_libs) ) + libraries = [panel_library] + curses_libs) ) # Andrew Kuchling's zlib module. Note that some versions of zlib From buildbot at python.org Mon Aug 7 02:57:53 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 07 Aug 2006 00:57:53 +0000 Subject: [Python-checkins] buildbot warnings in x86 OpenBSD 2.4 Message-ID: <20060807005754.17DAF1E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%25202.4/builds/147 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: andrew.kuchling Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Mon Aug 7 04:07:32 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 07 Aug 2006 02:07:32 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) 2.4 Message-ID: <20060807020732.BDAE31E4003@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%25202.4/builds/128 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: andrew.kuchling Build Had Warnings: warnings test sincerely, -The Buildbot From martin at v.loewis.de Mon Aug 7 13:29:40 2006 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Mon, 07 Aug 2006 13:29:40 +0200 Subject: [Python-checkins] r51113 - in python/trunk: Misc/NEWS setup.py In-Reply-To: <20060804185735.77EAD1E4003@bag.python.org> References: <20060804185735.77EAD1E4003@bag.python.org> Message-ID: <44D72424.8030708@v.loewis.de> thomas.heller schrieb: > Fix #1530448 - fix ctypes build failure on solaris 10. > > The '-mimpure-text' linker flag is required when linking _ctypes.so. This is probably not the full truth. -mimpure-text is only supported in gcc, so this won't work with the system compiler (SunPro/Forte/Whatever). Also, usage of -mimpure-text typically just hides some other, deeper problem. For C code, it indicates that -fPIC/-KPIC was missing somewhere. IIRC, this problem originated from assembler code, and I'm uncertain what the right fix is. Anyway, this is probably an improvement, so it should stay until somebody comes along with a real solution. Regards, Martin From python-checkins at python.org Tue Aug 8 13:52:35 2006 From: python-checkins at python.org (georg.brandl) Date: Tue, 8 Aug 2006 13:52:35 +0200 (CEST) Subject: [Python-checkins] r51137 - python/trunk/Lib/webbrowser.py Message-ID: <20060808115235.938311E4005@bag.python.org> Author: georg.brandl Date: Tue Aug 8 13:52:34 2006 New Revision: 51137 Modified: python/trunk/Lib/webbrowser.py Log: webbrowser: Silence stderr output if no gconftool or gnome browser found Modified: python/trunk/Lib/webbrowser.py ============================================================================== --- python/trunk/Lib/webbrowser.py (original) +++ python/trunk/Lib/webbrowser.py Tue Aug 8 13:52:34 2006 @@ -434,13 +434,13 @@ # The default Gnome browser if _iscommand("gconftool-2"): # get the web browser string from gconftool - gc = 'gconftool-2 -g /desktop/gnome/url-handlers/http/command' + gc = 'gconftool-2 -g /desktop/gnome/url-handlers/http/command 2>/dev/null' out = os.popen(gc) commd = out.read().strip() retncode = out.close() # if successful, register it - if retncode == None and len(commd) != 0: + if retncode is None and commd: register("gnome", None, BackgroundBrowser(commd)) # First, the Mozilla/Netscape browsers From python-checkins at python.org Tue Aug 8 13:56:21 2006 From: python-checkins at python.org (georg.brandl) Date: Tue, 8 Aug 2006 13:56:21 +0200 (CEST) Subject: [Python-checkins] r51138 - python/trunk/Objects/abstract.c Message-ID: <20060808115621.E694F1E4005@bag.python.org> Author: georg.brandl Date: Tue Aug 8 13:56:21 2006 New Revision: 51138 Modified: python/trunk/Objects/abstract.c Log: Remove "non-mapping" and "non-sequence" from TypeErrors raised by PyMapping_Size and PySequence_Size. Because len() tries first sequence, then mapping size, it will always raise a "non-mapping object has no len" error which is confusing. Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Tue Aug 8 13:56:21 2006 @@ -1114,7 +1114,7 @@ if (m && m->sq_length) return m->sq_length(s); - type_error("non-sequence object of type '%.200s' has no len()", s); + type_error("object of type '%.200s' has no len()", s); return -1; } @@ -1705,7 +1705,7 @@ if (m && m->mp_length) return m->mp_length(o); - type_error("non-mapping object of type '%.200s' has no len()", o); + type_error("object of type '%.200s' has no len()", o); return -1; } From python-checkins at python.org Tue Aug 8 19:37:01 2006 From: python-checkins at python.org (thomas.heller) Date: Tue, 8 Aug 2006 19:37:01 +0200 (CEST) Subject: [Python-checkins] r51139 - in python/trunk: Lib/test/test_types.py Misc/NEWS Objects/bufferobject.c Message-ID: <20060808173701.6B5D01E4005@bag.python.org> Author: thomas.heller Date: Tue Aug 8 19:37:00 2006 New Revision: 51139 Modified: python/trunk/Lib/test/test_types.py python/trunk/Misc/NEWS python/trunk/Objects/bufferobject.c Log: memcmp() can return values other than -1, 0, and +1 but tp_compare must not. Modified: python/trunk/Lib/test/test_types.py ============================================================================== --- python/trunk/Lib/test/test_types.py (original) +++ python/trunk/Lib/test/test_types.py Tue Aug 8 19:37:00 2006 @@ -233,6 +233,9 @@ try: buffer('asdf', -1) except ValueError: pass else: raise TestFailed, "buffer('asdf', -1) should raise ValueError" +cmp(buffer("abc"), buffer("def")) # used to raise a warning: tp_compare didn't return -1, 0, or 1 + +cmp(buffer('abc'), buffer('def')) try: buffer(None) except TypeError: pass Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Aug 8 19:37:00 2006 @@ -12,6 +12,8 @@ Core and builtins ----------------- +- Bug #1536786: buffer comparison could emit a RuntimeWarning. + - Bug #1535165: fixed a segfault in input() and raw_input() when sys.stdin is closed. Modified: python/trunk/Objects/bufferobject.c ============================================================================== --- python/trunk/Objects/bufferobject.c (original) +++ python/trunk/Objects/bufferobject.c Tue Aug 8 19:37:00 2006 @@ -272,7 +272,7 @@ if (min_len > 0) { cmp = memcmp(p1, p2, min_len); if (cmp != 0) - return cmp; + return cmp < 0 ? -1 : 1; } return (len_self < len_other) ? -1 : (len_self > len_other) ? 1 : 0; } From python-checkins at python.org Tue Aug 8 19:39:21 2006 From: python-checkins at python.org (thomas.heller) Date: Tue, 8 Aug 2006 19:39:21 +0200 (CEST) Subject: [Python-checkins] r51140 - python/trunk/Lib/test/test_types.py Message-ID: <20060808173921.E4BF71E4005@bag.python.org> Author: thomas.heller Date: Tue Aug 8 19:39:20 2006 New Revision: 51140 Modified: python/trunk/Lib/test/test_types.py Log: Remove accidently committed, duplicated test. Modified: python/trunk/Lib/test/test_types.py ============================================================================== --- python/trunk/Lib/test/test_types.py (original) +++ python/trunk/Lib/test/test_types.py Tue Aug 8 19:39:20 2006 @@ -235,8 +235,6 @@ else: raise TestFailed, "buffer('asdf', -1) should raise ValueError" cmp(buffer("abc"), buffer("def")) # used to raise a warning: tp_compare didn't return -1, 0, or 1 -cmp(buffer('abc'), buffer('def')) - try: buffer(None) except TypeError: pass else: raise TestFailed, "buffer(None) should raise TypeError" From python-checkins at python.org Tue Aug 8 19:42:32 2006 From: python-checkins at python.org (thomas.heller) Date: Tue, 8 Aug 2006 19:42:32 +0200 (CEST) Subject: [Python-checkins] r51141 - in python/branches/release24-maint: Lib/test/test_types.py Misc/NEWS Objects/bufferobject.c Message-ID: <20060808174232.126DC1E4005@bag.python.org> Author: thomas.heller Date: Tue Aug 8 19:42:30 2006 New Revision: 51141 Modified: python/branches/release24-maint/Lib/test/test_types.py python/branches/release24-maint/Misc/NEWS python/branches/release24-maint/Objects/bufferobject.c Log: memcmp() can return values other than -1, 0, and +1 but tp_compare must not. Modified: python/branches/release24-maint/Lib/test/test_types.py ============================================================================== --- python/branches/release24-maint/Lib/test/test_types.py (original) +++ python/branches/release24-maint/Lib/test/test_types.py Tue Aug 8 19:42:30 2006 @@ -229,6 +229,7 @@ try: buffer('asdf', -1) except ValueError: pass else: raise TestFailed, "buffer('asdf', -1) should raise ValueError" +cmp(buffer("abc"), buffer("def")) # used to raise a warning: tp_compare didn't return -1, 0, or 1 try: buffer(None) except TypeError: pass Modified: python/branches/release24-maint/Misc/NEWS ============================================================================== --- python/branches/release24-maint/Misc/NEWS (original) +++ python/branches/release24-maint/Misc/NEWS Tue Aug 8 19:42:30 2006 @@ -12,6 +12,8 @@ Core and builtins ----------------- +- Bug #1536786: buffer comparison could emit a RuntimeWarning. + - Bug #1535165: fixed a segfault in input() and raw_input() when sys.stdin is closed. Modified: python/branches/release24-maint/Objects/bufferobject.c ============================================================================== --- python/branches/release24-maint/Objects/bufferobject.c (original) +++ python/branches/release24-maint/Objects/bufferobject.c Tue Aug 8 19:42:30 2006 @@ -230,7 +230,7 @@ if (min_len > 0) { cmp = memcmp(p1, p2, min_len); if (cmp != 0) - return cmp; + return cmp < 0 ? -1 : 1; } return (len_self < len_other) ? -1 : (len_self > len_other) ? 1 : 0; } From buildbot at python.org Tue Aug 8 20:30:14 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 08 Aug 2006 18:30:14 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060808183014.5057F1E400E@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1043 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Tue Aug 8 20:50:14 2006 From: python-checkins at python.org (andrew.kuchling) Date: Tue, 8 Aug 2006 20:50:14 +0200 (CEST) Subject: [Python-checkins] r51147 - python/trunk/Doc/lib/libturtle.tex Message-ID: <20060808185014.CB4DF1E4005@bag.python.org> Author: andrew.kuchling Date: Tue Aug 8 20:50:14 2006 New Revision: 51147 Modified: python/trunk/Doc/lib/libturtle.tex Log: Reword paragraph to clarify Modified: python/trunk/Doc/lib/libturtle.tex ============================================================================== --- python/trunk/Doc/lib/libturtle.tex (original) +++ python/trunk/Doc/lib/libturtle.tex Tue Aug 8 20:50:14 2006 @@ -253,12 +253,13 @@ \subsection{Turtle, Pen and RawPen Objects \label{pen-rawpen-objects}} -\class{Turtle}, \class{Pen} and \class{RawPen} objects have all the -global functions described above, except for \function{demo()} as -methods, which manipulate the given pen. +Most of the global functions available in the module are also +available as methods of the \class{Turtle}, \class{Pen} and +\class{RawPen} classes, affecting only the state of the given pen. The only method which is more powerful as a method is -\function{degrees()}. +\function{degrees()}, which takes an optional argument letting +you specify the number of units corresponding to a full circle: \begin{methoddesc}{degrees}{\optional{fullcircle}} \var{fullcircle} is by default 360. This can cause the pen to have any From python-checkins at python.org Tue Aug 8 20:56:09 2006 From: python-checkins at python.org (andrew.kuchling) Date: Tue, 8 Aug 2006 20:56:09 +0200 (CEST) Subject: [Python-checkins] r51148 - python/trunk/Doc/whatsnew/whatsnew25.tex Message-ID: <20060808185609.282C61E4005@bag.python.org> Author: andrew.kuchling Date: Tue Aug 8 20:56:08 2006 New Revision: 51148 Modified: python/trunk/Doc/whatsnew/whatsnew25.tex Log: Move obmalloc item into C API section Modified: python/trunk/Doc/whatsnew/whatsnew25.tex ============================================================================== --- python/trunk/Doc/whatsnew/whatsnew25.tex (original) +++ python/trunk/Doc/whatsnew/whatsnew25.tex Tue Aug 8 20:56:08 2006 @@ -2219,8 +2219,8 @@ definition instead of \ctype{int}. See the earlier section~\ref{pep-353} for a discussion of this change. -\item The design of the bytecode compiler has changed a great deal, to -no longer generate bytecode by traversing the parse tree. Instead +\item The design of the bytecode compiler has changed a great deal, +no longer generating bytecode by traversing the parse tree. Instead the parse tree is converted to an abstract syntax tree (or AST), and it is the abstract syntax tree that's traversed to produce the bytecode. @@ -2261,6 +2261,32 @@ Armin Rigo, and Neil Schemenauer, plus the participants in a number of AST sprints at conferences such as PyCon. +\item Evan Jones's patch to obmalloc, first described in a talk +at PyCon DC 2005, was applied. Python 2.4 allocated small objects in +256K-sized arenas, but never freed arenas. With this patch, Python +will free arenas when they're empty. The net effect is that on some +platforms, when you allocate many objects, Python's memory usage may +actually drop when you delete them and the memory may be returned to +the operating system. (Implemented by Evan Jones, and reworked by Tim +Peters.) + +Note that this change means extension modules must be more careful +when allocating memory. Python's API has many different +functions for allocating memory that are grouped into families. For +example, \cfunction{PyMem_Malloc()}, \cfunction{PyMem_Realloc()}, and +\cfunction{PyMem_Free()} are one family that allocates raw memory, +while \cfunction{PyObject_Malloc()}, \cfunction{PyObject_Realloc()}, +and \cfunction{PyObject_Free()} are another family that's supposed to +be used for creating Python objects. + +Previously these different families all reduced to the platform's +\cfunction{malloc()} and \cfunction{free()} functions. This meant +it didn't matter if you got things wrong and allocated memory with the +\cfunction{PyMem} function but freed it with the \cfunction{PyObject} +function. With 2.5's changes to obmalloc, these families now do different +things and mismatches will probably result in a segfault. You should +carefully test your C extension modules with Python 2.5. + \item The built-in set types now have an official C API. Call \cfunction{PySet_New()} and \cfunction{PyFrozenSet_New()} to create a new set, \cfunction{PySet_Add()} and \cfunction{PySet_Discard()} to @@ -2347,32 +2373,6 @@ \begin{itemize} -\item Evan Jones's patch to obmalloc, first described in a talk -at PyCon DC 2005, was applied. Python 2.4 allocated small objects in -256K-sized arenas, but never freed arenas. With this patch, Python -will free arenas when they're empty. The net effect is that on some -platforms, when you allocate many objects, Python's memory usage may -actually drop when you delete them, and the memory may be returned to -the operating system. (Implemented by Evan Jones, and reworked by Tim -Peters.) - -Note that this change means extension modules need to be more careful -with how they allocate memory. Python's API has many different -functions for allocating memory that are grouped into families. For -example, \cfunction{PyMem_Malloc()}, \cfunction{PyMem_Realloc()}, and -\cfunction{PyMem_Free()} are one family that allocates raw memory, -while \cfunction{PyObject_Malloc()}, \cfunction{PyObject_Realloc()}, -and \cfunction{PyObject_Free()} are another family that's supposed to -be used for creating Python objects. - -Previously these different families all reduced to the platform's -\cfunction{malloc()} and \cfunction{free()} functions. This meant -it didn't matter if you got things wrong and allocated memory with the -\cfunction{PyMem} function but freed it with the \cfunction{PyObject} -function. With the obmalloc change, these families now do different -things, and mismatches will probably result in a segfault. You should -carefully test your C extension modules with Python 2.5. - \item Coverity, a company that markets a source code analysis tool called Prevent, provided the results of their examination of the Python source code. The analysis found about 60 bugs that @@ -2444,7 +2444,7 @@ article: Nick Coghlan, Phillip J. Eby, Lars Gust\"abel, Raymond Hettinger, Ralf W. Grosse-Kunstleve, Kent Johnson, Martin von~L\"owis, Fredrik Lundh, Andrew McNamara, Skip Montanaro, -Gustavo Niemeyer, James Pryor, Mike Rovner, Scott Weikart, Barry +Gustavo Niemeyer, Paul Prescod, James Pryor, Mike Rovner, Scott Weikart, Barry Warsaw, Thomas Wouters. \end{document} From python-checkins at python.org Tue Aug 8 21:00:14 2006 From: python-checkins at python.org (andrew.kuchling) Date: Tue, 8 Aug 2006 21:00:14 +0200 (CEST) Subject: [Python-checkins] r51149 - python/trunk/Doc/whatsnew/whatsnew25.tex Message-ID: <20060808190014.9C17C1E400C@bag.python.org> Author: andrew.kuchling Date: Tue Aug 8 21:00:14 2006 New Revision: 51149 Modified: python/trunk/Doc/whatsnew/whatsnew25.tex Log: 'Other changes' section now has only one item; move the item elsewhere and remove the section Modified: python/trunk/Doc/whatsnew/whatsnew25.tex ============================================================================== --- python/trunk/Doc/whatsnew/whatsnew25.tex (original) +++ python/trunk/Doc/whatsnew/whatsnew25.tex Tue Aug 8 21:00:14 2006 @@ -39,6 +39,12 @@ language feature or another; none of them are broad modifications to Python's semantics. +As well as the language and library additions, other improvements and +bugfixes were made throughout the source tree. A search through the +SVN change logs finds there were 334 patches applied and 443 bugs +fixed between Python 2.4 and 2.5. (Both figures are likely to be +underestimates.) + This article doesn't try to be a complete specification of the new features; instead changes are briefly introduced using helpful examples. For full details, you should always refer to the @@ -2214,6 +2220,13 @@ carried out by Martin von~L\"owis. The procedure was developed as \pep{347}. +\item Coverity, a company that markets a source code analysis tool +called Prevent, provided the results of their examination of the Python +source code. The analysis found about 60 bugs that +were quickly fixed. Many of the bugs were refcounting problems, often +occurring in error-handling code. See +\url{http://scan.coverity.com} for the statistics. + \item The largest change to the C API came from \pep{353}, which modifies the interpreter to use a \ctype{Py_ssize_t} type definition instead of \ctype{int}. See the earlier @@ -2362,28 +2375,6 @@ %====================================================================== -\section{Other Changes and Fixes \label{section-other}} - -As usual, there were a bunch of other improvements and bugfixes -scattered throughout the source tree. A search through the SVN change -logs finds there were 334 patches applied and 443 bugs fixed between -Python 2.4 and 2.5. Both figures are likely to be underestimates. - -Some of the more notable changes are: - -\begin{itemize} - -\item Coverity, a company that markets a source code analysis tool - called Prevent, provided the results of their examination of the Python - source code. The analysis found about 60 bugs that - were quickly fixed. Many of the bugs were refcounting problems, often - occurring in error-handling code. See - \url{http://scan.coverity.com} for the statistics. - -\end{itemize} - - -%====================================================================== \section{Porting to Python 2.5\label{porting}} This section lists previously described changes that may require From python-checkins at python.org Tue Aug 8 21:00:36 2006 From: python-checkins at python.org (andrew.kuchling) Date: Tue, 8 Aug 2006 21:00:36 +0200 (CEST) Subject: [Python-checkins] r51150 - python/trunk/Doc/whatsnew/whatsnew25.tex Message-ID: <20060808190036.36C711E4014@bag.python.org> Author: andrew.kuchling Date: Tue Aug 8 21:00:34 2006 New Revision: 51150 Modified: python/trunk/Doc/whatsnew/whatsnew25.tex Log: Bump version number Modified: python/trunk/Doc/whatsnew/whatsnew25.tex ============================================================================== --- python/trunk/Doc/whatsnew/whatsnew25.tex (original) +++ python/trunk/Doc/whatsnew/whatsnew25.tex Tue Aug 8 21:00:34 2006 @@ -6,7 +6,7 @@ % Count up the patches and bugs \title{What's New in Python 2.5} -\release{0.4} +\release{0.9} \author{A.M. Kuchling} \authoraddress{\email{amk at amk.ca}} From buildbot at python.org Tue Aug 8 21:07:29 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 08 Aug 2006 19:07:29 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 2.4 Message-ID: <20060808190729.AF0F71E4014@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%25202.4/builds/154 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From g.brandl at gmx.net Tue Aug 8 22:11:16 2006 From: g.brandl at gmx.net (Georg Brandl) Date: Tue, 08 Aug 2006 22:11:16 +0200 Subject: [Python-checkins] r51150 - python/trunk/Doc/whatsnew/whatsnew25.tex In-Reply-To: <20060808190036.36C711E4014@bag.python.org> References: <20060808190036.36C711E4014@bag.python.org> Message-ID: andrew.kuchling wrote: > Author: andrew.kuchling > Date: Tue Aug 8 21:00:34 2006 > New Revision: 51150 > > Modified: > python/trunk/Doc/whatsnew/whatsnew25.tex > Log: > Bump version number Andrew, could you have a look at http://python.org/sf/1534027? Should I provide you some description of the changes, and/or usage examples? Georg From python-checkins at python.org Tue Aug 8 22:11:26 2006 From: python-checkins at python.org (georg.brandl) Date: Tue, 8 Aug 2006 22:11:26 +0200 (CEST) Subject: [Python-checkins] r51151 - python/trunk/Doc/api/concrete.tex Message-ID: <20060808201126.26FEE1E4017@bag.python.org> Author: georg.brandl Date: Tue Aug 8 22:11:22 2006 New Revision: 51151 Modified: python/trunk/Doc/api/concrete.tex Log: Bug #1536828: typo: TypeType should have been StringType. Modified: python/trunk/Doc/api/concrete.tex ============================================================================== --- python/trunk/Doc/api/concrete.tex (original) +++ python/trunk/Doc/api/concrete.tex Tue Aug 8 22:11:22 2006 @@ -580,7 +580,7 @@ \begin{cvardesc}{PyTypeObject}{PyString_Type} This instance of \ctype{PyTypeObject} represents the Python string - type; it is the same object as \code{types.TypeType} in the Python + type; it is the same object as \code{types.StringType} in the Python layer. \withsubitem{(in module types)}{\ttindex{StringType}}. \end{cvardesc} From python-checkins at python.org Tue Aug 8 22:11:32 2006 From: python-checkins at python.org (georg.brandl) Date: Tue, 8 Aug 2006 22:11:32 +0200 (CEST) Subject: [Python-checkins] r51152 - python/branches/release24-maint/Doc/api/concrete.tex Message-ID: <20060808201132.1F2E41E4005@bag.python.org> Author: georg.brandl Date: Tue Aug 8 22:11:30 2006 New Revision: 51152 Modified: python/branches/release24-maint/Doc/api/concrete.tex Log: Bug #1536828: typo: TypeType should have been StringType. (backport from rev. 51151) Modified: python/branches/release24-maint/Doc/api/concrete.tex ============================================================================== --- python/branches/release24-maint/Doc/api/concrete.tex (original) +++ python/branches/release24-maint/Doc/api/concrete.tex Tue Aug 8 22:11:30 2006 @@ -558,7 +558,7 @@ \begin{cvardesc}{PyTypeObject}{PyString_Type} This instance of \ctype{PyTypeObject} represents the Python string - type; it is the same object as \code{types.TypeType} in the Python + type; it is the same object as \code{types.StringType} in the Python layer. \withsubitem{(in module types)}{\ttindex{StringType}}. \end{cvardesc} From python-checkins at python.org Tue Aug 8 22:13:13 2006 From: python-checkins at python.org (georg.brandl) Date: Tue, 8 Aug 2006 22:13:13 +0200 (CEST) Subject: [Python-checkins] r51153 - python/trunk/Doc/ref/ref2.tex Message-ID: <20060808201313.77D381E4005@bag.python.org> Author: georg.brandl Date: Tue Aug 8 22:13:13 2006 New Revision: 51153 Modified: python/trunk/Doc/ref/ref2.tex Log: Bug #1536660: separate two words. Modified: python/trunk/Doc/ref/ref2.tex ============================================================================== --- python/trunk/Doc/ref/ref2.tex (original) +++ python/trunk/Doc/ref/ref2.tex Tue Aug 8 22:13:13 2006 @@ -56,7 +56,7 @@ A physical line is a sequence of characters terminated by an end-of-line sequence. In source files, any of the standard platform line -termination sequences can be used - the \UNIX form using \ASCII{} LF +termination sequences can be used - the \UNIX{} form using \ASCII{} LF (linefeed), the Windows form using the \ASCII{} sequence CR LF (return followed by linefeed), or the Macintosh form using the \ASCII{} CR (return) character. All of these forms can be used equally, regardless From python-checkins at python.org Tue Aug 8 22:13:16 2006 From: python-checkins at python.org (georg.brandl) Date: Tue, 8 Aug 2006 22:13:16 +0200 (CEST) Subject: [Python-checkins] r51154 - python/branches/release24-maint/Doc/ref/ref2.tex Message-ID: <20060808201316.516311E4005@bag.python.org> Author: georg.brandl Date: Tue Aug 8 22:13:16 2006 New Revision: 51154 Modified: python/branches/release24-maint/Doc/ref/ref2.tex Log: Bug #1536660: separate two words. (backport from rev. 51153) Modified: python/branches/release24-maint/Doc/ref/ref2.tex ============================================================================== --- python/branches/release24-maint/Doc/ref/ref2.tex (original) +++ python/branches/release24-maint/Doc/ref/ref2.tex Tue Aug 8 22:13:16 2006 @@ -56,7 +56,7 @@ A physical line is a sequence of characters terminated by an end-of-line sequence. In source files, any of the standard platform line -termination sequences can be used - the \UNIX form using \ASCII{} LF +termination sequences can be used - the \UNIX{} form using \ASCII{} LF (linefeed), the Windows form using the \ASCII{} sequence CR LF (return followed by linefeed), or the Macintosh form using the \ASCII{} CR (return) character. All of these forms can be used equally, regardless From python-checkins at python.org Tue Aug 8 22:48:10 2006 From: python-checkins at python.org (georg.brandl) Date: Tue, 8 Aug 2006 22:48:10 +0200 (CEST) Subject: [Python-checkins] r51155 - python/trunk/Doc/api/concrete.tex Message-ID: <20060808204810.EDB831E4005@bag.python.org> Author: georg.brandl Date: Tue Aug 8 22:48:10 2006 New Revision: 51155 Modified: python/trunk/Doc/api/concrete.tex Log: ``str`` is now the same object as ``types.StringType``. Modified: python/trunk/Doc/api/concrete.tex ============================================================================== --- python/trunk/Doc/api/concrete.tex (original) +++ python/trunk/Doc/api/concrete.tex Tue Aug 8 22:48:10 2006 @@ -31,7 +31,7 @@ \begin{cvardesc}{PyObject*}{PyType_Type} This is the type object for type objects; it is the same object as - \code{types.TypeType} in the Python layer. + \code{type} and \code{types.TypeType} in the Python layer. \withsubitem{(in module types)}{\ttindex{TypeType}} \end{cvardesc} @@ -117,7 +117,8 @@ \begin{cvardesc}{PyTypeObject}{PyInt_Type} This instance of \ctype{PyTypeObject} represents the Python plain - integer type. This is the same object as \code{types.IntType}. + integer type. This is the same object as \code{int} and + \code{types.IntType}. \withsubitem{(in modules types)}{\ttindex{IntType}} \end{cvardesc} @@ -260,7 +261,8 @@ \begin{cvardesc}{PyTypeObject}{PyLong_Type} This instance of \ctype{PyTypeObject} represents the Python long - integer type. This is the same object as \code{types.LongType}. + integer type. This is the same object as \code{long} and + \code{types.LongType}. \withsubitem{(in modules types)}{\ttindex{LongType}} \end{cvardesc} @@ -411,7 +413,8 @@ \begin{cvardesc}{PyTypeObject}{PyFloat_Type} This instance of \ctype{PyTypeObject} represents the Python floating - point type. This is the same object as \code{types.FloatType}. + point type. This is the same object as \code{float} and + \code{types.FloatType}. \withsubitem{(in modules types)}{\ttindex{FloatType}} \end{cvardesc} @@ -520,7 +523,8 @@ \begin{cvardesc}{PyTypeObject}{PyComplex_Type} This instance of \ctype{PyTypeObject} represents the Python complex - number type. + number type. It is the same object as \code{complex} and + \code{types.ComplexType}. \end{cvardesc} \begin{cfuncdesc}{int}{PyComplex_Check}{PyObject *p} @@ -580,8 +584,8 @@ \begin{cvardesc}{PyTypeObject}{PyString_Type} This instance of \ctype{PyTypeObject} represents the Python string - type; it is the same object as \code{types.StringType} in the Python - layer. + type; it is the same object as \code{str} and \code{types.StringType} + in the Python layer. \withsubitem{(in module types)}{\ttindex{StringType}}. \end{cvardesc} @@ -850,7 +854,8 @@ \begin{cvardesc}{PyTypeObject}{PyUnicode_Type} This instance of \ctype{PyTypeObject} represents the Python Unicode - type. + type. It is exposed to Python code as \code{unicode} and + \code{types.UnicodeType}. \end{cvardesc} The following APIs are really C macros and can be used to do fast @@ -1623,8 +1628,9 @@ \begin{cvardesc}{PyTypeObject}{PyBuffer_Type} The instance of \ctype{PyTypeObject} which represents the Python - buffer type; it is the same object as \code{types.BufferType} in the - Python layer.\withsubitem{(in module types)}{\ttindex{BufferType}}. + buffer type; it is the same object as \code{buffer} and + \code{types.BufferType} in the Python layer. + \withsubitem{(in module types)}{\ttindex{BufferType}}. \end{cvardesc} \begin{cvardesc}{int}{Py_END_OF_BUFFER} @@ -1698,8 +1704,8 @@ \begin{cvardesc}{PyTypeObject}{PyTuple_Type} This instance of \ctype{PyTypeObject} represents the Python tuple - type; it is the same object as \code{types.TupleType} in the Python - layer.\withsubitem{(in module types)}{\ttindex{TupleType}}. + type; it is the same object as \code{tuple} and \code{types.TupleType} + in the Python layer.\withsubitem{(in module types)}{\ttindex{TupleType}}. \end{cvardesc} \begin{cfuncdesc}{int}{PyTuple_Check}{PyObject *p} @@ -1795,8 +1801,8 @@ \begin{cvardesc}{PyTypeObject}{PyList_Type} This instance of \ctype{PyTypeObject} represents the Python list - type. This is the same object as \code{types.ListType}. - \withsubitem{(in module types)}{\ttindex{ListType}} + type. This is the same object as \code{list} and \code{types.ListType} + in the Python layer.\withsubitem{(in module types)}{\ttindex{ListType}} \end{cvardesc} \begin{cfuncdesc}{int}{PyList_Check}{PyObject *p} @@ -1924,7 +1930,7 @@ \begin{cvardesc}{PyTypeObject}{PyDict_Type} This instance of \ctype{PyTypeObject} represents the Python dictionary type. This is exposed to Python programs as - \code{types.DictType} and \code{types.DictionaryType}. + \code{dict} and \code{types.DictType}. \withsubitem{(in module types)}{\ttindex{DictType}\ttindex{DictionaryType}} \end{cvardesc} @@ -2139,7 +2145,8 @@ \begin{cvardesc}{PyTypeObject}{PyFile_Type} This instance of \ctype{PyTypeObject} represents the Python file - type. This is exposed to Python programs as \code{types.FileType}. + type. This is exposed to Python programs as \code{file} and + \code{types.FileType}. \withsubitem{(in module types)}{\ttindex{FileType}} \end{cvardesc} @@ -2588,7 +2595,7 @@ \begin{cvardesc}{PyTypeObject}{PySlice_Type} The type object for slice objects. This is the same as - \code{types.SliceType}. + \code{slice} and \code{types.SliceType}. \withsubitem{(in module types)}{\ttindex{SliceType}} \end{cvardesc} From buildbot at python.org Tue Aug 8 23:22:40 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 08 Aug 2006 21:22:40 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian 2.4 Message-ID: <20060808212240.72C4E1E4005@bag.python.org> The Buildbot has detected a new failure of alpha Debian 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%25202.4/builds/5 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 9 02:52:26 2006 From: python-checkins at python.org (tim.peters) Date: Wed, 9 Aug 2006 02:52:26 +0200 (CEST) Subject: [Python-checkins] r51156 - python/trunk/Lib/test/test_builtin.py Message-ID: <20060809005226.B56CD1E4005@bag.python.org> Author: tim.peters Date: Wed Aug 9 02:52:26 2006 New Revision: 51156 Modified: python/trunk/Lib/test/test_builtin.py Log: Whitespace normalization. Modified: python/trunk/Lib/test/test_builtin.py ============================================================================== --- python/trunk/Lib/test/test_builtin.py (original) +++ python/trunk/Lib/test/test_builtin.py Wed Aug 9 02:52:26 2006 @@ -1432,7 +1432,7 @@ self.assertEqual(input('testing\n'), 2) self.assertEqual(raw_input(), 'The quick brown fox jumps over the lazy dog.') self.assertEqual(raw_input('testing\n'), 'Dear John') - + # SF 1535165: don't segfault on closed stdin # sys.stdout must be a regular file for triggering sys.stdout = savestdout From buildbot at python.org Wed Aug 9 03:58:19 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 09 Aug 2006 01:58:19 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) trunk Message-ID: <20060809015819.902761E4005@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%2520trunk/builds/885 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,georg.brandl,tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 9 08:52:39 2006 From: python-checkins at python.org (georg.brandl) Date: Wed, 9 Aug 2006 08:52:39 +0200 (CEST) Subject: [Python-checkins] r51157 - peps/trunk/pep-0356.txt Message-ID: <20060809065239.6EBF71E4007@bag.python.org> Author: georg.brandl Date: Wed Aug 9 08:52:38 2006 New Revision: 51157 Modified: peps/trunk/pep-0356.txt Log: This bug is now mostly fixed; what remains is such a very unlikely chance of a crash that it doesn't prevent a release anymore. Modified: peps/trunk/pep-0356.txt ============================================================================== --- peps/trunk/pep-0356.txt (original) +++ peps/trunk/pep-0356.txt Wed Aug 9 08:52:38 2006 @@ -157,8 +157,6 @@ - Bugs that ought to be resolved before release (all exist in 2.4): http://python.org/sf/1526585 - SystemError concat long strings - http://python.org/sf/1523610 - PyArg_ParseTupleAndKeywords potential - core dump http://python.org/sf/1475523 - gettext.py bug (owner: Martin v. Loewis) http://python.org/sf/1467929 - %-formatting and dicts From python-checkins at python.org Wed Aug 9 09:03:24 2006 From: python-checkins at python.org (georg.brandl) Date: Wed, 9 Aug 2006 09:03:24 +0200 (CEST) Subject: [Python-checkins] r51158 - python/trunk/Python/getargs.c Message-ID: <20060809070324.801B21E4007@bag.python.org> Author: georg.brandl Date: Wed Aug 9 09:03:22 2006 New Revision: 51158 Modified: python/trunk/Python/getargs.c Log: Introduce an upper bound on tuple nesting depth in C argument format strings; fixes rest of #1523610. Modified: python/trunk/Python/getargs.c ============================================================================== --- python/trunk/Python/getargs.c (original) +++ python/trunk/Python/getargs.c Wed Aug 9 09:03:22 2006 @@ -206,6 +206,9 @@ if (level == 0) max++; level++; + if (level >= 30) + Py_FatalError("too many tuple nesting levels " + "in argument format string"); break; case ')': if (level == 0) From python-checkins at python.org Wed Aug 9 09:15:30 2006 From: python-checkins at python.org (georg.brandl) Date: Wed, 9 Aug 2006 09:15:30 +0200 (CEST) Subject: [Python-checkins] r51159 - in python/branches/release24-maint: Lib/test/test_getargs2.py Modules/_testcapimodule.c Python/getargs.c Message-ID: <20060809071530.9F13C1E4007@bag.python.org> Author: georg.brandl Date: Wed Aug 9 09:15:29 2006 New Revision: 51159 Modified: python/branches/release24-maint/Lib/test/test_getargs2.py python/branches/release24-maint/Modules/_testcapimodule.c python/branches/release24-maint/Python/getargs.c Log: Backport fixes for #1523610 (crashes in PyArg_ParseTuple): rev. 51158 and rev. 50843. Modified: python/branches/release24-maint/Lib/test/test_getargs2.py ============================================================================== --- python/branches/release24-maint/Lib/test/test_getargs2.py (original) +++ python/branches/release24-maint/Lib/test/test_getargs2.py Wed Aug 9 09:15:29 2006 @@ -216,8 +216,25 @@ self.failUnlessEqual(VERY_LARGE & ULLONG_MAX, getargs_K(VERY_LARGE)) + +class Tuple_TestCase(unittest.TestCase): + def test_tuple(self): + from _testcapi import getargs_tuple + + ret = getargs_tuple(1, (2, 3)) + self.assertEquals(ret, (1,2,3)) + + # make sure invalid tuple arguments are handled correctly + class seq: + def __len__(self): + return 2 + def __getitem__(self, n): + raise ValueError + self.assertRaises(TypeError, getargs_tuple, 1, seq()) + + def test_main(): - tests = [Signed_TestCase, Unsigned_TestCase] + tests = [Signed_TestCase, Unsigned_TestCase, Tuple_TestCase] try: from _testcapi import getargs_L, getargs_K except ImportError: Modified: python/branches/release24-maint/Modules/_testcapimodule.c ============================================================================== --- python/branches/release24-maint/Modules/_testcapimodule.c (original) +++ python/branches/release24-maint/Modules/_testcapimodule.c Wed Aug 9 09:15:29 2006 @@ -294,6 +294,16 @@ #endif /* ifdef HAVE_LONG_LONG */ +/* Test tuple argument processing */ +static PyObject * +getargs_tuple(PyObject *self, PyObject *args) +{ + int a, b, c; + if (!PyArg_ParseTuple(args, "i(ii)", &a, &b, &c)) + return NULL; + return Py_BuildValue("iii", a, b, c); +} + /* Functions to call PyArg_ParseTuple with integer format codes, and return the result. */ @@ -804,6 +814,7 @@ {"test_k_code", (PyCFunction)test_k_code, METH_NOARGS}, {"test_null_strings", (PyCFunction)test_null_strings, METH_NOARGS}, + {"getargs_tuple", (PyCFunction)getargs_tuple, METH_VARARGS}, {"getargs_b", (PyCFunction)getargs_b, METH_VARARGS}, {"getargs_B", (PyCFunction)getargs_B, METH_VARARGS}, {"getargs_H", (PyCFunction)getargs_H, METH_VARARGS}, Modified: python/branches/release24-maint/Python/getargs.c ============================================================================== --- python/branches/release24-maint/Python/getargs.c (original) +++ python/branches/release24-maint/Python/getargs.c Wed Aug 9 09:15:29 2006 @@ -144,6 +144,9 @@ if (level == 0) max++; level++; + if (level >= 30) + Py_FatalError("too many tuple nesting levels " + "in argument format string"); break; case ')': if (level == 0) @@ -287,8 +290,8 @@ "argument %d", iarg); i = 0; p += strlen(p); - while (levels[i] > 0 && (int)(p-buf) < 220) { - PyOS_snprintf(p, sizeof(buf) - (buf - p), + while (levels[i] > 0 && i < 32 && (int)(p-buf) < 220) { + PyOS_snprintf(p, sizeof(buf) - (p - buf), ", item %d", levels[i]-1); p += strlen(p); i++; @@ -374,6 +377,13 @@ char *msg; PyObject *item; item = PySequence_GetItem(arg, i); + if (item == NULL) { + PyErr_Clear(); + levels[0] = i+1; + levels[1] = 0; + strncpy(msgbuf, "is not retrievable", bufsize); + return msgbuf; + } msg = convertitem(item, &format, p_va, levels+1, msgbuf, bufsize, freelist); /* PySequence_GetItem calls tp->sq_item, which INCREFs */ @@ -1361,6 +1371,7 @@ else { msg = skipitem(&format, p_va); if (msg) { + levels[0] = 0; seterror(i+1, msg, levels, fname, message); return cleanreturn(0, freelist); } From python-checkins at python.org Wed Aug 9 09:57:42 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 9 Aug 2006 09:57:42 +0200 (CEST) Subject: [Python-checkins] r51160 - in python/trunk: Doc/ref/ref3.tex Lib/test/test_builtin.py Misc/NEWS Objects/classobject.c Objects/typeobject.c Message-ID: <20060809075742.2E29A1E4009@bag.python.org> Author: martin.v.loewis Date: Wed Aug 9 09:57:39 2006 New Revision: 51160 Modified: python/trunk/Doc/ref/ref3.tex python/trunk/Lib/test/test_builtin.py python/trunk/Misc/NEWS python/trunk/Objects/classobject.c python/trunk/Objects/typeobject.c Log: __hash__ may now return long int; the final hash value is obtained by invoking hash on the long int. Fixes #1536021. Modified: python/trunk/Doc/ref/ref3.tex ============================================================================== --- python/trunk/Doc/ref/ref3.tex (original) +++ python/trunk/Doc/ref/ref3.tex Wed Aug 9 09:57:39 2006 @@ -1307,6 +1307,11 @@ since the dictionary implementation requires that a key's hash value is immutable (if the object's hash value changes, it will be in the wrong hash bucket). + +\versionchanged[\method{__hash__()} may now also return a long +integer object; the 32-bit integer is then derived from the hash +of that object]{2.5} + \withsubitem{(object method)}{\ttindex{__cmp__()}} \end{methoddesc} Modified: python/trunk/Lib/test/test_builtin.py ============================================================================== --- python/trunk/Lib/test/test_builtin.py (original) +++ python/trunk/Lib/test/test_builtin.py Wed Aug 9 09:57:39 2006 @@ -640,6 +640,15 @@ def f(): pass self.assertRaises(TypeError, hash, []) self.assertRaises(TypeError, hash, {}) + # Bug 1536021: Allow hash to return long objects + class X: + def __hash__(self): + return 2**100 + self.assertEquals(type(hash(X())), int) + class Y(object): + def __hash__(self): + return 2**100 + self.assertEquals(type(hash(Y())), int) def test_hex(self): self.assertEqual(hex(16), '0x10') Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 9 09:57:39 2006 @@ -12,6 +12,9 @@ Core and builtins ----------------- +- Bug #1536021: __hash__ may now return long int; the final hash + value is obtained by invoking hash on the long int. + - Bug #1536786: buffer comparison could emit a RuntimeWarning. - Bug #1535165: fixed a segfault in input() and raw_input() when Modified: python/trunk/Objects/classobject.c ============================================================================== --- python/trunk/Objects/classobject.c (original) +++ python/trunk/Objects/classobject.c Wed Aug 9 09:57:39 2006 @@ -934,11 +934,9 @@ Py_DECREF(func); if (res == NULL) return -1; - if (PyInt_Check(res)) { - outcome = PyInt_AsLong(res); - if (outcome == -1) - outcome = -2; - } + if (PyInt_Check(res) || PyLong_Check(res)) + /* This already converts a -1 result to -2. */ + outcome = res->ob_type->tp_hash(res); else { PyErr_SetString(PyExc_TypeError, "__hash__() should return an int"); Modified: python/trunk/Objects/typeobject.c ============================================================================== --- python/trunk/Objects/typeobject.c (original) +++ python/trunk/Objects/typeobject.c Wed Aug 9 09:57:39 2006 @@ -4559,7 +4559,10 @@ Py_DECREF(func); if (res == NULL) return -1; - h = PyInt_AsLong(res); + if (PyLong_Check(res)) + h = res->ob_type->tp_hash(res); + else + h = PyInt_AsLong(res); Py_DECREF(res); } else { From buildbot at python.org Wed Aug 9 10:57:27 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 09 Aug 2006 08:57:27 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) 2.4 Message-ID: <20060809085727.87C0B1E4007@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%25202.4/builds/130 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 9 11:53:54 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 9 Aug 2006 11:53:54 +0200 (CEST) Subject: [Python-checkins] r51161 - external/openssl-0.9.8a/CHANGES external/openssl-0.9.8a/Configure Message-ID: <20060809095354.E3D981E4007@bag.python.org> Author: martin.v.loewis Date: Wed Aug 9 11:53:53 2006 New Revision: 51161 Modified: external/openssl-0.9.8a/CHANGES external/openssl-0.9.8a/Configure Log: Disable IDEA because it's patented. Modified: external/openssl-0.9.8a/CHANGES ============================================================================== --- external/openssl-0.9.8a/CHANGES (original) +++ external/openssl-0.9.8a/CHANGES Wed Aug 9 11:53:53 2006 @@ -2,6 +2,10 @@ OpenSSL CHANGES _______________ + Changes in the version on svn.python.org + + *) Disable IDEA because it's patented. + Changes between 0.9.8 and 0.9.8a [11 Oct 2005] *) Remove the functionality of SSL_OP_MSIE_SSLV2_RSA_PADDING Modified: external/openssl-0.9.8a/Configure ============================================================================== --- external/openssl-0.9.8a/Configure (original) +++ external/openssl-0.9.8a/Configure Wed Aug 9 11:53:53 2006 @@ -604,7 +604,8 @@ "rc5" => "default", "shared" => "default", "zlib" => "default", - "zlib-dynamic" => "default" + "zlib-dynamic" => "default", + "idea" => "patented" ); # Additional "no-..." options will be collected in %disabled. From buildbot at python.org Wed Aug 9 12:09:10 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 09 Aug 2006 10:09:10 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) trunk Message-ID: <20060809100910.9714A1E4007@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%2520trunk/builds/887 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 9 15:03:42 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 9 Aug 2006 15:03:42 +0200 (CEST) Subject: [Python-checkins] r51168 - python/trunk/Doc/whatsnew/whatsnew25.tex Message-ID: <20060809130342.21A3F1E4007@bag.python.org> Author: andrew.kuchling Date: Wed Aug 9 15:03:41 2006 New Revision: 51168 Modified: python/trunk/Doc/whatsnew/whatsnew25.tex Log: [Bug #1536021] Mention __hash__ change Modified: python/trunk/Doc/whatsnew/whatsnew25.tex ============================================================================== --- python/trunk/Doc/whatsnew/whatsnew25.tex (original) +++ python/trunk/Doc/whatsnew/whatsnew25.tex Wed Aug 9 15:03:41 2006 @@ -3,7 +3,6 @@ % $Id$ % Fix XXX comments -% Count up the patches and bugs \title{What's New in Python 2.5} \release{0.9} @@ -1100,10 +1099,10 @@ \item Both 8-bit and Unicode strings have new \method{partition(sep)} and \method{rpartition(sep)} methods that simplify a common use case. + The \method{find(S)} method is often used to get an index which is then used to slice the string and obtain the pieces that are before and after the separator. - \method{partition(sep)} condenses this pattern into a single method call that returns a 3-tuple containing the substring before the separator, the separator itself, and the @@ -1165,6 +1164,15 @@ all of the values returned by the iterator evaluate as true. (Suggested by Guido van~Rossum, and implemented by Raymond Hettinger.) +\item The result of a class's \method{__hash__()} method can now +be either a long integer or a regular integer. If a long integer is +returned, the hash of that value is taken. In earlier versions the +hash value was required to be a regular integer, but in 2.5 the +\function{id()} built-in was changed to always return non-negative +numbers, and users often seem to use \code{id(self)} in +\method{__hash__()} methods (though this is discouraged). +% Bug #1536021 + \item ASCII is now the default encoding for modules. It's now a syntax error if a module contains string literals with 8-bit characters but doesn't have an encoding declaration. In Python 2.4 From python-checkins at python.org Wed Aug 9 15:57:05 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 9 Aug 2006 15:57:05 +0200 (CEST) Subject: [Python-checkins] r51169 - python/trunk/Doc/whatsnew/whatsnew25.tex Message-ID: <20060809135705.E14C61E4007@bag.python.org> Author: andrew.kuchling Date: Wed Aug 9 15:57:05 2006 New Revision: 51169 Modified: python/trunk/Doc/whatsnew/whatsnew25.tex Log: [Patch #1534027] Add notes on locale module changes Modified: python/trunk/Doc/whatsnew/whatsnew25.tex ============================================================================== --- python/trunk/Doc/whatsnew/whatsnew25.tex (original) +++ python/trunk/Doc/whatsnew/whatsnew25.tex Wed Aug 9 15:57:05 2006 @@ -1503,6 +1503,29 @@ (Contributed by Raymond Hettinger.) +\item The \function{format()} function in the \module{locale} module +has been modified and two new functions were added, +\function{format_string()} and \function{currency()}. + +The \function{format()} function's \var{val} parameter could +previously be a string as long as no more than one \%char specifier +appeared; now the parameter must be exactly one \%char specifier with +no surrounding text. An optional \var{monetary} parameter was also +added which, if \code{True}, will use the locale's rules for +formatting currency in placing a separator between groups of three +digits. + +To format strings with multiple \%char specifiers, use the new +\function{format_string()} function that works like \function{format()} +but also supports mixing \%char specifiers with +arbitrary text. + +A new \function{currency()} function was also added that formats a +number according to the current locale's settings. + +(Contributed by Georg Brandl.) +% Patch 1180296 + \item The \module{mailbox} module underwent a massive rewrite to add the capability to modify mailboxes in addition to reading them. A new set of classes that include \class{mbox}, \class{MH}, and @@ -2405,6 +2428,12 @@ input should be split into lines in a manner which preserves the newline characters. +\item Library: the \module{locale} module's +\function{format()} function's would previously +accept any string as long as no more than one \%char specifier +appeared. In Python 2.5, the argument must be exactly one \%char +specifier with no surrounding text. + \item Library: The \module{pickle} and \module{cPickle} modules no longer accept a return value of \code{None} from the \method{__reduce__()} method; the method must return a tuple of @@ -2440,10 +2469,10 @@ The author would like to thank the following people for offering suggestions, corrections and assistance with various drafts of this -article: Nick Coghlan, Phillip J. Eby, Lars Gust\"abel, Raymond Hettinger, Ralf -W. Grosse-Kunstleve, Kent Johnson, Martin von~L\"owis, Fredrik Lundh, -Andrew McNamara, Skip Montanaro, -Gustavo Niemeyer, Paul Prescod, James Pryor, Mike Rovner, Scott Weikart, Barry -Warsaw, Thomas Wouters. +article: Georg Brandl, Nick Coghlan, Phillip J. Eby, Lars Gust\"abel, +Raymond Hettinger, Ralf W. Grosse-Kunstleve, Kent Johnson, Iain Lowe, +Martin von~L\"owis, Fredrik Lundh, Andrew McNamara, Skip Montanaro, +Gustavo Niemeyer, Paul Prescod, James Pryor, Mike Rovner, Scott +Weikart, Barry Warsaw, Thomas Wouters. \end{document} From python-checkins at python.org Wed Aug 9 16:05:36 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 9 Aug 2006 16:05:36 +0200 (CEST) Subject: [Python-checkins] r51170 - python/trunk/Doc/howto/sockets.tex Message-ID: <20060809140536.0A47C1E4007@bag.python.org> Author: andrew.kuchling Date: Wed Aug 9 16:05:35 2006 New Revision: 51170 Modified: python/trunk/Doc/howto/sockets.tex Log: Add missing 'self' parameters Modified: python/trunk/Doc/howto/sockets.tex ============================================================================== --- python/trunk/Doc/howto/sockets.tex (original) +++ python/trunk/Doc/howto/sockets.tex Wed Aug 9 16:05:35 2006 @@ -222,9 +222,11 @@ socket.AF_INET, socket.SOCK_STREAM) else: self.sock = sock - def connect(host, port): + + def connect(self, host, port): self.sock.connect((host, port)) - def mysend(msg): + + def mysend(self, msg): totalsent = 0 while totalsent < MSGLEN: sent = self.sock.send(msg[totalsent:]) @@ -232,7 +234,8 @@ raise RuntimeError, \\ "socket connection broken" totalsent = totalsent + sent - def myreceive(): + + def myreceive(self): msg = '' while len(msg) < MSGLEN: chunk = self.sock.recv(MSGLEN-len(msg)) From python-checkins at python.org Wed Aug 9 16:06:19 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 9 Aug 2006 16:06:19 +0200 (CEST) Subject: [Python-checkins] r51171 - python/trunk/Doc/howto/sockets.tex Message-ID: <20060809140619.81E1C1E4007@bag.python.org> Author: andrew.kuchling Date: Wed Aug 9 16:06:19 2006 New Revision: 51171 Modified: python/trunk/Doc/howto/sockets.tex Log: Reindent code Modified: python/trunk/Doc/howto/sockets.tex ============================================================================== --- python/trunk/Doc/howto/sockets.tex (original) +++ python/trunk/Doc/howto/sockets.tex Wed Aug 9 16:06:19 2006 @@ -213,37 +213,39 @@ is a fixed length message: \begin{verbatim} - class mysocket: - '''demonstration class only - - coded for clarity, not efficiency''' - def __init__(self, sock=None): - if sock is None: - self.sock = socket.socket( - socket.AF_INET, socket.SOCK_STREAM) - else: - self.sock = sock - - def connect(self, host, port): - self.sock.connect((host, port)) - - def mysend(self, msg): - totalsent = 0 - while totalsent < MSGLEN: - sent = self.sock.send(msg[totalsent:]) - if sent == 0: - raise RuntimeError, \\ - "socket connection broken" - totalsent = totalsent + sent - - def myreceive(self): - msg = '' - while len(msg) < MSGLEN: - chunk = self.sock.recv(MSGLEN-len(msg)) - if chunk == '': - raise RuntimeError, \\ - "socket connection broken" - msg = msg + chunk - return msg +class mysocket: + '''demonstration class only + - coded for clarity, not efficiency + ''' + + def __init__(self, sock=None): + if sock is None: + self.sock = socket.socket( + socket.AF_INET, socket.SOCK_STREAM) + else: + self.sock = sock + + def connect(self, host, port): + self.sock.connect((host, port)) + + def mysend(self, msg): + totalsent = 0 + while totalsent < MSGLEN: + sent = self.sock.send(msg[totalsent:]) + if sent == 0: + raise RuntimeError, \\ + "socket connection broken" + totalsent = totalsent + sent + + def myreceive(self): + msg = '' + while len(msg) < MSGLEN: + chunk = self.sock.recv(MSGLEN-len(msg)) + if chunk == '': + raise RuntimeError, \\ + "socket connection broken" + msg = msg + chunk + return msg \end{verbatim} The sending code here is usable for almost any messaging scheme - in From theller at python.net Wed Aug 9 16:43:37 2006 From: theller at python.net (Thomas Heller) Date: Wed, 09 Aug 2006 16:43:37 +0200 Subject: [Python-checkins] r51113 - in python/trunk: Misc/NEWS setup.py In-Reply-To: <44D72424.8030708@v.loewis.de> References: <20060804185735.77EAD1E4003@bag.python.org> <44D72424.8030708@v.loewis.de> Message-ID: Martin v. L?wis schrieb: > thomas.heller schrieb: >> Fix #1530448 - fix ctypes build failure on solaris 10. >> >> The '-mimpure-text' linker flag is required when linking _ctypes.so. > > This is probably not the full truth. -mimpure-text is only supported > in gcc, so this won't work with the system compiler > (SunPro/Forte/Whatever). Also, usage of -mimpure-text typically just > hides some other, deeper problem. For C code, it indicates that > -fPIC/-KPIC was missing somewhere. IIRC, this problem originated from > assembler code, and I'm uncertain what the right fix is. > > Anyway, this is probably an improvement, so it should stay until > somebody comes along with a real solution. I suggest you add something like this text to setup.py, where the '-mimpure-text' flag is used. Thanks, Thomas From python-checkins at python.org Wed Aug 9 16:55:27 2006 From: python-checkins at python.org (armin.rigo) Date: Wed, 9 Aug 2006 16:55:27 +0200 (CEST) Subject: [Python-checkins] r51172 - in python/trunk: Lib/test/test_builtin.py Objects/typeobject.c Message-ID: <20060809145527.307D61E4007@bag.python.org> Author: armin.rigo Date: Wed Aug 9 16:55:26 2006 New Revision: 51172 Modified: python/trunk/Lib/test/test_builtin.py python/trunk/Objects/typeobject.c Log: Fix and test for an infinite C recursion. Modified: python/trunk/Lib/test/test_builtin.py ============================================================================== --- python/trunk/Lib/test/test_builtin.py (original) +++ python/trunk/Lib/test/test_builtin.py Wed Aug 9 16:55:26 2006 @@ -649,6 +649,10 @@ def __hash__(self): return 2**100 self.assertEquals(type(hash(Y())), int) + class Z(long): + def __hash__(self): + return self + self.assertEquals(hash(Z(42)), hash(42L)) def test_hex(self): self.assertEqual(hex(16), '0x10') Modified: python/trunk/Objects/typeobject.c ============================================================================== --- python/trunk/Objects/typeobject.c (original) +++ python/trunk/Objects/typeobject.c Wed Aug 9 16:55:26 2006 @@ -4560,7 +4560,7 @@ if (res == NULL) return -1; if (PyLong_Check(res)) - h = res->ob_type->tp_hash(res); + h = PyLong_Type.tp_hash(res); else h = PyInt_AsLong(res); Py_DECREF(res); From python-checkins at python.org Wed Aug 9 16:56:34 2006 From: python-checkins at python.org (ronald.oussoren) Date: Wed, 9 Aug 2006 16:56:34 +0200 (CEST) Subject: [Python-checkins] r51173 - python/trunk/configure python/trunk/configure.in Message-ID: <20060809145634.70F671E400D@bag.python.org> Author: ronald.oussoren Date: Wed Aug 9 16:56:33 2006 New Revision: 51173 Modified: python/trunk/configure python/trunk/configure.in Log: It's unlikely that future versions will require _POSIX_C_SOURCE Modified: python/trunk/configure ============================================================================== --- python/trunk/configure (original) +++ python/trunk/configure Wed Aug 9 16:56:33 2006 @@ -1588,7 +1588,7 @@ # disables platform specific features beyond repair. # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE # has no effect, don't bother defining them - Darwin/[78].*) + Darwin/[789].*) define_xopen_source=no ;; Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Wed Aug 9 16:56:33 2006 @@ -236,7 +236,7 @@ # disables platform specific features beyond repair. # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE # has no effect, don't bother defining them - Darwin/@<:@78@:>@.*) + Darwin/@<:@789@:>@.*) define_xopen_source=no ;; From buildbot at python.org Wed Aug 9 17:19:35 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 09 Aug 2006 15:19:35 +0000 Subject: [Python-checkins] buildbot warnings in x86 cygwin trunk Message-ID: <20060809151935.CBF561E4007@bag.python.org> The Buildbot has detected a new failure of x86 cygwin trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520cygwin%2520trunk/builds/1082 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,armin.rigo,ronald.oussoren Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Wed Aug 9 17:22:38 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 09 Aug 2006 15:22:38 +0000 Subject: [Python-checkins] buildbot warnings in x86 gentoo trunk Message-ID: <20060809152238.CD1571E4011@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520gentoo%2520trunk/builds/1471 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,armin.rigo,ronald.oussoren Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 9 17:37:27 2006 From: python-checkins at python.org (armin.rigo) Date: Wed, 9 Aug 2006 17:37:27 +0200 (CEST) Subject: [Python-checkins] r51178 - in python/trunk: Lib/test/regrtest.py Lib/test/test_bigaddrspace.py Lib/test/test_support.py Python/ceval.c Message-ID: <20060809153727.13AA61E4007@bag.python.org> Author: armin.rigo Date: Wed Aug 9 17:37:26 2006 New Revision: 51178 Added: python/trunk/Lib/test/test_bigaddrspace.py Modified: python/trunk/Lib/test/regrtest.py python/trunk/Lib/test/test_support.py python/trunk/Python/ceval.c Log: Concatenation on a long string breaks (SF #1526585). Modified: python/trunk/Lib/test/regrtest.py ============================================================================== --- python/trunk/Lib/test/regrtest.py (original) +++ python/trunk/Lib/test/regrtest.py Wed Aug 9 17:37:26 2006 @@ -66,7 +66,9 @@ -M runs tests that require an exorbitant amount of memory. These tests typically try to ascertain containers keep working when containing more than -2 bilion objects, and only work on 64-bit systems. The passed-in memlimit, +2 billion objects, which only works on 64-bit systems. There are also some +tests that try to exhaust the address space of the process, which only makes +sense on 32-bit systems with at least 2Gb of memory. The passed-in memlimit, which is a string in the form of '2.5Gb', determines howmuch memory the tests will limit themselves to (but they may go slightly over.) The number shouldn't be more memory than the machine has (including swap memory). You Added: python/trunk/Lib/test/test_bigaddrspace.py ============================================================================== --- (empty file) +++ python/trunk/Lib/test/test_bigaddrspace.py Wed Aug 9 17:37:26 2006 @@ -0,0 +1,46 @@ +from test import test_support +from test.test_support import bigaddrspacetest, MAX_Py_ssize_t + +import unittest +import operator +import sys + + +class StrTest(unittest.TestCase): + + @bigaddrspacetest + def test_concat(self): + s1 = 'x' * MAX_Py_ssize_t + self.assertRaises(OverflowError, operator.add, s1, '?') + + @bigaddrspacetest + def test_optimized_concat(self): + x = 'x' * MAX_Py_ssize_t + try: + x = x + '?' # this statement uses a fast path in ceval.c + except OverflowError: + pass + else: + self.fail("should have raised OverflowError") + try: + x += '?' # this statement uses a fast path in ceval.c + except OverflowError: + pass + else: + self.fail("should have raised OverflowError") + self.assertEquals(len(x), MAX_Py_ssize_t) + + ### the following test is pending a patch + # (http://mail.python.org/pipermail/python-dev/2006-July/067774.html) + #@bigaddrspacetest + #def test_repeat(self): + # self.assertRaises(OverflowError, operator.mul, 'x', MAX_Py_ssize_t + 1) + + +def test_main(): + test_support.run_unittest(StrTest) + +if __name__ == '__main__': + if len(sys.argv) > 1: + test_support.set_memlimit(sys.argv[1]) + test_main() Modified: python/trunk/Lib/test/test_support.py ============================================================================== --- python/trunk/Lib/test/test_support.py (original) +++ python/trunk/Lib/test/test_support.py Wed Aug 9 17:37:26 2006 @@ -314,6 +314,12 @@ _1G = 1024 * _1M _2G = 2 * _1G +# Hack to get at the maximum value an internal index can take. +class _Dummy: + def __getslice__(self, i, j): + return j +MAX_Py_ssize_t = _Dummy()[:] + def set_memlimit(limit): import re global max_memuse @@ -328,7 +334,9 @@ if m is None: raise ValueError('Invalid memory limit %r' % (limit,)) memlimit = int(float(m.group(1)) * sizes[m.group(3).lower()]) - if memlimit < 2.5*_1G: + if memlimit > MAX_Py_ssize_t: + memlimit = MAX_Py_ssize_t + if memlimit < _2G - 1: raise ValueError('Memory limit %r too low to be useful' % (limit,)) max_memuse = memlimit @@ -371,6 +379,17 @@ return wrapper return decorator +def bigaddrspacetest(f): + """Decorator for tests that fill the address space.""" + def wrapper(self): + if max_memuse < MAX_Py_ssize_t: + if verbose: + sys.stderr.write("Skipping %s because of memory " + "constraint\n" % (f.__name__,)) + else: + return f(self) + return wrapper + #======================================================================= # Preliminary PyUNIT integration. Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Wed Aug 9 17:37:26 2006 @@ -4225,6 +4225,14 @@ { /* This function implements 'variable += expr' when both arguments are strings. */ + Py_ssize_t v_len = PyString_GET_SIZE(v); + Py_ssize_t w_len = PyString_GET_SIZE(w); + Py_ssize_t new_len = v_len + w_len; + if (new_len < 0) { + PyErr_SetString(PyExc_OverflowError, + "strings are too large to concat"); + return NULL; + } if (v->ob_refcnt == 2) { /* In the common case, there are 2 references to the value @@ -4269,9 +4277,7 @@ /* Now we own the last reference to 'v', so we can resize it * in-place. */ - Py_ssize_t v_len = PyString_GET_SIZE(v); - Py_ssize_t w_len = PyString_GET_SIZE(w); - if (_PyString_Resize(&v, v_len + w_len) != 0) { + if (_PyString_Resize(&v, new_len) != 0) { /* XXX if _PyString_Resize() fails, 'v' has been * deallocated so it cannot be put back into 'variable'. * The MemoryError is raised when there is no value in From python-checkins at python.org Wed Aug 9 17:43:13 2006 From: python-checkins at python.org (armin.rigo) Date: Wed, 9 Aug 2006 17:43:13 +0200 (CEST) Subject: [Python-checkins] r51179 - peps/trunk/pep-0356.txt Message-ID: <20060809154313.413BA1E4007@bag.python.org> Author: armin.rigo Date: Wed Aug 9 17:43:12 2006 New Revision: 51179 Modified: peps/trunk/pep-0356.txt Log: Bug fixed. Modified: peps/trunk/pep-0356.txt ============================================================================== --- peps/trunk/pep-0356.txt (original) +++ peps/trunk/pep-0356.txt Wed Aug 9 17:43:12 2006 @@ -156,7 +156,6 @@ str/unicode dict keys can raise an exception - Bugs that ought to be resolved before release (all exist in 2.4): - http://python.org/sf/1526585 - SystemError concat long strings http://python.org/sf/1475523 - gettext.py bug (owner: Martin v. Loewis) http://python.org/sf/1467929 - %-formatting and dicts From python-checkins at python.org Wed Aug 9 18:46:16 2006 From: python-checkins at python.org (kurt.kaiser) Date: Wed, 9 Aug 2006 18:46:16 +0200 (CEST) Subject: [Python-checkins] r51180 - python/trunk/Lib/idlelib/CREDITS.txt python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/PyShell.py Message-ID: <20060809164616.53BA21E4007@bag.python.org> Author: kurt.kaiser Date: Wed Aug 9 18:46:15 2006 New Revision: 51180 Modified: python/trunk/Lib/idlelib/CREDITS.txt python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/PyShell.py Log: 1. When used w/o subprocess, all exceptions were preceeded by an error message claiming they were IDLE internal errors (since 1.2a1). 2. Add Ronald Oussoren to CREDITS M NEWS.txt M PyShell.py M CREDITS.txt Modified: python/trunk/Lib/idlelib/CREDITS.txt ============================================================================== --- python/trunk/Lib/idlelib/CREDITS.txt (original) +++ python/trunk/Lib/idlelib/CREDITS.txt Wed Aug 9 18:46:15 2006 @@ -19,9 +19,9 @@ subprocess, and made a number of usability enhancements. Other contributors include Raymond Hettinger, Tony Lownds (Mac integration), -Neal Norwitz (code check and clean-up), Noam Raphael (Code Context, Call Tips, -many other patches), and Chui Tey (RPC integration, debugger integration and -persistent breakpoints). +Neal Norwitz (code check and clean-up), Ronald Oussoren (Mac integration), +Noam Raphael (Code Context, Call Tips, many other patches), and Chui Tey (RPC +integration, debugger integration and persistent breakpoints). Scott David Daniels, Tal Einat, Hernan Foffani, Christos Georgiou, Martin v. Löwis, Jason Orendorff, Josh Robb, Nigel Rowe, Bruce Sherwood, Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Wed Aug 9 18:46:15 2006 @@ -1,3 +1,11 @@ +What's New in IDLE 1.2c1? +========================= + +*Release date: XX-AUG-2006* + +- When used w/o subprocess, all exceptions were preceeded by an error + message claiming they were IDLE internal errors (since 1.2a1). + What's New in IDLE 1.2b3? ========================= Modified: python/trunk/Lib/idlelib/PyShell.py ============================================================================== --- python/trunk/Lib/idlelib/PyShell.py (original) +++ python/trunk/Lib/idlelib/PyShell.py Wed Aug 9 18:46:15 2006 @@ -722,7 +722,8 @@ else: self.showtraceback() except: - print>>sys.stderr, "IDLE internal error in runcode()" + if self.rpcclt: + print>>sys.stderr, "IDLE internal error in runcode()" self.showtraceback() finally: if not use_subprocess: From buildbot at python.org Wed Aug 9 19:09:29 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 09 Aug 2006 17:09:29 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060809170929.8D53D1E4007@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1048 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 9 19:47:15 2006 From: python-checkins at python.org (kurt.kaiser) Date: Wed, 9 Aug 2006 19:47:15 +0200 (CEST) Subject: [Python-checkins] r51181 - python/trunk/Lib/idlelib python/trunk/Lib/idlelib/PyShell.py Message-ID: <20060809174715.A03BE1E400F@bag.python.org> Author: kurt.kaiser Date: Wed Aug 9 19:47:15 2006 New Revision: 51181 Modified: python/trunk/Lib/idlelib/ (props changed) python/trunk/Lib/idlelib/PyShell.py Log: As a slight enhancement to the previous checkin, improve the internal error reporting by moving message to IDLE console. Modified: python/trunk/Lib/idlelib/PyShell.py ============================================================================== --- python/trunk/Lib/idlelib/PyShell.py (original) +++ python/trunk/Lib/idlelib/PyShell.py Wed Aug 9 19:47:15 2006 @@ -722,9 +722,12 @@ else: self.showtraceback() except: - if self.rpcclt: - print>>sys.stderr, "IDLE internal error in runcode()" + if use_subprocess: + print >> self.tkconsole.stderr, \ + "IDLE internal error in runcode()" self.showtraceback() + if use_subprocess: + self.tkconsole.endexecuting() finally: if not use_subprocess: self.tkconsole.endexecuting() From python-checkins at python.org Wed Aug 9 20:23:14 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 9 Aug 2006 20:23:14 +0200 (CEST) Subject: [Python-checkins] r51182 - python/trunk/Lib/idlelib/NEWS.txt Message-ID: <20060809182314.8CFEE1E4007@bag.python.org> Author: andrew.kuchling Date: Wed Aug 9 20:23:14 2006 New Revision: 51182 Modified: python/trunk/Lib/idlelib/NEWS.txt Log: Typo fix Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Wed Aug 9 20:23:14 2006 @@ -3,7 +3,7 @@ *Release date: XX-AUG-2006* -- When used w/o subprocess, all exceptions were preceeded by an error +- When used w/o subprocess, all exceptions were preceded by an error message claiming they were IDLE internal errors (since 1.2a1). What's New in IDLE 1.2b3? From buildbot at python.org Wed Aug 9 21:14:05 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 09 Aug 2006 19:14:05 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060809191405.27BD71E4008@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1050 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 9 22:34:47 2006 From: python-checkins at python.org (kurt.kaiser) Date: Wed, 9 Aug 2006 22:34:47 +0200 (CEST) Subject: [Python-checkins] r51183 - python/trunk/Lib/idlelib/EditorWindow.py python/trunk/Lib/idlelib/NEWS.txt Message-ID: <20060809203447.36C851E4007@bag.python.org> Author: kurt.kaiser Date: Wed Aug 9 22:34:46 2006 New Revision: 51183 Modified: python/trunk/Lib/idlelib/EditorWindow.py python/trunk/Lib/idlelib/NEWS.txt Log: ToggleTab dialog was setting indent to 8 even if cancelled (since 1.2a1). Modified: python/trunk/Lib/idlelib/EditorWindow.py ============================================================================== --- python/trunk/Lib/idlelib/EditorWindow.py (original) +++ python/trunk/Lib/idlelib/EditorWindow.py Wed Aug 9 22:34:46 2006 @@ -1277,13 +1277,13 @@ "Toggle tabs", "Turn tabs " + ("on", "off")[self.usetabs] + "?\nIndent width " + - ("will be", "remains at")[self.usetabs] + " 8.", + ("will be", "remains at")[self.usetabs] + " 8." + + "\n Note: a tab is always 8 columns", parent=self.text): self.usetabs = not self.usetabs - # Try to prevent mixed tabs/spaces. - # User must reset indent width manually after using tabs - # if he insists on getting into trouble. - self.indentwidth = 8 + # Try to prevent inconsistent indentation. + # User must change indent width manually after using tabs. + self.indentwidth = 8 return "break" # XXX this isn't bound to anything -- see tabwidth comments Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Wed Aug 9 22:34:46 2006 @@ -3,6 +3,8 @@ *Release date: XX-AUG-2006* +- ToggleTab dialog was setting indent to 8 even if cancelled (since 1.2a1). + - When used w/o subprocess, all exceptions were preceded by an error message claiming they were IDLE internal errors (since 1.2a1). From buildbot at python.org Wed Aug 9 22:57:15 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 09 Aug 2006 20:57:15 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP-2 trunk Message-ID: <20060809205716.077111E4018@bag.python.org> The Buildbot has detected a new failure of x86 XP-2 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP-2%2520trunk/builds/844 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: kurt.kaiser Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Wed Aug 9 23:12:22 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 09 Aug 2006 21:12:22 +0000 Subject: [Python-checkins] buildbot failure in alpha Tru64 5.1 trunk Message-ID: <20060809211222.D068A1E400A@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1051 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: kurt.kaiser BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Thu Aug 10 01:42:18 2006 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 10 Aug 2006 01:42:18 +0200 (CEST) Subject: [Python-checkins] r51184 - python/trunk/setup.py Message-ID: <20060809234218.BA28F1E4007@bag.python.org> Author: martin.v.loewis Date: Thu Aug 10 01:42:18 2006 New Revision: 51184 Modified: python/trunk/setup.py Log: Add some commentary on -mimpure-text. Modified: python/trunk/setup.py ============================================================================== --- python/trunk/setup.py (original) +++ python/trunk/setup.py Thu Aug 10 01:42:18 2006 @@ -1369,6 +1369,14 @@ ## extra_link_args.extend(['-read_only_relocs', 'warning']) elif sys.platform == 'sunos5': + # XXX This shouldn't be necessary; it appears that some + # of the assembler code is non-PIC (i.e. it has relocations + # when it shouldn't. The proper fix would be to rewrite + # the assembler code to be PIC. + # This only works with GCC; the Sun compiler likely refuses + # this option. If you want to compile ctypes with the Sun + # compiler, please research a proper solution, instead of + # finding some -z option for the Sun compiler. extra_link_args.append('-mimpure-text') ext = Extension('_ctypes', From martin at v.loewis.de Thu Aug 10 01:42:42 2006 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Thu, 10 Aug 2006 01:42:42 +0200 Subject: [Python-checkins] r51113 - in python/trunk: Misc/NEWS setup.py In-Reply-To: References: <20060804185735.77EAD1E4003@bag.python.org> <44D72424.8030708@v.loewis.de> Message-ID: <44DA72F2.30403@v.loewis.de> Thomas Heller schrieb: > I suggest you add something like this text to setup.py, where the > '-mimpure-text' flag is used. Done! Martin From martin at v.loewis.de Thu Aug 10 01:46:02 2006 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Thu, 10 Aug 2006 01:46:02 +0200 Subject: [Python-checkins] r51173 - python/trunk/configure python/trunk/configure.in In-Reply-To: <20060809145634.70F671E400D@bag.python.org> References: <20060809145634.70F671E400D@bag.python.org> Message-ID: <44DA73BA.1010407@v.loewis.de> ronald.oussoren schrieb: > It's unlikely that future versions will require _POSIX_C_SOURCE You seem to be missing the point here. This exclusion list is not for systems that don't *require* _POSIX_C_SOURCE, but for systems that incorrectly *fail* if _POSIX_C_SOURCE is given. So in essence, you are stating that future OS X releases will be just as buggy as the current one. Please revert that change, and make configure only take decisions for systems that actually have been released. Regards, Martin From python-checkins at python.org Thu Aug 10 02:58:49 2006 From: python-checkins at python.org (tim.peters) Date: Thu, 10 Aug 2006 02:58:49 +0200 (CEST) Subject: [Python-checkins] r51185 - python/trunk/Lib/test/test_bigaddrspace.py Message-ID: <20060810005849.C007C1E4007@bag.python.org> Author: tim.peters Date: Thu Aug 10 02:58:49 2006 New Revision: 51185 Modified: python/trunk/Lib/test/test_bigaddrspace.py (props changed) Log: Add missing svn:eol-style property to text files. From python-checkins at python.org Thu Aug 10 03:41:19 2006 From: python-checkins at python.org (kurt.kaiser) Date: Thu, 10 Aug 2006 03:41:19 +0200 (CEST) Subject: [Python-checkins] r51186 - python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/ScriptBinding.py Message-ID: <20060810014119.672AF1E4007@bag.python.org> Author: kurt.kaiser Date: Thu Aug 10 03:41:17 2006 New Revision: 51186 Modified: python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/ScriptBinding.py Log: Changing tokenize (39046) to detect dedent broke tabnanny check (since 1.2a1) Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Thu Aug 10 03:41:17 2006 @@ -3,6 +3,8 @@ *Release date: XX-AUG-2006* +- Changing tokenize (39046) to detect dedent broke tabnanny check (since 1.2a1) + - ToggleTab dialog was setting indent to 8 even if cancelled (since 1.2a1). - When used w/o subprocess, all exceptions were preceded by an error Modified: python/trunk/Lib/idlelib/ScriptBinding.py ============================================================================== --- python/trunk/Lib/idlelib/ScriptBinding.py (original) +++ python/trunk/Lib/idlelib/ScriptBinding.py Thu Aug 10 03:41:17 2006 @@ -76,6 +76,9 @@ self.editwin.gotoline(nag.get_lineno()) self.errorbox("Tab/space error", indent_message) return False + except IndentationError: + # From tokenize(), let compile() in checksyntax find it again. + pass return True def checksyntax(self, filename): From python-checkins at python.org Thu Aug 10 05:01:31 2006 From: python-checkins at python.org (tim.peters) Date: Thu, 10 Aug 2006 05:01:31 +0200 (CEST) Subject: [Python-checkins] r51187 - python/trunk/Lib/test/test_shutil.py Message-ID: <20060810030131.1B9321E4007@bag.python.org> Author: tim.peters Date: Thu Aug 10 05:01:26 2006 New Revision: 51187 Modified: python/trunk/Lib/test/test_shutil.py Log: test_copytree_simple(): This was leaving behind two new temp directories each time it ran, at least on Windows. Several changes: explicitly closed all files; wrapped long lines; stopped suppressing errors when removing a file or directory fails (removing /shouldn't/ fail!); and changed what appeared to be incorrect usage of os.removedirs() (that doesn't remove empty directories at and /under/ the given path, instead it must be given an empty leaf directory and then deletes empty directories moving /up/ the path -- could be that the conceptually simpler shutil.rmtree() was really actually intended here). Modified: python/trunk/Lib/test/test_shutil.py ============================================================================== --- python/trunk/Lib/test/test_shutil.py (original) +++ python/trunk/Lib/test/test_shutil.py Thu Aug 10 05:01:26 2006 @@ -74,31 +74,51 @@ except: pass - def test_copytree_simple(self): + def write_data(path, data): + f = open(path, "w") + f.write(data) + f.close() + + def read_data(path): + f = open(path) + data = f.read() + f.close() + return data + src_dir = tempfile.mkdtemp() dst_dir = os.path.join(tempfile.mkdtemp(), 'destination') - open(os.path.join(src_dir, 'test.txt'), 'w').write('123') + + write_data(os.path.join(src_dir, 'test.txt'), '123') + os.mkdir(os.path.join(src_dir, 'test_dir')) - open(os.path.join(src_dir, 'test_dir', 'test.txt'), 'w').write('456') - # + write_data(os.path.join(src_dir, 'test_dir', 'test.txt'), '456') + try: shutil.copytree(src_dir, dst_dir) self.assertTrue(os.path.isfile(os.path.join(dst_dir, 'test.txt'))) self.assertTrue(os.path.isdir(os.path.join(dst_dir, 'test_dir'))) - self.assertTrue(os.path.isfile(os.path.join(dst_dir, 'test_dir', 'test.txt'))) - self.assertEqual(open(os.path.join(dst_dir, 'test.txt')).read(), '123') - self.assertEqual(open(os.path.join(dst_dir, 'test_dir', 'test.txt')).read(), '456') + self.assertTrue(os.path.isfile(os.path.join(dst_dir, 'test_dir', + 'test.txt'))) + actual = read_data(os.path.join(dst_dir, 'test.txt')) + self.assertEqual(actual, '123') + actual = read_data(os.path.join(dst_dir, 'test_dir', 'test.txt')) + self.assertEqual(actual, '456') finally: - try: - os.remove(os.path.join(src_dir, 'test.txt')) - os.remove(os.path.join(dst_dir, 'test.txt')) - os.remove(os.path.join(src_dir, 'test_dir', 'test.txt')) - os.remove(os.path.join(dst_dir, 'test_dir', 'test.txt')) - os.removedirs(src_dir) - os.removedirs(dst_dir) - except: - pass + for path in ( + os.path.join(src_dir, 'test.txt'), + os.path.join(dst_dir, 'test.txt'), + os.path.join(src_dir, 'test_dir', 'test.txt'), + os.path.join(dst_dir, 'test_dir', 'test.txt'), + ): + if os.path.exists(path): + os.remove(path) + for path in ( + os.path.join(src_dir, 'test_dir'), + os.path.join(dst_dir, 'test_dir'), + ): + if os.path.exists(path): + os.removedirs(path) if hasattr(os, "symlink"): From buildbot at python.org Thu Aug 10 05:53:30 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 03:53:30 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060810035330.8AC471E4007@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1054 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Thu Aug 10 09:50:00 2006 From: python-checkins at python.org (georg.brandl) Date: Thu, 10 Aug 2006 09:50:00 +0200 (CEST) Subject: [Python-checkins] r51188 - peps/trunk/pep-0356.txt Message-ID: <20060810075000.F03311E4007@bag.python.org> Author: georg.brandl Date: Thu Aug 10 09:50:00 2006 New Revision: 51188 Modified: peps/trunk/pep-0356.txt Log: Add some more priority-9 bugs. Modified: peps/trunk/pep-0356.txt ============================================================================== --- peps/trunk/pep-0356.txt (original) +++ peps/trunk/pep-0356.txt Thu Aug 10 09:50:00 2006 @@ -148,6 +148,10 @@ - Bugs that need resolving before release, ie, they block release: http://python.org/sf/1530559 - struct rejecting floats (patch pending) + http://python.org/sf/1534630 - potential crash in cElementTree + http://python.org/sf/1530559 - struct.pack raises TypeError where it + used to convert (Owner: Bob Ippolito) + http://python.org/sf/1112549 - potential DoS in cgi.py http://mail.python.org/pipermail/python-dev/2006-July/067774.html Problem with __index__ (patch pending) From python-checkins at python.org Thu Aug 10 19:11:09 2006 From: python-checkins at python.org (kurt.kaiser) Date: Thu, 10 Aug 2006 19:11:09 +0200 (CEST) Subject: [Python-checkins] r51189 - python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/PyShell.py Message-ID: <20060810171109.E777D1E4007@bag.python.org> Author: kurt.kaiser Date: Thu Aug 10 19:11:09 2006 New Revision: 51189 Modified: python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/PyShell.py Log: Retrieval of previous shell command was not always preserving indentation since 1.2a1) Patch 1528468 Tal Einat. Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Thu Aug 10 19:11:09 2006 @@ -3,6 +3,9 @@ *Release date: XX-AUG-2006* +- Retrieval of previous shell command was not always preserving indentation + (since 1.2a1) Patch 1528468 Tal Einat. + - Changing tokenize (39046) to detect dedent broke tabnanny check (since 1.2a1) - ToggleTab dialog was setting indent to 8 even if cancelled (since 1.2a1). Modified: python/trunk/Lib/idlelib/PyShell.py ============================================================================== --- python/trunk/Lib/idlelib/PyShell.py (original) +++ python/trunk/Lib/idlelib/PyShell.py Thu Aug 10 19:11:09 2006 @@ -593,7 +593,7 @@ source = source.encode(IOBinding.encoding) except UnicodeError: self.tkconsole.resetoutput() - self.write("Unsupported characters in input") + self.write("Unsupported characters in input\n") return try: # InteractiveInterpreter.runsource() calls its runcode() method, @@ -1138,21 +1138,27 @@ return "break" def recall(self, s, event): + # remove leading and trailing empty or whitespace lines + s = re.sub(r'^\s*\n', '' , s) + s = re.sub(r'\n\s*$', '', s) + lines = s.split('\n') self.text.undo_block_start() try: self.text.tag_remove("sel", "1.0", "end") self.text.mark_set("insert", "end-1c") - s = s.strip() - lines = s.split('\n') - prefix = self.text.get("insert linestart","insert").rstrip() - if prefix and prefix[-1]==':': + prefix = self.text.get("insert linestart", "insert") + if prefix.rstrip().endswith(':'): self.newline_and_indent_event(event) - self.text.insert("insert",lines[0].strip()) + prefix = self.text.get("insert linestart", "insert") + self.text.insert("insert", lines[0].strip()) if len(lines) > 1: - self.newline_and_indent_event(event) + orig_base_indent = re.search(r'^([ \t]*)', lines[0]).group(0) + new_base_indent = re.search(r'^([ \t]*)', prefix).group(0) for line in lines[1:]: - self.text.insert("insert", line.strip()) - self.newline_and_indent_event(event) + if line.startswith(orig_base_indent): + # replace orig base indentation with new indentation + line = new_base_indent + line[len(orig_base_indent):] + self.text.insert('insert', '\n'+line.rstrip()) finally: self.text.see("insert") self.text.undo_block_stop() From python-checkins at python.org Thu Aug 10 19:41:11 2006 From: python-checkins at python.org (guido.van.rossum) Date: Thu, 10 Aug 2006 19:41:11 +0200 (CEST) Subject: [Python-checkins] r51190 - in python/trunk/Lib: cgi.py test/output/test_cgi test/test_cgi.py Message-ID: <20060810174111.4EC901E4007@bag.python.org> Author: guido.van.rossum Date: Thu Aug 10 19:41:07 2006 New Revision: 51190 Modified: python/trunk/Lib/cgi.py python/trunk/Lib/test/output/test_cgi python/trunk/Lib/test/test_cgi.py Log: Chris McDonough's patch to defend against certain DoS attacks on FieldStorage. SF bug #1112549. Modified: python/trunk/Lib/cgi.py ============================================================================== --- python/trunk/Lib/cgi.py (original) +++ python/trunk/Lib/cgi.py Thu Aug 10 19:41:07 2006 @@ -251,6 +251,10 @@ XXX This should really be subsumed by FieldStorage altogether -- no point in having two implementations of the same parsing algorithm. + Also, FieldStorage protects itself better against certain DoS attacks + by limiting the size of the data read in one chunk. The API here + does not support that kind of protection. This also affects parse() + since it can call parse_multipart(). """ boundary = "" @@ -699,7 +703,7 @@ def read_lines_to_eof(self): """Internal: read lines until EOF.""" while 1: - line = self.fp.readline() + line = self.fp.readline(1<<16) if not line: self.done = -1 break @@ -710,12 +714,13 @@ next = "--" + self.outerboundary last = next + "--" delim = "" + last_line_lfend = True while 1: - line = self.fp.readline() + line = self.fp.readline(1<<16) if not line: self.done = -1 break - if line[:2] == "--": + if line[:2] == "--" and last_line_lfend: strippedline = line.strip() if strippedline == next: break @@ -726,11 +731,14 @@ if line[-2:] == "\r\n": delim = "\r\n" line = line[:-2] + last_line_lfend = True elif line[-1] == "\n": delim = "\n" line = line[:-1] + last_line_lfend = True else: delim = "" + last_line_lfend = False self.__write(odelim + line) def skip_lines(self): @@ -739,18 +747,20 @@ return next = "--" + self.outerboundary last = next + "--" + last_line_lfend = True while 1: - line = self.fp.readline() + line = self.fp.readline(1<<16) if not line: self.done = -1 break - if line[:2] == "--": + if line[:2] == "--" and last_line_lfend: strippedline = line.strip() if strippedline == next: break if strippedline == last: self.done = 1 break + last_line_lfend = line.endswith('\n') def make_file(self, binary=None): """Overridable: return a readable & writable file. Modified: python/trunk/Lib/test/output/test_cgi ============================================================================== --- python/trunk/Lib/test/output/test_cgi (original) +++ python/trunk/Lib/test/output/test_cgi Thu Aug 10 19:41:07 2006 @@ -38,3 +38,5 @@ Testing log Testing initlog 1 Testing log 2 +Test FieldStorage methods that use readline +Test basic FieldStorage multipart parsing Modified: python/trunk/Lib/test/test_cgi.py ============================================================================== --- python/trunk/Lib/test/test_cgi.py (original) +++ python/trunk/Lib/test/test_cgi.py Thu Aug 10 19:41:07 2006 @@ -2,6 +2,8 @@ import cgi import os import sys +import tempfile +from StringIO import StringIO class HackedSysModule: # The regression test will have real values in sys.argv, which @@ -203,4 +205,71 @@ cgi.initlog("%s", "Testing log 3") cgi.log("Testing log 4") + print "Test FieldStorage methods that use readline" + # FieldStorage uses readline, which has the capacity to read all + # contents of the input file into memory; we use readline's size argument + # to prevent that for files that do not contain any newlines in + # non-GET/HEAD requests + class TestReadlineFile: + def __init__(self, file): + self.file = file + self.numcalls = 0 + + def readline(self, size=None): + self.numcalls += 1 + if size: + return self.file.readline(size) + else: + return self.file.readline() + + def __getattr__(self, name): + file = self.__dict__['file'] + a = getattr(file, name) + if not isinstance(a, int): + setattr(self, name, a) + return a + + f = TestReadlineFile(tempfile.TemporaryFile()) + f.write('x' * 256 * 1024) + f.seek(0) + env = {'REQUEST_METHOD':'PUT'} + fs = cgi.FieldStorage(fp=f, environ=env) + # if we're not chunking properly, readline is only called twice + # (by read_binary); if we are chunking properly, it will be called 5 times + # as long as the chunksize is 1 << 16. + verify(f.numcalls > 2) + + print "Test basic FieldStorage multipart parsing" + env = {'REQUEST_METHOD':'POST', 'CONTENT_TYPE':'multipart/form-data; boundary=---------------------------721837373350705526688164684', 'CONTENT_LENGTH':'558'} + postdata = r"""-----------------------------721837373350705526688164684 +Content-Disposition: form-data; name="id" + +1234 +-----------------------------721837373350705526688164684 +Content-Disposition: form-data; name="title" + + +-----------------------------721837373350705526688164684 +Content-Disposition: form-data; name="file"; filename="test.txt" +Content-Type: text/plain + +Testing 123. + +-----------------------------721837373350705526688164684 +Content-Disposition: form-data; name="submit" + + Add +-----------------------------721837373350705526688164684-- +""" + fs = cgi.FieldStorage(fp=StringIO(postdata), environ=env) + verify(len(fs.list) == 4) + expect = [{'name':'id', 'filename':None, 'value':'1234'}, + {'name':'title', 'filename':None, 'value':''}, + {'name':'file', 'filename':'test.txt','value':'Testing 123.\n'}, + {'name':'submit', 'filename':None, 'value':' Add '}] + for x in range(len(fs.list)): + for k, exp in expect[x].items(): + got = getattr(fs.list[x], k) + verify(got == exp) + main() From python-checkins at python.org Thu Aug 10 19:42:50 2006 From: python-checkins at python.org (guido.van.rossum) Date: Thu, 10 Aug 2006 19:42:50 +0200 (CEST) Subject: [Python-checkins] r51191 - python/trunk/Misc/NEWS Message-ID: <20060810174250.87EB81E4007@bag.python.org> Author: guido.van.rossum Date: Thu Aug 10 19:42:50 2006 New Revision: 51191 Modified: python/trunk/Misc/NEWS Log: News item for SF bug 1112549. Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Aug 10 19:42:50 2006 @@ -4,10 +4,10 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) -What's New in Python 2.5 release candidate 1? -============================================= +What's New in Python 2.5 beta 3? +================================ -*Release date: XX-AUG-2006* +*Release date: 18-AUG-2006* Core and builtins ----------------- @@ -38,6 +38,8 @@ Library ------- +- Bug #1112549, DoS attack on cgi.FieldStorage. + - Bug #1531405, format_exception no longer raises an exception if str(exception) raised an exception. From mal at egenix.com Thu Aug 10 20:06:21 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Thu, 10 Aug 2006 20:06:21 +0200 Subject: [Python-checkins] r51191 - python/trunk/Misc/NEWS In-Reply-To: <20060810174250.87EB81E4007@bag.python.org> References: <20060810174250.87EB81E4007@bag.python.org> Message-ID: <44DB759D.6070706@egenix.com> guido.van.rossum wrote: > Author: guido.van.rossum > Date: Thu Aug 10 19:42:50 2006 > New Revision: 51191 > > Modified: > python/trunk/Misc/NEWS > Log: > News item for SF bug 1112549. > > > Modified: python/trunk/Misc/NEWS > ============================================================================== > --- python/trunk/Misc/NEWS (original) > +++ python/trunk/Misc/NEWS Thu Aug 10 19:42:50 2006 > @@ -4,10 +4,10 @@ > > (editors: check NEWS.help for information about editing NEWS using ReST.) > > -What's New in Python 2.5 release candidate 1? > -============================================= > +What's New in Python 2.5 beta 3? > +================================ Shouldn't this read: beta 4 ? Beta 3 was released on 03 Aug. > -*Release date: XX-AUG-2006* > +*Release date: 18-AUG-2006* > > Core and builtins > ----------------- > @@ -38,6 +38,8 @@ > Library > ------- > > +- Bug #1112549, DoS attack on cgi.FieldStorage. > + > - Bug #1531405, format_exception no longer raises an exception if > str(exception) raised an exception. > > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 10 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From python-checkins at python.org Thu Aug 10 20:09:26 2006 From: python-checkins at python.org (guido.van.rossum) Date: Thu, 10 Aug 2006 20:09:26 +0200 (CEST) Subject: [Python-checkins] r51192 - python/trunk/Misc/NEWS Message-ID: <20060810180926.4584B1E4007@bag.python.org> Author: guido.van.rossum Date: Thu Aug 10 20:09:25 2006 New Revision: 51192 Modified: python/trunk/Misc/NEWS Log: Fix title -- it's rc1, not beta3. Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Aug 10 20:09:25 2006 @@ -4,8 +4,8 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) -What's New in Python 2.5 beta 3? -================================ +What's New in Python 2.5 release candidate 1? +============================================= *Release date: 18-AUG-2006* From guido at python.org Thu Aug 10 20:09:50 2006 From: guido at python.org (Guido van Rossum) Date: Thu, 10 Aug 2006 11:09:50 -0700 Subject: [Python-checkins] r51191 - python/trunk/Misc/NEWS In-Reply-To: <44DB759D.6070706@egenix.com> References: <20060810174250.87EB81E4007@bag.python.org> <44DB759D.6070706@egenix.com> Message-ID: Oops. It should have read rc1. I misremembered pep 356. Fixed now. On 8/10/06, M.-A. Lemburg wrote: > guido.van.rossum wrote: > > Author: guido.van.rossum > > Date: Thu Aug 10 19:42:50 2006 > > New Revision: 51191 > > > > Modified: > > python/trunk/Misc/NEWS > > Log: > > News item for SF bug 1112549. > > > > > > Modified: python/trunk/Misc/NEWS > > ============================================================================== > > --- python/trunk/Misc/NEWS (original) > > +++ python/trunk/Misc/NEWS Thu Aug 10 19:42:50 2006 > > @@ -4,10 +4,10 @@ > > > > (editors: check NEWS.help for information about editing NEWS using ReST.) > > > > -What's New in Python 2.5 release candidate 1? > > -============================================= > > +What's New in Python 2.5 beta 3? > > +================================ > > Shouldn't this read: beta 4 ? > > Beta 3 was released on 03 Aug. > > > -*Release date: XX-AUG-2006* > > +*Release date: 18-AUG-2006* > > > > Core and builtins > > ----------------- > > @@ -38,6 +38,8 @@ > > Library > > ------- > > > > +- Bug #1112549, DoS attack on cgi.FieldStorage. > > + > > - Bug #1531405, format_exception no longer raises an exception if > > str(exception) raised an exception. > > > > _______________________________________________ > > Python-checkins mailing list > > Python-checkins at python.org > > http://mail.python.org/mailman/listinfo/python-checkins > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Aug 10 2006) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > > ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > -- --Guido van Rossum (home page: http://www.python.org/~guido/) From python-checkins at python.org Thu Aug 10 20:29:22 2006 From: python-checkins at python.org (mateusz.rukowicz) Date: Thu, 10 Aug 2006 20:29:22 +0200 (CEST) Subject: [Python-checkins] r51193 - sandbox/trunk/decimal-c/_decimal.c Message-ID: <20060810182922.67C7F1E4007@bag.python.org> Author: mateusz.rukowicz Date: Thu Aug 10 20:29:21 2006 New Revision: 51193 Modified: sandbox/trunk/decimal-c/_decimal.c Log: Reviewed and fixed some warnings. Modified: sandbox/trunk/decimal-c/_decimal.c ============================================================================== --- sandbox/trunk/decimal-c/_decimal.c (original) +++ sandbox/trunk/decimal-c/_decimal.c Thu Aug 10 20:29:21 2006 @@ -503,7 +503,6 @@ long tmp_limbs; long diff; long mid; - int bla; diff = up - down; mid = down + diff/2; @@ -574,7 +573,7 @@ return new_pos; } - +/* static long _limb_normalize(long *first, long size) { long i; @@ -591,6 +590,7 @@ return new_size; } +*/ #ifdef BIG_EXP /* TODO I have to *limit* passing arguments by value, @@ -685,11 +685,11 @@ written ++; } - tmp = sprintf(buf, "%i", exp.limbs[exp.size-1]); + tmp = sprintf(buf, "%ld", exp.limbs[exp.size-1]); buf += tmp; written += tmp; for (i = exp.size - 2; i>=0; i--) { - tmp = sprintf(buf, "%."LOG_STR"i", exp.limbs[i]); + tmp = sprintf(buf, "%."LOG_STR"ld", exp.limbs[i]); buf += tmp; written += tmp; } @@ -831,12 +831,12 @@ exp_sub_i(exp_t a, long b) { return exp_sub(a, exp_from_i(b)); } - +/* static exp_t exp_inp_add_i(exp_t *a, long b) { return exp_inp_add(a, exp_from_i(b)); } - +*/ static exp_t exp_inp_sub_i(exp_t *a, long b) { return exp_inp_sub(a, exp_from_i(b)); @@ -894,16 +894,6 @@ return ret; } -static exp_t -exp_floordiv_i(exp_t a, long b) { - long remainder; - exp_t ret; - ret = exp_div_i(a, b, &remainder); - if (remainder && exp_is_neg(a)) - exp_dec(&ret); - - return ret; -} static int exp_mod_i(exp_t a, long b) { @@ -928,12 +918,12 @@ else return cmp; } - +/* static int exp_cmp_i(exp_t a, long b) { return exp_cmp(a, exp_from_i(b)); } - +*/ static int exp_g(exp_t a, exp_t b) { int cmp = exp_cmp(a, b); @@ -972,12 +962,12 @@ int cmp = exp_cmp(a, b); return cmp != 0; } - +/* static int exp_ne_i(exp_t a, long b) { return exp_ne(a, exp_from_i(b)); } - +*/ static int exp_ge(exp_t a, exp_t b) { int cmp = exp_cmp(a, b); @@ -1041,6 +1031,17 @@ return b; } +static exp_t +exp_floordiv_i(exp_t a, long b) { + long remainder; + exp_t ret; + ret = exp_div_i(a, b, &remainder); + if (remainder && exp_is_neg(a)) + exp_dec(&ret); + return ret; +} + + #else /* TODO a little mess here ;P */ #define exp_add_i(exp, a) ((exp) + (a)) @@ -1071,8 +1072,8 @@ #define exp_floordiv_i(a,b) ((a) / (b) - ((a) % (b) && (a) < 0)) #define exp_inp_sub(a, b) ((*(a)) -= (b)) #define exp_inp_sub_i(a, b) ((*(a)) -= (b)) -#define exp_sprintf(a, e) (sprintf(a, "%d", e)) -#define exp_sscanf(a, e) (sscanf(a, "%d", e)) +#define exp_sprintf(a, e) (sprintf(a, "%ld", e)) +#define exp_sscanf(a, e) (sscanf(a, "%ld", e)) #define exp_min(a, b) ((a) < (b) ? (a) : (b)) #define exp_max(a, b) ((a) > (b) ? (a) : (b)) #define exp_neg(a) (-(a)) @@ -1260,6 +1261,7 @@ static decimalobject *_do_decimal_subtract(decimalobject *, decimalobject *, contextobject *); static PyObject *context_ignore_flags(contextobject *self, PyObject *args); static decimalobject *_do_decimal_power(decimalobject *, decimalobject *, decimalobject *, contextobject *); +static int _decimal_isint(decimalobject*); /* Exception handlers *********************************************************/ @@ -1336,7 +1338,7 @@ return res; } -static decimalobject * +static PyObject * handle_DivisionImpossible(PyTypeObject *type, contextobject *ctx, char *expl) { HANDLE_ERROR(ctx, C_DIV_IMPOSSIBLE, expl, NULL); @@ -1346,7 +1348,7 @@ return Py_BuildValue("(OO)", PyDecimal_NaN, PyDecimal_NaN); } -static decimalobject * +static PyObject * handle_DivisionUndefined(PyTypeObject *type, contextobject *ctx, char *expl, int two) { @@ -1354,7 +1356,7 @@ if (!two) { Py_INCREF(PyDecimal_NaN); - return PyDecimal_NaN; + return (PyObject*)PyDecimal_NaN; } else { @@ -1398,7 +1400,6 @@ handle_Overflow(PyTypeObject *type, contextobject *ctx, char *expl, long lsign) { decimalobject *res = 0; - long i; HANDLE_ERROR(ctx, S_OVERFLOW, expl, NULL); @@ -1589,7 +1590,6 @@ static decimalobject * _round_down(decimalobject *self, long prec, exp_t expdiff, contextobject *ctx) { - long i; decimalobject *new = _NEW_decimalobj(prec, self->sign, exp_add(self->exp, expdiff)); if (!new) return NULL; @@ -1699,7 +1699,6 @@ _round_half_up(decimalobject *self, long prec, exp_t expdiff, contextobject *ctx) { decimalobject *tmp; - long i; tmp = _NEW_decimalobj(prec, self->sign, exp_add(self->exp, expdiff)); if (!tmp) return NULL; _limb_first_n_digits(self->limbs, self->ob_size, 0, tmp->limbs, prec); @@ -2359,13 +2358,14 @@ contextobject *ctx; int res; ctx = getcontext(); - if (!ctx) return NULL; + if (!ctx) return 0; other = (decimalobject *)_convert_to_decimal(self->ob_type, - other, ctx, 0); + (PyObject*)other, ctx, 0); - if (!other) return NULL; - if (other == Py_NotImplemented) return other; + if (!other) return 0; + /* XXX ??*/ + if ((PyObject*) other == Py_NotImplemented) return 0; res = _do_real_decimal_compare(self, other, ctx); Py_DECREF(other); @@ -2732,8 +2732,8 @@ goto err; } - side = PySequence_GetItem(divmod, 0); - r = PySequence_GetItem(divmod, 1); + side = (decimalobject*) PySequence_GetItem(divmod, 0); + r = (decimalobject*) PySequence_GetItem(divmod, 1); Py_DECREF(divmod); } @@ -2768,7 +2768,7 @@ two->limbs[0] = 2; two->sign = other->sign&1; - comparison = _do_decimal__divide(other, two, 0, ctx2); + comparison = (decimalobject*) _do_decimal__divide(other, two, 0, ctx2); Py_DECREF(two); if (!comparison) @@ -2831,8 +2831,8 @@ Py_DECREF(side); Py_DECREF(r); - side = PySequence_GetItem(divmod, 0); - r = PySequence_GetItem(divmod, 1); + side = (decimalobject *)PySequence_GetItem(divmod, 0); + r = (decimalobject *)PySequence_GetItem(divmod, 1); Py_DECREF(divmod); } @@ -2860,7 +2860,7 @@ if (PyErr_Occurred()) goto err; - if (cmp == 1 || decrease && cmp == 0) { + if ((cmp == 1) || (decrease && cmp == 0)) { r->sign = s1; comparison->sign = s2; ctx2->prec += 1; @@ -2899,7 +2899,7 @@ Py_DECREF(r); Py_DECREF(comparison); - return ret; + return (decimalobject *)ret; } Py_DECREF(tmp); @@ -3154,7 +3154,7 @@ while (1) { ctx2->prec = 2 * ctx2->prec - 2 < maxp ? 2 * ctx2->prec - 2: maxp; /* ans = half * (ans + tmp/ans) */ - tmp2 = _do_decimal__divide(tmp, ans, 0, ctx2); + tmp2 = (decimalobject*) _do_decimal__divide(tmp, ans, 0, ctx2); if (!tmp2) goto err; /* ans = half * (ans + tmp2) */ @@ -3539,7 +3539,7 @@ { for(i=0;i< d->ob_size;i++) { - p+= sprintf(p, "%d", _limb_get_digit(d->limbs, d->ob_size, i)); /* SLOW */ + p+= sprintf(p, "%ld", _limb_get_digit(d->limbs, d->ob_size, i)); /* SLOW */ SANITY_CHECK(p); } } @@ -3707,7 +3707,7 @@ { if(exp_eq_i(dotplace, i)) *p++ = '.'; - p += sprintf(p, "%d", _limb_get_digit(d->limbs,d->ob_size,i)); + p += sprintf(p, "%ld", _limb_get_digit(d->limbs,d->ob_size,i)); } while(extra_zeros --)*p++ = '0'; @@ -3918,9 +3918,9 @@ if (self_is_zero && other_is_zero) { if (divmod) { - return handle_DivisionUndefined(self->ob_type, ctx, "0 / 0", 1); + return (PyObject*)handle_DivisionUndefined(self->ob_type, ctx, "0 / 0", 1); } - return handle_DivisionUndefined(self->ob_type, ctx, "0 / 0", 0); + return (PyObject*)handle_DivisionUndefined(self->ob_type, ctx, "0 / 0", 0); } if (self_is_zero) { @@ -3974,9 +3974,9 @@ if (other_is_zero) { if (divmod) { - return handle_DivisionByZero(self->ob_type, ctx, "divmod(x,0)", sign, 1); + return (PyObject*)handle_DivisionByZero(self->ob_type, ctx, "divmod(x,0)", sign, 1); } - return handle_DivisionByZero(self->ob_type, ctx, "x / 0", sign, 0); + return (PyObject*)handle_DivisionByZero(self->ob_type, ctx, "x / 0", sign, 0); } /* now fun starts, answer isnt one of 0 NaN or INF */ @@ -4083,7 +4083,7 @@ exp_t expdiff; long rlimbs; long old_size; - exp_t adj1, adj2, adjusted = exp_from_i(0); + exp_t adjusted = exp_from_i(0); long i; long max_size; exp_t min_expdiff; /* used when divmod */ @@ -4313,7 +4313,9 @@ static char *kwlist[] = {"other", "divmod", "context", 0}; contextobject *ctx = NULL; int divmod = 0; - PyObject *other; + PyObject *other, *ret; + /* what should we DECREF */ + decimalobject *dec = 0; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|iO:_divide", kwlist, &other, &divmod, &ctx)) @@ -4323,15 +4325,32 @@ if (!(ctx = getcontext())) return NULL; + if (PyDecimal_Check(self)) { + other = _convert_to_decimal(self->ob_type, other, ctx, 0); + if (!other || other == Py_NotImplemented) + return other; + dec = (decimalobject*)other; + } + + else { + assert(PyDecimal_Check(other)); + self = (decimalobject*)_convert_to_decimal(other->ob_type, (PyObject*)self, ctx, 0); + if (!self || (PyObject*)self == Py_NotImplemented) + return (PyObject*)self; + dec = (decimalobject*)self; + } if (!PyDecimalContext_Check(ctx)) { PyErr_SetString(PyExc_TypeError, "context must be Context object"); + Py_DECREF(dec); return NULL; } - return (PyObject*) _do_decimal__divide(self, other, divmod, ctx); + ret = _do_decimal__divide(self, (decimalobject*)other, divmod, ctx); + Py_DECREF(dec); + return ret; } -static int * +static int check_ctx(decimalobject *self, contextobject *ctx) { if (ctx->prec > MAX_MATH || @@ -4347,7 +4366,7 @@ * But first, we divide x, by integer, so that x < 1 - this results * in much faster calculation. So we have e^(x/a), where a = 10^h, * when we got e^(x/a) we raise it to power a. H is at most 8. */ -static PyObject * +static decimalobject * _do_decimal_exponent(decimalobject *self, contextobject *ctx) { decimalobject *ans; long h; @@ -4377,7 +4396,7 @@ return NULL; ans->limbs[0] = 0; - return ans; + return ans; } else { ans = _decimal_get_copy(self); @@ -4392,7 +4411,7 @@ return NULL; ans->limbs[0] = 1; - return ans; + return ans; } h = exp_to_i(ADJUSTED(self)) + 1; @@ -4512,7 +4531,7 @@ t = tmp; - tmp = _do_decimal__divide(t, d, 0, ctx2); + tmp = (decimalobject*)_do_decimal__divide(t, d, 0, ctx2); Py_DECREF(t); if (!tmp) { @@ -4570,7 +4589,7 @@ for (i = 0; i < h; i++) pow *= 10; - y = decimal_from_long(self->ob_type, pow); + y = (decimalobject*)decimal_from_long(self->ob_type, pow); if (!y) { Py_DECREF(ans); @@ -4580,7 +4599,7 @@ } Py_INCREF(Py_None); - tmp = _do_decimal_power(ans, y, Py_None, ctx); + tmp = _do_decimal_power(ans, y, (decimalobject*)Py_None, ctx); Py_DECREF(Py_None); Py_DECREF(y); Py_DECREF(ans); @@ -4619,7 +4638,7 @@ Py_DECREF(ans); ans = fixed; } - return ans; + return ans; } DECIMAL_UNARY_FUNC(exponent); @@ -4632,8 +4651,8 @@ return NULL; if (!check_ctx(self, ctx)) - return handle_InvalidContext(self->ob_type, ctx, NULL); - return _do_decimal_exponent(self, ctx); + return (PyObject*)handle_InvalidContext(self->ob_type, ctx, NULL); + return (PyObject*)_do_decimal_exponent(self, ctx); } DECIMAL_UNARY_FUNC(exp); @@ -4649,15 +4668,13 @@ 5341, 4889, 4437, 39930, 35534, 31186, 26886, 22630, 18418, 14254, 10130, 6046, 20055}; -static PyObject * +static decimalobject * _do_decimal__ln(decimalobject *self, contextobject *ctx) { decimalobject *ans = 0, *b = 0, *tmp, *one = 0; contextobject *ctx1 = 0, *ctx2 = 0; PyObject *flags; - long precision; int rounding; - int clamped; long prec, cp; int t; if (!ctx) @@ -4710,10 +4727,10 @@ prec = (self->ob_size > ctx->prec ? self->ob_size : ctx->prec) + 2; prec = prec > 9 ? prec : 9; - ans = decimal_from_long(self->ob_type, exp_to_i(ADJUSTED(self)) + 1); + ans = (decimalobject*)decimal_from_long(self->ob_type, exp_to_i(ADJUSTED(self)) + 1); if (!ans) goto err; - b = decimal_from_long(self->ob_type, 2302585); + b = (decimalobject*)decimal_from_long(self->ob_type, 2302585); if (!b) goto err; b->exp = exp_from_i(-6); @@ -4736,7 +4753,7 @@ t = ln_lookup[t-10]; Py_DECREF(b); - b = decimal_from_long(self->ob_type, t >> 2); + b = (decimalobject*)decimal_from_long(self->ob_type, t >> 2); if (!b) goto err; b->exp = exp_from_i(-(t&3) - 3); @@ -4875,13 +4892,13 @@ static PyObject * _do_decimal_ln(decimalobject *self, contextobject *ctx) { if (!check_ctx(self, ctx)) - return handle_InvalidContext(self->ob_type, ctx, NULL); - return _do_decimal__ln(self, ctx); + return (PyObject*)handle_InvalidContext(self->ob_type, ctx, NULL); + return (PyObject*)_do_decimal__ln(self, ctx); } DECIMAL_UNARY_FUNC(ln); -static PyObject * +static decimalobject * _do_decimal_log10(decimalobject *self, contextobject *ctx) { decimalobject *ret; long prec; @@ -4925,7 +4942,7 @@ if (i == self->ob_size) { decimalobject *fixed; /* TODO what about big exp? */ - ret = decimal_from_long(self->ob_type, exp_to_i(ADJUSTED(self))); + ret = (decimalobject*)decimal_from_long(self->ob_type, exp_to_i(ADJUSTED(self))); if (!ret) return NULL; @@ -4997,7 +5014,7 @@ Py_DECREF(ctx2); /* log10 = ln(self)/ln(10) */ - ret = _do_decimal__divide(a, ln10, 0, ctx); + ret = (decimalobject*)_do_decimal__divide(a, ln10, 0, ctx); Py_DECREF(a); Py_DECREF(ln10); @@ -5076,7 +5093,6 @@ if (exp_eq(adj_self, adj_other)) { long digits = self->ob_size > other->ob_size ? self->ob_size : other->ob_size; long i; - long ret; /* SLOW */ for (i=0;iob_type, res); + return (decimalobject*)decimal_from_long(self->ob_type, res); } DECIMAL_BINARY_FUNC(comparetotal); @@ -5591,7 +5610,6 @@ if(!decimal_nonzero(self) || !decimal_nonzero(other)) { - decimalobject *ret; ans = _NEW_decimalobj(1, resultsign, resultexp); if(!ans) return NULL; @@ -5650,7 +5668,7 @@ _do_decimal_divide(decimalobject *self, decimalobject *other, contextobject *ctx) { - return _do_decimal__divide(self, other, 0, ctx); + return (decimalobject*)_do_decimal__divide(self, other, 0, ctx); } DECIMAL_SPECIAL_2FUNC(decimal_divide) @@ -5665,11 +5683,11 @@ return NULL; if (PySequence_Check(seq)) { - ret = PySequence_GetItem(seq, 0); + ret = (decimalobject*)PySequence_GetItem(seq, 0); Py_DECREF(seq); } else - ret = seq; + ret = (decimalobject*)seq; return ret; } DECIMAL_SPECIAL_2FUNC(decimal_floor_div) @@ -5705,17 +5723,17 @@ return NULL; if (PySequence_Check(seq)) { - ret = PySequence_GetItem(seq, 1); + ret = (decimalobject*)PySequence_GetItem(seq, 1); Py_DECREF(seq); } else - ret = seq; + ret = (decimalobject*)seq; return ret; } DECIMAL_SPECIAL_2FUNC(decimal_remainder) -static decimalobject * +static PyObject * _do_decimal_divmod(decimalobject *self, decimalobject *other, contextobject *ctx) { @@ -5732,7 +5750,7 @@ long n; int sign; long spot; - int mod = modulo != Py_None; + int mod = modulo != (decimalobject *)Py_None; long firstprec = ctx->prec; int cmp; int use_exp = 0; /* when we should use exp/ln method */ @@ -5742,10 +5760,6 @@ if (!ctx) return NULL; -// if ((ISINF(other) || exp_g_i(ADJUSTED(other), 8)) && decimal_nonzero(other) ) { -// return handle_InvalidOperation(self->ob_type, ctx, "x ** INF", NULL); -// } - if ((exp_g_i(ADJUSTED(other), 8)) && decimal_nonzero(other)) { use_exp = 1; } @@ -6082,7 +6096,7 @@ if (n < 0) { decimalobject *tmp; n *= -1; - tmp = _do_decimal__divide(val, mul, 0, ctx); + tmp = (decimalobject*)_do_decimal__divide(val, mul, 0, ctx); if (!tmp) { Py_DECREF(mul); Py_DECREF(val); @@ -6170,7 +6184,7 @@ other = _convert_to_decimal(self->ob_type, other, ctx, 0); if (!other || other == Py_NotImplemented) return other; - dec = other; + dec = (decimalobject*)other; } @@ -6179,7 +6193,7 @@ self = _convert_to_decimal(other->ob_type, self, ctx, 0); if (!self || self == Py_NotImplemented) return self; - dec = self; + dec = (decimalobject*)self; } @@ -7196,7 +7210,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - decimal_cmp, /* tp_compare */ + (cmpfunc)decimal_cmp, /* tp_compare */ (reprfunc)decimal_repr, /* tp_repr */ &decimal_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -7598,14 +7612,14 @@ dec_c = (decimalobject *)_convert_to_decimal( &PyDecimal_DecimalType, c, self, 1); if (dec_c == NULL) { - dec_c = Py_None; + dec_c = (decimalobject *)Py_None; Py_INCREF(Py_None); /* XXX is it ok ? */ PyErr_Clear(); } } else { - dec_c = Py_None; + dec_c = (decimalobject*)Py_None; Py_INCREF(Py_None); } res = _do_decimal_power(dec_a, dec_b, dec_c, self); From buildbot at python.org Thu Aug 10 20:52:15 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 18:52:15 +0000 Subject: [Python-checkins] buildbot warnings in ppc Debian unstable trunk Message-ID: <20060810185215.2451C1E4007@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%2520Debian%2520unstable%2520trunk/builds/1082 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: kurt.kaiser Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Thu Aug 10 21:04:01 2006 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 10 Aug 2006 21:04:01 +0200 (CEST) Subject: [Python-checkins] r51194 - python/trunk/Modules/unicodedata.c Message-ID: <20060810190401.B0CF21E4007@bag.python.org> Author: martin.v.loewis Date: Thu Aug 10 21:04:00 2006 New Revision: 51194 Modified: python/trunk/Modules/unicodedata.c Log: Update dangling references to the 3.2 database to mention that this is UCD 4.1 now. Modified: python/trunk/Modules/unicodedata.c ============================================================================== --- python/trunk/Modules/unicodedata.c (original) +++ python/trunk/Modules/unicodedata.c Thu Aug 10 21:04:00 2006 @@ -1,8 +1,8 @@ /* ------------------------------------------------------------------------ - unicodedata -- Provides access to the Unicode 3.2 data base. + unicodedata -- Provides access to the Unicode 4.1 data base. - Data was extracted from the Unicode 3.2 UnicodeData.txt file. + Data was extracted from the Unicode 4.1 UnicodeData.txt file. Written by Marc-Andre Lemburg (mal at lemburg.com). Modified for Python 2.0 by Fredrik Lundh (fredrik at pythonware.com) @@ -1173,11 +1173,11 @@ "This module provides access to the Unicode Character Database which\n\ defines character properties for all Unicode characters. The data in\n\ this database is based on the UnicodeData.txt file version\n\ -3.2.0 which is publically available from ftp://ftp.unicode.org/.\n\ +4.1.0 which is publically available from ftp://ftp.unicode.org/.\n\ \n\ The module uses the same names and symbols as defined by the\n\ -UnicodeData File Format 3.2.0 (see\n\ -http://www.unicode.org/Public/3.2-Update/UnicodeData-3.2.0.html)."); +UnicodeData File Format 4.1.0 (see\n\ +http://www.unicode.org/Public/4.1.0/ucd/UCD.html)."); PyMODINIT_FUNC initunicodedata(void) From amk at amk.ca Thu Aug 10 21:31:45 2006 From: amk at amk.ca (A.M. Kuchling) Date: Thu, 10 Aug 2006 15:31:45 -0400 Subject: [Python-checkins] r51187 - python/trunk/Lib/test/test_shutil.py In-Reply-To: <20060810030131.1B9321E4007@bag.python.org> References: <20060810030131.1B9321E4007@bag.python.org> Message-ID: <20060810193145.GA17852@rogue.amk.ca> On Thu, Aug 10, 2006 at 05:01:31AM +0200, tim.peters wrote: > ... stopped suppressing errors when removing a file or > directory fails (removing /shouldn't/ fail!) I thought you couldn't remove a running executable on Windows; am I correct? (Or is that just in older Windows versions?) --amk From tim.peters at gmail.com Thu Aug 10 22:05:13 2006 From: tim.peters at gmail.com (Tim Peters) Date: Thu, 10 Aug 2006 16:05:13 -0400 Subject: [Python-checkins] r51187 - python/trunk/Lib/test/test_shutil.py In-Reply-To: <20060810193145.GA17852@rogue.amk.ca> References: <20060810030131.1B9321E4007@bag.python.org> <20060810193145.GA17852@rogue.amk.ca> Message-ID: <1f7befae0608101305w4a0e78acua804f218742332d6@mail.gmail.com> [Tim] >> ... stopped suppressing errors when removing a file or >> directory fails (removing /shouldn't/ fail!) [Andrew] > I thought you couldn't remove a running executable on Windows; am I > correct? (Or is that just in older Windows versions?) That's correct. But test_shutil attempts nothing of the sort, so it's irrelevant (test_shutil had been suppressing exceptions from trying to delete ordinary files and directories it had itself created, and it was in fact because it suppressed these exceptions that it didn't notice it was needlessly leaving junk temp files and junk temp directories behind). Note that the patch was against test_shutil.py; it didn't touch shutil.py. From python-checkins at python.org Fri Aug 11 00:45:36 2006 From: python-checkins at python.org (tim.peters) Date: Fri, 11 Aug 2006 00:45:36 +0200 (CEST) Subject: [Python-checkins] r51195 - in python/trunk: Doc/api/init.tex Lib/test/test_threading.py Misc/NEWS Python/pystate.c Message-ID: <20060810224536.5CABF1E400C@bag.python.org> Author: tim.peters Date: Fri Aug 11 00:45:34 2006 New Revision: 51195 Modified: python/trunk/Doc/api/init.tex python/trunk/Lib/test/test_threading.py python/trunk/Misc/NEWS python/trunk/Python/pystate.c Log: Followup to bug #1069160. PyThreadState_SetAsyncExc(): internal correctness changes wrt refcount safety and deadlock avoidance. Also added a basic test case (relying on ctypes) and repaired the docs. Modified: python/trunk/Doc/api/init.tex ============================================================================== --- python/trunk/Doc/api/init.tex (original) +++ python/trunk/Doc/api/init.tex Fri Aug 11 00:45:34 2006 @@ -696,15 +696,15 @@ \end{cfuncdesc} \begin{cfuncdesc}{int}{PyThreadState_SetAsyncExc}{long id, PyObject *exc} - Asynchronously raise an exception in a thread. + Asynchronously raise an exception in a thread. The \var{id} argument is the thread id of the target thread; \var{exc} is the exception object to be raised. This function does not steal any references to \var{exc}. - To prevent naive misuse, you must write your own C extension - to call this. Must be called with the GIL held. - Returns the number of thread states modified; if it returns a number - greater than one, you're in trouble, and you should call it again - with \var{exc} set to \constant{NULL} to revert the effect. + To prevent naive misuse, you must write your own C extension + to call this. Must be called with the GIL held. + Returns the number of thread states modified; this is normally one, but + will be zero if the thread id isn't found. If \var{exc} is + \constant{NULL}, the pending exception (if any) for the thread is cleared. This raises no exceptions. \versionadded{2.3} \end{cfuncdesc} Modified: python/trunk/Lib/test/test_threading.py ============================================================================== --- python/trunk/Lib/test/test_threading.py (original) +++ python/trunk/Lib/test/test_threading.py Fri Aug 11 00:45:34 2006 @@ -131,6 +131,75 @@ threading._DummyThread)) del threading._active[tid] + # PyThreadState_SetAsyncExc() is a CPython-only gimmick, not (currently) + # exposed at the Python level. This test relies on ctypes to get at it. + def test_PyThreadState_SetAsyncExc(self): + try: + import ctypes + except ImportError: + if verbose: + print "test_PyThreadState_SetAsyncExc can't import ctypes" + return # can't do anything + + set_async_exc = ctypes.pythonapi.PyThreadState_SetAsyncExc + + class AsyncExc(Exception): + pass + + exception = ctypes.py_object(AsyncExc) + + # `worker_started` is set by the thread when it's inside a try/except + # block waiting to catch the asynchronously set AsyncExc exception. + # `worker_saw_exception` is set by the thread upon catching that + # exception. + worker_started = threading.Event() + worker_saw_exception = threading.Event() + + class Worker(threading.Thread): + def run(self): + self.id = thread.get_ident() + self.finished = False + + try: + while True: + worker_started.set() + time.sleep(0.1) + except AsyncExc: + self.finished = True + worker_saw_exception.set() + + t = Worker() + if verbose: + print " started worker thread" + t.start() + + # Try a thread id that doesn't make sense. + if verbose: + print " trying nonsensical thread id" + result = set_async_exc(-1, exception) + self.assertEqual(result, 0) # no thread states modified + + # Now raise an exception in the worker thread. + if verbose: + print " waiting for worker thread to get started" + worker_started.wait() + if verbose: + print " verifying worker hasn't exited" + self.assert_(not t.finished) + if verbose: + print " attempting to raise asynch exception in worker" + result = set_async_exc(t.id, exception) + self.assertEqual(result, 1) # one thread state modified + if verbose: + print " waiting for worker to say it caught the exception" + worker_saw_exception.wait(timeout=10) + self.assert_(t.finished) + if verbose: + print " all OK -- joining worker" + if t.finished: + t.join() + # else the thread is still running, and we have no way to kill it + def test_main(): test.test_support.run_unittest(ThreadTests) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 11 00:45:34 2006 @@ -78,6 +78,15 @@ - Bug #1530448, ctypes buld failure on Solaris 10 was fixed. +C API +----- + +- Bug #1069160. Internal correctness changes were made to + ``PyThreadState_SetAsyncExc()``. A test case was added, and + the documentation was changed to state that the return value + is always 1 (normal) or 0 (if the specified thread wasn't found). + + Mac --- @@ -148,7 +157,7 @@ - os.urandom no longer masks unrelated exceptions like SystemExit or KeyboardInterrupt. -- Bug #1525866: Don't copy directory stat times in +- Bug #1525866: Don't copy directory stat times in shutil.copytree on Windows - Bug #1002398: The documentation for os.path.sameopenfile now correctly @@ -281,7 +290,7 @@ - Bug #1527397: PythonLauncher now launches scripts with the working directory set to the directory that contains the script instead of the user home - directory. That latter was an implementation accident and not what users + directory. That latter was an implementation accident and not what users expect. Modified: python/trunk/Python/pystate.c ============================================================================== --- python/trunk/Python/pystate.c (original) +++ python/trunk/Python/pystate.c Fri Aug 11 00:45:34 2006 @@ -342,28 +342,43 @@ /* Asynchronously raise an exception in a thread. Requested by Just van Rossum and Alex Martelli. To prevent naive misuse, you must write your own extension - to call this. Must be called with the GIL held. - Returns the number of tstates modified; if it returns a number - greater than one, you're in trouble, and you should call it again - with exc=NULL to revert the effect. This raises no exceptions. */ + to call this, or use ctypes. Must be called with the GIL held. + Returns the number of tstates modified (normally 1, but 0 if `id` didn't + match any known thread id). Can be called with exc=NULL to clear an + existing async exception. This raises no exceptions. */ int PyThreadState_SetAsyncExc(long id, PyObject *exc) { PyThreadState *tstate = PyThreadState_GET(); PyInterpreterState *interp = tstate->interp; PyThreadState *p; - int count = 0; + + /* Although the GIL is held, a few C API functions can be called + * without the GIL held, and in particular some that create and + * destroy thread and interpreter states. Those can mutate the + * list of thread states we're traversing, so to prevent that we lock + * head_mutex for the duration. + */ HEAD_LOCK(); for (p = interp->tstate_head; p != NULL; p = p->next) { - if (p->thread_id != id) - continue; - Py_CLEAR(p->async_exc); - Py_XINCREF(exc); - p->async_exc = exc; - count += 1; + if (p->thread_id == id) { + /* Tricky: we need to decref the current value + * (if any) in p->async_exc, but that can in turn + * allow arbitrary Python code to run, including + * perhaps calls to this function. To prevent + * deadlock, we need to release head_mutex before + * the decref. + */ + PyObject *old_exc = p->async_exc; + Py_XINCREF(exc); + p->async_exc = exc; + HEAD_UNLOCK(); + Py_XDECREF(old_exc); + return 1; + } } HEAD_UNLOCK(); - return count; + return 0; } From python-checkins at python.org Fri Aug 11 00:48:45 2006 From: python-checkins at python.org (tim.peters) Date: Fri, 11 Aug 2006 00:48:45 +0200 (CEST) Subject: [Python-checkins] r51196 - python/trunk/Lib/test/test_cgi.py Message-ID: <20060810224845.932941E4007@bag.python.org> Author: tim.peters Date: Fri Aug 11 00:48:45 2006 New Revision: 51196 Modified: python/trunk/Lib/test/test_cgi.py Log: Whitespace normalization. Modified: python/trunk/Lib/test/test_cgi.py ============================================================================== --- python/trunk/Lib/test/test_cgi.py (original) +++ python/trunk/Lib/test/test_cgi.py Fri Aug 11 00:48:45 2006 @@ -258,7 +258,7 @@ -----------------------------721837373350705526688164684 Content-Disposition: form-data; name="submit" - Add + Add -----------------------------721837373350705526688164684-- """ fs = cgi.FieldStorage(fp=StringIO(postdata), environ=env) From buildbot at python.org Fri Aug 11 01:10:12 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 23:10:12 +0000 Subject: [Python-checkins] buildbot warnings in x86 W2k trunk Message-ID: <20060810231012.AF2AA1E4010@bag.python.org> The Buildbot has detected a new failure of x86 W2k trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%2520trunk/builds/1389 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 01:11:13 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 23:11:13 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP-2 trunk Message-ID: <20060810231113.DE3531E4015@bag.python.org> The Buildbot has detected a new failure of x86 XP-2 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP-2%2520trunk/builds/851 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 01:12:00 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 23:12:00 +0000 Subject: [Python-checkins] buildbot warnings in amd64 gentoo trunk Message-ID: <20060810231200.422F31E4017@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%2520gentoo%2520trunk/builds/1398 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 01:12:07 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 23:12:07 +0000 Subject: [Python-checkins] buildbot warnings in x86 gentoo trunk Message-ID: <20060810231207.B02A71E4009@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520gentoo%2520trunk/builds/1482 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 01:14:43 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 23:14:43 +0000 Subject: [Python-checkins] buildbot warnings in x86 OpenBSD trunk Message-ID: <20060810231443.E41811E4007@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%2520trunk/builds/1161 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Fri Aug 11 01:22:14 2006 From: python-checkins at python.org (tim.peters) Date: Fri, 11 Aug 2006 01:22:14 +0200 (CEST) Subject: [Python-checkins] r51197 - python/trunk/Lib/test/test_cgi.py Message-ID: <20060810232214.484E51E4007@bag.python.org> Author: tim.peters Date: Fri Aug 11 01:22:13 2006 New Revision: 51197 Modified: python/trunk/Lib/test/test_cgi.py Log: Whitespace normalization broke test_cgi, because a line of quoted test data relied on preserving a single trailing blank. Changed the string from raw to regular, and forced in the trailing blank via an explicit \x20 escape. Modified: python/trunk/Lib/test/test_cgi.py ============================================================================== --- python/trunk/Lib/test/test_cgi.py (original) +++ python/trunk/Lib/test/test_cgi.py Fri Aug 11 01:22:13 2006 @@ -241,7 +241,7 @@ print "Test basic FieldStorage multipart parsing" env = {'REQUEST_METHOD':'POST', 'CONTENT_TYPE':'multipart/form-data; boundary=---------------------------721837373350705526688164684', 'CONTENT_LENGTH':'558'} - postdata = r"""-----------------------------721837373350705526688164684 + postdata = """-----------------------------721837373350705526688164684 Content-Disposition: form-data; name="id" 1234 @@ -258,7 +258,7 @@ -----------------------------721837373350705526688164684 Content-Disposition: form-data; name="submit" - Add + Add\x20 -----------------------------721837373350705526688164684-- """ fs = cgi.FieldStorage(fp=StringIO(postdata), environ=env) From buildbot at python.org Fri Aug 11 01:25:33 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 23:25:33 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP trunk Message-ID: <20060810232533.6A0AE1E4008@bag.python.org> The Buildbot has detected a new failure of x86 XP trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%2520trunk/builds/1340 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 01:26:19 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 23:26:19 +0000 Subject: [Python-checkins] buildbot warnings in sparc solaris10 gcc trunk Message-ID: <20060810232619.C5D6D1E4008@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520solaris10%2520gcc%2520trunk/builds/1339 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 01:26:45 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 23:26:45 +0000 Subject: [Python-checkins] buildbot warnings in g4 osx.4 trunk Message-ID: <20060810232645.DB5191E4008@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/g4%2520osx.4%2520trunk/builds/1328 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 01:27:28 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 23:27:28 +0000 Subject: [Python-checkins] buildbot warnings in ppc Debian unstable trunk Message-ID: <20060810232729.055871E4008@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%2520Debian%2520unstable%2520trunk/builds/1085 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 01:28:28 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 23:28:28 +0000 Subject: [Python-checkins] buildbot warnings in MIPS Debian trunk Message-ID: <20060810232828.AEDA71E4007@bag.python.org> The Buildbot has detected a new failure of MIPS Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/MIPS%2520Debian%2520trunk/builds/345 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 01:29:38 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 23:29:38 +0000 Subject: [Python-checkins] buildbot failure in sparc Ubuntu dapper trunk Message-ID: <20060810232938.6D7671E4007@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520Ubuntu%2520dapper%2520trunk/builds/624 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 01:30:27 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 23:30:27 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian trunk Message-ID: <20060810233027.6460E1E400E@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%2520trunk/builds/387 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 01:31:20 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 10 Aug 2006 23:31:20 +0000 Subject: [Python-checkins] buildbot failure in S-390 Debian trunk Message-ID: <20060810233123.DA4041E4008@bag.python.org> The Buildbot has detected a new failure of S-390 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%2520Debian%2520trunk/builds/304 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,andrew.macintyre BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Fri Aug 11 02:49:02 2006 From: python-checkins at python.org (tim.peters) Date: Fri, 11 Aug 2006 02:49:02 +0200 (CEST) Subject: [Python-checkins] r51198 - python/trunk/Lib/test/test_threading.py Message-ID: <20060811004902.6376F1E4008@bag.python.org> Author: tim.peters Date: Fri Aug 11 02:49:01 2006 New Revision: 51198 Modified: python/trunk/Lib/test/test_threading.py Log: test_PyThreadState_SetAsyncExc(): This is failing on some 64-bit boxes. I have no idea what the ctypes docs mean by "integers", and blind-guessing here that it intended to mean the signed C "int" type, in which case perhaps I can repair this by feeding the thread id argument to type ctypes.c_long(). Also made the worker thread daemonic, so it doesn't hang Python shutdown if the test continues to fail. Modified: python/trunk/Lib/test/test_threading.py ============================================================================== --- python/trunk/Lib/test/test_threading.py (original) +++ python/trunk/Lib/test/test_threading.py Fri Aug 11 02:49:01 2006 @@ -169,14 +169,15 @@ worker_saw_exception.set() t = Worker() + t.setDaemon(True) # so if this fails, we don't hang Python at shutdown + t.start() if verbose: print " started worker thread" - t.start() # Try a thread id that doesn't make sense. if verbose: print " trying nonsensical thread id" - result = set_async_exc(-1, exception) + result = set_async_exc(ctypes.c_long(-1), exception) self.assertEqual(result, 0) # no thread states modified # Now raise an exception in the worker thread. @@ -188,7 +189,7 @@ self.assert_(not t.finished) if verbose: print " attempting to raise asynch exception in worker" - result = set_async_exc(t.id, exception) + result = set_async_exc(ctypes.c_long(t.id), exception) self.assertEqual(result, 1) # one thread state modified if verbose: print " waiting for worker to say it caught the exception" From python-checkins at python.org Fri Aug 11 05:49:10 2006 From: python-checkins at python.org (tim.peters) Date: Fri, 11 Aug 2006 05:49:10 +0200 (CEST) Subject: [Python-checkins] r51199 - python/trunk/Lib/test/test_signal.py Message-ID: <20060811034910.C67171E400D@bag.python.org> Author: tim.peters Date: Fri Aug 11 05:49:10 2006 New Revision: 51199 Modified: python/trunk/Lib/test/test_signal.py Log: force_test_exit(): This has been completely ineffective at stopping test_signal from hanging forever on the Tru64 buildbot. That could be because there's no such thing as signal.SIGALARM. Changed to the idiotic (but standard) signal.SIGALRM instead, and added some more debug output. Modified: python/trunk/Lib/test/test_signal.py ============================================================================== --- python/trunk/Lib/test/test_signal.py (original) +++ python/trunk/Lib/test/test_signal.py Fri Aug 11 05:49:10 2006 @@ -10,7 +10,10 @@ x = '-x' else: x = '+x' + pid = os.getpid() +if verbose: + print "test runner's pid is", pid # Shell script that will send us asynchronous signals script = """ @@ -89,7 +92,8 @@ time.sleep(MAX_DURATION + 5) print >> sys.__stdout__, ' child should not have to kill parent' for i in range(3): - os.kill(pid, signal.SIGALARM) + os.kill(pid, signal.SIGALRM) + print >> sys.__stdout__, " child sent SIGALRM to", pid finally: os._exit(0) # In parent (or error) From python-checkins at python.org Fri Aug 11 06:22:58 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 11 Aug 2006 06:22:58 +0200 (CEST) Subject: [Python-checkins] r51200 - peps/trunk/pep-0356.txt Message-ID: <20060811042258.324EC1E4008@bag.python.org> Author: neal.norwitz Date: Fri Aug 11 06:22:57 2006 New Revision: 51200 Modified: peps/trunk/pep-0356.txt Log: Remove duplicate entry and cgi issue that was fixed. Reduce priority of element tree crash. It would still be nice to be fixed for 2.5, but shouldn't block release. Modified: peps/trunk/pep-0356.txt ============================================================================== --- peps/trunk/pep-0356.txt (original) +++ peps/trunk/pep-0356.txt Fri Aug 11 06:22:57 2006 @@ -147,11 +147,8 @@ Open issues - Bugs that need resolving before release, ie, they block release: - http://python.org/sf/1530559 - struct rejecting floats (patch pending) - http://python.org/sf/1534630 - potential crash in cElementTree http://python.org/sf/1530559 - struct.pack raises TypeError where it used to convert (Owner: Bob Ippolito) - http://python.org/sf/1112549 - potential DoS in cgi.py http://mail.python.org/pipermail/python-dev/2006-July/067774.html Problem with __index__ (patch pending) @@ -160,6 +157,7 @@ str/unicode dict keys can raise an exception - Bugs that ought to be resolved before release (all exist in 2.4): + http://python.org/sf/1534630 - potential crash in cElementTree http://python.org/sf/1475523 - gettext.py bug (owner: Martin v. Loewis) http://python.org/sf/1467929 - %-formatting and dicts From nnorwitz at gmail.com Fri Aug 11 06:33:51 2006 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 10 Aug 2006 21:33:51 -0700 Subject: [Python-checkins] r51119 - in python/trunk: Lib/test/test_struct.py Misc/NEWS Modules/_struct.c In-Reply-To: <20060804235922.CB4C41E4003@bag.python.org> References: <20060804235922.CB4C41E4003@bag.python.org> Message-ID: > Modified: python/trunk/Lib/test/test_struct.py > ============================================================================== > --- python/trunk/Lib/test/test_struct.py (original) > +++ python/trunk/Lib/test/test_struct.py Sat Aug 5 01:59:21 2006 > @@ -15,9 +15,11 @@ > except ImportError: > PY_STRUCT_RANGE_CHECKING = 0 > PY_STRUCT_OVERFLOW_MASKING = 1 > + PY_STRUCT_FLOAT_COERCE = 2 > else: > - PY_STRUCT_RANGE_CHECKING = _struct._PY_STRUCT_RANGE_CHECKING > - PY_STRUCT_OVERFLOW_MASKING = _struct._PY_STRUCT_OVERFLOW_MASKING > + PY_STRUCT_RANGE_CHECKING = getattr(_struct, '_PY_STRUCT_RANGE_CHECKING', 0) > + PY_STRUCT_OVERFLOW_MASKING = getattr(_struct, '_PY_STRUCT_OVERFLOW_MASKING', 0) > + PY_STRUCT_FLOAT_COERCE = getattr(_struct, '_PY_STRUCT_FLOAT_COERCE', 0) It would be really nice to document what each of these values mean. It's confusing without reading the code and seems odd to me. Particularly PY_STRUCT_FLOAT_COERCE. I closed the bug report/patch associated with this checkin. Thanks, n From python-checkins at python.org Fri Aug 11 06:34:29 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 11 Aug 2006 06:34:29 +0200 (CEST) Subject: [Python-checkins] r51201 - peps/trunk/pep-0356.txt Message-ID: <20060811043429.0BD3E1E4009@bag.python.org> Author: neal.norwitz Date: Fri Aug 11 06:34:28 2006 New Revision: 51201 Modified: peps/trunk/pep-0356.txt Log: struct.pack was fixed about a week ago. Modified: peps/trunk/pep-0356.txt ============================================================================== --- peps/trunk/pep-0356.txt (original) +++ peps/trunk/pep-0356.txt Fri Aug 11 06:34:28 2006 @@ -147,8 +147,6 @@ Open issues - Bugs that need resolving before release, ie, they block release: - http://python.org/sf/1530559 - struct.pack raises TypeError where it - used to convert (Owner: Bob Ippolito) http://mail.python.org/pipermail/python-dev/2006-July/067774.html Problem with __index__ (patch pending) From python-checkins at python.org Fri Aug 11 08:09:43 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 11 Aug 2006 08:09:43 +0200 (CEST) Subject: [Python-checkins] r51202 - in python/trunk: Lib/test/test_mailbox.py Misc/NEWS Message-ID: <20060811060943.0A4FC1E4008@bag.python.org> Author: neal.norwitz Date: Fri Aug 11 08:09:41 2006 New Revision: 51202 Modified: python/trunk/Lib/test/test_mailbox.py python/trunk/Misc/NEWS Log: Fix the failures on cygwin (2006-08-10 fixed the actual locking issue). The first hunk changes the colon to an ! like other Windows variants. We need to always wait on the child so the lock gets released and no other tests fail. This is the try/finally in the second hunk. Modified: python/trunk/Lib/test/test_mailbox.py ============================================================================== --- python/trunk/Lib/test/test_mailbox.py (original) +++ python/trunk/Lib/test/test_mailbox.py Fri Aug 11 08:09:41 2006 @@ -1,4 +1,5 @@ import os +import sys import time import stat import socket @@ -461,7 +462,7 @@ def setUp(self): TestMailbox.setUp(self) - if os.name in ('nt', 'os2'): + if os.name in ('nt', 'os2') or sys.platform == 'cygwin': self._box.colon = '!' def test_add_MM(self): @@ -736,11 +737,13 @@ # In the parent, sleep a bit to give the child time to acquire # the lock. time.sleep(0.5) - self.assertRaises(mailbox.ExternalClashError, - self._box.lock) + try: + self.assertRaises(mailbox.ExternalClashError, + self._box.lock) + finally: + # Wait for child to exit. Locking should now succeed. + exited_pid, status = os.waitpid(pid, 0) - # Wait for child to exit. Locking should now succeed. - exited_pid, status = os.waitpid(pid, 0) self._box.lock() self._box.unlock() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 11 08:09:41 2006 @@ -58,6 +58,8 @@ Tests ----- +- test_mailbox should now work on cygwin versions 2006-08-10 and later. + - Bug #1535182: really test the xreadlines() method of bz2 objects. - test_threading now skips testing alternate thread stack sizes on From python-checkins at python.org Fri Aug 11 09:11:15 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 11 Aug 2006 09:11:15 +0200 (CEST) Subject: [Python-checkins] r51203 - peps/trunk/pep-0302.txt Message-ID: <20060811071115.04C5A1E4008@bag.python.org> Author: georg.brandl Date: Fri Aug 11 09:11:14 2006 New Revision: 51203 Modified: peps/trunk/pep-0302.txt Log: Add a sentence clarifying that once a path_hooks importer has been found for a sys.path entry, the builtin import machinery will not handle that entry any longer. Modified: peps/trunk/pep-0302.txt ============================================================================== --- peps/trunk/pep-0302.txt (original) +++ peps/trunk/pep-0302.txt Fri Aug 11 09:11:14 2006 @@ -311,13 +311,16 @@ sequence to determine if they can handle a given path item. The callable is called with one argument, the path item. The callable must raise ImportError if it is unable to handle the path item, and - return an importer object if it can handle the path item. The - callable is typically the class of the import hook, and hence the - class __init__ method is called. (This is also the reason why it - should raise ImportError: an __init__ method can't return anything. - This would be possible with a __new__ method in a new style class, - but we don't want to require anything about how a hook is - implemented.) + return an importer object if it can handle the path item. Note + that if the callable returns an importer object for a specific + sys.path entry, the builtin import machinery will not be invoked + to handle that entry any longer, even if the importer object later + fails to find a specific module. The callable is typically the + class of the import hook, and hence the class __init__ method is + called. (This is also the reason why it should raise ImportError: + an __init__ method can't return anything. This would be possible + with a __new__ method in a new style class, but we don't want to + require anything about how a hook is implemented.) The results of path hook checks are cached in sys.path_importer_cache, which is a dictionary mapping path entries From python-checkins at python.org Fri Aug 11 09:14:39 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 11 Aug 2006 09:14:39 +0200 (CEST) Subject: [Python-checkins] r51204 - in python/branches/release24-maint: Lib/cgi.py Lib/test/output/test_cgi Lib/test/test_cgi.py Misc/NEWS Message-ID: <20060811071439.85ECA1E4008@bag.python.org> Author: georg.brandl Date: Fri Aug 11 09:14:38 2006 New Revision: 51204 Modified: python/branches/release24-maint/Lib/cgi.py python/branches/release24-maint/Lib/test/output/test_cgi python/branches/release24-maint/Lib/test/test_cgi.py python/branches/release24-maint/Misc/NEWS Log: Chris McDonough's patch to defend against certain DoS attacks on FieldStorage. SF bug #1112549. (backport from rev. 51190) Modified: python/branches/release24-maint/Lib/cgi.py ============================================================================== --- python/branches/release24-maint/Lib/cgi.py (original) +++ python/branches/release24-maint/Lib/cgi.py Fri Aug 11 09:14:38 2006 @@ -247,6 +247,10 @@ XXX This should really be subsumed by FieldStorage altogether -- no point in having two implementations of the same parsing algorithm. + Also, FieldStorage protects itself better against certain DoS attacks + by limiting the size of the data read in one chunk. The API here + does not support that kind of protection. This also affects parse() + since it can call parse_multipart(). """ boundary = "" @@ -695,7 +699,7 @@ def read_lines_to_eof(self): """Internal: read lines until EOF.""" while 1: - line = self.fp.readline() + line = self.fp.readline(1<<16) if not line: self.done = -1 break @@ -706,12 +710,13 @@ next = "--" + self.outerboundary last = next + "--" delim = "" + last_line_lfend = True while 1: - line = self.fp.readline() + line = self.fp.readline(1<<16) if not line: self.done = -1 break - if line[:2] == "--": + if line[:2] == "--" and last_line_lfend: strippedline = line.strip() if strippedline == next: break @@ -722,11 +727,14 @@ if line[-2:] == "\r\n": delim = "\r\n" line = line[:-2] + last_line_lfend = True elif line[-1] == "\n": delim = "\n" line = line[:-1] + last_line_lfend = True else: delim = "" + last_line_lfend = False self.__write(odelim + line) def skip_lines(self): @@ -735,18 +743,20 @@ return next = "--" + self.outerboundary last = next + "--" + last_line_lfend = True while 1: - line = self.fp.readline() + line = self.fp.readline(1<<16) if not line: self.done = -1 break - if line[:2] == "--": + if line[:2] == "--" and last_line_lfend: strippedline = line.strip() if strippedline == next: break if strippedline == last: self.done = 1 break + last_line_lfend = line.endswith('\n') def make_file(self, binary=None): """Overridable: return a readable & writable file. Modified: python/branches/release24-maint/Lib/test/output/test_cgi ============================================================================== --- python/branches/release24-maint/Lib/test/output/test_cgi (original) +++ python/branches/release24-maint/Lib/test/output/test_cgi Fri Aug 11 09:14:38 2006 @@ -38,3 +38,5 @@ Testing log Testing initlog 1 Testing log 2 +Test FieldStorage methods that use readline +Test basic FieldStorage multipart parsing Modified: python/branches/release24-maint/Lib/test/test_cgi.py ============================================================================== --- python/branches/release24-maint/Lib/test/test_cgi.py (original) +++ python/branches/release24-maint/Lib/test/test_cgi.py Fri Aug 11 09:14:38 2006 @@ -2,6 +2,8 @@ import cgi import os import sys +import tempfile +from StringIO import StringIO class HackedSysModule: # The regression test will have real values in sys.argv, which @@ -203,4 +205,71 @@ cgi.initlog("%s", "Testing log 3") cgi.log("Testing log 4") + print "Test FieldStorage methods that use readline" + # FieldStorage uses readline, which has the capacity to read all + # contents of the input file into memory; we use readline's size argument + # to prevent that for files that do not contain any newlines in + # non-GET/HEAD requests + class TestReadlineFile: + def __init__(self, file): + self.file = file + self.numcalls = 0 + + def readline(self, size=None): + self.numcalls += 1 + if size: + return self.file.readline(size) + else: + return self.file.readline() + + def __getattr__(self, name): + file = self.__dict__['file'] + a = getattr(file, name) + if not isinstance(a, int): + setattr(self, name, a) + return a + + f = TestReadlineFile(tempfile.TemporaryFile()) + f.write('x' * 256 * 1024) + f.seek(0) + env = {'REQUEST_METHOD':'PUT'} + fs = cgi.FieldStorage(fp=f, environ=env) + # if we're not chunking properly, readline is only called twice + # (by read_binary); if we are chunking properly, it will be called 5 times + # as long as the chunksize is 1 << 16. + verify(f.numcalls > 2) + + print "Test basic FieldStorage multipart parsing" + env = {'REQUEST_METHOD':'POST', 'CONTENT_TYPE':'multipart/form-data; boundary=---------------------------721837373350705526688164684', 'CONTENT_LENGTH':'558'} + postdata = r"""-----------------------------721837373350705526688164684 +Content-Disposition: form-data; name="id" + +1234 +-----------------------------721837373350705526688164684 +Content-Disposition: form-data; name="title" + + +-----------------------------721837373350705526688164684 +Content-Disposition: form-data; name="file"; filename="test.txt" +Content-Type: text/plain + +Testing 123. + +-----------------------------721837373350705526688164684 +Content-Disposition: form-data; name="submit" + + Add +-----------------------------721837373350705526688164684-- +""" + fs = cgi.FieldStorage(fp=StringIO(postdata), environ=env) + verify(len(fs.list) == 4) + expect = [{'name':'id', 'filename':None, 'value':'1234'}, + {'name':'title', 'filename':None, 'value':''}, + {'name':'file', 'filename':'test.txt','value':'Testing 123.\n'}, + {'name':'submit', 'filename':None, 'value':' Add '}] + for x in range(len(fs.list)): + for k, exp in expect[x].items(): + got = getattr(fs.list[x], k) + verify(got == exp) + main() Modified: python/branches/release24-maint/Misc/NEWS ============================================================================== --- python/branches/release24-maint/Misc/NEWS (original) +++ python/branches/release24-maint/Misc/NEWS Fri Aug 11 09:14:38 2006 @@ -72,6 +72,8 @@ Library ------- +- Bug #1112549, DoS attack on cgi.FieldStorage. + - Bug #1257728: Complain about missing VS 2003 in the error message of msvccompiler, and mention Cygwin as an alternative. From python-checkins at python.org Fri Aug 11 09:15:39 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 11 Aug 2006 09:15:39 +0200 (CEST) Subject: [Python-checkins] r51205 - python/trunk/Misc/ACKS Message-ID: <20060811071539.5A7751E401B@bag.python.org> Author: georg.brandl Date: Fri Aug 11 09:15:38 2006 New Revision: 51205 Modified: python/trunk/Misc/ACKS Log: Add Chris McDonough (latest cgi.py patch) Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Fri Aug 11 09:15:38 2006 @@ -412,6 +412,7 @@ Michael McLay Gordon McMillan Jay T. Miller +Chris McDonough Andrew McNamara Caolan McNamara Craig McPheeters From python-checkins at python.org Fri Aug 11 09:26:17 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 11 Aug 2006 09:26:17 +0200 (CEST) Subject: [Python-checkins] r51206 - in python/trunk: Lib/logging/__init__.py Misc/NEWS Message-ID: <20060811072617.CB5BF1E4009@bag.python.org> Author: georg.brandl Date: Fri Aug 11 09:26:10 2006 New Revision: 51206 Modified: python/trunk/Lib/logging/__init__.py python/trunk/Misc/NEWS Log: logging's atexit hook now runs even if the rest of the module has already been cleaned up. Modified: python/trunk/Lib/logging/__init__.py ============================================================================== --- python/trunk/Lib/logging/__init__.py (original) +++ python/trunk/Lib/logging/__init__.py Fri Aug 11 09:26:10 2006 @@ -1337,14 +1337,14 @@ """ root.manager.disable = level -def shutdown(): +def shutdown(handlerList=_handlerList): """ Perform any cleanup actions in the logging system (e.g. flushing buffers). Should be called at application exit. """ - for h in _handlerList[:]: # was _handlers.keys(): + for h in handlerList[:]: #errors might occur, for example, if files are locked #we just ignore them if raiseExceptions is not set try: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 11 09:26:10 2006 @@ -38,6 +38,9 @@ Library ------- +- logging's atexit hook now runs even if the rest of the module has + already been cleaned up. + - Bug #1112549, DoS attack on cgi.FieldStorage. - Bug #1531405, format_exception no longer raises an exception if From python-checkins at python.org Fri Aug 11 09:32:53 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 11 Aug 2006 09:32:53 +0200 (CEST) Subject: [Python-checkins] r51207 - python/branches/release24-maint/Lib/test/test_cgi.py Message-ID: <20060811073253.A52B81E4008@bag.python.org> Author: georg.brandl Date: Fri Aug 11 09:32:53 2006 New Revision: 51207 Modified: python/branches/release24-maint/Lib/test/test_cgi.py Log: Backport whitespace-normalization-proofing test_cgi fix. Modified: python/branches/release24-maint/Lib/test/test_cgi.py ============================================================================== --- python/branches/release24-maint/Lib/test/test_cgi.py (original) +++ python/branches/release24-maint/Lib/test/test_cgi.py Fri Aug 11 09:32:53 2006 @@ -241,7 +241,7 @@ print "Test basic FieldStorage multipart parsing" env = {'REQUEST_METHOD':'POST', 'CONTENT_TYPE':'multipart/form-data; boundary=---------------------------721837373350705526688164684', 'CONTENT_LENGTH':'558'} - postdata = r"""-----------------------------721837373350705526688164684 + postdata = """-----------------------------721837373350705526688164684 Content-Disposition: form-data; name="id" 1234 @@ -258,7 +258,7 @@ -----------------------------721837373350705526688164684 Content-Disposition: form-data; name="submit" - Add + Add\x20 -----------------------------721837373350705526688164684-- """ fs = cgi.FieldStorage(fp=StringIO(postdata), environ=env) From python-checkins at python.org Fri Aug 11 09:35:51 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 11 Aug 2006 09:35:51 +0200 (CEST) Subject: [Python-checkins] r51208 - python/branches/release24-maint/Doc/api/newtypes.tex Message-ID: <20060811073551.7E0BE1E4008@bag.python.org> Author: georg.brandl Date: Fri Aug 11 09:35:51 2006 New Revision: 51208 Modified: python/branches/release24-maint/Doc/api/newtypes.tex Log: Fix typo. Modified: python/branches/release24-maint/Doc/api/newtypes.tex ============================================================================== --- python/branches/release24-maint/Doc/api/newtypes.tex (original) +++ python/branches/release24-maint/Doc/api/newtypes.tex Fri Aug 11 09:35:51 2006 @@ -525,7 +525,7 @@ \member{tp_free}. The object deallocator should be the one used to allocate the instance; this is normally \cfunction{PyObject_Del()} if the instance was allocated using \cfunction{PyObject_New()} or - \cfunction{PyOject_VarNew()}, or \cfunction{PyObject_GC_Del()} if + \cfunction{PyObject_VarNew()}, or \cfunction{PyObject_GC_Del()} if the instance was allocated using \cfunction{PyObject_GC_New()} or \cfunction{PyObject_GC_VarNew()}. From buildbot at python.org Fri Aug 11 10:32:27 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 11 Aug 2006 08:32:27 +0000 Subject: [Python-checkins] buildbot warnings in x86 OpenBSD 2.4 Message-ID: <20060811083227.934EA1E4008@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%25202.4/builds/151 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 10:41:03 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 11 Aug 2006 08:41:03 +0000 Subject: [Python-checkins] buildbot warnings in ppc Debian unstable trunk Message-ID: <20060811084103.E65EA1E4008@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%2520Debian%2520unstable%2520trunk/builds/1090 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 10:48:29 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 11 Aug 2006 08:48:29 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian trunk Message-ID: <20060811084829.30FDA1E4008@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%2520trunk/builds/392 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 11 10:55:07 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 11 Aug 2006 08:55:07 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060811085508.080AD1E4008@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1063 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From bob at redivi.com Fri Aug 11 11:03:56 2006 From: bob at redivi.com (Bob Ippolito) Date: Fri, 11 Aug 2006 02:03:56 -0700 Subject: [Python-checkins] r51119 - in python/trunk: Lib/test/test_struct.py Misc/NEWS Modules/_struct.c In-Reply-To: References: <20060804235922.CB4C41E4003@bag.python.org> Message-ID: <854D1341-3FF7-405E-B29C-B30C0CF54487@redivi.com> They're all documented in _struct.c /* If PY_STRUCT_FLOAT_COERCE is defined, the struct module will allow float arguments for integer formats with a warning for backwards compatibility. */ -bob On Aug 10, 2006, at 9:33 PM, Neal Norwitz wrote: >> Modified: python/trunk/Lib/test/test_struct.py >> ===================================================================== >> ========= >> --- python/trunk/Lib/test/test_struct.py (original) >> +++ python/trunk/Lib/test/test_struct.py Sat Aug 5 >> 01:59:21 2006 >> @@ -15,9 +15,11 @@ >> except ImportError: >> PY_STRUCT_RANGE_CHECKING = 0 >> PY_STRUCT_OVERFLOW_MASKING = 1 >> + PY_STRUCT_FLOAT_COERCE = 2 >> else: >> - PY_STRUCT_RANGE_CHECKING = _struct._PY_STRUCT_RANGE_CHECKING >> - PY_STRUCT_OVERFLOW_MASKING = _struct._PY_STRUCT_OVERFLOW_MASKING >> + PY_STRUCT_RANGE_CHECKING = getattr(_struct, >> '_PY_STRUCT_RANGE_CHECKING', 0) >> + PY_STRUCT_OVERFLOW_MASKING = getattr(_struct, >> '_PY_STRUCT_OVERFLOW_MASKING', 0) >> + PY_STRUCT_FLOAT_COERCE = getattr(_struct, >> '_PY_STRUCT_FLOAT_COERCE', 0) > > It would be really nice to document what each of these values mean. > It's confusing without reading the code and seems odd to me. > Particularly PY_STRUCT_FLOAT_COERCE. > > I closed the bug report/patch associated with this checkin. > > Thanks, > n From buildbot at python.org Fri Aug 11 16:06:35 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 11 Aug 2006 14:06:35 +0000 Subject: [Python-checkins] buildbot warnings in S-390 Debian trunk Message-ID: <20060811140635.351FB1E4009@bag.python.org> The Buildbot has detected a new failure of S-390 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%2520Debian%2520trunk/builds/305 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,armin.rigo,georg.brandl,guido.van.rossum,kurt.kaiser,martin.v.loewis,neal.norwitz,ronald.oussoren,thomas.heller,tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From jimjjewett at gmail.com Fri Aug 11 16:20:39 2006 From: jimjjewett at gmail.com (Jim Jewett) Date: Fri, 11 Aug 2006 10:20:39 -0400 Subject: [Python-checkins] r51195 - in python/trunk: Doc/api/init.tex Lib/test/test_threading.py Misc/NEWS Python/pystate.c In-Reply-To: <20060810224536.5CABF1E400C@bag.python.org> References: <20060810224536.5CABF1E400C@bag.python.org> Message-ID: It seems a bit odd to say that *this* raises no exceptions. Maybe "This raises no exceptions (except, of course, in the target thread)." On 8/10/06, tim.peters wrote: > Author: tim.peters > Date: Fri Aug 11 00:45:34 2006 > New Revision: 51195 ============================================================================== > --- python/trunk/Doc/api/init.tex (original) > +++ python/trunk/Doc/api/init.tex Fri Aug 11 00:45:34 2006 > @@ -696,15 +696,15 @@ > \end{cfuncdesc} > > \begin{cfuncdesc}{int}{PyThreadState_SetAsyncExc}{long id, PyObject *exc} > - Asynchronously raise an exception in a thread. > + Asynchronously raise an exception in a thread. > The \var{id} argument is the thread id of the target thread; > \var{exc} is the exception object to be raised. > This function does not steal any references to \var{exc}. > - To prevent naive misuse, you must write your own C extension > - to call this. Must be called with the GIL held. > - Returns the number of thread states modified; if it returns a number > - greater than one, you're in trouble, and you should call it again > - with \var{exc} set to \constant{NULL} to revert the effect. > + To prevent naive misuse, you must write your own C extension > + to call this. Must be called with the GIL held. > + Returns the number of thread states modified; this is normally one, but > + will be zero if the thread id isn't found. If \var{exc} is > + \constant{NULL}, the pending exception (if any) for the thread is cleared. > This raises no exceptions. > \versionadded{2.3} > \end{cfuncdesc} From buildbot at python.org Fri Aug 11 16:26:23 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 11 Aug 2006 14:26:23 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian 2.4 Message-ID: <20060811142623.594C51E400A@bag.python.org> The Buildbot has detected a new failure of alpha Debian 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%25202.4/builds/7 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Fri Aug 11 17:02:44 2006 From: python-checkins at python.org (thomas.wouters) Date: Fri, 11 Aug 2006 17:02:44 +0200 (CEST) Subject: [Python-checkins] r51212 - python/trunk/Lib/xml/etree Message-ID: <20060811150244.067371E4009@bag.python.org> Author: thomas.wouters Date: Fri Aug 11 17:02:39 2006 New Revision: 51212 Modified: python/trunk/Lib/xml/etree/ (props changed) Log: Add ignore of *.pyc and *.pyo to Lib/xml/etree/. From nnorwitz at gmail.com Fri Aug 11 17:25:09 2006 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 11 Aug 2006 08:25:09 -0700 Subject: [Python-checkins] r51119 - in python/trunk: Lib/test/test_struct.py Misc/NEWS Modules/_struct.c In-Reply-To: <854D1341-3FF7-405E-B29C-B30C0CF54487@redivi.com> References: <20060804235922.CB4C41E4003@bag.python.org> <854D1341-3FF7-405E-B29C-B30C0CF54487@redivi.com> Message-ID: On 8/11/06, Bob Ippolito wrote: > They're all documented in _struct.c > > > /* If PY_STRUCT_FLOAT_COERCE is defined, the struct module will allow > float > arguments for integer formats with a warning for backwards > compatibility. */ Yet in the python code below, PY_STRUCT_FLOAT_COERCE can have the values 0, 1, or 2. n > > > -bob > > On Aug 10, 2006, at 9:33 PM, Neal Norwitz wrote: > > >> Modified: python/trunk/Lib/test/test_struct.py > >> ===================================================================== > >> ========= > >> --- python/trunk/Lib/test/test_struct.py (original) > >> +++ python/trunk/Lib/test/test_struct.py Sat Aug 5 > >> 01:59:21 2006 > >> @@ -15,9 +15,11 @@ > >> except ImportError: > >> PY_STRUCT_RANGE_CHECKING = 0 > >> PY_STRUCT_OVERFLOW_MASKING = 1 > >> + PY_STRUCT_FLOAT_COERCE = 2 > >> else: > >> - PY_STRUCT_RANGE_CHECKING = _struct._PY_STRUCT_RANGE_CHECKING > >> - PY_STRUCT_OVERFLOW_MASKING = _struct._PY_STRUCT_OVERFLOW_MASKING > >> + PY_STRUCT_RANGE_CHECKING = getattr(_struct, > >> '_PY_STRUCT_RANGE_CHECKING', 0) > >> + PY_STRUCT_OVERFLOW_MASKING = getattr(_struct, > >> '_PY_STRUCT_OVERFLOW_MASKING', 0) > >> + PY_STRUCT_FLOAT_COERCE = getattr(_struct, > >> '_PY_STRUCT_FLOAT_COERCE', 0) > > > > It would be really nice to document what each of these values mean. > > It's confusing without reading the code and seems odd to me. > > Particularly PY_STRUCT_FLOAT_COERCE. > > > > I closed the bug report/patch associated with this checkin. > > > > Thanks, > > n > > From buildbot at python.org Fri Aug 11 18:01:50 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 11 Aug 2006 16:01:50 +0000 Subject: [Python-checkins] buildbot warnings in S-390 Debian 2.4 Message-ID: <20060811160150.2B2A91E4008@bag.python.org> The Buildbot has detected a new failure of S-390 Debian 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%2520Debian%25202.4/builds/47 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl,thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Fri Aug 11 18:59:40 2006 From: python-checkins at python.org (thomas.heller) Date: Fri, 11 Aug 2006 18:59:40 +0200 (CEST) Subject: [Python-checkins] r51213 - peps/trunk/pep-0356.txt Message-ID: <20060811165940.600211E4008@bag.python.org> Author: thomas.heller Date: Fri Aug 11 18:59:39 2006 New Revision: 51213 Modified: peps/trunk/pep-0356.txt Log: Per MvL's suggestion, add #1532975 to PEP 356. Modified: peps/trunk/pep-0356.txt ============================================================================== --- peps/trunk/pep-0356.txt (original) +++ peps/trunk/pep-0356.txt Fri Aug 11 18:59:39 2006 @@ -154,6 +154,11 @@ http://mail.python.org/pipermail/python-dev/2006-August/067926.html str/unicode dict keys can raise an exception + - Bugs that ought to be resolved before release: + + http://python.org/sf/1533481 - ctypes _as_parameter_ not + working as documented (work in progress) + - Bugs that ought to be resolved before release (all exist in 2.4): http://python.org/sf/1534630 - potential crash in cElementTree http://python.org/sf/1475523 - gettext.py bug (owner: Martin v. Loewis) From python-checkins at python.org Fri Aug 11 21:55:35 2006 From: python-checkins at python.org (thomas.heller) Date: Fri, 11 Aug 2006 21:55:35 +0200 (CEST) Subject: [Python-checkins] r51215 - python/trunk/Modules/_ctypes/callbacks.c Message-ID: <20060811195535.9D7E71E4018@bag.python.org> Author: thomas.heller Date: Fri Aug 11 21:55:35 2006 New Revision: 51215 Modified: python/trunk/Modules/_ctypes/callbacks.c Log: When a ctypes C callback function is called, zero out the result storage before converting the result to C data. See the comment in the code for details. Provide a better context for errors when the conversion of a callback function's result cannot be converted. Modified: python/trunk/Modules/_ctypes/callbacks.c ============================================================================== --- python/trunk/Modules/_ctypes/callbacks.c (original) +++ python/trunk/Modules/_ctypes/callbacks.c Fri Aug 11 21:55:35 2006 @@ -205,14 +205,24 @@ result = PyObject_CallObject(callable, arglist); CHECK("'calling callback function'", result); +#ifdef WORDS_BIGENDIAN + /* See the corresponding code in callproc.c, around line 961 */ + if (restype->type != FFI_TYPE_FLOAT && restype->size < sizeof(ffi_arg)) + mem = (char *)mem + sizeof(ffi_arg) - restype->size; +#endif + /* The code that converts 'result' into C data is not executed when + 'callable' returns Py_None, so we zero out the memory that will + receive the C return data to not return random data. + + Cleaner would be to call 'setfunc' anyway and complain with + PyErr_WriteUnraisable(), but ctypes has always accepted a Py_None + return value for *any* 'restype' and it would probably break too + much code if this is changed now. + */ + memset(mem, 0, restype->size); if ((restype != &ffi_type_void) && result && result != Py_None) { PyObject *keep; assert(setfunc); -#ifdef WORDS_BIGENDIAN - /* See the corresponding code in callproc.c, around line 961 */ - if (restype->type != FFI_TYPE_FLOAT && restype->size < sizeof(ffi_arg)) - mem = (char *)mem + sizeof(ffi_arg) - restype->size; -#endif keep = setfunc(mem, result, 0); CHECK("'converting callback result'", keep); /* keep is an object we have to keep alive so that the result @@ -225,13 +235,13 @@ itself knows how to manage the refcount of these objects. */ if (keep == NULL) /* Could not convert callback result. */ - PyErr_WriteUnraisable(Py_None); + PyErr_WriteUnraisable(callable); else if (keep == Py_None) /* Nothing to keep */ Py_DECREF(keep); else if (setfunc != getentry("O")->setfunc) { if (-1 == PyErr_Warn(PyExc_RuntimeWarning, "memory leak in callback function.")) - PyErr_WriteUnraisable(Py_None); + PyErr_WriteUnraisable(callable); } } Py_XDECREF(result); From python-checkins at python.org Sat Aug 12 03:43:42 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 03:43:42 +0200 (CEST) Subject: [Python-checkins] r51218 - in python/trunk: Misc/README.klocwork Modules/_codecsmodule.c Modules/_elementtree.c Modules/_hotshot.c Modules/arraymodule.c Objects/structseq.c Python/ast.c Python/symtable.c Message-ID: <20060812014342.EAE731E4009@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 03:43:40 2006 New Revision: 51218 Modified: python/trunk/Misc/README.klocwork python/trunk/Modules/_codecsmodule.c python/trunk/Modules/_elementtree.c python/trunk/Modules/_hotshot.c python/trunk/Modules/arraymodule.c python/trunk/Objects/structseq.c python/trunk/Python/ast.c python/trunk/Python/symtable.c Log: Klocwork made another run and found a bunch more problems. This is the first batch of fixes that should be easy to verify based on context. This fixes problem numbers: 220 (ast), 323-324 (symtable), 321-322 (structseq), 215 (array), 210 (hotshot), 182 (codecs), 209 (etree). Modified: python/trunk/Misc/README.klocwork ============================================================================== --- python/trunk/Misc/README.klocwork (original) +++ python/trunk/Misc/README.klocwork Sat Aug 12 03:43:40 2006 @@ -23,4 +23,8 @@ False positives were also annotated so that the comments can be reviewed and reversed if the analysis was incorrect. +A second run was performed on 10-Aug-2006. The tool was tuned to remove +some false positives and perform some additional checks. ~150 new +warnings were produced, primarily related to dereferencing NULL pointers. + Contact python-dev at python.org for more information. Modified: python/trunk/Modules/_codecsmodule.c ============================================================================== --- python/trunk/Modules/_codecsmodule.c (original) +++ python/trunk/Modules/_codecsmodule.c Sat Aug 12 03:43:40 2006 @@ -192,7 +192,8 @@ buf = PyString_AS_STRING (str); len = PyString_GET_SIZE (str); memmove(buf, buf+1, len-2); - _PyString_Resize(&str, len-2); + if (_PyString_Resize(&str, len-2) < 0) + return NULL; return codec_tuple(str, PyString_Size(str)); } Modified: python/trunk/Modules/_elementtree.c ============================================================================== --- python/trunk/Modules/_elementtree.c (original) +++ python/trunk/Modules/_elementtree.c Sat Aug 12 03:43:40 2006 @@ -809,7 +809,7 @@ PyObject* text = element_get_text(item); if (text == Py_None) return PyString_FromString(""); - Py_INCREF(text); + Py_XINCREF(text); return text; } } Modified: python/trunk/Modules/_hotshot.c ============================================================================== --- python/trunk/Modules/_hotshot.c (original) +++ python/trunk/Modules/_hotshot.c Sat Aug 12 03:43:40 2006 @@ -313,6 +313,11 @@ return err; buf = (char *)malloc(len); + if (!buf) { + PyErr_NoMemory(); + return ERR_EXCEPTION; + } + for (i=0; i < len; i++) { ch = fgetc(self->logfp); buf[i] = ch; Modified: python/trunk/Modules/arraymodule.c ============================================================================== --- python/trunk/Modules/arraymodule.c (original) +++ python/trunk/Modules/arraymodule.c Sat Aug 12 03:43:40 2006 @@ -702,6 +702,8 @@ /* Special case "a[i:j] = a" -- copy b first */ int ret; v = array_slice(b, 0, n); + if (!v) + return -1; ret = array_ass_slice(a, ilow, ihigh, v); Py_DECREF(v); return ret; @@ -1708,6 +1710,8 @@ if (self == av) { value = array_slice(av, 0, av->ob_size); av = (arrayobject*)value; + if (!av) + return -1; } else { Py_INCREF(value); Modified: python/trunk/Objects/structseq.c ============================================================================== --- python/trunk/Objects/structseq.c (original) +++ python/trunk/Objects/structseq.c Sat Aug 12 03:43:40 2006 @@ -215,6 +215,8 @@ PyObject *tup; int result; tup = make_tuple(obj); + if (!tup) + return -1; result = PySequence_Contains(tup, o); Py_DECREF(tup); return result; @@ -226,6 +228,8 @@ PyObject *tup; long result; tup = make_tuple((PyStructSequence*) obj); + if (!tup) + return -1; result = PyObject_Hash(tup); Py_DECREF(tup); return result; Modified: python/trunk/Python/ast.c ============================================================================== --- python/trunk/Python/ast.c (original) +++ python/trunk/Python/ast.c Sat Aug 12 03:43:40 2006 @@ -2197,6 +2197,8 @@ } else { alias_ty a = alias_for_import_name(c, CHILD(n, 0)); + if (!a) + return NULL; if (strcmp(STR(CHILD(n, 1)), "as") != 0) { ast_error(n, "must use 'as' in import"); return NULL; Modified: python/trunk/Python/symtable.c ============================================================================== --- python/trunk/Python/symtable.c (original) +++ python/trunk/Python/symtable.c Sat Aug 12 03:43:40 2006 @@ -915,6 +915,8 @@ PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]", ++st->st_cur->ste_tmpname); tmp = PyString_InternFromString(tmpname); + if (!tmp) + return 0; if (!symtable_add_def(st, tmp, DEF_LOCAL)) return 0; Py_DECREF(tmp); @@ -1323,8 +1325,11 @@ PyObject *name = (a->asname == NULL) ? a->name : a->asname; const char *base = PyString_AS_STRING(name); char *dot = strchr(base, '.'); - if (dot) + if (dot) { store_name = PyString_FromStringAndSize(base, dot - base); + if (!store_name) + return 0; + } else { store_name = name; Py_INCREF(store_name); From python-checkins at python.org Sat Aug 12 03:45:48 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 03:45:48 +0200 (CEST) Subject: [Python-checkins] r51219 - python/trunk/Python/compile.c Message-ID: <20060812014548.1BD421E4009@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 03:45:47 2006 New Revision: 51219 Modified: python/trunk/Python/compile.c Log: Even though _Py_Mangle() isn't truly public anyone can call it and there was no verification that privateobj was a PyString. If it wasn't a string, this could have allowed a NULL pointer to creep in below and crash. I wonder if this should be PyString_CheckExact? Must identifiers be strings or can they be subclasses? Klocwork #275 Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Sat Aug 12 03:45:47 2006 @@ -204,8 +204,8 @@ const char *p, *name = PyString_AsString(ident); char *buffer; size_t nlen, plen; - if (privateobj == NULL || name == NULL || name[0] != '_' || - name[1] != '_') { + if (privateobj == NULL || !PyString_Check(privateobj) || + name == NULL || name[0] != '_' || name[1] != '_') { Py_INCREF(ident); return ident; } From python-checkins at python.org Sat Aug 12 03:46:43 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 03:46:43 +0200 (CEST) Subject: [Python-checkins] r51220 - python/trunk/Python/bltinmodule.c Message-ID: <20060812014643.601E91E4009@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 03:46:42 2006 New Revision: 51220 Modified: python/trunk/Python/bltinmodule.c Log: It's highly unlikely, though possible for PyEval_Get*() to return NULLs. So be safe and do an XINCREF. Klocwork # 221-222. Modified: python/trunk/Python/bltinmodule.c ============================================================================== --- python/trunk/Python/bltinmodule.c (original) +++ python/trunk/Python/bltinmodule.c Sat Aug 12 03:46:42 2006 @@ -759,7 +759,7 @@ PyObject *d; d = PyEval_GetGlobals(); - Py_INCREF(d); + Py_XINCREF(d); return d; } @@ -1190,7 +1190,7 @@ PyObject *d; d = PyEval_GetLocals(); - Py_INCREF(d); + Py_XINCREF(d); return d; } From python-checkins at python.org Sat Aug 12 03:47:59 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 03:47:59 +0200 (CEST) Subject: [Python-checkins] r51221 - python/trunk/Python/marshal.c Message-ID: <20060812014759.8B1D01E4009@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 03:47:59 2006 New Revision: 51221 Modified: python/trunk/Python/marshal.c Log: This code is actually not used unless WITHOUT_COMPLEX is defined. However, there was no error checking that PyFloat_FromDouble returned a valid pointer. I believe this change is correct as it seemed to follow other code in the area. Klocwork # 292. Modified: python/trunk/Python/marshal.c ============================================================================== --- python/trunk/Python/marshal.c (original) +++ python/trunk/Python/marshal.c Sat Aug 12 03:47:59 2006 @@ -213,6 +213,10 @@ w_byte(TYPE_COMPLEX, p); temp = (PyFloatObject*)PyFloat_FromDouble( PyComplex_RealAsDouble(v)); + if (!temp) { + p->error = 1; + return; + } PyFloat_AsReprString(buf, temp); Py_DECREF(temp); n = strlen(buf); @@ -220,6 +224,10 @@ w_string(buf, (int)n, p); temp = (PyFloatObject*)PyFloat_FromDouble( PyComplex_ImagAsDouble(v)); + if (!temp) { + p->error = 1; + return; + } PyFloat_AsReprString(buf, temp); Py_DECREF(temp); n = strlen(buf); From python-checkins at python.org Sat Aug 12 03:49:13 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 03:49:13 +0200 (CEST) Subject: [Python-checkins] r51222 - python/trunk/Parser/parsetok.c Message-ID: <20060812014913.39EF61E4009@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 03:49:12 2006 New Revision: 51222 Modified: python/trunk/Parser/parsetok.c Log: Handle NULL nodes while parsing. I'm not entirely sure this is correct. There might be something else that needs to be done to setup the error. Klocwork #295. Modified: python/trunk/Parser/parsetok.c ============================================================================== --- python/trunk/Parser/parsetok.c (original) +++ python/trunk/Parser/parsetok.c Sat Aug 12 03:49:12 2006 @@ -229,6 +229,11 @@ } } else if (tok->encoding != NULL) { node* r = PyNode_New(encoding_decl); + if (!r) { + err_ret->error = E_NOMEM; + n = NULL; + goto done; + } r->n_str = tok->encoding; r->n_nchildren = 1; r->n_child = n; @@ -236,6 +241,7 @@ n = r; } +done: PyTokenizer_Free(tok); return n; From python-checkins at python.org Sat Aug 12 03:50:39 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 03:50:39 +0200 (CEST) Subject: [Python-checkins] r51223 - python/trunk/Modules/posixmodule.c Message-ID: <20060812015039.0E7751E4009@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 03:50:38 2006 New Revision: 51223 Modified: python/trunk/Modules/posixmodule.c Log: If _stat_float_times is false, we will try to INCREF ival which could be NULL. Return early in that case. The caller checks for PyErr_Occurred so this should be ok. Klocwork #297 Modified: python/trunk/Modules/posixmodule.c ============================================================================== --- python/trunk/Modules/posixmodule.c (original) +++ python/trunk/Modules/posixmodule.c Sat Aug 12 03:50:38 2006 @@ -1121,6 +1121,8 @@ #else ival = PyInt_FromLong((long)sec); #endif + if (!ival) + return; if (_stat_float_times) { fval = PyFloat_FromDouble(sec + 1e-9*nsec); } else { From python-checkins at python.org Sat Aug 12 03:51:13 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 03:51:13 +0200 (CEST) Subject: [Python-checkins] r51224 - python/trunk/Modules/collectionsmodule.c Message-ID: <20060812015113.256851E4009@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 03:51:12 2006 New Revision: 51224 Modified: python/trunk/Modules/collectionsmodule.c Log: Move the assert which checks for a NULL pointer first. Klocwork #274. Modified: python/trunk/Modules/collectionsmodule.c ============================================================================== --- python/trunk/Modules/collectionsmodule.c (original) +++ python/trunk/Modules/collectionsmodule.c Sat Aug 12 03:51:12 2006 @@ -224,9 +224,9 @@ deque->leftindex = CENTER + 1; deque->rightindex = CENTER; } else { + assert(deque->leftblock != NULL); assert(deque->leftblock != deque->rightblock); prevblock = deque->leftblock->rightlink; - assert(deque->leftblock != NULL); PyMem_Free(deque->leftblock); assert(prevblock != NULL); prevblock->leftlink = NULL; From python-checkins at python.org Sat Aug 12 03:53:29 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 03:53:29 +0200 (CEST) Subject: [Python-checkins] r51225 - python/trunk/Modules/_sre.c Message-ID: <20060812015329.208021E4009@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 03:53:28 2006 New Revision: 51225 Modified: python/trunk/Modules/_sre.c Log: Try to handle a malloc failure. I'm not entirely sure this is correct. There might be something else we need to do to handle the exception. Klocwork # 212-213 Modified: python/trunk/Modules/_sre.c ============================================================================== --- python/trunk/Modules/_sre.c (original) +++ python/trunk/Modules/_sre.c Sat Aug 12 03:53:28 2006 @@ -1166,6 +1166,9 @@ /* install new repeat context */ ctx->u.rep = (SRE_REPEAT*) PyObject_MALLOC(sizeof(*ctx->u.rep)); + /* XXX(nnorwitz): anything else we need to do on error? */ + if (!ctx->u.rep) + RETURN_FAILURE; ctx->u.rep->count = -1; ctx->u.rep->pattern = ctx->pattern; ctx->u.rep->prev = state->repeat; From python-checkins at python.org Sat Aug 12 03:57:47 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 03:57:47 +0200 (CEST) Subject: [Python-checkins] r51226 - python/trunk/Modules/unicodedata.c Message-ID: <20060812015747.DD88B1E4009@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 03:57:47 2006 New Revision: 51226 Modified: python/trunk/Modules/unicodedata.c Log: I'm not sure why this code allocates this string for the error message. I think it would be better to always use snprintf and have the format limit the size of the name appropriately (like %.200s). Klocwork #340 Modified: python/trunk/Modules/unicodedata.c ============================================================================== --- python/trunk/Modules/unicodedata.c (original) +++ python/trunk/Modules/unicodedata.c Sat Aug 12 03:57:47 2006 @@ -1078,6 +1078,7 @@ { Py_UCS4 code; Py_UNICODE str[1]; + char errbuf[256]; char* name; int namelen; @@ -1085,11 +1086,19 @@ return NULL; if (!_getcode(self, name, namelen, &code)) { + /* XXX(nnorwitz): why are we allocating for the error msg? + Why not always use snprintf? */ char fmt[] = "undefined character name '%s'"; char *buf = PyMem_MALLOC(sizeof(fmt) + namelen); - sprintf(buf, fmt, name); + if (buf) + sprintf(buf, fmt, name); + else { + buf = errbuf; + PyOS_snprintf(buf, sizeof(errbuf), fmt, name); + } PyErr_SetString(PyExc_KeyError, buf); - PyMem_FREE(buf); + if (buf != errbuf) + PyMem_FREE(buf); return NULL; } From python-checkins at python.org Sat Aug 12 04:06:35 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 04:06:35 +0200 (CEST) Subject: [Python-checkins] r51227 - in python/trunk: Lib/test/regrtest.py Modules/_ctypes/cfield.c Objects/funcobject.c Python/ceval.c Python/pythonrun.c Message-ID: <20060812020635.B6CA01E4017@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 04:06:34 2006 New Revision: 51227 Modified: python/trunk/Lib/test/regrtest.py python/trunk/Modules/_ctypes/cfield.c python/trunk/Objects/funcobject.c python/trunk/Python/ceval.c python/trunk/Python/pythonrun.c Log: Check returned pointer is valid. Klocwork #233 Modified: python/trunk/Lib/test/regrtest.py ============================================================================== --- python/trunk/Lib/test/regrtest.py (original) +++ python/trunk/Lib/test/regrtest.py Sat Aug 12 04:06:34 2006 @@ -123,6 +123,7 @@ import os import sys +import signal import getopt import random import warnings @@ -289,6 +290,12 @@ if single and fromfile: usage(2, "-s and -f don't go together!") + def handle_signal(*args): + raise RuntimeError('signal received %s' % args) + + # Provide a traceback if we are terminated. + signal.signal(signal.SIGTERM, handle_signal) + good = [] bad = [] skipped = [] Modified: python/trunk/Modules/_ctypes/cfield.c ============================================================================== --- python/trunk/Modules/_ctypes/cfield.c (original) +++ python/trunk/Modules/_ctypes/cfield.c Sat Aug 12 04:06:34 2006 @@ -105,6 +105,12 @@ StgDictObject *idict; if (adict && adict->proto) { idict = PyType_stgdict(adict->proto); + if (!idict) { + PyErr_SetString(PyExc_TypeError, + "has no _stginfo_"); + Py_DECREF(self); + return NULL; + } if (idict->getfunc == getentry("c")->getfunc) { struct fielddesc *fd = getentry("s"); getfunc = fd->getfunc; Modified: python/trunk/Objects/funcobject.c ============================================================================== --- python/trunk/Objects/funcobject.c (original) +++ python/trunk/Objects/funcobject.c Sat Aug 12 04:06:34 2006 @@ -486,9 +486,10 @@ Py_ssize_t nk, nd; argdefs = PyFunction_GET_DEFAULTS(func); + /* XXX(nnorwitz): don't we know argdefs is either NULL or a tuple? */ if (argdefs != NULL && PyTuple_Check(argdefs)) { d = &PyTuple_GET_ITEM((PyTupleObject *)argdefs, 0); - nd = PyTuple_Size(argdefs); + nd = PyTuple_GET_SIZE(argdefs); } else { d = NULL; @@ -517,7 +518,7 @@ result = PyEval_EvalCodeEx( (PyCodeObject *)PyFunction_GET_CODE(func), PyFunction_GET_GLOBALS(func), (PyObject *)NULL, - &PyTuple_GET_ITEM(arg, 0), PyTuple_Size(arg), + &PyTuple_GET_ITEM(arg, 0), PyTuple_GET_SIZE(arg), k, nk, d, nd, PyFunction_GET_CLOSURE(func)); Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Sat Aug 12 04:06:34 2006 @@ -230,6 +230,15 @@ } void +_PyEval_FiniThreads(void) +{ + if (interpreter_lock) + PyThread_free_lock(interpreter_lock); + interpreter_lock = 0; + main_thread = 0; +} + +void PyEval_AcquireLock(void) { PyThread_acquire_lock(interpreter_lock, 1); Modified: python/trunk/Python/pythonrun.c ============================================================================== --- python/trunk/Python/pythonrun.c (original) +++ python/trunk/Python/pythonrun.c Sat Aug 12 04:06:34 2006 @@ -60,6 +60,7 @@ static void call_ll_exitfuncs(void); extern void _PyUnicode_Init(void); extern void _PyUnicode_Fini(void); +extern void _PyEval_FiniThreads(void); #ifdef WITH_THREAD extern void _PyGILState_Init(PyInterpreterState *, PyThreadState *); @@ -461,6 +462,8 @@ _PyUnicode_Fini(); #endif + _PyEval_FiniThreads(); + /* XXX Still allocated: - various static ad-hoc pointers to interned strings - int and float free list blocks From buildbot at python.org Sat Aug 12 04:09:45 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 02:09:45 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060812020945.EC9D01E4009@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/2 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sat Aug 12 04:12:31 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 04:12:31 +0200 (CEST) Subject: [Python-checkins] r51228 - in python/trunk: Lib/test/regrtest.py Objects/funcobject.c Python/ceval.c Python/pythonrun.c Message-ID: <20060812021231.7F5511E4009@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 04:12:30 2006 New Revision: 51228 Modified: python/trunk/Lib/test/regrtest.py python/trunk/Objects/funcobject.c python/trunk/Python/ceval.c python/trunk/Python/pythonrun.c Log: Whoops, how did that get in there. :-) Revert all the parts of 51227 that were not supposed to go it. Only Modules/_ctypes/cfields.c was supposed to be changed Modified: python/trunk/Lib/test/regrtest.py ============================================================================== --- python/trunk/Lib/test/regrtest.py (original) +++ python/trunk/Lib/test/regrtest.py Sat Aug 12 04:12:30 2006 @@ -123,7 +123,6 @@ import os import sys -import signal import getopt import random import warnings @@ -290,12 +289,6 @@ if single and fromfile: usage(2, "-s and -f don't go together!") - def handle_signal(*args): - raise RuntimeError('signal received %s' % args) - - # Provide a traceback if we are terminated. - signal.signal(signal.SIGTERM, handle_signal) - good = [] bad = [] skipped = [] Modified: python/trunk/Objects/funcobject.c ============================================================================== --- python/trunk/Objects/funcobject.c (original) +++ python/trunk/Objects/funcobject.c Sat Aug 12 04:12:30 2006 @@ -486,10 +486,9 @@ Py_ssize_t nk, nd; argdefs = PyFunction_GET_DEFAULTS(func); - /* XXX(nnorwitz): don't we know argdefs is either NULL or a tuple? */ if (argdefs != NULL && PyTuple_Check(argdefs)) { d = &PyTuple_GET_ITEM((PyTupleObject *)argdefs, 0); - nd = PyTuple_GET_SIZE(argdefs); + nd = PyTuple_Size(argdefs); } else { d = NULL; @@ -518,7 +517,7 @@ result = PyEval_EvalCodeEx( (PyCodeObject *)PyFunction_GET_CODE(func), PyFunction_GET_GLOBALS(func), (PyObject *)NULL, - &PyTuple_GET_ITEM(arg, 0), PyTuple_GET_SIZE(arg), + &PyTuple_GET_ITEM(arg, 0), PyTuple_Size(arg), k, nk, d, nd, PyFunction_GET_CLOSURE(func)); Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Sat Aug 12 04:12:30 2006 @@ -230,15 +230,6 @@ } void -_PyEval_FiniThreads(void) -{ - if (interpreter_lock) - PyThread_free_lock(interpreter_lock); - interpreter_lock = 0; - main_thread = 0; -} - -void PyEval_AcquireLock(void) { PyThread_acquire_lock(interpreter_lock, 1); Modified: python/trunk/Python/pythonrun.c ============================================================================== --- python/trunk/Python/pythonrun.c (original) +++ python/trunk/Python/pythonrun.c Sat Aug 12 04:12:30 2006 @@ -60,7 +60,6 @@ static void call_ll_exitfuncs(void); extern void _PyUnicode_Init(void); extern void _PyUnicode_Fini(void); -extern void _PyEval_FiniThreads(void); #ifdef WITH_THREAD extern void _PyGILState_Init(PyInterpreterState *, PyThreadState *); @@ -462,8 +461,6 @@ _PyUnicode_Fini(); #endif - _PyEval_FiniThreads(); - /* XXX Still allocated: - various static ad-hoc pointers to interned strings - int and float free list blocks From python-checkins at python.org Sat Aug 12 04:33:39 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 04:33:39 +0200 (CEST) Subject: [Python-checkins] r51229 - python/trunk/Modules/_tkinter.c Message-ID: <20060812023339.2F4221E4009@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 04:33:36 2006 New Revision: 51229 Modified: python/trunk/Modules/_tkinter.c Log: Don't deref v if it's NULL. Klocwork #214 Modified: python/trunk/Modules/_tkinter.c ============================================================================== --- python/trunk/Modules/_tkinter.c (original) +++ python/trunk/Modules/_tkinter.c Sat Aug 12 04:33:36 2006 @@ -2493,8 +2493,10 @@ } v = Tktt_New(func); - v->token = Tcl_CreateTimerHandler(milliseconds, TimerHandler, - (ClientData)v); + if (v) { + v->token = Tcl_CreateTimerHandler(milliseconds, TimerHandler, + (ClientData)v); + } return (PyObject *) v; } From buildbot at python.org Sat Aug 12 04:57:52 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 02:57:52 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060812025752.824BD1E4009@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1066 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sat Aug 12 05:16:56 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 05:16:56 +0200 (CEST) Subject: [Python-checkins] r51230 - python/trunk/Objects/listobject.c Message-ID: <20060812031656.9C8091E4002@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 05:16:54 2006 New Revision: 51230 Modified: python/trunk/Objects/listobject.c Log: Check return of PyMem_MALLOC (garbage) is non-NULL. Check seq in both portions of if/else. Klocwork #289-290. Modified: python/trunk/Objects/listobject.c ============================================================================== --- python/trunk/Objects/listobject.c (original) +++ python/trunk/Objects/listobject.c Sat Aug 12 05:16:54 2006 @@ -2541,6 +2541,10 @@ garbage = (PyObject**) PyMem_MALLOC(slicelength*sizeof(PyObject*)); + if (!garbage) { + PyErr_NoMemory(); + return -1; + } /* drawing pictures might help understand these for loops */ @@ -2589,9 +2593,9 @@ else { seq = PySequence_Fast(value, "must assign iterable to extended slice"); - if (!seq) - return -1; } + if (!seq) + return -1; if (PySequence_Fast_GET_SIZE(seq) != slicelength) { PyErr_Format(PyExc_ValueError, From python-checkins at python.org Sat Aug 12 05:17:43 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 05:17:43 +0200 (CEST) Subject: [Python-checkins] r51231 - python/trunk/Python/pythonrun.c Message-ID: <20060812031743.6B9741E4002@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 05:17:41 2006 New Revision: 51231 Modified: python/trunk/Python/pythonrun.c Log: PyModule_GetDict() can fail, produce fatal errors if this happens on startup. Klocwork #298-299. Modified: python/trunk/Python/pythonrun.c ============================================================================== --- python/trunk/Python/pythonrun.c (original) +++ python/trunk/Python/pythonrun.c Sat Aug 12 05:17:41 2006 @@ -203,12 +203,16 @@ if (bimod == NULL) Py_FatalError("Py_Initialize: can't initialize __builtin__"); interp->builtins = PyModule_GetDict(bimod); + if (interp->builtins == NULL) + Py_FatalError("Py_Initialize: can't initialize builtins dict"); Py_INCREF(interp->builtins); sysmod = _PySys_Init(); if (sysmod == NULL) Py_FatalError("Py_Initialize: can't initialize sys"); interp->sysdict = PyModule_GetDict(sysmod); + if (interp->sysdict == NULL) + Py_FatalError("Py_Initialize: can't initialize sys dict"); Py_INCREF(interp->sysdict); _PyImport_FixupExtension("sys", "sys"); PySys_SetPath(Py_GetPath()); From python-checkins at python.org Sat Aug 12 05:18:51 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 05:18:51 +0200 (CEST) Subject: [Python-checkins] r51232 - python/trunk/Modules/rgbimgmodule.c Message-ID: <20060812031851.439F71E4002@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 05:18:50 2006 New Revision: 51232 Modified: python/trunk/Modules/rgbimgmodule.c Log: Verify verdat which is returned from malloc is not NULL. Ensure we don't pass NULL to free. Klocwork #306 (at least the first part, checking malloc) Modified: python/trunk/Modules/rgbimgmodule.c ============================================================================== --- python/trunk/Modules/rgbimgmodule.c (original) +++ python/trunk/Modules/rgbimgmodule.c Sat Aug 12 05:18:50 2006 @@ -410,6 +410,11 @@ addlongimgtag(base, xsize, ysize); #endif verdat = (unsigned char *)malloc(xsize); + if (!verdat) { + Py_CLEAR(rv); + goto finally; + } + fseek(inf, 512, SEEK_SET); for (z = 0; z < zsize; z++) { lptr = base; @@ -431,10 +436,14 @@ copybw((Py_Int32 *) base, xsize * ysize); } finally: - free(starttab); - free(lengthtab); - free(rledat); - free(verdat); + if (starttab) + free(starttab); + if (lengthtab) + free(lengthtab); + if (rledat) + free(rledat); + if (verdat) + free(verdat); fclose(inf); return rv; } From buildbot at python.org Sat Aug 12 05:51:47 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 03:51:47 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060812035147.77D8D1E4002@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/480 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sat Aug 12 06:42:48 2006 From: python-checkins at python.org (tim.peters) Date: Sat, 12 Aug 2006 06:42:48 +0200 (CEST) Subject: [Python-checkins] r51233 - python/trunk/Lib/test/test_signal.py python/trunk/Lib/test/test_threadsignals.py Message-ID: <20060812044248.EFFF91E4002@bag.python.org> Author: tim.peters Date: Sat Aug 12 06:42:47 2006 New Revision: 51233 Modified: python/trunk/Lib/test/test_signal.py python/trunk/Lib/test/test_threadsignals.py Log: test_signal: Signal handling on the Tru64 buildbot appears to be utterly insane. Plug some theoretical insecurities in the test script: - Verify that the SIGALRM handler was actually installed. - Don't call alarm() before the handler is installed. - Move everything that can fail inside the try/finally, so the test cleans up after itself more often. - Try sending all the expected signals in force_test_exit(), not just SIGALRM. Since that was fixed to actually send SIGALRM (instead of invisibly dying with an AttributeError), we've seen that sending SIGALRM alone does not stop this from hanging. - Move the "kill the child" business into the finally clause, so the child doesn't survive test failure to send SIGALRM to other tests later (there are also baffling SIGALRM-related failures in test_socket). - Cancel the alarm in the finally clause -- if the test dies early, we again don't want SIGALRM showing up to confuse a later test. Alas, this still relies on timing luck wrt the spawned script that sends the test signals, but it's hard to see how waiting for seconds can so often be so unlucky. test_threadedsignals: curiously, this test never fails on Tru64, but doesn't normally signal SIGALRM. Anyway, fixed an obvious (but probably inconsequential) logic error. Modified: python/trunk/Lib/test/test_signal.py ============================================================================== --- python/trunk/Lib/test/test_signal.py (original) +++ python/trunk/Lib/test/test_signal.py Sat Aug 12 06:42:47 2006 @@ -6,6 +6,8 @@ if sys.platform[:3] in ('win', 'os2') or sys.platform=='riscos': raise TestSkipped, "Can't test signal on %s" % sys.platform +MAX_DURATION = 20 # Entire test should last at most 20 sec. + if verbose: x = '-x' else: @@ -34,7 +36,7 @@ global a_called a_called = True if verbose: - print "handlerA", args + print "handlerA invoked", args class HandlerBCalled(Exception): pass @@ -43,88 +45,111 @@ global b_called b_called = True if verbose: - print "handlerB", args + print "handlerB invoked", args raise HandlerBCalled, args -MAX_DURATION = 20 -signal.alarm(MAX_DURATION) # Entire test should last at most 20 sec. +# Set up a child to send signals to us (the parent) after waiting long +# enough to receive the alarm. It seems we miss the alarm for some +# reason. This will hopefully stop the hangs on Tru64/Alpha. +# Alas, it doesn't. Tru64 appears to miss all the signals at times, or +# seemingly random subsets of them, and nothing done in force_test_exit +# so far has actually helped. +def force_test_exit(): + # Sigh, both imports seem necessary to avoid errors. + import os + fork_pid = os.fork() + if fork_pid: + # In parent. + return fork_pid + + # In child. + import os, time + try: + # Wait 5 seconds longer than the expected alarm to give enough + # time for the normal sequence of events to occur. This is + # just a stop-gap to try to prevent the test from hanging. + time.sleep(MAX_DURATION + 5) + print >> sys.__stdout__, ' child should not have to kill parent' + for signame in "SIGHUP", "SIGUSR1", "SIGUSR2", "SIGALRM": + os.kill(pid, getattr(signal, signame)) + print >> sys.__stdout__, " child sent", signame, "to", pid + time.sleep(1) + finally: + os._exit(0) + +# Install handlers. hup = signal.signal(signal.SIGHUP, handlerA) usr1 = signal.signal(signal.SIGUSR1, handlerB) usr2 = signal.signal(signal.SIGUSR2, signal.SIG_IGN) alrm = signal.signal(signal.SIGALRM, signal.default_int_handler) -vereq(signal.getsignal(signal.SIGHUP), handlerA) -vereq(signal.getsignal(signal.SIGUSR1), handlerB) -vereq(signal.getsignal(signal.SIGUSR2), signal.SIG_IGN) - try: - signal.signal(4242, handlerB) - raise TestFailed, 'expected ValueError for invalid signal # to signal()' -except ValueError: - pass -try: - signal.getsignal(4242) - raise TestFailed, 'expected ValueError for invalid signal # to getsignal()' -except ValueError: - pass + signal.alarm(MAX_DURATION) + vereq(signal.getsignal(signal.SIGHUP), handlerA) + vereq(signal.getsignal(signal.SIGUSR1), handlerB) + vereq(signal.getsignal(signal.SIGUSR2), signal.SIG_IGN) + vereq(signal.getsignal(signal.SIGALRM), signal.default_int_handler) -try: - signal.signal(signal.SIGUSR1, None) - raise TestFailed, 'expected TypeError for non-callable' -except TypeError: - pass + # Try to ensure this test exits even if there is some problem with alarm. + # Tru64/Alpha often hangs and is ultimately killed by the buildbot. + fork_pid = force_test_exit() -# Set up a child to send an alarm signal to us (the parent) after waiting -# long enough to receive the alarm. It seems we miss the alarm for some -# reason. This will hopefully stop the hangs on Tru64/Alpha. -def force_test_exit(): - # Sigh, both imports seem necessary to avoid errors. - import os - fork_pid = os.fork() - if fork_pid == 0: - # In child - import os, time - try: - # Wait 5 seconds longer than the expected alarm to give enough - # time for the normal sequence of events to occur. This is - # just a stop-gap to prevent the test from hanging. - time.sleep(MAX_DURATION + 5) - print >> sys.__stdout__, ' child should not have to kill parent' - for i in range(3): - os.kill(pid, signal.SIGALRM) - print >> sys.__stdout__, " child sent SIGALRM to", pid - finally: - os._exit(0) - # In parent (or error) - return fork_pid + try: + signal.getsignal(4242) + raise TestFailed('expected ValueError for invalid signal # to ' + 'getsignal()') + except ValueError: + pass -try: - os.system(script) + try: + signal.signal(4242, handlerB) + raise TestFailed('expected ValueError for invalid signal # to ' + 'signal()') + except ValueError: + pass - # Try to ensure this test exits even if there is some problem with alarm. - # Tru64/Alpha sometimes hangs and is ultimately killed by the buildbot. - fork_pid = force_test_exit() - print "starting pause() loop..." + try: + signal.signal(signal.SIGUSR1, None) + raise TestFailed('expected TypeError for non-callable') + except TypeError: + pass + # Launch an external script to send us signals. + # We expect the external script to: + # send HUP, which invokes handlerA to set a_called + # send USR1, which invokes handlerB to set b_called and raise + # HandlerBCalled + # send USR2, which is ignored + # + # Then we expect the alarm to go off, and its handler raises + # KeyboardInterrupt, finally getting us out of the loop. + os.system(script) try: + if verbose: + print "starting pause() loop..." while 1: - if verbose: - print "call pause()..." try: + if verbose: + print "call pause()..." signal.pause() if verbose: print "pause() returned" except HandlerBCalled: if verbose: print "HandlerBCalled exception caught" - else: - pass except KeyboardInterrupt: if verbose: - print "KeyboardInterrupt (assume the alarm() went off)" + print "KeyboardInterrupt (the alarm() went off)" + + if not a_called: + print 'HandlerA not called' + + if not b_called: + print 'HandlerB not called' +finally: # Forcibly kill the child we created to ping us if there was a test error. try: # Make sure we don't kill ourself if there was a fork error. @@ -132,16 +157,11 @@ os.kill(fork_pid, signal.SIGKILL) except: # If the child killed us, it has probably exited. Killing a - # non-existant process will raise an error which we don't care about. + # non-existent process will raise an error which we don't care about. pass - if not a_called: - print 'HandlerA not called' - - if not b_called: - print 'HandlerB not called' - -finally: + # Restore handlers. + signal.alarm(0) # cancel alarm in case we died early signal.signal(signal.SIGHUP, hup) signal.signal(signal.SIGUSR1, usr1) signal.signal(signal.SIGUSR2, usr2) Modified: python/trunk/Lib/test/test_threadsignals.py ============================================================================== --- python/trunk/Lib/test/test_threadsignals.py (original) +++ python/trunk/Lib/test/test_threadsignals.py Sat Aug 12 06:42:47 2006 @@ -49,7 +49,7 @@ # and might be out of order.) If we haven't seen # the signals yet, send yet another signal and # wait for it return. - if signal_blackboard[signal.SIGUSR2]['tripped'] == 0 \ + if signal_blackboard[signal.SIGUSR1]['tripped'] == 0 \ or signal_blackboard[signal.SIGUSR2]['tripped'] == 0: signal.alarm(1) signal.pause() From buildbot at python.org Sat Aug 12 07:05:45 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 05:05:45 +0000 Subject: [Python-checkins] buildbot warnings in x86 gentoo trunk Message-ID: <20060812050545.A90B41E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520gentoo%2520trunk/builds/1493 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 07:06:22 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 05:06:22 +0000 Subject: [Python-checkins] buildbot warnings in amd64 gentoo trunk Message-ID: <20060812050622.B1D531E4002@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%2520gentoo%2520trunk/builds/1409 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 07:09:49 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 05:09:49 +0000 Subject: [Python-checkins] buildbot warnings in x86 OpenBSD trunk Message-ID: <20060812050949.5C6EC1E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%2520trunk/builds/1172 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 07:13:01 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 05:13:01 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060812051301.713C21E4002@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/6 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sat Aug 12 07:17:42 2006 From: python-checkins at python.org (tim.peters) Date: Sat, 12 Aug 2006 07:17:42 +0200 (CEST) Subject: [Python-checkins] r51234 - python/trunk/Lib/test/test_signal.py Message-ID: <20060812051742.06BD11E4002@bag.python.org> Author: tim.peters Date: Sat Aug 12 07:17:41 2006 New Revision: 51234 Modified: python/trunk/Lib/test/test_signal.py Log: Ah, fudge. One of the prints here actually "shouldn't be" protected by "if verbose:", which caused the test to fail on all non-Windows boxes. Note that I deliberately didn't convert this to unittest yet, because I expect it would be even harder to debug this on Tru64 after conversion. Modified: python/trunk/Lib/test/test_signal.py ============================================================================== --- python/trunk/Lib/test/test_signal.py (original) +++ python/trunk/Lib/test/test_signal.py Sat Aug 12 07:17:41 2006 @@ -126,8 +126,7 @@ # KeyboardInterrupt, finally getting us out of the loop. os.system(script) try: - if verbose: - print "starting pause() loop..." + print "starting pause() loop..." while 1: try: if verbose: From buildbot at python.org Sat Aug 12 07:18:51 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 05:18:51 +0000 Subject: [Python-checkins] buildbot warnings in sparc solaris10 gcc trunk Message-ID: <20060812051851.8B5AD1E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520solaris10%2520gcc%2520trunk/builds/1350 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 07:19:16 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 05:19:16 +0000 Subject: [Python-checkins] buildbot warnings in g4 osx.4 trunk Message-ID: <20060812051916.995CC1E4002@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/g4%2520osx.4%2520trunk/builds/1338 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 07:19:59 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 05:19:59 +0000 Subject: [Python-checkins] buildbot failure in x86 cygwin trunk Message-ID: <20060812051959.91EC41E4002@bag.python.org> The Buildbot has detected a new failure of x86 cygwin trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520cygwin%2520trunk/builds/1102 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters BUILD FAILED: failed configure sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 07:20:24 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 05:20:24 +0000 Subject: [Python-checkins] buildbot warnings in ia64 Ubuntu trunk trunk Message-ID: <20060812052024.3FE481E4002@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu trunk trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%2520Ubuntu%2520trunk%2520trunk/builds/5 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 07:21:49 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 05:21:49 +0000 Subject: [Python-checkins] buildbot warnings in MIPS Debian trunk Message-ID: <20060812052150.076B51E4002@bag.python.org> The Buildbot has detected a new failure of MIPS Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/MIPS%2520Debian%2520trunk/builds/352 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz,tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 07:22:37 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 05:22:37 +0000 Subject: [Python-checkins] buildbot warnings in ppc Debian unstable trunk Message-ID: <20060812052237.F108C1E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%2520Debian%2520unstable%2520trunk/builds/1094 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 07:24:47 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 05:24:47 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian trunk Message-ID: <20060812052447.58FF51E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%2520trunk/builds/395 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 07:28:09 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 05:28:09 +0000 Subject: [Python-checkins] buildbot warnings in sparc Ubuntu dapper trunk Message-ID: <20060812052809.8451B1E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520Ubuntu%2520dapper%2520trunk/builds/630 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 08:27:18 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 06:27:18 +0000 Subject: [Python-checkins] buildbot warnings in x86 cygwin trunk Message-ID: <20060812062718.AEDE21E4002@bag.python.org> The Buildbot has detected a new failure of x86 cygwin trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520cygwin%2520trunk/builds/1103 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sat Aug 12 10:32:03 2006 From: python-checkins at python.org (georg.brandl) Date: Sat, 12 Aug 2006 10:32:03 +0200 (CEST) Subject: [Python-checkins] r51235 - in python/trunk/Lib: logging/config.py test/test_logging.py Message-ID: <20060812083203.DEBD21E4010@bag.python.org> Author: georg.brandl Date: Sat Aug 12 10:32:02 2006 New Revision: 51235 Modified: python/trunk/Lib/logging/config.py python/trunk/Lib/test/test_logging.py Log: Repair logging test spew caused by rev. 51206. Modified: python/trunk/Lib/logging/config.py ============================================================================== --- python/trunk/Lib/logging/config.py (original) +++ python/trunk/Lib/logging/config.py Sat Aug 12 10:32:02 2006 @@ -79,7 +79,7 @@ logging._acquireLock() try: logging._handlers.clear() - logging._handlerList = [] + del logging._handlerList[:] # Handlers add themselves to logging._handlers handlers = _install_handlers(cp, formatters) _install_loggers(cp, handlers) Modified: python/trunk/Lib/test/test_logging.py ============================================================================== --- python/trunk/Lib/test/test_logging.py (original) +++ python/trunk/Lib/test/test_logging.py Sat Aug 12 10:32:02 2006 @@ -493,7 +493,7 @@ try: logging._handlers.clear() logging._handlers.update(saved_handlers) - logging._handlerList = saved_handler_list + logging._handlerList[:] = saved_handler_list loggerDict = logging.getLogger().manager.loggerDict loggerDict.clear() loggerDict.update(saved_loggers) @@ -560,7 +560,7 @@ try: logging._handlers.clear() logging._handlers.update(saved_handlers) - logging._handlerList = saved_handler_list + logging._handlerList[:] = saved_handler_list loggerDict = logging.getLogger().manager.loggerDict loggerDict.clear() loggerDict.update(saved_loggers) From python-checkins at python.org Sat Aug 12 19:03:25 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 19:03:25 +0200 (CEST) Subject: [Python-checkins] r51236 - in python/trunk: Doc/api/abstract.tex Include/abstract.h Include/object.h Lib/test/test_index.py Misc/NEWS Modules/arraymodule.c Modules/mmapmodule.c Modules/operator.c Objects/abstract.c Objects/classobject.c Objects/intobject.c Objects/listobject.c Objects/longobject.c Objects/sliceobject.c Objects/stringobject.c Objects/tupleobject.c Objects/typeobject.c Objects/unicodeobject.c Python/ceval.c Message-ID: <20060812170325.1ED441E4002@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 19:03:09 2006 New Revision: 51236 Modified: python/trunk/Doc/api/abstract.tex python/trunk/Include/abstract.h python/trunk/Include/object.h python/trunk/Lib/test/test_index.py python/trunk/Misc/NEWS python/trunk/Modules/arraymodule.c python/trunk/Modules/mmapmodule.c python/trunk/Modules/operator.c python/trunk/Objects/abstract.c python/trunk/Objects/classobject.c python/trunk/Objects/intobject.c python/trunk/Objects/listobject.c python/trunk/Objects/longobject.c python/trunk/Objects/sliceobject.c python/trunk/Objects/stringobject.c python/trunk/Objects/tupleobject.c python/trunk/Objects/typeobject.c python/trunk/Objects/unicodeobject.c python/trunk/Python/ceval.c Log: Patch #1538606, Patch to fix __index__() clipping. I modified this patch some by fixing style, some error checking, and adding XXX comments. This patch requires review and some changes are to be expected. I'm checking in now to get the greatest possible review and establish a baseline for moving forward. I don't want this to hold up release if possible. Modified: python/trunk/Doc/api/abstract.tex ============================================================================== --- python/trunk/Doc/api/abstract.tex (original) +++ python/trunk/Doc/api/abstract.tex Sat Aug 12 19:03:09 2006 @@ -693,12 +693,31 @@ \samp{float(\var{o})}.\bifuncindex{float} \end{cfuncdesc} -\begin{cfuncdesc}{Py_ssize_t}{PyNumber_Index}{PyObject *o} - Returns the \var{o} converted to a Py_ssize_t integer on success, or - -1 with an exception raised on failure. +\begin{cfuncdesc}{PyObject*}{PyNumber_Index}{PyObject *o} + Returns the \var{o} converted to a Python int or long on success or \NULL{} + with a TypeError exception raised on failure. \versionadded{2.5} \end{cfuncdesc} +\begin{cfuncdesc}{Py_ssize_t}{PyNumber_AsSsize_t}{PyObject *o, PyObject *exc} + Returns \var{o} converted to a Py_ssize_t value if \var{o} + can be interpreted as an integer. If \var{o} can be converted to a Python + int or long but the attempt to convert to a Py_ssize_t value + would raise an \exception{OverflowError}, then the \var{exc} argument + is the type of exception that will be raised (usually \exception{IndexError} + or \exception{OverflowError}). If \var{exc} is \NULL{}, then the exception + is cleared and the value is clipped to \var{PY_SSIZE_T_MIN} + for a negative integer or \var{PY_SSIZE_T_MAX} for a positive integer. + \versionadded{2.5} +\end{cfuncdesc} + +\begin{cfuncdesc}{int}{PyIndex_Check}{PyObject *o} + Returns True if \var{o} is an index integer (has the nb_index slot of + the tp_as_number structure filled in). + \versionadded{2.5} +\end{cfuncdesc} + + \section{Sequence Protocol \label{sequence}} \begin{cfuncdesc}{int}{PySequence_Check}{PyObject *o} Modified: python/trunk/Include/abstract.h ============================================================================== --- python/trunk/Include/abstract.h (original) +++ python/trunk/Include/abstract.h Sat Aug 12 19:03:09 2006 @@ -758,13 +758,27 @@ */ - PyAPI_FUNC(Py_ssize_t) PyNumber_Index(PyObject *); +#define PyIndex_Check(obj) \ + ((obj)->ob_type->tp_as_number != NULL && \ + PyType_HasFeature((obj)->ob_type, Py_TPFLAGS_HAVE_INDEX) && \ + (obj)->ob_type->tp_as_number->nb_index != NULL) + + PyAPI_FUNC(PyObject *) PyNumber_Index(PyObject *o); /* - Returns the object converted to Py_ssize_t on success - or -1 with an error raised on failure. + Returns the object converted to a Python long or int + or NULL with an error raised on failure. */ + PyAPI_FUNC(Py_ssize_t) PyNumber_AsSsize_t(PyObject *o, PyObject *exc); + + /* + Returns the object converted to Py_ssize_t by going through + PyNumber_Index first. If an overflow error occurs while + converting the int-or-long to Py_ssize_t, then the second argument + is the error-type to return. If it is NULL, then the overflow error + is cleared and the value is clipped. + */ PyAPI_FUNC(PyObject *) PyNumber_Int(PyObject *o); Modified: python/trunk/Include/object.h ============================================================================== --- python/trunk/Include/object.h (original) +++ python/trunk/Include/object.h Sat Aug 12 19:03:09 2006 @@ -208,7 +208,7 @@ binaryfunc nb_inplace_true_divide; /* Added in release 2.5 */ - lenfunc nb_index; + unaryfunc nb_index; } PyNumberMethods; typedef struct { Modified: python/trunk/Lib/test/test_index.py ============================================================================== --- python/trunk/Lib/test/test_index.py (original) +++ python/trunk/Lib/test/test_index.py Sat Aug 12 19:03:09 2006 @@ -1,6 +1,7 @@ import unittest from test import test_support import operator +from sys import maxint class oldstyle: def __index__(self): @@ -10,68 +11,115 @@ def __index__(self): return self.ind +class TrapInt(int): + def __index__(self): + return self + +class TrapLong(long): + def __index__(self): + return self + class BaseTestCase(unittest.TestCase): def setUp(self): self.o = oldstyle() self.n = newstyle() - self.o2 = oldstyle() - self.n2 = newstyle() def test_basic(self): self.o.ind = -2 self.n.ind = 2 - assert(self.seq[self.n] == self.seq[2]) - assert(self.seq[self.o] == self.seq[-2]) - assert(operator.index(self.o) == -2) - assert(operator.index(self.n) == 2) + self.assertEqual(operator.index(self.o), -2) + self.assertEqual(operator.index(self.n), 2) + + def test_slice(self): + self.o.ind = 1 + self.n.ind = 2 + slc = slice(self.o, self.o, self.o) + check_slc = slice(1, 1, 1) + self.assertEqual(slc.indices(self.o), check_slc.indices(1)) + slc = slice(self.n, self.n, self.n) + check_slc = slice(2, 2, 2) + self.assertEqual(slc.indices(self.n), check_slc.indices(2)) + def test_wrappers(self): + self.o.ind = 4 + self.n.ind = 5 + self.assertEqual(6 .__index__(), 6) + self.assertEqual(-7L.__index__(), -7) + self.assertEqual(self.o.__index__(), 4) + self.assertEqual(self.n.__index__(), 5) + + def test_infinite_recursion(self): + self.failUnlessRaises(TypeError, operator.index, TrapInt()) + self.failUnlessRaises(TypeError, operator.index, TrapLong()) + self.failUnless(slice(TrapInt()).indices(0)==(0,0,1)) + self.failUnlessRaises(TypeError, slice(TrapLong()).indices, 0) + def test_error(self): self.o.ind = 'dumb' self.n.ind = 'bad' - myfunc = lambda x, obj: obj.seq[x] self.failUnlessRaises(TypeError, operator.index, self.o) self.failUnlessRaises(TypeError, operator.index, self.n) - self.failUnlessRaises(TypeError, myfunc, self.o, self) - self.failUnlessRaises(TypeError, myfunc, self.n, self) + self.failUnlessRaises(TypeError, slice(self.o).indices, 0) + self.failUnlessRaises(TypeError, slice(self.n).indices, 0) + + +class SeqTestCase(unittest.TestCase): + # This test case isn't run directly. It just defines common tests + # to the different sequence types below + def setUp(self): + self.o = oldstyle() + self.n = newstyle() + self.o2 = oldstyle() + self.n2 = newstyle() + + def test_index(self): + self.o.ind = -2 + self.n.ind = 2 + self.assertEqual(self.seq[self.n], self.seq[2]) + self.assertEqual(self.seq[self.o], self.seq[-2]) def test_slice(self): self.o.ind = 1 self.o2.ind = 3 self.n.ind = 2 self.n2.ind = 4 - assert(self.seq[self.o:self.o2] == self.seq[1:3]) - assert(self.seq[self.n:self.n2] == self.seq[2:4]) + self.assertEqual(self.seq[self.o:self.o2], self.seq[1:3]) + self.assertEqual(self.seq[self.n:self.n2], self.seq[2:4]) def test_repeat(self): self.o.ind = 3 self.n.ind = 2 - assert(self.seq * self.o == self.seq * 3) - assert(self.seq * self.n == self.seq * 2) - assert(self.o * self.seq == self.seq * 3) - assert(self.n * self.seq == self.seq * 2) + self.assertEqual(self.seq * self.o, self.seq * 3) + self.assertEqual(self.seq * self.n, self.seq * 2) + self.assertEqual(self.o * self.seq, self.seq * 3) + self.assertEqual(self.n * self.seq, self.seq * 2) def test_wrappers(self): - n = self.n - n.ind = 5 - assert n.__index__() == 5 - assert 6 .__index__() == 6 - assert -7L.__index__() == -7 - assert self.seq.__getitem__(n) == self.seq[5] - assert self.seq.__mul__(n) == self.seq * 5 - assert self.seq.__rmul__(n) == self.seq * 5 - - def test_infinite_recusion(self): - class Trap1(int): - def __index__(self): - return self - class Trap2(long): - def __index__(self): - return self - self.failUnlessRaises(TypeError, operator.getitem, self.seq, Trap1()) - self.failUnlessRaises(TypeError, operator.getitem, self.seq, Trap2()) + self.o.ind = 4 + self.n.ind = 5 + self.assertEqual(self.seq.__getitem__(self.o), self.seq[4]) + self.assertEqual(self.seq.__mul__(self.o), self.seq * 4) + self.assertEqual(self.seq.__rmul__(self.o), self.seq * 4) + self.assertEqual(self.seq.__getitem__(self.n), self.seq[5]) + self.assertEqual(self.seq.__mul__(self.n), self.seq * 5) + self.assertEqual(self.seq.__rmul__(self.n), self.seq * 5) + + def test_infinite_recursion(self): + self.failUnlessRaises(TypeError, operator.getitem, self.seq, TrapInt()) + self.failUnlessRaises(TypeError, operator.getitem, self.seq, TrapLong()) + + def test_error(self): + self.o.ind = 'dumb' + self.n.ind = 'bad' + indexobj = lambda x, obj: obj.seq[x] + self.failUnlessRaises(TypeError, indexobj, self.o, self) + self.failUnlessRaises(TypeError, indexobj, self.n, self) + sliceobj = lambda x, obj: obj.seq[x:] + self.failUnlessRaises(TypeError, sliceobj, self.o, self) + self.failUnlessRaises(TypeError, sliceobj, self.n, self) -class ListTestCase(BaseTestCase): +class ListTestCase(SeqTestCase): seq = [0,10,20,30,40,50] def test_setdelitem(self): @@ -82,36 +130,36 @@ del lst[self.n] lst[self.o] = 'X' lst[self.n] = 'Y' - assert lst == list('abYdefghXj') + self.assertEqual(lst, list('abYdefghXj')) lst = [5, 6, 7, 8, 9, 10, 11] lst.__setitem__(self.n, "here") - assert lst == [5, 6, "here", 8, 9, 10, 11] + self.assertEqual(lst, [5, 6, "here", 8, 9, 10, 11]) lst.__delitem__(self.n) - assert lst == [5, 6, 8, 9, 10, 11] + self.assertEqual(lst, [5, 6, 8, 9, 10, 11]) def test_inplace_repeat(self): self.o.ind = 2 self.n.ind = 3 lst = [6, 4] lst *= self.o - assert lst == [6, 4, 6, 4] + self.assertEqual(lst, [6, 4, 6, 4]) lst *= self.n - assert lst == [6, 4, 6, 4] * 3 + self.assertEqual(lst, [6, 4, 6, 4] * 3) lst = [5, 6, 7, 8, 9, 11] l2 = lst.__imul__(self.n) - assert l2 is lst - assert lst == [5, 6, 7, 8, 9, 11] * 3 + self.assert_(l2 is lst) + self.assertEqual(lst, [5, 6, 7, 8, 9, 11] * 3) -class TupleTestCase(BaseTestCase): +class TupleTestCase(SeqTestCase): seq = (0,10,20,30,40,50) -class StringTestCase(BaseTestCase): +class StringTestCase(SeqTestCase): seq = "this is a test" -class UnicodeTestCase(BaseTestCase): +class UnicodeTestCase(SeqTestCase): seq = u"this is a test" @@ -120,17 +168,47 @@ def test_xrange(self): n = newstyle() n.ind = 5 - assert xrange(1, 20)[n] == 6 - assert xrange(1, 20).__getitem__(n) == 6 + self.assertEqual(xrange(1, 20)[n], 6) + self.assertEqual(xrange(1, 20).__getitem__(n), 6) + +class OverflowTestCase(unittest.TestCase): + + def setUp(self): + self.pos = 2**100 + self.neg = -self.pos + + def test_large_longs(self): + self.assertEqual(self.pos.__index__(), self.pos) + self.assertEqual(self.neg.__index__(), self.neg) + + def test_getitem(self): + class GetItem(object): + def __len__(self): + return maxint + def __getitem__(self, key): + return key + def __getslice__(self, i, j): + return i, j + x = GetItem() + self.assertEqual(x[self.pos], self.pos) + self.assertEqual(x[self.neg], self.neg) + self.assertEqual(x[self.neg:self.pos], (-1, maxint)) + self.assertEqual(x[self.neg:self.pos:1].indices(maxint), (0, maxint, 1)) + + def test_sequence_repeat(self): + self.failUnlessRaises(OverflowError, lambda: "a" * self.pos) + self.failUnlessRaises(OverflowError, lambda: "a" * self.neg) def test_main(): test_support.run_unittest( + BaseTestCase, ListTestCase, TupleTestCase, StringTestCase, UnicodeTestCase, XRangeTestCase, + OverflowTestCase, ) if __name__ == "__main__": Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Aug 12 19:03:09 2006 @@ -12,6 +12,11 @@ Core and builtins ----------------- +- Patch #1538606, Fix __index__() clipping. There were some problems + discovered with the API and how integers that didn't fit into Py_ssize_t + were handled. This patch attempts to provide enough alternatives + to effectively use __index__. + - Bug #1536021: __hash__ may now return long int; the final hash value is obtained by invoking hash on the long int. Modified: python/trunk/Modules/arraymodule.c ============================================================================== --- python/trunk/Modules/arraymodule.c (original) +++ python/trunk/Modules/arraymodule.c Sat Aug 12 19:03:09 2006 @@ -1572,14 +1572,11 @@ return s; } -#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX) - static PyObject* array_subscr(arrayobject* self, PyObject* item) { - PyNumberMethods *nb = item->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { - Py_ssize_t i = nb->nb_index(item); + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i==-1 && PyErr_Occurred()) { return NULL; } @@ -1627,9 +1624,8 @@ static int array_ass_subscr(arrayobject* self, PyObject* item, PyObject* value) { - PyNumberMethods *nb = item->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { - Py_ssize_t i = nb->nb_index(item); + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i==-1 && PyErr_Occurred()) return -1; if (i < 0) Modified: python/trunk/Modules/mmapmodule.c ============================================================================== --- python/trunk/Modules/mmapmodule.c (original) +++ python/trunk/Modules/mmapmodule.c Sat Aug 12 19:03:09 2006 @@ -808,8 +808,6 @@ }; -#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX) - /* extract the map size from the given PyObject Returns -1 on error, with an appropriate Python exception raised. On @@ -817,31 +815,19 @@ static Py_ssize_t _GetMapSize(PyObject *o) { - PyNumberMethods *nb = o->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(o) && nb->nb_index != NULL) { - Py_ssize_t i = nb->nb_index(o); + if (PyIndex_Check(o)) { + Py_ssize_t i = PyNumber_AsSsize_t(o, PyExc_OverflowError); if (i==-1 && PyErr_Occurred()) return -1; - if (i < 0) - goto onnegoverflow; - if (i==PY_SSIZE_T_MAX) - goto onposoverflow; + if (i < 0) { + PyErr_SetString(PyExc_OverflowError, + "memory mapped size must be positive"); + return -1; + } return i; } - else { - PyErr_SetString(PyExc_TypeError, - "map size must be an integral value"); - return -1; - } - - onnegoverflow: - PyErr_SetString(PyExc_OverflowError, - "memory mapped size must be positive"); - return -1; - onposoverflow: - PyErr_SetString(PyExc_OverflowError, - "memory mapped size is too large (limited by C int)"); + PyErr_SetString(PyExc_TypeError, "map size must be an integral value"); return -1; } Modified: python/trunk/Modules/operator.c ============================================================================== --- python/trunk/Modules/operator.c (original) +++ python/trunk/Modules/operator.c Sat Aug 12 19:03:09 2006 @@ -139,15 +139,7 @@ static PyObject * op_index(PyObject *s, PyObject *a) { - Py_ssize_t i; - PyObject *a1; - if (!PyArg_UnpackTuple(a,"index", 1, 1, &a1)) - return NULL; - i = PyNumber_Index(a1); - if (i == -1 && PyErr_Occurred()) - return NULL; - else - return PyInt_FromSsize_t(i); + return PyNumber_Index(a); } static PyObject* @@ -249,7 +241,7 @@ spam1(is_, "is_(a, b) -- Same as a is b.") spam1(is_not, "is_not(a, b) -- Same as a is not b.") -spam2(index, __index__, "index(a) -- Same as a.__index__()") +spam2o(index, __index__, "index(a) -- Same as a.__index__()") spam2(add,__add__, "add(a, b) -- Same as a + b.") spam2(sub,__sub__, "sub(a, b) -- Same as a - b.") spam2(mul,__mul__, "mul(a, b) -- Same as a * b.") Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Sat Aug 12 19:03:09 2006 @@ -8,8 +8,6 @@ #define NEW_STYLE_NUMBER(o) PyType_HasFeature((o)->ob_type, \ Py_TPFLAGS_CHECKTYPES) -#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX) - /* Shorthands to return certain errors */ @@ -122,9 +120,9 @@ return m->mp_subscript(o, key); if (o->ob_type->tp_as_sequence) { - PyNumberMethods *nb = key->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(key) && nb->nb_index != NULL) { - Py_ssize_t key_value = nb->nb_index(key); + if (PyIndex_Check(key)) { + Py_ssize_t key_value; + key_value = PyNumber_AsSsize_t(key, PyExc_IndexError); if (key_value == -1 && PyErr_Occurred()) return NULL; return PySequence_GetItem(o, key_value); @@ -151,9 +149,9 @@ return m->mp_ass_subscript(o, key, value); if (o->ob_type->tp_as_sequence) { - PyNumberMethods *nb = key->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(key) && nb->nb_index != NULL) { - Py_ssize_t key_value = nb->nb_index(key); + if (PyIndex_Check(key)) { + Py_ssize_t key_value; + key_value = PyNumber_AsSsize_t(key, PyExc_IndexError); if (key_value == -1 && PyErr_Occurred()) return -1; return PySequence_SetItem(o, key_value, value); @@ -183,9 +181,9 @@ return m->mp_ass_subscript(o, key, (PyObject*)NULL); if (o->ob_type->tp_as_sequence) { - PyNumberMethods *nb = key->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(key) && nb->nb_index != NULL) { - Py_ssize_t key_value = nb->nb_index(key); + if (PyIndex_Check(key)) { + Py_ssize_t key_value; + key_value = PyNumber_AsSsize_t(key, PyExc_IndexError); if (key_value == -1 && PyErr_Occurred()) return -1; return PySequence_DelItem(o, key_value); @@ -653,9 +651,8 @@ sequence_repeat(ssizeargfunc repeatfunc, PyObject *seq, PyObject *n) { Py_ssize_t count; - PyNumberMethods *nb = n->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(n) && nb->nb_index != NULL) { - count = nb->nb_index(n); + if (PyIndex_Check(n)) { + count = PyNumber_AsSsize_t(n, PyExc_OverflowError); if (count == -1 && PyErr_Occurred()) return NULL; } @@ -938,23 +935,89 @@ return x; } -/* Return a Py_ssize_t integer from the object item */ -Py_ssize_t +/* Return a Python Int or Long from the object item + Raise TypeError if the result is not an int-or-long + or if the object cannot be interpreted as an index. +*/ +PyObject * PyNumber_Index(PyObject *item) { - Py_ssize_t value = -1; - PyNumberMethods *nb = item->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { - value = nb->nb_index(item); + PyObject *result = NULL; + if (item == NULL) + return null_error(); + /* XXX(nnorwitz): should these be CheckExact? Aren't subclasses ok? */ + if (PyInt_CheckExact(item) || PyLong_CheckExact(item)) { + Py_INCREF(item); + return item; + } + if (PyIndex_Check(item)) { + result = item->ob_type->tp_as_number->nb_index(item); + /* XXX(nnorwitz): Aren't subclasses ok here too? */ + if (result && + !PyInt_CheckExact(result) && !PyLong_CheckExact(result)) { + PyErr_Format(PyExc_TypeError, + "__index__ returned non-(int,long) " \ + "(type %.200s)", + result->ob_type->tp_name); + Py_DECREF(result); + return NULL; + } } else { PyErr_Format(PyExc_TypeError, "'%.200s' object cannot be interpreted " "as an index", item->ob_type->tp_name); } - return value; + return result; } +/* Return an error on Overflow only if err is not NULL*/ + +Py_ssize_t +PyNumber_AsSsize_t(PyObject *item, PyObject *err) +{ + Py_ssize_t result; + PyObject *runerr; + PyObject *value = PyNumber_Index(item); + if (value == NULL) + return -1; + + /* We're done if PyInt_AsSsize_t() returns without error. */ + result = PyInt_AsSsize_t(value); + if (result != -1 || !(runerr = PyErr_Occurred())) + goto finish; + + /* Error handling code -- only manage OverflowError differently */ + if (!PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) + goto finish; + + PyErr_Clear(); + /* If no error-handling desired then the default clipping + is sufficient. + */ + if (!err) { + assert(PyLong_Check(value)); + /* Whether or not it is less than or equal to + zero is determined by the sign of ob_size + */ + if (_PyLong_Sign(value) < 0) + result = PY_SSIZE_T_MIN; + else + result = PY_SSIZE_T_MAX; + } + else { + /* Otherwise replace the error with caller's error object. */ + PyErr_Format(err, + "cannot fit '%.200s' into an index-sized integer", + item->ob_type->tp_name); + } + + finish: + Py_DECREF(value); + return result; +} + + PyObject * PyNumber_Int(PyObject *o) { Modified: python/trunk/Objects/classobject.c ============================================================================== --- python/trunk/Objects/classobject.c (original) +++ python/trunk/Objects/classobject.c Sat Aug 12 19:03:09 2006 @@ -1670,40 +1670,28 @@ return outcome > 0; } -static Py_ssize_t +static PyObject * instance_index(PyInstanceObject *self) { PyObject *func, *res; - Py_ssize_t outcome; static PyObject *indexstr = NULL; if (indexstr == NULL) { indexstr = PyString_InternFromString("__index__"); if (indexstr == NULL) - return -1; + return NULL; } if ((func = instance_getattr(self, indexstr)) == NULL) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) - return -1; + return NULL; PyErr_Clear(); PyErr_SetString(PyExc_TypeError, "object cannot be interpreted as an index"); - return -1; + return NULL; } res = PyEval_CallObject(func, (PyObject *)NULL); Py_DECREF(func); - if (res == NULL) - return -1; - if (PyInt_Check(res) || PyLong_Check(res)) { - outcome = res->ob_type->tp_as_number->nb_index(res); - } - else { - PyErr_SetString(PyExc_TypeError, - "__index__ must return an int or a long"); - outcome = -1; - } - Py_DECREF(res); - return outcome; + return res; } @@ -2026,7 +2014,7 @@ instance_truediv, /* nb_true_divide */ instance_ifloordiv, /* nb_inplace_floor_divide */ instance_itruediv, /* nb_inplace_true_divide */ - (lenfunc)instance_index, /* nb_index */ + (unaryfunc)instance_index, /* nb_index */ }; PyTypeObject PyInstance_Type = { Modified: python/trunk/Objects/intobject.c ============================================================================== --- python/trunk/Objects/intobject.c (original) +++ python/trunk/Objects/intobject.c Sat Aug 12 19:03:09 2006 @@ -193,16 +193,21 @@ PyIntObject *io; Py_ssize_t val; #endif - if (op && !PyInt_CheckExact(op) && PyLong_Check(op)) + + if (op == NULL) { + PyErr_SetString(PyExc_TypeError, "an integer is required"); + return -1; + } + + if (PyInt_Check(op)) + return PyInt_AS_LONG((PyIntObject*) op); + if (PyLong_Check(op)) return _PyLong_AsSsize_t(op); #if SIZEOF_SIZE_T == SIZEOF_LONG return PyInt_AsLong(op); #else - if (op && PyInt_Check(op)) - return PyInt_AS_LONG((PyIntObject*) op); - - if (op == NULL || (nb = op->ob_type->tp_as_number) == NULL || + if ((nb = op->ob_type->tp_as_number) == NULL || (nb->nb_int == NULL && nb->nb_long == 0)) { PyErr_SetString(PyExc_TypeError, "an integer is required"); return -1; @@ -1079,7 +1084,7 @@ int_true_divide, /* nb_true_divide */ 0, /* nb_inplace_floor_divide */ 0, /* nb_inplace_true_divide */ - PyInt_AsSsize_t, /* nb_index */ + (unaryfunc)int_int, /* nb_index */ }; PyTypeObject PyInt_Type = { Modified: python/trunk/Objects/listobject.c ============================================================================== --- python/trunk/Objects/listobject.c (original) +++ python/trunk/Objects/listobject.c Sat Aug 12 19:03:09 2006 @@ -2450,14 +2450,13 @@ "list() -> new list\n" "list(sequence) -> new list initialized from sequence's items"); -#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX) static PyObject * list_subscript(PyListObject* self, PyObject* item) { - PyNumberMethods *nb = item->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { - Py_ssize_t i = nb->nb_index(item); + if (PyIndex_Check(item)) { + Py_ssize_t i; + i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) return NULL; if (i < 0) @@ -2504,9 +2503,8 @@ static int list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value) { - PyNumberMethods *nb = item->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { - Py_ssize_t i = nb->nb_index(item); + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) return -1; if (i < 0) Modified: python/trunk/Objects/longobject.c ============================================================================== --- python/trunk/Objects/longobject.c (original) +++ python/trunk/Objects/longobject.c Sat Aug 12 19:03:09 2006 @@ -240,8 +240,11 @@ return -1; } -static Py_ssize_t -_long_as_ssize_t(PyObject *vv) { +/* Get a Py_ssize_t from a long int object. + Returns -1 and sets an error condition if overflow occurs. */ + +Py_ssize_t +_PyLong_AsSsize_t(PyObject *vv) { register PyLongObject *v; size_t x, prev; Py_ssize_t i; @@ -277,45 +280,7 @@ overflow: PyErr_SetString(PyExc_OverflowError, "long int too large to convert to int"); - if (sign > 0) - return PY_SSIZE_T_MAX; - else - return PY_SSIZE_T_MIN; -} - -/* Get a Py_ssize_t from a long int object. - Returns -1 and sets an error condition if overflow occurs. */ - -Py_ssize_t -_PyLong_AsSsize_t(PyObject *vv) -{ - Py_ssize_t x; - - x = _long_as_ssize_t(vv); - if (PyErr_Occurred()) return -1; - return x; -} - - -/* Get a Py_ssize_t from a long int object. - Silently reduce values larger than PY_SSIZE_T_MAX to PY_SSIZE_T_MAX, - and silently boost values less than -PY_SSIZE_T_MAX-1 to -PY_SSIZE_T_MAX-1. - On error, return -1 with an exception set. -*/ - -static Py_ssize_t -long_index(PyObject *vv) -{ - Py_ssize_t x; - - x = _long_as_ssize_t(vv); - if (PyErr_Occurred()) { - /* If overflow error, ignore the error */ - if (x != -1) { - PyErr_Clear(); - } - } - return x; + return -1; } /* Get a C unsigned long int from a long int object. @@ -3405,7 +3370,7 @@ long_true_divide, /* nb_true_divide */ 0, /* nb_inplace_floor_divide */ 0, /* nb_inplace_true_divide */ - long_index, /* nb_index */ + long_long, /* nb_index */ }; PyTypeObject PyLong_Type = { Modified: python/trunk/Objects/sliceobject.c ============================================================================== --- python/trunk/Objects/sliceobject.c (original) +++ python/trunk/Objects/sliceobject.c Sat Aug 12 19:03:09 2006 @@ -252,7 +252,7 @@ { Py_ssize_t ilen, start, stop, step, slicelength; - ilen = PyInt_AsSsize_t(len); + ilen = PyNumber_AsSsize_t(len, PyExc_OverflowError); if (ilen == -1 && PyErr_Occurred()) { return NULL; Modified: python/trunk/Objects/stringobject.c ============================================================================== --- python/trunk/Objects/stringobject.c (original) +++ python/trunk/Objects/stringobject.c Sat Aug 12 19:03:09 2006 @@ -1184,14 +1184,11 @@ return x; } -#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX) - static PyObject* string_subscript(PyStringObject* self, PyObject* item) { - PyNumberMethods *nb = item->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { - Py_ssize_t i = nb->nb_index(item); + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) return NULL; if (i < 0) Modified: python/trunk/Objects/tupleobject.c ============================================================================== --- python/trunk/Objects/tupleobject.c (original) +++ python/trunk/Objects/tupleobject.c Sat Aug 12 19:03:09 2006 @@ -577,14 +577,11 @@ (objobjproc)tuplecontains, /* sq_contains */ }; -#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX) - static PyObject* tuplesubscript(PyTupleObject* self, PyObject* item) { - PyNumberMethods *nb = item->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { - Py_ssize_t i = nb->nb_index(item); + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) return NULL; if (i < 0) Modified: python/trunk/Objects/typeobject.c ============================================================================== --- python/trunk/Objects/typeobject.c (original) +++ python/trunk/Objects/typeobject.c Sat Aug 12 19:03:09 2006 @@ -3527,7 +3527,7 @@ if (!PyArg_UnpackTuple(args, "", 1, 1, &o)) return NULL; - i = PyNumber_Index(o); + i = PyNumber_AsSsize_t(o, PyExc_OverflowError); if (i == -1 && PyErr_Occurred()) return NULL; return (*func)(self, i); @@ -3538,7 +3538,7 @@ { Py_ssize_t i; - i = PyNumber_Index(arg); + i = PyNumber_AsSsize_t(arg, PyExc_OverflowError); if (i == -1 && PyErr_Occurred()) return -1; if (i < 0) { @@ -4344,26 +4344,11 @@ } -static Py_ssize_t +static PyObject * slot_nb_index(PyObject *self) { static PyObject *index_str; - PyObject *temp = call_method(self, "__index__", &index_str, "()"); - Py_ssize_t result; - - if (temp == NULL) - return -1; - if (PyInt_CheckExact(temp) || PyLong_CheckExact(temp)) { - result = temp->ob_type->tp_as_number->nb_index(temp); - } - else { - PyErr_Format(PyExc_TypeError, - "__index__ must return an int or a long, " - "not '%.200s'", temp->ob_type->tp_name); - result = -1; - } - Py_DECREF(temp); - return result; + return call_method(self, "__index__", &index_str, "()"); } @@ -5109,7 +5094,7 @@ "oct(x)"), UNSLOT("__hex__", nb_hex, slot_nb_hex, wrap_unaryfunc, "hex(x)"), - NBSLOT("__index__", nb_index, slot_nb_index, wrap_lenfunc, + NBSLOT("__index__", nb_index, slot_nb_index, wrap_unaryfunc, "x[y:z] <==> x[y.__index__():z.__index__()]"), IBSLOT("__iadd__", nb_inplace_add, slot_nb_inplace_add, wrap_binaryfunc, "+"), Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Sat Aug 12 19:03:09 2006 @@ -6985,14 +6985,11 @@ PyUnicode_Contains, /* sq_contains */ }; -#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX) - static PyObject* unicode_subscript(PyUnicodeObject* self, PyObject* item) { - PyNumberMethods *nb = item->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { - Py_ssize_t i = nb->nb_index(item); + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) return NULL; if (i < 0) Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Sat Aug 12 19:03:09 2006 @@ -3866,12 +3866,14 @@ if (v != NULL) { Py_ssize_t x; if (PyInt_Check(v)) { - x = PyInt_AsSsize_t(v); + /* XXX(nnorwitz): I think PyInt_AS_LONG is correct, + however, it looks like it should be AsSsize_t. + There should be a comment here explaining why. + */ + x = PyInt_AS_LONG(v); } - else if (v->ob_type->tp_as_number && - PyType_HasFeature(v->ob_type, Py_TPFLAGS_HAVE_INDEX) - && v->ob_type->tp_as_number->nb_index) { - x = v->ob_type->tp_as_number->nb_index(v); + else if (PyIndex_Check(v)) { + x = PyNumber_AsSsize_t(v, NULL); if (x == -1 && PyErr_Occurred()) return 0; } @@ -3887,10 +3889,8 @@ } #undef ISINDEX -#define ISINDEX(x) ((x) == NULL || PyInt_Check(x) || PyLong_Check(x) || \ - ((x)->ob_type->tp_as_number && \ - PyType_HasFeature((x)->ob_type, Py_TPFLAGS_HAVE_INDEX) \ - && (x)->ob_type->tp_as_number->nb_index)) +#define ISINDEX(x) ((x) == NULL || \ + PyInt_Check(x) || PyLong_Check(x) || PyIndex_Check(x)) static PyObject * apply_slice(PyObject *u, PyObject *v, PyObject *w) /* return u[v:w] */ From python-checkins at python.org Sat Aug 12 19:10:03 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 19:10:03 +0200 (CEST) Subject: [Python-checkins] r51237 - peps/trunk/pep-0356.txt Message-ID: <20060812171003.D079C1E4002@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 19:10:02 2006 New Revision: 51237 Modified: peps/trunk/pep-0356.txt Log: update __index__ issue Modified: peps/trunk/pep-0356.txt ============================================================================== --- peps/trunk/pep-0356.txt (original) +++ peps/trunk/pep-0356.txt Sat Aug 12 19:10:02 2006 @@ -148,6 +148,7 @@ - Bugs that need resolving before release, ie, they block release: + /* Patch # 1538606 was checked in, needs review and testing. */ http://mail.python.org/pipermail/python-dev/2006-July/067774.html Problem with __index__ (patch pending) From buildbot at python.org Sat Aug 12 19:11:52 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 17:11:52 +0000 Subject: [Python-checkins] buildbot failure in x86 XP trunk Message-ID: <20060812171152.B06981E401A@bag.python.org> The Buildbot has detected a new failure of x86 XP trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%2520trunk/builds/1354 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 19:27:15 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 17:27:15 +0000 Subject: [Python-checkins] buildbot warnings in amd64 gentoo trunk Message-ID: <20060812172715.49C1A1E4002@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%2520gentoo%2520trunk/builds/1412 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 19:45:12 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 17:45:12 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian trunk Message-ID: <20060812174513.05B1B1E4012@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%2520trunk/builds/398 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 19:54:47 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 17:54:47 +0000 Subject: [Python-checkins] buildbot warnings in ia64 Ubuntu trunk trunk Message-ID: <20060812175447.E0DDF1E4002@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu trunk trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%2520Ubuntu%2520trunk%2520trunk/builds/8 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 12 19:56:47 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 17:56:47 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060812175647.5C6971E4003@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1071 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sat Aug 12 20:44:07 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 12 Aug 2006 20:44:07 +0200 (CEST) Subject: [Python-checkins] r51238 - in python/trunk: Lib/test/test_index.py Misc/NEWS Objects/classobject.c Objects/typeobject.c Message-ID: <20060812184407.5F6701E4002@bag.python.org> Author: neal.norwitz Date: Sat Aug 12 20:44:06 2006 New Revision: 51238 Modified: python/trunk/Lib/test/test_index.py python/trunk/Misc/NEWS python/trunk/Objects/classobject.c python/trunk/Objects/typeobject.c Log: Fix a couple of bugs exposed by the new __index__ code. The 64-bit buildbots were failing due to inappropriate clipping of numbers larger than 2**31 with new-style classes. (typeobject.c) In reviewing the code for classic classes, there were 2 problems. Any negative value return could be returned. Always return -1 if there was an error. Also make the checks similar with the new-style classes. I believe this is correct for 32 and 64 bit boxes, including Windows64. Add a test of classic classes too. Modified: python/trunk/Lib/test/test_index.py ============================================================================== --- python/trunk/Lib/test/test_index.py (original) +++ python/trunk/Lib/test/test_index.py Sat Aug 12 20:44:06 2006 @@ -181,8 +181,8 @@ self.assertEqual(self.pos.__index__(), self.pos) self.assertEqual(self.neg.__index__(), self.neg) - def test_getitem(self): - class GetItem(object): + def _getitem_helper(self, base): + class GetItem(base): def __len__(self): return maxint def __getitem__(self, key): @@ -195,6 +195,13 @@ self.assertEqual(x[self.neg:self.pos], (-1, maxint)) self.assertEqual(x[self.neg:self.pos:1].indices(maxint), (0, maxint, 1)) + def test_getitem(self): + self._getitem_helper(object) + + def test_getitem_classic(self): + class Empty: pass + self._getitem_helper(Empty) + def test_sequence_repeat(self): self.failUnlessRaises(OverflowError, lambda: "a" * self.pos) self.failUnlessRaises(OverflowError, lambda: "a" * self.neg) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Aug 12 20:44:06 2006 @@ -12,6 +12,12 @@ Core and builtins ----------------- +- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines + with new-style classes. + +- Fix bug related to __len__ functions returning negative values with + classic classes. + - Patch #1538606, Fix __index__() clipping. There were some problems discovered with the API and how integers that didn't fit into Py_ssize_t were handled. This patch attempts to provide enough alternatives Modified: python/trunk/Objects/classobject.c ============================================================================== --- python/trunk/Objects/classobject.c (original) +++ python/trunk/Objects/classobject.c Sat Aug 12 20:44:06 2006 @@ -974,24 +974,25 @@ if (res == NULL) return -1; if (PyInt_Check(res)) { - Py_ssize_t temp = PyInt_AsSsize_t(res); - if (temp == -1 && PyErr_Occurred()) { + outcome = PyInt_AsSsize_t(res); + if (outcome == -1 && PyErr_Occurred()) { Py_DECREF(res); return -1; } - outcome = (Py_ssize_t)temp; -#if SIZEOF_SIZE_T < SIZEOF_LONG +#if SIZEOF_SIZE_T < SIZEOF_INT /* Overflow check -- range of PyInt is more than C int */ - if (outcome != temp) { + if (outcome != (int)outcome) { PyErr_SetString(PyExc_OverflowError, "__len__() should return 0 <= outcome < 2**31"); outcome = -1; } else #endif - if (outcome < 0) + if (outcome < 0) { PyErr_SetString(PyExc_ValueError, "__len__() should return >= 0"); + outcome = -1; + } } else { PyErr_SetString(PyExc_TypeError, Modified: python/trunk/Objects/typeobject.c ============================================================================== --- python/trunk/Objects/typeobject.c (original) +++ python/trunk/Objects/typeobject.c Sat Aug 12 20:44:06 2006 @@ -4110,19 +4110,17 @@ { static PyObject *len_str; PyObject *res = call_method(self, "__len__", &len_str, "()"); - Py_ssize_t temp; Py_ssize_t len; if (res == NULL) return -1; - temp = PyInt_AsSsize_t(res); - len = (int)temp; + len = PyInt_AsSsize_t(res); Py_DECREF(res); if (len == -1 && PyErr_Occurred()) return -1; -#if SIZEOF_SIZE_T < SIZEOF_LONG +#if SIZEOF_SIZE_T < SIZEOF_INT /* Overflow check -- range of PyInt is more than C ssize_t */ - if (len != temp) { + if (len != (int)len) { PyErr_SetString(PyExc_OverflowError, "__len__() should return 0 <= outcome < 2**31"); return -1; From buildbot at python.org Sat Aug 12 20:53:08 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 18:53:08 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060812185308.E49E21E4002@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/484 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sat Aug 12 21:12:39 2006 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 12 Aug 2006 21:12:39 +0200 (CEST) Subject: [Python-checkins] r51239 - peps/trunk/pep-0356.txt Message-ID: <20060812191239.7AEE81E4002@bag.python.org> Author: andrew.kuchling Date: Sat Aug 12 21:12:38 2006 New Revision: 51239 Modified: peps/trunk/pep-0356.txt Log: [#390] Update final release date to match schedule Modified: peps/trunk/pep-0356.txt ============================================================================== --- peps/trunk/pep-0356.txt (original) +++ peps/trunk/pep-0356.txt Sat Aug 12 21:12:38 2006 @@ -17,7 +17,8 @@ beta release. Bugs may be fixed until the final release. There will be at least two alpha releases, two beta releases, and - one release candidate. The release date is planned 19 August 2006. + one release candidate. The release date is planned for + 12 September 2006. Release Manager From buildbot at python.org Sat Aug 12 21:43:01 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 12 Aug 2006 19:43:01 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP trunk Message-ID: <20060812194301.362561E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%2520trunk/builds/1356 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sun Aug 13 02:20:50 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 02:20:50 +0200 (CEST) Subject: [Python-checkins] r51240 - python/trunk/Doc/dist/dist.tex Message-ID: <20060813002050.1DF131E4016@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 02:20:49 2006 New Revision: 51240 Modified: python/trunk/Doc/dist/dist.tex Log: SF bug #1539336, distutils example code missing Modified: python/trunk/Doc/dist/dist.tex ============================================================================== --- python/trunk/Doc/dist/dist.tex (original) +++ python/trunk/Doc/dist/dist.tex Sun Aug 13 02:20:49 2006 @@ -1992,6 +1992,7 @@ script for this could be \begin{verbatim} from distutils.core import setup +from distutils.extension import Extension setup(name='foobar', version='1.0', ext_modules=[Extension('foo', ['foo.c'])], @@ -2006,6 +2007,7 @@ extension: \begin{verbatim} from distutils.core import setup +from distutils.extension import Extension setup(name='foobar', version='1.0', ext_modules=[Extension('foopkg.foo', ['foo.c'])], From python-checkins at python.org Sun Aug 13 14:24:50 2006 From: python-checkins at python.org (georg.brandl) Date: Sun, 13 Aug 2006 14:24:50 +0200 (CEST) Subject: [Python-checkins] r51241 - peps/trunk/pep-3099.txt Message-ID: <20060813122450.1E8F81E4002@bag.python.org> Author: georg.brandl Date: Sun Aug 13 14:24:49 2006 New Revision: 51241 Modified: peps/trunk/pep-3099.txt Log: Add "no complete rewrite" to PEP 3099. Modified: peps/trunk/pep-3099.txt ============================================================================== --- peps/trunk/pep-3099.txt (original) +++ peps/trunk/pep-3099.txt Sun Aug 13 14:24:49 2006 @@ -32,6 +32,14 @@ Core language ============= +* Python 3000 will not be a rewrite from scratch. + + It will also not use C++ or another language different from C + as implementation language. Rather, there will be a gradual + transmogrification of the codebase. There's an excellent essay + by Joel Spolsky explaining why: + http://www.joelonsoftware.com/articles/fog0000000069.html + * ``self`` will not become implicit. Having ``self`` be explicit is a *good thing*. It makes the code From python-checkins at python.org Sun Aug 13 18:44:36 2006 From: python-checkins at python.org (matt.fleming) Date: Sun, 13 Aug 2006 18:44:36 +0200 (CEST) Subject: [Python-checkins] r51242 - in sandbox/trunk/pdb: README.txt mconnection.py mpdb.py mproc.py mremote.py pdbserver.py test/support.py Message-ID: <20060813164436.8C82E1E4002@bag.python.org> Author: matt.fleming Date: Sun Aug 13 18:44:35 2006 New Revision: 51242 Added: sandbox/trunk/pdb/mproc.py sandbox/trunk/pdb/mremote.py sandbox/trunk/pdb/pdbserver.py (contents, props changed) Modified: sandbox/trunk/pdb/README.txt sandbox/trunk/pdb/mconnection.py sandbox/trunk/pdb/mpdb.py sandbox/trunk/pdb/test/support.py Log: Create some factory functions to decouple the instation of the conection objects from mpdb.py. Unit tests need fixing. Modified: sandbox/trunk/pdb/README.txt ============================================================================== --- sandbox/trunk/pdb/README.txt (original) +++ sandbox/trunk/pdb/README.txt Sun Aug 13 18:44:35 2006 @@ -51,6 +51,8 @@ input from the user and doesn't work remotely. * pdbserver using a TCP connection uses setsockopt() REUSEADDR by default. Need some way to make this configurable. `set reuseaddr' ? +* The style in which mpdb.py is written is too 'amorphous'. Need to at least + separate process, thread and communication code out. -=[FIXED]=- * Can restart program remotely with new arguments. Modified: sandbox/trunk/pdb/mconnection.py ============================================================================== --- sandbox/trunk/pdb/mconnection.py (original) +++ sandbox/trunk/pdb/mconnection.py Sun Aug 13 18:44:35 2006 @@ -36,6 +36,45 @@ """ raise NotImplementedError, NotImplementedMessage +def import_hook(target): + cls = target[target.rfind('.')+1:] + target = target[:target.rfind('.')] + pkg = __import__(target, globals(), locals(), []) + return getattr(pkg, cls) + +class MConnectionClientFactory: + + """A factory class that provides a connection for use with a client + for example, with a target function. + """ + @staticmethod + def create(target): + if 'tcp' in target: + return MConnectionClientTCP() + elif 'serial' in target: + return MConnectionSerial() + elif 'fifo' in target: + return MConnectionClientFIFO() + else: + return import_hook(target) + + +class MConnectionServerFactory: + + """A factory class that provides a connection to be used with + a pdbserver. + """ + @staticmethod + def create(target): + if 'tcp' in target: + return MConnectionServerTCP() + elif 'serial' in target: + return MConnectionSerial() + elif 'fifo' in target: + return MConnectionServerFIFO() + else: + return import_hook(target) + ### This might go in a different file # Not, serial protocol does not require the distinction between server and # client. Modified: sandbox/trunk/pdb/mpdb.py ============================================================================== --- sandbox/trunk/pdb/mpdb.py (original) +++ sandbox/trunk/pdb/mpdb.py Sun Aug 13 18:44:35 2006 @@ -53,16 +53,6 @@ self.target = 'local' # local connections by default self.lastcmd = '' self.connection = None - self.debugger_name = 'mpdb' - - self.setcmds.add('debug-signal', self.set_debug_signal) - self.setcmds.add('target-address', self.set_target_address) - self.showcmds.add('debug-signal', self.show_debug_signal) - self.showcmds.add('target-address', self.show_target_address) - self.infocmds.add('target', self.info_target) - - self.target_addr = "" # target address used by 'attach' - self.debug_signal = None # The signal used by 'attach' # We need to be in control of self.stdin self.use_rawinput = False @@ -76,349 +66,15 @@ if not hasattr(self.stdout, 'flush'): self.stdout.flush = lambda: None - def remote_onecmd(self, line): - """ All commands in 'line' are sent across this object's connection - instance variable. - """ - if not line: - # Execute the previous command - line = self.lastcmd - # This is the simplest way I could think of to do this without - # breaking any of the inherited code from pydb/pdb. If we're a - # remote client, always call 'rquit' (remote quit) when connected to - # a pdbserver. This executes extra code to allow the client and server - # to quit cleanly. - if 'quit'.startswith(line): - line = 'rquit' - self.connection.write(line) - # Reset the onecmd method - self.onecmd = lambda x: pydb.Pdb.onecmd(self, x) - self.do_rquit(None) - return - if 'detach'.startswith(line): - self.connection.write('rdetach') - self.do_detach(None) - self.connection.write(line) - ret = self.connection.readline() - if ret == '': - self.errmsg('Connection closed unexpectedly') - self.onecmd = lambda x: pydb.Pdb.onecmd(self, x) - self.do_rquit(None) - # The output from the command that we've just sent to the server - # is returned along with the prompt of that server. So we keep reading - # until we find our prompt. - i = 1 - while self.local_prompt not in ret: - if i == 100: - # We're probably _never_ going to get that data and that - # connection is probably dead. - self.errmsg('Connection died unexpectedly') - self.onecmd = lambda x: pydb.Pdb.onecmd(self, x) - self.do_rquit(None) - else: - ret += self.connection.readline() - i += 1 - - # Some 'special' actions must be taken depending on the data returned - if 'restart_now' in ret: - self.connection.write('ACK:restart_now') - self.errmsg('Pdbserver restarting..') - # We've acknowledged a restart, which means that a new pdbserver - # process is started, so we have to connect all over again. - self._disconnect() - time.sleep(3.0) - if not self.do_target(self.target_addr): - # We cannot trust these variables below to be in a - # stable state. i.e. if the pdbserver doesn't come back up. - self.onecmd = lambda x: pydb.Pdb.onecmd(self, x) - return - self.msg_nocr(ret) - self.lastcmd = line - return - - def _disconnect(self): - """ Disconnect a connection. """ - self.connection.disconnect() - self.connection = None - self.target = 'local' - if hasattr(self, 'local_prompt'): - self.prompt = self.local_prompt - self.onecmd = lambda x: pydb.Pdb.onecmd(self, x) - def help_mpdb(self, *arg): help() - def set_debug_signal(self, args): - """Set the signal sent to a process to trigger debugging.""" - try: - exec 'from signal import %s' % args[1] - except ImportError: - self.errmsg('Invalid signal') - return - self.debug_signal = args[1] - self.msg('debug-signal set to: %s' % self.debug_signal) - - def set_target_address(self, args): - """Set the address of a target.""" - self.target_addr = "".join(["%s " % a for a in args[1:]]) - self.target_addr = self.target_addr.strip() - self.msg('target address set to %s' % self.target_addr) - - def show_debug_signal(self, arg): - """Show the signal currently used for triggering debugging - of an already running process. - """ - if not self.debug_signal: - self.msg('debug-signal not set.') - return - self.msg('debug-signal is %s' % self.debug_signal) - - def show_target_address(self, arg): - """Show the address of the current target.""" - self.msg('target-address is %s.' % self.target_addr.__repr__()) - - def info_target(self, args): - """Display information about the current target.""" - self.msg('target is %s' % self.target) - - # Debugger commands - def do_attach(self, addr): - """ Attach to a process or file outside of Pdb. -This command attaches to another target, of the same type as your last -"target" command. The command may take as argument a process id or a -device file. For a process id, you must have permission to send the -process a signal, and it must have the same effective uid as the debugger. -When using "attach" with a process id, the debugger finds the -program running in the process, looking first in the current working -directory, or (if not found there) using the source file search path -(see the "directory" command). You can also use the "file" command -to specify the program, and to load its symbol table. -""" - if not self.target_addr: - self.errmsg('No target address is set') - return - try: - pid = int(addr) - except ValueError: - # no PID - self.errmsg('You must specify a process ID to attach to.') - return - if not self.debug_signal: - from signal import SIGUSR1 - self.debug_signal = SIGUSR1 - try: - os.kill(pid, self.debug_signal) - except OSError, err: - self.errmsg(err) - return - - # XXX this still needs removing - time.sleep(1.0) - - self.do_target(self.target_addr) - - def do_target(self, args): - """ Connect to a target machine or process. -The first argument is the type or protocol of the target machine -(which can be the name of a class that is available either in the current -working directory or in Python's PYTHONPATH environment variable). -Remaining arguments are interpreted by the target protocol. For more -information on the arguments for a particular protocol, type -`help target ' followed by the protocol name. - -List of target subcommands: - -target serial device-name -- Use a remote computer via a serial line -target tcp hostname:port -- Use a remote computer via a socket connection -""" - if not args: - args = self.target_addr - try: - target, addr = args.split(' ') - except ValueError: - self.errmsg('Invalid arguments') - return False - # If addr is ':PORT' fill in 'localhost' as the hostname - if addr[0] == ':': - addr = 'localhost'+addr[:] - if 'remote' in self.target: - self.errmsg('Already connected to a remote machine.') - return False - if target == 'tcp': - # TODO: need to save state of current debug session - if self.connection: self.connection.disconnect() - try: - from mconnection import (MConnectionClientTCP, - ConnectionFailed) - self.connection = MConnectionClientTCP() - - except ImportError: - self.errmsg('Could not import MConnectionClientTCP') - return False - elif target == 'serial': - if self.connection: self.connection.disconnect() - try: - from mconnection import (MConnectionSerial, - ConnectionFailed) - self.connection = MConnectionSerial() - except ImportError: - self.errmsg('Could not import MConnectionSerial') - return False - elif target == 'fifo': - if self.connection: self.connection.disconnect() - try: - from mconnection import (MConnectionClientFIFO, - ConnectionFailed) - self.connection = MConnectionClientFIFO() - except ImportError: - self.errmsg('Could not import MConnectionClientFIFO') - return False - else: - cls = target[target.rfind('.')+1:] - path = target[:target.rfind('.')] - exec 'from ' + path + ' import ' + cls + ', ConnectionFailed' - self.connection = eval(cls+'()') - try: - self.connection.connect(addr) - except ConnectionFailed, err: - self.errmsg("Failed to connect to %s: (%s)" % (addr, err)) - return False - # This interpreter no longer interprets commands but sends - # them straight across this object's connection to a server. - # XXX: In the remote_onecmd method we use the local_prompt string - # to find where the end of the message from the server is. We - # really need a way to get the prompt from the server for checking - # in remote_onecmd, because it may be different to this client's. - self.local_prompt = self.prompt - self.prompt = "" - self.target_addr = target + " " + addr - line = self.connection.readline() - if line == '': - self.errmsg('Connection closed unexpectedly') - self.do_quit(None) - while '(MPdb)' not in line: - line = self.connection.readline() - self.msg_nocr(line) - self.onecmd = self.remote_onecmd - self.target = 'remote-client' - return True - - def do_detach(self, args): - """ Detach a process or file previously attached. -If a process, it is no longer traced, and it continues its execution. If -you were debugging a file, the file is closed and Pdb no longer accesses it. -""" - raise KeyboardInterrupt - - def do_pdbserver(self, args): - """ Allow a debugger to connect to this session. -The first argument is the type or protocol that is used for this connection -(which can be the name of a class that is avaible either in the current -working directory or in Python's PYTHONPATH environtment variable). -The next argument is protocol specific arguments (e.g. hostname and -port number for a TCP connection, or a serial device for a serial line -connection). The next argument is the filename of the script that is -being debugged. The rest of the arguments are passed as arguments to the -script file and are optional. For more information on the arguments for a -particular protocol, type `help pdbserver ' followed by the protocol name. -The syntax for this command is, - -`pdbserver ConnectionClass comm scriptfile [args ...]' - -""" - try: - target, comm = args.split(' ') - except ValueError: - self.errmsg('Invalid arguments') - return - if 'remote' in self.target: - self.errmsg('Already connected remotely') - return - if target == 'tcp': - try: - from mconnection import (MConnectionServerTCP, - ConnectionFailed) - self.connection = MConnectionServerTCP() - except ImportError: - self.errmsg('Could not load MConnectionServerTCP class') - return - elif target == 'serial': - try: - from mconnection import (MConnectionSerial, - ConnectionFailed) - self.connection = MConnectionSerial() - except ImportError: - self.errmsg('Could not load MConnectionSerial class') - return - else: - if '.' in target: - base = target[:target.rfind('.')] - target = target[target.rfind('.')+1:] - try: - exec 'from ' + base + ' import (' + target + \ - ', ConnectionFailed)' - except ImportError: - self.errmsg('Unknown protocol') - return - else: - try: - __import__(target) - except ImportError: - self.errmsg('Unknown protocol') - return - self.connection = eval(target+'()') - try: - self.msg('Listening on: %s' % comm) - self.connection.connect(comm) - except ConnectionFailed, err: - self.errmsg("Failed to connect to %s: (%s)" % (comm, err)) - return - self.pdbserver_addr = comm - self.target = 'remote-pdbserver' - self._rebind_input(self.connection) - self._rebind_output(self.connection) - - def do_rquit(self, arg): - """ Quit a remote debugging session. The program being executed -is aborted. -""" - if self.target == 'local': - self.errmsg('Connected locally; cannot remotely quit') - return - self._rebind_output(self.orig_stdout) - self._rebind_input(self.orig_stdin) - self._disconnect() - self.target = 'local' - sys.settrace(None) - self.do_quit(None) - - def do_restart(self, arg): - """ Extend pydb.do_restart to signal to any clients connected on - a debugger's connection that this debugger is going to be restarted. - All state is lost, and a new copy of the debugger is used. + def _pdbserver_hook(self, addr): + """This method allows a pdbserver to be created from inside the + 'default' debugger. This may be needed for instance, if this process + receives a signal to start debugging from another process. """ - # We don't proceed with the restart until the action has been - # ACK'd by any connected clients - if self.connection != None: - self.msg('restart_now\n(MPdb)') - line = "" - while not 'ACK:restart_now' in line: - line = self.connection.readline() - self.do_rquit(None) - else: - self.msg("Re exec'ing\n\t%s" % self._sys_argv) - os.execvp(self._sys_argv[0], self._sys_argv) - - def do_rdetach(self, arg): - """ The rdetach command is performed on the pdbserver, it cleans - things up when the client has detached from this process. - Control returns to the file being debugged and execution of that - file continues. - """ - self._rebind_input(self.orig_stdin) - self._rebind_output(self.orig_stdout) - - self.cmdqueue.append('continue') # Continue execution + mpdb.pdbserver(addr, self) def pdbserver(addr, m): """ This method sets up a pdbserver debugger that allows debuggers @@ -426,6 +82,8 @@ tcp = 'tcp mydomainname.com:9876' serial = 'serial /dev/ttyC0' """ + from mremote import RemoteWrapperServer + m = RemoteWrapperServer(m) m.do_pdbserver(addr) while True: try: @@ -447,10 +105,13 @@ 'opts' an the OptionParser object. If opts.target is True, call do_target. If opts.pid is true, call do_attach. """ - mpdb.reset() if opts.target: + from mremote import RemoteWrapperClient + mpdb = RemoteWrapperClient(mpdb) mpdb.do_target(addr) elif opts.pid: + from mproc import ProcessWrapper + mpdb = ProcessWrapper(mpdb) pid = addr[:addr.find(' ')] addr = addr[addr.find(' ')+1:] mpdb.do_set('target ' + addr) @@ -534,6 +195,8 @@ # Clear up namespace del frame.f_globals['mpdb'] + from mremote import RemoteWrapperServer + m = RemoteWrapperServer(m) m.do_pdbserver(pdbserver_addr) m.set_trace(frame) Added: sandbox/trunk/pdb/mproc.py ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/mproc.py Sun Aug 13 18:44:35 2006 @@ -0,0 +1,57 @@ +"""This file contains all code to allow debugging of another process.""" +from mremote import RemoteWrapperClient + +class ProcessWrapper(RemoteWrapperClient): + + """This class wraps an MPdb instance to provide functionality for + debugging processes. + """ + def __init__(self, mpdb_object): + RemoteWrapperClient.__init__(self, mpdb_object) + self.debug_signal = None + + def do_detach(self, args): + """ Detach a process or file previously attached. + If a process, it is no longer traced, and it continues its + execution. If you were debugging a file, the file is closed and + Pdb no longer accesses it. + """ + raise KeyboardInterrupt + + def do_attach(self, addr): + """ Attach to a process or file outside of Pdb. +This command attaches to another target, of the same type as your last +"target" command. The command may take as argument a process id or a +device file. For a process id, you must have permission to send the +process a signal, and it must have the same effective uid as the debugger. +When using "attach" with a process id, the debugger finds the +program running in the process, looking first in the current working +directory, or (if not found there) using the source file search path +(see the "directory" command). You can also use the "file" command +to specify the program, and to load its symbol table. +""" + if not self.target_addr: + self.errmsg('No target address is set') + return + try: + pid = int(addr) + except ValueError: + # no PID + self.errmsg('You must specify a process ID to attach to.') + return + if not self.debug_signal: + from signal import SIGUSR1 + self.debug_signal = SIGUSR1 + try: + import os + os.kill(pid, self.debug_signal) + except OSError, err: + self.errmsg(err) + return + + # XXX this still needs removing + import time + time.sleep(1.0) + + self.do_target(self.target_addr) + Added: sandbox/trunk/pdb/mremote.py ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/mremote.py Sun Aug 13 18:44:35 2006 @@ -0,0 +1,258 @@ +"""Contains all code for remote/out-of-process connections.""" + +from mpdb import MPdb + +class RemoteWrapper(MPdb): + + """An abstract wrapper class that provides common functionality + for an object that wishes to use remote communication. Classes + should inherit from this class if they wish to build an object + capable of remote communication. + """ + def __init__(self, mpdb_object): + MPdb.__init__(self) + self.mpdb = mpdb_object + self.connection = None + + def _disconnect(self): + """ Disconnect a connection. """ + self.connection.disconnect() + self.connection = None + self.target = 'local' + if hasattr(self, 'local_prompt'): + import pydb + self.prompt = self.local_prompt + self.onecmd = lambda x: pydb.Pdb.onecmd(self, x) + + def do_restart(self, arg): + """ Extend pydb.do_restart to signal to any clients connected on + a debugger's connection that this debugger is going to be restarted. + All state is lost, and a new copy of the debugger is used. + """ + # We don't proceed with the restart until the action has been + # ACK'd by any connected clients + if self.connection != None: + self.msg('restart_now\n(MPdb)') + line = "" + while not 'ACK:restart_now' in line: + line = self.connection.readline() + self.do_rquit(None) + else: + self.msg("Re exec'ing\n\t%s" % self._sys_argv) + os.execvp(self._sys_argv[0], self._sys_argv) + + def do_rquit(self, arg): + """ Quit a remote debugging session. The program being executed + is aborted. + """ + if self.target == 'local': + self.errmsg('Connected locally; cannot remotely quit') + return + self._rebind_output(self.orig_stdout) + self._rebind_input(self.orig_stdin) + self._disconnect() + self.target = 'local' + import sys + sys.settrace(None) + self.do_quit(None) + +class RemoteWrapperServer(RemoteWrapper): + def __init__(self, mpdb_object): + RemoteWrapper.__init__(self, mpdb_object) + + def do_pdbserver(self, args): + """ Allow a debugger to connect to this session. +The first argument is the type or protocol that is used for this connection +(which can be the name of a class that is avaible either in the current +working directory or in Python's PYTHONPATH environtment variable). +The next argument is protocol specific arguments (e.g. hostname and +port number for a TCP connection, or a serial device for a serial line +connection). The next argument is the filename of the script that is +being debugged. The rest of the arguments are passed as arguments to the +script file and are optional. For more information on the arguments for a +particular protocol, type `help pdbserver ' followed by the protocol name. +The syntax for this command is, + +`pdbserver ConnectionClass comm scriptfile [args ...]' + +""" + try: + target, comm = args.split(' ') + except ValueError: + self.errmsg('Invalid arguments') + return + if 'remote' in self.target: + self.errmsg('Already connected remotely') + return + if self.connection: self.connection.disconnect() + from mconnection import MConnectionServerFactory, ConnectionFailed + self.connection = MConnectionServerFactory.create(target) + if self.connection is None: + self.msg('Unknown protocol') + return + try: + self.msg('Listening on: %s' % comm) + self.connection.connect(comm) + except ConnectionFailed, err: + self.errmsg("Failed to connect to %s: (%s)" % (comm, err)) + return + self.pdbserver_addr = comm + self.target = 'remote-pdbserver' + self._rebind_input(self.connection) + self._rebind_output(self.connection) + + def do_rdetach(self, arg): + """ The rdetach command is performed on the pdbserver, it cleans + things up when the client has detached from this process. + Control returns to the file being debugged and execution of that + file continues. + """ + self._rebind_input(self.orig_stdin) + self._rebind_output(self.orig_stdout) + + self.cmdqueue.append('continue') # Continue execution + +class RemoteWrapperClient(RemoteWrapper): + + """This is a wrapper class that provides remote capability to an + instance of mpdb.MPdb. + """ + def __init__(self, mpdb_object): + RemoteWrapper.__init__(self, mpdb_object) + self.setcmds.add('target-address', self.set_target_address) + self.showcmds.add('target-address', self.show_target_address) + self.infocmds.add('target', self.info_target) + self.target_addr = '' + + def remote_onecmd(self, line): + """ All commands in 'line' are sent across this object's connection + instance variable. + """ + if not line: + # Execute the previous command + line = self.lastcmd + # This is the simplest way I could think of to do this without + # breaking any of the inherited code from pydb/pdb. If we're a + # remote client, always call 'rquit' (remote quit) when connected to + # a pdbserver. This executes extra code to allow the client and server + # to quit cleanly. + if 'quit'.startswith(line): + line = 'rquit' + self.connection.write(line) + # Reset the onecmd method + self.onecmd = lambda x: pydb.Pdb.onecmd(self, x) + self.do_rquit(None) + return + if 'detach'.startswith(line): + self.connection.write('rdetach') + self.do_detach(None) + self.connection.write(line) + ret = self.connection.readline() + if ret == '': + self.errmsg('Connection closed unexpectedly') + self.onecmd = lambda x: pydb.Pdb.onecmd(self, x) + self.do_rquit(None) + # The output from the command that we've just sent to the server + # is returned along with the prompt of that server. So we keep reading + # until we find our prompt. + i = 1 + while self.local_prompt not in ret: + if i == 100: + # We're probably _never_ going to get that data and that + # connection is probably dead. + self.errmsg('Connection died unexpectedly') + self.onecmd = lambda x: pydb.Pdb.onecmd(self, x) + self.do_rquit(None) + else: + ret += self.connection.readline() + i += 1 + + # Some 'special' actions must be taken depending on the data returned + if 'restart_now' in ret: + self.connection.write('ACK:restart_now') + self.errmsg('Pdbserver restarting..') + # We've acknowledged a restart, which means that a new pdbserver + # process is started, so we have to connect all over again. + self._disconnect() + time.sleep(3.0) + if not self.do_target(self.target_addr): + # We cannot trust these variables below to be in a + # stable state. i.e. if the pdbserver doesn't come back up. + self.onecmd = lambda x: pydb.Pdb.onecmd(self, x) + return + self.msg_nocr(ret) + self.lastcmd = line + return + + def do_target(self, args): + """ Connect to a target machine or process. +The first argument is the type or protocol of the target machine +(which can be the name of a class that is available either in the current +working directory or in Python's PYTHONPATH environment variable). +Remaining arguments are interpreted by the target protocol. For more +information on the arguments for a particular protocol, type +`help target ' followed by the protocol name. + +List of target subcommands: + +target serial device-name -- Use a remote computer via a serial line +target tcp hostname:port -- Use a remote computer via a socket connection +""" + if not args: + args = self.target_addr + try: + target, addr = args.split(' ') + except ValueError: + self.errmsg('Invalid arguments') + return False + # If addr is ':PORT' fill in 'localhost' as the hostname + if addr[0] == ':': + addr = 'localhost'+addr[:] + if 'remote' in self.target: + self.errmsg('Already connected to a remote machine.') + return False + if self.connection: self.connection.disconnect() + from mconnection import MConnectionClientFactory, ConnectionFailed + self.connection = MConnectionClientFactory.create(target) + try: + self.connection.connect(addr) + except ConnectionFailed, err: + self.errmsg("Failed to connect to %s: (%s)" % (addr, err)) + return False + # This interpreter no longer interprets commands but sends + # them straight across this object's connection to a server. + # XXX: In the remote_onecmd method we use the local_prompt string + # to find where the end of the message from the server is. We + # really need a way to get the prompt from the server for checking + # in remote_onecmd, because it may be different to this client's. + self.local_prompt = self.prompt + self.prompt = "" + self.target_addr = target + " " + addr + line = self.connection.readline() + if line == '': + self.errmsg('Connection closed unexpectedly') + self.do_quit(None) + while '(MPdb)' not in line: + line = self.connection.readline() + self.msg_nocr(line) + self.onecmd = self.remote_onecmd + self.target = 'remote-client' + return True + + def set_target_address(self, args): + """Set the address of a target.""" + self.target_addr = "".join(["%s " % a for a in args[1:]]) + self.target_addr = self.target_addr.strip() + self.msg('target address set to %s' % self.target_addr) + + def show_target_address(self, arg): + """Show the address of the current target.""" + self.msg('target-address is %s.' % self.target_addr.__repr__()) + + def info_target(self, args): + """Display information about the current target.""" + self.msg('target is %s' % self.target) + + + + Added: sandbox/trunk/pdb/pdbserver.py ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/pdbserver.py Sun Aug 13 18:44:35 2006 @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +"""This file is analogous to the GNU debugger's "gdbserver" command.""" + +from mpdb import MPdb, Restart +from mremote import RemoteWrapperServer +import sys + +#1. Parse commands +#2. Create MPdb object capable of pdbservering +#3. Run script + +# Should this be merged into one 'mremote.py' file with target-stuff too? +def do_pdbserver(): + """ This method sets up a pdbserver debugger that allows debuggers + to connect to 'addr', which a protocol-specific address, i.e. + tcp = 'tcp mydomainname.com:9876' + serial = 'serial /dev/ttyC0' + """ + args = sys.argv[1:] # skip script filename + if len(args) < 2: + # Need address and file to debug + return + addr = args[0] + filename = args[1] + + # args to pass to the script + if args[2:]: + script_args = args[2:] + + server = MPdb() + server = RemoteWrapperServer(server) + server.do_pdbserver(addr) + while True: + try: + server.runscript(filename) + if server._user_requested_quit: break + except Restart: + sys.argv = list(server._program_sys_argv) + server.msg('Restarting') + +if __name__ == '__main__': + do_pdbserver() Modified: sandbox/trunk/pdb/test/support.py ============================================================================== --- sandbox/trunk/pdb/test/support.py (original) +++ sandbox/trunk/pdb/test/support.py Sun Aug 13 18:44:35 2006 @@ -17,19 +17,20 @@ def write(self, msg): pass -from mpdb import MPdb +from mremote import RemoteWrapperClient, RemoteWrapperServer -class MPdbTest(MPdb): +class MPdbTest(RemoteWrapperClient): """ This class provides a version of the MPdb class that is suitable for use in unit testing. All output is captured and stored in this object's 'lines' instance variable. """ - def __init__(self, cmds=[]): + def __init__(self, mpdb, cmds=[]): """ The optional argument 'cmds' is a list specifying commands that this instance should interpret in it's 'cmdloop' method. """ - MPdb.__init__(self) + RemoteWrapperClient.__init__(self, mpdb) self.lines = [] + self.curframe = None self.cmdqueue = cmds self.botframe = None @@ -37,19 +38,24 @@ self.lines.append(msg) -class Pdbserver(threading.Thread, MPdb): +class Pdbserver(threading.Thread, RemoteWrapperServer): """ This class provides a fully functional pdbserver that runs in a separate thread. The optional argument 'addr' specifies a protocol and an address to use for pdbserver. """ - def __init__(self, addr=None): - MPdb.__init__(self) + def __init__(self, mpdb, addr=None): + RemoteWrapperServer.__init__(self, mpdb) threading.Thread.__init__(self) self._sys_argv = ['python', '-c', '"pass"'] self.botframe = None + self.curframe = None + self.lines = [] if not addr: self.addr = 'tcp localhost:8000' + + def msg_nocr(self, msg, out=None): + self.lines.append(msg) def run(self): self.do_pdbserver(self.addr) @@ -65,7 +71,17 @@ def __init__(self, cmds=[]): threading.Thread.__init__(self) MPdbTest.__init__(self, cmds) + +from mproc import ProcessWrapper +class MPdbTestProc(ProcessWrapper): + def __init__(self, mpdb): + ProcessWrapper.__init__(self, mpdb) + self.lines = [] + self.curframe = None + + def msg_nocr(self, msg, out=None): + self.lines.append(msg) From python-checkins at python.org Sun Aug 13 19:42:59 2006 From: python-checkins at python.org (phillip.eby) Date: Sun, 13 Aug 2006 19:42:59 +0200 (CEST) Subject: [Python-checkins] r51243 - sandbox/trunk/setuptools/EasyInstall.txt Message-ID: <20060813174259.D5EA71E4002@bag.python.org> Author: phillip.eby Date: Sun Aug 13 19:42:59 2006 New Revision: 51243 Modified: sandbox/trunk/setuptools/EasyInstall.txt Log: Fix wrong Mac OS X installation paths. Modified: sandbox/trunk/setuptools/EasyInstall.txt ============================================================================== --- sandbox/trunk/setuptools/EasyInstall.txt (original) +++ sandbox/trunk/setuptools/EasyInstall.txt Sun Aug 13 19:42:59 2006 @@ -1003,7 +1003,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you are on a Mac OS X machine, you should just use the -``~/Library/Python2.x/site-packages`` directory as your custom installation +``~/Library/Python/2.x/site-packages`` directory as your custom installation location, because it is already configured to process ``.pth`` files, and EasyInstall already knows this. @@ -1011,7 +1011,7 @@ file with the following contents (or add this to the existing contents):: [install] - install_lib = ~/Library/Python$py_version_short/site-packages + install_lib = ~/Library/Python/$py_version_short/site-packages install_scripts = ~/bin This will tell the distutils and EasyInstall to always install packages in From python-checkins at python.org Sun Aug 13 19:44:02 2006 From: python-checkins at python.org (phillip.eby) Date: Sun, 13 Aug 2006 19:44:02 +0200 (CEST) Subject: [Python-checkins] r51244 - sandbox/branches/setuptools-0.6/EasyInstall.txt Message-ID: <20060813174402.CDC251E4002@bag.python.org> Author: phillip.eby Date: Sun Aug 13 19:44:02 2006 New Revision: 51244 Modified: sandbox/branches/setuptools-0.6/EasyInstall.txt Log: Backport OS X doc fix from trunk. Modified: sandbox/branches/setuptools-0.6/EasyInstall.txt ============================================================================== --- sandbox/branches/setuptools-0.6/EasyInstall.txt (original) +++ sandbox/branches/setuptools-0.6/EasyInstall.txt Sun Aug 13 19:44:02 2006 @@ -999,7 +999,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you are on a Mac OS X machine, you should just use the -``~/Library/Python2.x/site-packages`` directory as your custom installation +``~/Library/Python/2.x/site-packages`` directory as your custom installation location, because it is already configured to process ``.pth`` files, and EasyInstall already knows this. @@ -1007,7 +1007,7 @@ file with the following contents (or add this to the existing contents):: [install] - install_lib = ~/Library/Python$py_version_short/site-packages + install_lib = ~/Library/Python/$py_version_short/site-packages install_scripts = ~/bin This will tell the distutils and EasyInstall to always install packages in From python-checkins at python.org Sun Aug 13 20:10:10 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 20:10:10 +0200 (CEST) Subject: [Python-checkins] r51245 - python/trunk/Python/ceval.c Message-ID: <20060813181010.AA9EF1E4002@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 20:10:10 2006 New Revision: 51245 Modified: python/trunk/Python/ceval.c Log: Move/copy assert for tstate != NULL before first use. Verify that PyEval_Get{Globals,Locals} returned valid pointers. Klocwork 231-232 Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Sun Aug 13 20:10:10 2006 @@ -2623,6 +2623,7 @@ return NULL; } + assert(tstate != NULL); assert(globals != NULL); f = PyFrame_New(tstate, co, globals, locals); if (f == NULL) @@ -3636,6 +3637,7 @@ 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; @@ -3648,7 +3650,6 @@ fastlocals[i] = *stack++; } retval = PyEval_EvalFrameEx(f,0); - assert(tstate != NULL); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; @@ -4130,6 +4131,11 @@ locals = PyEval_GetLocals(); plain = 1; } + if (!globals || !locals) { + PyErr_SetString(PyExc_SystemError, + "globals and locals cannot be NULL"); + return -1; + } } else if (locals == Py_None) locals = globals; From python-checkins at python.org Sun Aug 13 20:10:29 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 20:10:29 +0200 (CEST) Subject: [Python-checkins] r51246 - python/trunk/Objects/classobject.c Message-ID: <20060813181029.2D7D81E4002@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 20:10:28 2006 New Revision: 51246 Modified: python/trunk/Objects/classobject.c Log: Handle a whole lot of failures from PyString_FromInternedString(). Should fix most of Klocwork 234-272. Modified: python/trunk/Objects/classobject.c ============================================================================== --- python/trunk/Objects/classobject.c (original) +++ python/trunk/Objects/classobject.c Sun Aug 13 20:10:28 2006 @@ -103,8 +103,14 @@ op->cl_name = name; if (getattrstr == NULL) { getattrstr = PyString_InternFromString("__getattr__"); + if (getattrstr == NULL) + return NULL; setattrstr = PyString_InternFromString("__setattr__"); + if (setattrstr == NULL) + return NULL; delattrstr = PyString_InternFromString("__delattr__"); + if (delattrstr == NULL) + return NULL; } op->cl_getattr = class_lookup(op, getattrstr, &dummy); op->cl_setattr = class_lookup(op, setattrstr, &dummy); @@ -522,11 +528,14 @@ PyObject *init; static PyObject *initstr; + if (initstr == NULL) { + initstr = PyString_InternFromString("__init__"); + if (initstr == NULL) + return NULL; + } inst = (PyInstanceObject *) PyInstance_NewRaw(klass, NULL); if (inst == NULL) return NULL; - if (initstr == NULL) - initstr = PyString_InternFromString("__init__"); init = instance_getattr2(inst, initstr); if (init == NULL) { if (PyErr_Occurred()) { @@ -612,8 +621,11 @@ /* Save the current exception, if any. */ PyErr_Fetch(&error_type, &error_value, &error_traceback); /* Execute __del__ method, if any. */ - if (delstr == NULL) + if (delstr == NULL) { delstr = PyString_InternFromString("__del__"); + if (delstr == NULL) + return NULL; + } if ((del = instance_getattr2(inst, delstr)) != NULL) { PyObject *res = PyEval_CallObject(del, (PyObject *)NULL); if (res == NULL) @@ -840,8 +852,11 @@ PyObject *res; static PyObject *reprstr; - if (reprstr == NULL) + if (reprstr == NULL) { reprstr = PyString_InternFromString("__repr__"); + if (reprstr == NULL) + return NULL; + } func = instance_getattr(inst, reprstr); if (func == NULL) { PyObject *classname, *mod; @@ -876,8 +891,11 @@ PyObject *res; static PyObject *strstr; - if (strstr == NULL) + if (strstr == NULL) { strstr = PyString_InternFromString("__str__"); + if (strstr == NULL) + return NULL; + } func = instance_getattr(inst, strstr); if (func == NULL) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) @@ -898,8 +916,11 @@ long outcome; static PyObject *hashstr, *eqstr, *cmpstr; - if (hashstr == NULL) + if (hashstr == NULL) { hashstr = PyString_InternFromString("__hash__"); + if (hashstr == NULL) + return -1; + } func = instance_getattr(inst, hashstr); if (func == NULL) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) @@ -908,15 +929,21 @@ /* If there is no __eq__ and no __cmp__ method, we hash on the address. If an __eq__ or __cmp__ method exists, there must be a __hash__. */ - if (eqstr == NULL) + if (eqstr == NULL) { eqstr = PyString_InternFromString("__eq__"); + if (eqstr == NULL) + return -1; + } func = instance_getattr(inst, eqstr); if (func == NULL) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) return -1; PyErr_Clear(); - if (cmpstr == NULL) + if (cmpstr == NULL) { cmpstr = PyString_InternFromString("__cmp__"); + if (cmpstr == NULL) + return -1; + } func = instance_getattr(inst, cmpstr); if (func == NULL) { if (!PyErr_ExceptionMatches( @@ -964,8 +991,11 @@ PyObject *res; Py_ssize_t outcome; - if (lenstr == NULL) + if (lenstr == NULL) { lenstr = PyString_InternFromString("__len__"); + if (lenstr == NULL) + return -1; + } func = instance_getattr(inst, lenstr); if (func == NULL) return -1; @@ -1010,8 +1040,11 @@ PyObject *arg; PyObject *res; - if (getitemstr == NULL) + if (getitemstr == NULL) { getitemstr = PyString_InternFromString("__getitem__"); + if (getitemstr == NULL) + return NULL; + } func = instance_getattr(inst, getitemstr); if (func == NULL) return NULL; @@ -1034,13 +1067,19 @@ PyObject *res; if (value == NULL) { - if (delitemstr == NULL) + if (delitemstr == NULL) { delitemstr = PyString_InternFromString("__delitem__"); + if (delitemstr == NULL) + return -1; + } func = instance_getattr(inst, delitemstr); } else { - if (setitemstr == NULL) + if (setitemstr == NULL) { setitemstr = PyString_InternFromString("__setitem__"); + if (setitemstr == NULL) + return -1; + } func = instance_getattr(inst, setitemstr); } if (func == NULL) @@ -1073,8 +1112,11 @@ { PyObject *func, *res; - if (getitemstr == NULL) + if (getitemstr == NULL) { getitemstr = PyString_InternFromString("__getitem__"); + if (getitemstr == NULL) + return NULL; + } func = instance_getattr(inst, getitemstr); if (func == NULL) return NULL; @@ -1089,8 +1131,11 @@ PyObject *func, *arg, *res; static PyObject *getslicestr; - if (getslicestr == NULL) + if (getslicestr == NULL) { getslicestr = PyString_InternFromString("__getslice__"); + if (getslicestr == NULL) + return NULL; + } func = instance_getattr(inst, getslicestr); if (func == NULL) { @@ -1098,8 +1143,11 @@ return NULL; PyErr_Clear(); - if (getitemstr == NULL) + if (getitemstr == NULL) { getitemstr = PyString_InternFromString("__getitem__"); + if (getitemstr == NULL) + return NULL; + } func = instance_getattr(inst, getitemstr); if (func == NULL) return NULL; @@ -1123,13 +1171,19 @@ PyObject *func, *arg, *res; if (item == NULL) { - if (delitemstr == NULL) + if (delitemstr == NULL) { delitemstr = PyString_InternFromString("__delitem__"); + if (delitemstr == NULL) + return -1; + } func = instance_getattr(inst, delitemstr); } else { - if (setitemstr == NULL) + if (setitemstr == NULL) { setitemstr = PyString_InternFromString("__setitem__"); + if (setitemstr == NULL) + return -1; + } func = instance_getattr(inst, setitemstr); } if (func == NULL) @@ -1158,17 +1212,23 @@ static PyObject *setslicestr, *delslicestr; if (value == NULL) { - if (delslicestr == NULL) + if (delslicestr == NULL) { delslicestr = PyString_InternFromString("__delslice__"); + if (delslicestr == NULL) + return -1; + } func = instance_getattr(inst, delslicestr); if (func == NULL) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) return -1; PyErr_Clear(); - if (delitemstr == NULL) + if (delitemstr == NULL) { delitemstr = PyString_InternFromString("__delitem__"); + if (delitemstr == NULL) + return -1; + } func = instance_getattr(inst, delitemstr); if (func == NULL) return -1; @@ -1179,17 +1239,23 @@ arg = Py_BuildValue("(nn)", i, j); } else { - if (setslicestr == NULL) + if (setslicestr == NULL) { setslicestr = PyString_InternFromString("__setslice__"); + if (setslicestr == NULL) + return -1; + } func = instance_getattr(inst, setslicestr); if (func == NULL) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) return -1; PyErr_Clear(); - if (setitemstr == NULL) + if (setitemstr == NULL) { setitemstr = PyString_InternFromString("__setitem__"); + if (setitemstr == NULL) + return -1; + } func = instance_getattr(inst, setitemstr); if (func == NULL) return -1; @@ -1462,7 +1528,8 @@ #define UNARY(funcname, methodname) \ static PyObject *funcname(PyInstanceObject *self) { \ static PyObject *o; \ - if (o == NULL) o = PyString_InternFromString(methodname); \ + if (o == NULL) { o = PyString_InternFromString(methodname); \ + if (o == NULL) return NULL; } \ return generic_unary_op(self, o); \ } @@ -1634,14 +1701,20 @@ long outcome; static PyObject *nonzerostr; - if (nonzerostr == NULL) + if (nonzerostr == NULL) { nonzerostr = PyString_InternFromString("__nonzero__"); + if (nonzerostr == NULL) + return -1; + } if ((func = instance_getattr(self, nonzerostr)) == NULL) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) return -1; PyErr_Clear(); - if (lenstr == NULL) + if (lenstr == NULL) { lenstr = PyString_InternFromString("__len__"); + if (lenstr == NULL) + return -1; + } if ((func = instance_getattr(self, lenstr)) == NULL) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) return -1; @@ -1923,8 +1996,11 @@ { PyObject *func; - if (nextstr == NULL) + if (nextstr == NULL) { nextstr = PyString_InternFromString("next"); + if (nextstr == NULL) + return NULL; + } if ((func = instance_getattr(self, nextstr)) != NULL) { PyObject *res = PyEval_CallObject(func, (PyObject *)NULL); From python-checkins at python.org Sun Aug 13 20:10:47 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 20:10:47 +0200 (CEST) Subject: [Python-checkins] r51247 - python/trunk/Python/import.c Message-ID: <20060813181047.96A561E4002@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 20:10:47 2006 New Revision: 51247 Modified: python/trunk/Python/import.c Log: cpathname could be NULL if it was longer than MAXPATHLEN. Don't try to write the .pyc to NULL. Check results of PyList_GetItem() and PyModule_GetDict() are not NULL. Klocwork 282, 283, 285 Modified: python/trunk/Python/import.c ============================================================================== --- python/trunk/Python/import.c (original) +++ python/trunk/Python/import.c Sun Aug 13 20:10:47 2006 @@ -933,7 +933,8 @@ if (Py_VerboseFlag) PySys_WriteStderr("import %s # from %s\n", name, pathname); - write_compiled_module(co, cpathname, mtime); + if (cpathname) + write_compiled_module(co, cpathname, mtime); } m = PyImport_ExecCodeModuleEx(name, (PyObject *)co, pathname); Py_DECREF(co); @@ -1232,6 +1233,8 @@ for (i = 0; i < npath; i++) { PyObject *copy = NULL; PyObject *v = PyList_GetItem(path, i); + if (!v) + return NULL; #ifdef Py_USING_UNICODE if (PyUnicode_Check(v)) { copy = PyUnicode_Encode(PyUnicode_AS_UNICODE(v), @@ -3044,6 +3047,8 @@ if (m == NULL) goto failure; d = PyModule_GetDict(m); + if (d == NULL) + goto failure; if (setint(d, "SEARCH_ERROR", SEARCH_ERROR) < 0) goto failure; if (setint(d, "PY_SOURCE", PY_SOURCE) < 0) goto failure; From python-checkins at python.org Sun Aug 13 20:11:09 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 20:11:09 +0200 (CEST) Subject: [Python-checkins] r51248 - in python/trunk: Lib/test/test_format.py Misc/NEWS Objects/stringobject.c Message-ID: <20060813181109.4FF711E4002@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 20:11:08 2006 New Revision: 51248 Modified: python/trunk/Lib/test/test_format.py python/trunk/Misc/NEWS python/trunk/Objects/stringobject.c Log: Fix segfault when doing string formatting on subclasses of long if __oct__, __hex__ don't return a string. Klocwork 308 Modified: python/trunk/Lib/test/test_format.py ============================================================================== --- python/trunk/Lib/test/test_format.py (original) +++ python/trunk/Lib/test/test_format.py Sun Aug 13 20:11:08 2006 @@ -230,6 +230,14 @@ test_exc(u'no format', u'1', TypeError, "not all arguments converted during string formatting") +class Foobar(long): + def __oct__(self): + # Returning a non-string should not blow up. + return self + 1 + +test_exc('%o', Foobar(), TypeError, + "expected string or Unicode object, long found") + if sys.maxint == 2**31-1: # crashes 2.2.1 and earlier: try: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Aug 13 20:11:08 2006 @@ -12,6 +12,8 @@ Core and builtins ----------------- +- Fix segfault when doing string formatting on subclasses of long. + - Fix bug related to __len__ functions using values > 2**32 on 64-bit machines with new-style classes. Modified: python/trunk/Objects/stringobject.c ============================================================================== --- python/trunk/Objects/stringobject.c (original) +++ python/trunk/Objects/stringobject.c Sun Aug 13 20:11:08 2006 @@ -4225,12 +4225,15 @@ if (!result) return NULL; + buf = PyString_AsString(result); + if (!buf) + return NULL; + /* To modify the string in-place, there can only be one reference. */ if (result->ob_refcnt != 1) { PyErr_BadInternalCall(); return NULL; } - buf = PyString_AsString(result); llen = PyString_Size(result); if (llen > PY_SSIZE_T_MAX) { PyErr_SetString(PyExc_ValueError, "string too large in _PyString_FormatLong"); From python-checkins at python.org Sun Aug 13 20:11:24 2006 From: python-checkins at python.org (matt.fleming) Date: Sun, 13 Aug 2006 20:11:24 +0200 (CEST) Subject: [Python-checkins] r51249 - sandbox/trunk/pdb/test/support.py sandbox/trunk/pdb/test/test_mpdb.py Message-ID: <20060813181124.9133D1E4002@bag.python.org> Author: matt.fleming Date: Sun Aug 13 20:11:23 2006 New Revision: 51249 Modified: sandbox/trunk/pdb/test/support.py sandbox/trunk/pdb/test/test_mpdb.py Log: Fixed one test file. Modified: sandbox/trunk/pdb/test/support.py ============================================================================== --- sandbox/trunk/pdb/test/support.py (original) +++ sandbox/trunk/pdb/test/support.py Sun Aug 13 20:11:23 2006 @@ -52,7 +52,8 @@ self.lines = [] if not addr: - self.addr = 'tcp localhost:8000' + addr = 'tcp localhost:8000' + self.addr = addr def msg_nocr(self, msg, out=None): self.lines.append(msg) Modified: sandbox/trunk/pdb/test/test_mpdb.py ============================================================================== --- sandbox/trunk/pdb/test/test_mpdb.py (original) +++ sandbox/trunk/pdb/test/test_mpdb.py Sun Aug 13 20:11:23 2006 @@ -19,7 +19,7 @@ from mpdb import MPdb, pdbserver, target from mconnection import (MConnectionClientTCP, MConnectionServerTCP, ConnectionFailed) -from support import MPdbTest, Pdbserver +from support import MPdbTest, Pdbserver, MPdbTestThread TESTFN = 'tester' # This provides us with a fine-grain way of connecting to a server @@ -51,28 +51,37 @@ # and vice versa. def testPdbserver(self): - client = MPdbTest() - thread.start_new_thread(connect_to_target, (client,)) + client = MPdbTest(MPdb()) + client.do_target('tcp localhost:8000') - self.server1 = MPdbTest() - self.server1.do_pdbserver('tcp '+__addr__) + self.server1 = Pdbserver(MPdb()) + self.server1.start() - self.server1.connection.disconnect() - - self.server2 = MPdbTest() - self.server2.do_pdbserver('unknown_protocol unknownhost') + while self.server1.connection is None: + time.sleep(0.1) + #self.server1.connection.disconnect() + self.server1.onecmd('quit\n') + + self.server2 = Pdbserver(MPdb(), 'unknown_protocol unknownhost') + self.server2.start() + time.sleep(1.0) line = self.server2.lines[0] self.assertEquals('*** Unknown protocol\n', line) + client.onecmd('quit\n') + self.server2.onecmd('quit\n') + def testTarget(self): - server = MConnectionServerTCP() - thread.start_new_thread(server.connect, (__addr__,True)) + server = Pdbserver(MPdb()) + server.start() + while server.connection is None: + time.sleep(0.1) - self.client1 = MPdbTest() - connect_to_target(self.client1) + self.client1 = MPdbTest(MPdb()) - self.client2 = MPdbTest() + self.client2 = MPdbTest(MPdb()) self.client2.do_target('dlkdlksldkslkd') + line = self.client2.lines[0] self.assertEquals('*** Invalid arguments\n', line) @@ -92,10 +101,10 @@ self.assertEquals(errmsg, line) - server.disconnect() + server.connection.disconnect() for i in range(MAXTRIES): - if server._sock != None: pass + if server.connection != None: pass else: break def testRebindOutput(self): @@ -125,20 +134,21 @@ self.assertEquals(line, 'help', 'Could not rebind input.') def testRestart(self): - server = Pdbserver() + server = Pdbserver(MPdb()) server.start() - self.client1 = MPdbTest() + self.client1 = MPdbTest(MPdb()) self.client1.do_target('tcp localhost:8000') while 'Failed' in self.client1.lines[0]: + time.sleep(1.0) self.client1.lines = [] self.client1.do_target('tcp localhost:8000') - server.target = 'remote' - self.client1.onecmd('restart') + # The server will _NOT_ come back up so don't try to reconnect + server.onecmd('restart\n') self.client1.connection.write('rquit\n') - server.disconnect() + server.connection.disconnect() for i in range(MAXTRIES): if server.connection != None: pass @@ -150,7 +160,7 @@ output to ensure that documentation constantly stays the same. """ def setUp(self): - self.m = MPdbTest() + self.m = MPdbTest(MPdb()) def tearDown(self): del self.m From python-checkins at python.org Sun Aug 13 20:11:28 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 20:11:28 +0200 (CEST) Subject: [Python-checkins] r51250 - python/trunk/Modules/mmapmodule.c Message-ID: <20060813181128.3EBA41E400A@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 20:11:27 2006 New Revision: 51250 Modified: python/trunk/Modules/mmapmodule.c Log: Check return result of PyModule_GetDict(). Fix a bunch of refleaks in the init of the module. This would only be found when running python -v. Modified: python/trunk/Modules/mmapmodule.c ============================================================================== --- python/trunk/Modules/mmapmodule.c (original) +++ python/trunk/Modules/mmapmodule.c Sun Aug 13 20:11:27 2006 @@ -1126,6 +1126,15 @@ {NULL, NULL} /* Sentinel */ }; +static void +setint(PyObject *d, const char *name, long value) +{ + PyObject *o = PyInt_FromLong(value); + if (o) + if (PyDict_SetItemString(d, name, o) == 0) + Py_DECREF(o); +} + PyMODINIT_FUNC initmmap(void) { @@ -1138,47 +1147,40 @@ if (module == NULL) return; dict = PyModule_GetDict(module); + if (!dict) + return; mmap_module_error = PyExc_EnvironmentError; - Py_INCREF(mmap_module_error); PyDict_SetItemString(dict, "error", mmap_module_error); #ifdef PROT_EXEC - PyDict_SetItemString(dict, "PROT_EXEC", PyInt_FromLong(PROT_EXEC) ); + setint(dict, "PROT_EXEC", PROT_EXEC); #endif #ifdef PROT_READ - PyDict_SetItemString(dict, "PROT_READ", PyInt_FromLong(PROT_READ) ); + setint(dict, "PROT_READ", PROT_READ); #endif #ifdef PROT_WRITE - PyDict_SetItemString(dict, "PROT_WRITE", PyInt_FromLong(PROT_WRITE) ); + setint(dict, "PROT_WRITE", PROT_WRITE); #endif #ifdef MAP_SHARED - PyDict_SetItemString(dict, "MAP_SHARED", PyInt_FromLong(MAP_SHARED) ); + setint(dict, "MAP_SHARED", MAP_SHARED); #endif #ifdef MAP_PRIVATE - PyDict_SetItemString(dict, "MAP_PRIVATE", - PyInt_FromLong(MAP_PRIVATE) ); + setint(dict, "MAP_PRIVATE", MAP_PRIVATE); #endif #ifdef MAP_DENYWRITE - PyDict_SetItemString(dict, "MAP_DENYWRITE", - PyInt_FromLong(MAP_DENYWRITE) ); + setint(dict, "MAP_DENYWRITE", MAP_DENYWRITE); #endif #ifdef MAP_EXECUTABLE - PyDict_SetItemString(dict, "MAP_EXECUTABLE", - PyInt_FromLong(MAP_EXECUTABLE) ); + setint(dict, "MAP_EXECUTABLE", MAP_EXECUTABLE); #endif #ifdef MAP_ANONYMOUS - PyDict_SetItemString(dict, "MAP_ANON", PyInt_FromLong(MAP_ANONYMOUS) ); - PyDict_SetItemString(dict, "MAP_ANONYMOUS", - PyInt_FromLong(MAP_ANONYMOUS) ); + setint(dict, "MAP_ANON", MAP_ANONYMOUS); + setint(dict, "MAP_ANONYMOUS", MAP_ANONYMOUS); #endif - PyDict_SetItemString(dict, "PAGESIZE", - PyInt_FromLong((long)my_getpagesize())); - - PyDict_SetItemString(dict, "ACCESS_READ", - PyInt_FromLong(ACCESS_READ)); - PyDict_SetItemString(dict, "ACCESS_WRITE", - PyInt_FromLong(ACCESS_WRITE)); - PyDict_SetItemString(dict, "ACCESS_COPY", - PyInt_FromLong(ACCESS_COPY)); + setint(dict, "PAGESIZE", (long)my_getpagesize()); + + setint(dict, "ACCESS_READ", ACCESS_READ); + setint(dict, "ACCESS_WRITE", ACCESS_WRITE); + setint(dict, "ACCESS_COPY", ACCESS_COPY); } From python-checkins at python.org Sun Aug 13 20:11:44 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 20:11:44 +0200 (CEST) Subject: [Python-checkins] r51251 - python/trunk/Modules/_bsddb.c Message-ID: <20060813181144.7F9B51E4003@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 20:11:43 2006 New Revision: 51251 Modified: python/trunk/Modules/_bsddb.c Log: Handle malloc and fopen failures more gracefully. Klocwork 180-181 Modified: python/trunk/Modules/_bsddb.c ============================================================================== --- python/trunk/Modules/_bsddb.c (original) +++ python/trunk/Modules/_bsddb.c Sun Aug 13 20:11:43 2006 @@ -1797,7 +1797,6 @@ DBC** cursors; DBC* dbc; - if (!PyArg_ParseTuple(args,"O|i:join", &cursorsObj, &flags)) return NULL; @@ -1811,6 +1810,11 @@ length = PyObject_Length(cursorsObj); cursors = malloc((length+1) * sizeof(DBC*)); + if (!cursors) { + PyErr_NoMemory(); + return NULL; + } + cursors[length] = NULL; for (x=0; xdb->verify(self->db, fileName, dbName, outFile, flags); MYDB_END_ALLOW_THREADS; - if (outFileName) + if (outFile) fclose(outFile); /* DB.verify acts as a DB handle destructor (like close); this was From python-checkins at python.org Sun Aug 13 20:12:03 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 20:12:03 +0200 (CEST) Subject: [Python-checkins] r51252 - python/trunk/Modules/zipimport.c Message-ID: <20060813181203.AE7E61E4002@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 20:12:03 2006 New Revision: 51252 Modified: python/trunk/Modules/zipimport.c Log: It's very unlikely, though possible that source is not a string. Verify that PyString_AsString() returns a valid pointer. (The problem can arise when zlib.decompress doesn't return a string.) Klocwork 346 Modified: python/trunk/Modules/zipimport.c ============================================================================== --- python/trunk/Modules/zipimport.c (original) +++ python/trunk/Modules/zipimport.c Sun Aug 13 20:12:03 2006 @@ -950,6 +950,9 @@ char *buf, *q, *p = PyString_AsString(source); PyObject *fixed_source; + if (!p) + return NULL; + /* one char extra for trailing \n and one for terminating \0 */ buf = (char *)PyMem_Malloc(PyString_Size(source) + 2); if (buf == NULL) { From python-checkins at python.org Sun Aug 13 20:12:27 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 20:12:27 +0200 (CEST) Subject: [Python-checkins] r51253 - python/trunk/Modules/expat/xmlparse.c Message-ID: <20060813181227.5FD261E4002@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 20:12:26 2006 New Revision: 51253 Modified: python/trunk/Modules/expat/xmlparse.c Log: Handle failures from lookup. Klocwork 341-342 Modified: python/trunk/Modules/expat/xmlparse.c ============================================================================== --- python/trunk/Modules/expat/xmlparse.c (original) +++ python/trunk/Modules/expat/xmlparse.c Sun Aug 13 20:12:26 2006 @@ -2795,6 +2795,8 @@ unsigned long uriHash = 0; ((XML_Char *)s)[-1] = 0; /* clear flag */ id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, s, 0); + if (!id) + return XML_ERROR_NO_MEMORY; b = id->prefix->binding; if (!b) return XML_ERROR_UNBOUND_PREFIX; @@ -5340,6 +5342,8 @@ return NULL; id->prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&dtd->pool), sizeof(PREFIX)); + if (!id->prefix) + return NULL; if (id->prefix->name == poolStart(&dtd->pool)) poolFinish(&dtd->pool); else From python-checkins at python.org Sun Aug 13 20:12:45 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 20:12:45 +0200 (CEST) Subject: [Python-checkins] r51254 - python/trunk/Modules/_cursesmodule.c Message-ID: <20060813181245.C37C31E4002@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 20:12:45 2006 New Revision: 51254 Modified: python/trunk/Modules/_cursesmodule.c Log: Handle failure from PyModule_GetDict() (Klocwork 208). Fix a bunch of refleaks in the init of the module. This would only be found when running python -v. Modified: python/trunk/Modules/_cursesmodule.c ============================================================================== --- python/trunk/Modules/_cursesmodule.c (original) +++ python/trunk/Modules/_cursesmodule.c Sun Aug 13 20:12:45 2006 @@ -1784,7 +1784,6 @@ PyCurses_InitScr(PyObject *self) { WINDOW *win; - PyObject *nlines, *cols; if (initialised == TRUE) { wrefresh(stdscr); @@ -1803,7 +1802,12 @@ /* This was moved from initcurses() because it core dumped on SGI, where they're not defined until you've called initscr() */ #define SetDictInt(string,ch) \ - PyDict_SetItemString(ModDict,string,PyInt_FromLong((long) (ch))); + do { \ + PyObject *o = PyInt_FromLong((long) (ch)); \ + if (o && PyDict_SetItemString(ModDict, string, o) == 0) { \ + Py_DECREF(o); \ + } \ + } while (0) /* Here are some graphic symbols you can use */ SetDictInt("ACS_ULCORNER", (ACS_ULCORNER)); @@ -1872,12 +1876,8 @@ SetDictInt("ACS_STERLING", (ACS_STERLING)); #endif - nlines = PyInt_FromLong((long) LINES); - PyDict_SetItemString(ModDict, "LINES", nlines); - Py_DECREF(nlines); - cols = PyInt_FromLong((long) COLS); - PyDict_SetItemString(ModDict, "COLS", cols); - Py_DECREF(cols); + SetDictInt("LINES", LINES); + SetDictInt("COLS", COLS); return (PyObject *)PyCursesWindow_New(win); } @@ -2554,6 +2554,8 @@ /* Add some symbolic constants to the module */ d = PyModule_GetDict(m); + if (d == NULL) + return; ModDict = d; /* For PyCurses_InitScr to use later */ /* Add a CObject for the C API */ @@ -2667,6 +2669,10 @@ if (strncmp(key_n,"KEY_F(",6)==0) { char *p1, *p2; key_n2 = malloc(strlen(key_n)+1); + if (!key_n2) { + PyErr_NoMemory(); + break; + } p1 = key_n; p2 = key_n2; while (*p1) { @@ -2679,7 +2685,7 @@ *p2 = (char)0; } else key_n2 = key_n; - PyDict_SetItemString(d,key_n2,PyInt_FromLong((long) key)); + SetDictInt(key_n2,key); if (key_n2 != key_n) free(key_n2); } From python-checkins at python.org Sun Aug 13 20:13:03 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 20:13:03 +0200 (CEST) Subject: [Python-checkins] r51255 - python/trunk/Modules/collectionsmodule.c Message-ID: <20060813181303.4D7EA1E4002@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 20:13:02 2006 New Revision: 51255 Modified: python/trunk/Modules/collectionsmodule.c Log: Really address the issue of where to place the assert for leftblock. (Followup of Klocwork 274) Modified: python/trunk/Modules/collectionsmodule.c ============================================================================== --- python/trunk/Modules/collectionsmodule.c (original) +++ python/trunk/Modules/collectionsmodule.c Sun Aug 13 20:13:02 2006 @@ -211,6 +211,7 @@ PyErr_SetString(PyExc_IndexError, "pop from an empty deque"); return NULL; } + assert(deque->leftblock != NULL); item = deque->leftblock->data[deque->leftindex]; deque->leftindex++; deque->len--; @@ -224,7 +225,6 @@ deque->leftindex = CENTER + 1; deque->rightindex = CENTER; } else { - assert(deque->leftblock != NULL); assert(deque->leftblock != deque->rightblock); prevblock = deque->leftblock->rightlink; PyMem_Free(deque->leftblock); From python-checkins at python.org Sun Aug 13 20:13:36 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 20:13:36 +0200 (CEST) Subject: [Python-checkins] r51256 - python/trunk/Parser/grammar.c Message-ID: <20060813181336.9FB3A1E4002@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 20:13:36 2006 New Revision: 51256 Modified: python/trunk/Parser/grammar.c Log: Handle malloc failure. Klocwork 281 Modified: python/trunk/Parser/grammar.c ============================================================================== --- python/trunk/Parser/grammar.c (original) +++ python/trunk/Parser/grammar.c Sun Aug 13 20:13:36 2006 @@ -199,6 +199,10 @@ else name_len = strlen(src); dest = (char *)malloc(name_len + 1); + if (!dest) { + printf("Can't alloc dest '%s'\n", src); + return; + } strncpy(dest, src, name_len); dest[name_len] = '\0'; free(lb->lb_str); From python-checkins at python.org Sun Aug 13 20:36:37 2006 From: python-checkins at python.org (matt.fleming) Date: Sun, 13 Aug 2006 20:36:37 +0200 (CEST) Subject: [Python-checkins] r51257 - in sandbox/trunk/pdb: mconnection.py mproc.py mremote.py test/test_process.py Message-ID: <20060813183637.E93611E4002@bag.python.org> Author: matt.fleming Date: Sun Aug 13 20:36:37 2006 New Revision: 51257 Modified: sandbox/trunk/pdb/mconnection.py sandbox/trunk/pdb/mproc.py sandbox/trunk/pdb/mremote.py sandbox/trunk/pdb/test/test_process.py Log: More unit test changes. Modified: sandbox/trunk/pdb/mconnection.py ============================================================================== --- sandbox/trunk/pdb/mconnection.py (original) +++ sandbox/trunk/pdb/mconnection.py Sun Aug 13 20:36:37 2006 @@ -39,7 +39,10 @@ def import_hook(target): cls = target[target.rfind('.')+1:] target = target[:target.rfind('.')] - pkg = __import__(target, globals(), locals(), []) + try: + pkg = __import__(target, globals(), locals(), []) + except ImportError: + return None return getattr(pkg, cls) class MConnectionClientFactory: Modified: sandbox/trunk/pdb/mproc.py ============================================================================== --- sandbox/trunk/pdb/mproc.py (original) +++ sandbox/trunk/pdb/mproc.py Sun Aug 13 20:36:37 2006 @@ -8,6 +8,7 @@ """ def __init__(self, mpdb_object): RemoteWrapperClient.__init__(self, mpdb_object) + self.cmdqueue = self.mpdb.cmdqueue self.debug_signal = None def do_detach(self, args): Modified: sandbox/trunk/pdb/mremote.py ============================================================================== --- sandbox/trunk/pdb/mremote.py (original) +++ sandbox/trunk/pdb/mremote.py Sun Aug 13 20:36:37 2006 @@ -39,6 +39,7 @@ self.do_rquit(None) else: self.msg("Re exec'ing\n\t%s" % self._sys_argv) + import os os.execvp(self._sys_argv[0], self._sys_argv) def do_rquit(self, arg): @@ -88,7 +89,7 @@ from mconnection import MConnectionServerFactory, ConnectionFailed self.connection = MConnectionServerFactory.create(target) if self.connection is None: - self.msg('Unknown protocol') + self.errmsg('Unknown protocol') return try: self.msg('Listening on: %s' % comm) Modified: sandbox/trunk/pdb/test/test_process.py ============================================================================== --- sandbox/trunk/pdb/test/test_process.py (original) +++ sandbox/trunk/pdb/test/test_process.py Sun Aug 13 20:36:37 2006 @@ -10,7 +10,7 @@ import unittest from test import test_support -from support import DummyStdout, MPdbTest, MPdbTestThread +from support import DummyStdout, MPdbTest, MPdbTestThread, MPdbTestProc sys.path.append('..') @@ -40,16 +40,18 @@ sys.stdout = sys.__stdout__ - def testSignalHandler(self): + def no_testSignalHandler(self): pid = self.child() - client = MPdbTest() + client = MPdbTestProc(mpdb.MPdb()) # Allow the child process to catch up time.sleep(0.1) + client.onecmd('set target-address tcp :9000') client.onecmd('attach %s' % str(pid)) client.onecmd('where') line = client.lines[1] self.assertEquals(line, ' \n(MPdb)') + try: client.onecmd('detach') except KeyboardInterrupt: @@ -62,18 +64,8 @@ pid = self.child() os.chdir('..') time.sleep(0.1) - os.system("./mpdb.py --exec='set target-address tcp :9000," + \ - "attach %s;;where;;detach' -o %s" % (str(pid), TESTFN)) - os.chdir('./test') - os.kill(pid, signal.SIGINT) - - os.waitpid(pid, 0) - - pid = self.child() - os.chdir('..') - time.sleep(0.1) - os.system("./mpdb.py --pid='%s tcp :9000' --exec='where;;detach' -o %s" \ - % (str(pid), TESTFN)) + os.system("./mpdb.py -e 'detach' --pid='%s tcp :9000'" \ + % (str(pid))) os.chdir('./test') os.kill(pid, signal.SIGINT) From python-checkins at python.org Sun Aug 13 20:40:41 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 20:40:41 +0200 (CEST) Subject: [Python-checkins] r51258 - python/trunk/Modules/_ctypes/_ctypes.c python/trunk/Modules/_ctypes/callproc.c Message-ID: <20060813184041.221EC1E4005@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 20:40:39 2006 New Revision: 51258 Modified: python/trunk/Modules/_ctypes/_ctypes.c python/trunk/Modules/_ctypes/callproc.c Log: Handle alloca failures. Klocwork 225-228 Modified: python/trunk/Modules/_ctypes/_ctypes.c ============================================================================== --- python/trunk/Modules/_ctypes/_ctypes.c (original) +++ python/trunk/Modules/_ctypes/_ctypes.c Sun Aug 13 20:40:39 2006 @@ -2475,6 +2475,8 @@ where n is 0, 4, 8, 12, ..., 128 */ mangled_name = alloca(strlen(name) + 1 + 1 + 1 + 3); /* \0 _ @ %d */ + if (!mangled_name) + return NULL; for (i = 0; i < 32; ++i) { sprintf(mangled_name, "_%s@%d", name, i*4); address = (PPROC)GetProcAddress(handle, mangled_name); Modified: python/trunk/Modules/_ctypes/callproc.c ============================================================================== --- python/trunk/Modules/_ctypes/callproc.c (original) +++ python/trunk/Modules/_ctypes/callproc.c Sun Aug 13 20:40:39 2006 @@ -915,6 +915,10 @@ #endif args = (struct argument *)alloca(sizeof(struct argument) * argcount); + if (!args) { + PyErr_NoMemory(); + return NULL; + } memset(args, 0, sizeof(struct argument) * argcount); argtype_count = argtypes ? PyTuple_GET_SIZE(argtypes) : 0; #ifdef MS_WIN32 @@ -968,6 +972,10 @@ avalues = (void **)alloca(sizeof(void *) * argcount); atypes = (ffi_type **)alloca(sizeof(ffi_type *) * argcount); + if (!resbuf || !avalues || !atypes) { + PyErr_NoMemory(); + goto cleanup; + } for (i = 0; i < argcount; ++i) { atypes[i] = args[i].ffi_type; if (atypes[i]->type == FFI_TYPE_STRUCT) @@ -1068,6 +1076,11 @@ return NULL; #ifdef _UNICODE name = alloca((PyString_Size(nameobj) + 1) * sizeof(WCHAR)); + if (!name) { + PyErr_NoMemory(); + return NULL; + } + { int r; char *aname = PyString_AsString(nameobj); From python-checkins at python.org Sun Aug 13 20:41:15 2006 From: python-checkins at python.org (neal.norwitz) Date: Sun, 13 Aug 2006 20:41:15 +0200 (CEST) Subject: [Python-checkins] r51259 - python/trunk/Modules/mmapmodule.c Message-ID: <20060813184115.C5BD41E4011@bag.python.org> Author: neal.norwitz Date: Sun Aug 13 20:41:15 2006 New Revision: 51259 Modified: python/trunk/Modules/mmapmodule.c Log: Get rid of compiler warning Modified: python/trunk/Modules/mmapmodule.c ============================================================================== --- python/trunk/Modules/mmapmodule.c (original) +++ python/trunk/Modules/mmapmodule.c Sun Aug 13 20:41:15 2006 @@ -1130,9 +1130,9 @@ setint(PyObject *d, const char *name, long value) { PyObject *o = PyInt_FromLong(value); - if (o) - if (PyDict_SetItemString(d, name, o) == 0) + if (o && PyDict_SetItemString(d, name, o) == 0) { Py_DECREF(o); + } } PyMODINIT_FUNC From python-checkins at python.org Sun Aug 13 23:41:29 2006 From: python-checkins at python.org (matt.fleming) Date: Sun, 13 Aug 2006 23:41:29 +0200 (CEST) Subject: [Python-checkins] r51260 - python/branches/release24-maint/Modules/socketmodule.c Message-ID: <20060813214129.B848F1E4002@bag.python.org> Author: matt.fleming Date: Sun Aug 13 23:41:29 2006 New Revision: 51260 Modified: python/branches/release24-maint/Modules/socketmodule.c Log: Backport a patch applied to trunk that allows Python to compile with NetBSD's bluetooth API. Modified: python/branches/release24-maint/Modules/socketmodule.c ============================================================================== --- python/branches/release24-maint/Modules/socketmodule.c (original) +++ python/branches/release24-maint/Modules/socketmodule.c Sun Aug 13 23:41:29 2006 @@ -351,6 +351,14 @@ #define _BT_SOCKADDR_MEMB(s, proto) &((s)->sock_addr) #define _BT_L2_MEMB(sa, memb) ((sa)->l2cap_##memb) #define _BT_RC_MEMB(sa, memb) ((sa)->rfcomm_##memb) +#elif defined(__NetBSD__) +#define sockaddr_l2 sockaddr_bt +#define sockaddr_rc sockaddr_bt +#define sockaddr_sco sockaddr_bt +#define _BT_SOCKADDR_MEMB(s, proto) &((s)->sock_addr) +#define _BT_L2_MEMB(sa, memb) ((sa)->bt_##memb) +#define _BT_RC_MEMB(sa, memb) ((sa)->bt_##memb) +#define _BT_SCO_MEMB(sa, memb) ((sa)->bt_##memb) #else #define _BT_SOCKADDR_MEMB(s, proto) (&((s)->sock_addr).bt_##proto) #define _BT_L2_MEMB(sa, memb) ((sa)->l2_##memb) From buildbot at python.org Sun Aug 13 23:59:56 2006 From: buildbot at python.org (buildbot at python.org) Date: Sun, 13 Aug 2006 21:59:56 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060813215956.816D11E4002@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/487 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Mon Aug 14 02:51:16 2006 From: python-checkins at python.org (neal.norwitz) Date: Mon, 14 Aug 2006 02:51:16 +0200 (CEST) Subject: [Python-checkins] r51261 - in python/trunk: Parser Tools/buildbot Message-ID: <20060814005116.580861E4002@bag.python.org> Author: neal.norwitz Date: Mon Aug 14 02:51:15 2006 New Revision: 51261 Modified: python/trunk/Parser/ (props changed) python/trunk/Tools/buildbot/ (props changed) Log: Ignore pgen.exe and kill_python.exe for cygwin From python-checkins at python.org Mon Aug 14 02:59:04 2006 From: python-checkins at python.org (neal.norwitz) Date: Mon, 14 Aug 2006 02:59:04 +0200 (CEST) Subject: [Python-checkins] r51262 - python/trunk/Objects/classobject.c Message-ID: <20060814005904.14CC61E4002@bag.python.org> Author: neal.norwitz Date: Mon Aug 14 02:59:03 2006 New Revision: 51262 Modified: python/trunk/Objects/classobject.c Log: Can't return NULL from a void function. If there is a memory error, about the best we can do is call PyErr_WriteUnraisable and go on. We won't be able to do the call below either, so verify delstr is valid. Modified: python/trunk/Objects/classobject.c ============================================================================== --- python/trunk/Objects/classobject.c (original) +++ python/trunk/Objects/classobject.c Mon Aug 14 02:59:03 2006 @@ -624,9 +624,9 @@ if (delstr == NULL) { delstr = PyString_InternFromString("__del__"); if (delstr == NULL) - return NULL; + PyErr_WriteUnraisable((PyObject*)inst); } - if ((del = instance_getattr2(inst, delstr)) != NULL) { + if (delstr && (del = instance_getattr2(inst, delstr)) != NULL) { PyObject *res = PyEval_CallObject(del, (PyObject *)NULL); if (res == NULL) PyErr_WriteUnraisable(del); From python-checkins at python.org Mon Aug 14 03:49:54 2006 From: python-checkins at python.org (neal.norwitz) Date: Mon, 14 Aug 2006 03:49:54 +0200 (CEST) Subject: [Python-checkins] r51263 - python/trunk/Misc/PURIFY.README Message-ID: <20060814014954.EDB9E1E4014@bag.python.org> Author: neal.norwitz Date: Mon Aug 14 03:49:54 2006 New Revision: 51263 Modified: python/trunk/Misc/PURIFY.README Log: Update purify doc some. Modified: python/trunk/Misc/PURIFY.README ============================================================================== --- python/trunk/Misc/PURIFY.README (original) +++ python/trunk/Misc/PURIFY.README Mon Aug 14 03:49:54 2006 @@ -1,6 +1,6 @@ Purify (tm) and Quantify (tm) are commercial software quality -assurance tools available from Rational Software Corporation -. Purify is essentially a memory access +assurance tools available from IBM . +Purify is essentially a memory access verifier and leak detector; Quantify is a C level profiler. The rest of this file assumes you generally know how to use Purify and Quantify, and that you have installed valid licenses for these @@ -20,6 +20,17 @@ make PURIFY=quantify +Starting with Python 2.3, pymalloc is enabled by default. This +will cause many supurious warnings. Modify Objects/obmalloc.c +and enable Py_USING_MEMORY_DEBUGGER by uncommenting it. +README.valgrind has more details about why this is necessary. +See below about setting up suppressions. Some tests may not +run well with Purify due to heavy memory or CPU usage. These +tests may include: test_largefile, test_import, and test_long. + +Please report any findings (problems or no warnings) to python-dev at python.org. +It may be useful to submit a bug report for any problems. + When running the regression test (make test), I have found it useful to set my PURIFYOPTIONS environment variable using the following (bash) shell function. Check out the Purify documentation for @@ -52,6 +63,11 @@ suppress umr ...; "nismodule.c" suppress umr ...; "pwdmodule.c" +Note: this list is very old and may not be accurate any longer. +It's possible some of these no longer need to be suppressed. +You will also need to suppress warnings (at least umr) +from Py_ADDRESS_IN_RANGE. + This will still leave you with just a few UMR, mostly in the readline library, which you can safely ignore. A lot of work has gone into Python 1.5 to plug as many leaks as possible. From buildbot at python.org Mon Aug 14 03:52:20 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 01:52:20 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060814015220.EF64D1E4002@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1075 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Mon Aug 14 09:13:05 2006 From: python-checkins at python.org (thomas.heller) Date: Mon, 14 Aug 2006 09:13:05 +0200 (CEST) Subject: [Python-checkins] r51264 - python/trunk/Modules/_ctypes/_ctypes_test.c Message-ID: <20060814071305.F3B691E4002@bag.python.org> Author: thomas.heller Date: Mon Aug 14 09:13:05 2006 New Revision: 51264 Modified: python/trunk/Modules/_ctypes/_ctypes_test.c Log: Remove unused, buggy test function. Fixes klockwork issue #207. Modified: python/trunk/Modules/_ctypes/_ctypes_test.c ============================================================================== --- python/trunk/Modules/_ctypes/_ctypes_test.c (original) +++ python/trunk/Modules/_ctypes/_ctypes_test.c Mon Aug 14 09:13:05 2006 @@ -197,18 +197,6 @@ #endif -EXPORT(int) _testfunc_ppp(char ***p) -{ - static char message[] = "Hello, World"; - if (p) { - *p = (char **)malloc(sizeof(char *)); - printf("malloc returned %p\n", *p); - **p = message; - return 1; - } - return 0; -} - typedef struct { char *name; char *value; From python-checkins at python.org Mon Aug 14 09:14:09 2006 From: python-checkins at python.org (thomas.heller) Date: Mon, 14 Aug 2006 09:14:09 +0200 (CEST) Subject: [Python-checkins] r51265 - python/trunk/Modules/_ctypes/_ctypes.c Message-ID: <20060814071409.A87621E4002@bag.python.org> Author: thomas.heller Date: Mon Aug 14 09:14:09 2006 New Revision: 51265 Modified: python/trunk/Modules/_ctypes/_ctypes.c Log: Check for NULL return value from new_CArgObject(). Fixes klockwork issues #183, #184, #185. Modified: python/trunk/Modules/_ctypes/_ctypes.c ============================================================================== --- python/trunk/Modules/_ctypes/_ctypes.c (original) +++ python/trunk/Modules/_ctypes/_ctypes.c Mon Aug 14 09:14:09 2006 @@ -1067,6 +1067,8 @@ struct fielddesc *fd = getentry("Z"); parg = new_CArgObject(); + if (parg == NULL) + return NULL; parg->pffi_type = &ffi_type_pointer; parg->tag = 'Z'; parg->obj = fd->setfunc(&parg->value, value, 0); @@ -1119,6 +1121,8 @@ struct fielddesc *fd = getentry("z"); parg = new_CArgObject(); + if (parg == NULL) + return NULL; parg->pffi_type = &ffi_type_pointer; parg->tag = 'z'; parg->obj = fd->setfunc(&parg->value, value, 0); @@ -1176,6 +1180,8 @@ struct fielddesc *fd = getentry("P"); parg = new_CArgObject(); + if (parg == NULL) + return NULL; parg->pffi_type = &ffi_type_pointer; parg->tag = 'P'; parg->obj = fd->setfunc(&parg->value, value, 0); From python-checkins at python.org Mon Aug 14 09:50:14 2006 From: python-checkins at python.org (thomas.heller) Date: Mon, 14 Aug 2006 09:50:14 +0200 (CEST) Subject: [Python-checkins] r51266 - python/trunk/Modules/_ctypes/_ctypes.c Message-ID: <20060814075014.EF3A51E4011@bag.python.org> Author: thomas.heller Date: Mon Aug 14 09:50:14 2006 New Revision: 51266 Modified: python/trunk/Modules/_ctypes/_ctypes.c Log: Check for NULL return value of GenericCData_new(). Fixes klockwork issues #188, #189. Modified: python/trunk/Modules/_ctypes/_ctypes.c ============================================================================== --- python/trunk/Modules/_ctypes/_ctypes.c (original) +++ python/trunk/Modules/_ctypes/_ctypes.c Mon Aug 14 09:50:14 2006 @@ -2752,6 +2752,8 @@ if (ptr == NULL) return NULL; ob = (CDataObject *)GenericCData_new(type, args, kwds); + if (ob == NULL) + return NULL; *(void **)ob->b_ptr = ptr; return (PyObject *)ob; } @@ -2799,6 +2801,8 @@ return NULL; self = (CFuncPtrObject *)GenericCData_new(type, args, kwds); + if (self == NULL) + return NULL; Py_INCREF(callable); self->callable = callable; From python-checkins at python.org Mon Aug 14 12:02:24 2006 From: python-checkins at python.org (thomas.heller) Date: Mon, 14 Aug 2006 12:02:24 +0200 (CEST) Subject: [Python-checkins] r51274 - python/trunk/Modules/_ctypes/callbacks.c Message-ID: <20060814100224.CB2E31E4003@bag.python.org> Author: thomas.heller Date: Mon Aug 14 12:02:24 2006 New Revision: 51274 Modified: python/trunk/Modules/_ctypes/callbacks.c Log: Revert the change that tries to zero out a closure's result storage area because the size if unknown in source/callproc.c. Modified: python/trunk/Modules/_ctypes/callbacks.c ============================================================================== --- python/trunk/Modules/_ctypes/callbacks.c (original) +++ python/trunk/Modules/_ctypes/callbacks.c Mon Aug 14 12:02:24 2006 @@ -205,24 +205,14 @@ result = PyObject_CallObject(callable, arglist); CHECK("'calling callback function'", result); -#ifdef WORDS_BIGENDIAN - /* See the corresponding code in callproc.c, around line 961 */ - if (restype->type != FFI_TYPE_FLOAT && restype->size < sizeof(ffi_arg)) - mem = (char *)mem + sizeof(ffi_arg) - restype->size; -#endif - /* The code that converts 'result' into C data is not executed when - 'callable' returns Py_None, so we zero out the memory that will - receive the C return data to not return random data. - - Cleaner would be to call 'setfunc' anyway and complain with - PyErr_WriteUnraisable(), but ctypes has always accepted a Py_None - return value for *any* 'restype' and it would probably break too - much code if this is changed now. - */ - memset(mem, 0, restype->size); if ((restype != &ffi_type_void) && result && result != Py_None) { PyObject *keep; assert(setfunc); +#ifdef WORDS_BIGENDIAN + /* See the corresponding code in callproc.c, around line 961 */ + if (restype->type != FFI_TYPE_FLOAT && restype->size < sizeof(ffi_arg)) + mem = (char *)mem + sizeof(ffi_arg) - restype->size; +#endif keep = setfunc(mem, result, 0); CHECK("'converting callback result'", keep); /* keep is an object we have to keep alive so that the result From buildbot at python.org Mon Aug 14 12:42:55 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 10:42:55 +0000 Subject: [Python-checkins] buildbot warnings in ppc Debian unstable trunk Message-ID: <20060814104255.56D311E4003@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%2520Debian%2520unstable%2520trunk/builds/1105 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Mon Aug 14 12:55:06 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 10:55:06 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060814105506.5FEFE1E4003@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1078 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Mon Aug 14 12:55:21 2006 From: python-checkins at python.org (marc-andre.lemburg) Date: Mon, 14 Aug 2006 12:55:21 +0200 (CEST) Subject: [Python-checkins] r51276 - in python/trunk: Doc/api/concrete.tex Doc/api/exceptions.tex Doc/lib/libexcs.tex Doc/lib/libwarnings.tex Include/pyerrors.h Include/unicodeobject.h Lib/test/exception_hierarchy.txt Misc/NEWS Objects/exceptions.c Objects/object.c Objects/unicodeobject.c Message-ID: <20060814105521.1401B1E4002@bag.python.org> Author: marc-andre.lemburg Date: Mon Aug 14 12:55:19 2006 New Revision: 51276 Modified: python/trunk/Doc/api/concrete.tex python/trunk/Doc/api/exceptions.tex python/trunk/Doc/lib/libexcs.tex python/trunk/Doc/lib/libwarnings.tex python/trunk/Include/pyerrors.h python/trunk/Include/unicodeobject.h python/trunk/Lib/test/exception_hierarchy.txt python/trunk/Misc/NEWS python/trunk/Objects/exceptions.c python/trunk/Objects/object.c python/trunk/Objects/unicodeobject.c Log: Slightly revised version of patch #1538956: Replace UnicodeDecodeErrors raised during == and != compares of Unicode and other objects with a new UnicodeWarning. All other comparisons continue to raise exceptions. Exceptions other than UnicodeDecodeErrors are also left untouched. Modified: python/trunk/Doc/api/concrete.tex ============================================================================== --- python/trunk/Doc/api/concrete.tex (original) +++ python/trunk/Doc/api/concrete.tex Mon Aug 14 12:55:19 2006 @@ -1560,6 +1560,31 @@ greater than, respectively. \end{cfuncdesc} +\begin{cfuncdesc}{int}{PyUnicode_RichCompare}{PyObject *left, + PyObject *right, + int op} + +% This entry could use some polishing - my TeX is too +% rusty these days... (MAL) + + Rich compare two strings and return one of the following: +\begin{verbatim} + - NULL in case an exception was raised + - Py_True or Py_False for successfuly comparisons + - Py_NotImplemented in case the type combination is unknown +\end{verbatim} + + Note that Py_EQ and Py_NE comparisons can cause a UnicodeWarning in + case the conversion of the arguments to Unicode fails with a + UnicodeDecodeError. + + Possible values for \var{op}: +\begin{verbatim} + Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE +\end{verbatim} + +\end{cfuncdesc} + \begin{cfuncdesc}{PyObject*}{PyUnicode_Format}{PyObject *format, PyObject *args} Return a new string object from \var{format} and \var{args}; this Modified: python/trunk/Doc/api/exceptions.tex ============================================================================== --- python/trunk/Doc/api/exceptions.tex (original) +++ python/trunk/Doc/api/exceptions.tex Mon Aug 14 12:55:19 2006 @@ -288,10 +288,11 @@ names are \samp{PyExc_} followed by the Python exception name. These have the type \ctype{PyObject*}; they are all class objects. Their names are \cdata{PyExc_Warning}, \cdata{PyExc_UserWarning}, - \cdata{PyExc_DeprecationWarning}, \cdata{PyExc_SyntaxWarning}, - \cdata{PyExc_RuntimeWarning}, and \cdata{PyExc_FutureWarning}. - \cdata{PyExc_Warning} is a subclass of \cdata{PyExc_Exception}; the - other warning categories are subclasses of \cdata{PyExc_Warning}. + \cdata{PyExc_UnicodeWarning}, \cdata{PyExc_DeprecationWarning}, + \cdata{PyExc_SyntaxWarning}, \cdata{PyExc_RuntimeWarning}, and + \cdata{PyExc_FutureWarning}. \cdata{PyExc_Warning} is a subclass of + \cdata{PyExc_Exception}; the other warning categories are subclasses + of \cdata{PyExc_Warning}. For information about warning control, see the documentation for the \module{warnings} module and the \programopt{-W} option in the Modified: python/trunk/Doc/lib/libexcs.tex ============================================================================== --- python/trunk/Doc/lib/libexcs.tex (original) +++ python/trunk/Doc/lib/libexcs.tex Mon Aug 14 12:55:19 2006 @@ -456,6 +456,11 @@ \versionadded{2.5} \end{excdesc} +\begin{excdesc}{UnicodeWarning} +Base class for warnings related to Unicode. +\versionadded{2.5} +\end{excdesc} + The class hierarchy for built-in exceptions is: \verbatiminput{../../Lib/test/exception_hierarchy.txt} Modified: python/trunk/Doc/lib/libwarnings.tex ============================================================================== --- python/trunk/Doc/lib/libwarnings.tex (original) +++ python/trunk/Doc/lib/libwarnings.tex Mon Aug 14 12:55:19 2006 @@ -76,6 +76,9 @@ \lineii{ImportWarning}{Base category for warnings triggered during the process of importing a module (ignored by default).} + +\lineii{UnicodeWarning}{Base category for warnings related to Unicode.} + \end{tableii} While these are technically built-in exceptions, they are documented Modified: python/trunk/Include/pyerrors.h ============================================================================== --- python/trunk/Include/pyerrors.h (original) +++ python/trunk/Include/pyerrors.h Mon Aug 14 12:55:19 2006 @@ -173,6 +173,7 @@ PyAPI_DATA(PyObject *) PyExc_RuntimeWarning; PyAPI_DATA(PyObject *) PyExc_FutureWarning; PyAPI_DATA(PyObject *) PyExc_ImportWarning; +PyAPI_DATA(PyObject *) PyExc_UnicodeWarning; /* Convenience functions */ Modified: python/trunk/Include/unicodeobject.h ============================================================================== --- python/trunk/Include/unicodeobject.h (original) +++ python/trunk/Include/unicodeobject.h Mon Aug 14 12:55:19 2006 @@ -189,6 +189,7 @@ # define PyUnicode_RSplit PyUnicodeUCS2_RSplit # define PyUnicode_Replace PyUnicodeUCS2_Replace # define PyUnicode_Resize PyUnicodeUCS2_Resize +# define PyUnicode_RichCompare PyUnicodeUCS2_RichCompare # define PyUnicode_SetDefaultEncoding PyUnicodeUCS2_SetDefaultEncoding # define PyUnicode_Split PyUnicodeUCS2_Split # define PyUnicode_Splitlines PyUnicodeUCS2_Splitlines @@ -266,6 +267,7 @@ # define PyUnicode_RSplit PyUnicodeUCS4_RSplit # define PyUnicode_Replace PyUnicodeUCS4_Replace # define PyUnicode_Resize PyUnicodeUCS4_Resize +# define PyUnicode_RichCompare PyUnicodeUCS4_RichCompare # define PyUnicode_SetDefaultEncoding PyUnicodeUCS4_SetDefaultEncoding # define PyUnicode_Split PyUnicodeUCS4_Split # define PyUnicode_Splitlines PyUnicodeUCS4_Splitlines @@ -1139,6 +1141,28 @@ PyObject *right /* Right string */ ); +/* Rich compare two strings and return one of the following: + + - NULL in case an exception was raised + - Py_True or Py_False for successfuly comparisons + - Py_NotImplemented in case the type combination is unknown + + Note that Py_EQ and Py_NE comparisons can cause a UnicodeWarning in + case the conversion of the arguments to Unicode fails with a + UnicodeDecodeError. + + Possible values for op: + + Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE + +*/ + +PyAPI_FUNC(PyObject *) PyUnicode_RichCompare( + PyObject *left, /* Left string */ + PyObject *right, /* Right string */ + int op /* Operation: Py_EQ, Py_NE, Py_GT, etc. */ + ); + /* Apply a argument tuple or dictionary to a format string and return the resulting Unicode string. */ Modified: python/trunk/Lib/test/exception_hierarchy.txt ============================================================================== --- python/trunk/Lib/test/exception_hierarchy.txt (original) +++ python/trunk/Lib/test/exception_hierarchy.txt Mon Aug 14 12:55:19 2006 @@ -45,3 +45,4 @@ +-- UserWarning +-- FutureWarning +-- ImportWarning + +-- UnicodeWarning Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Aug 14 12:55:19 2006 @@ -12,18 +12,18 @@ Core and builtins ----------------- -- Fix segfault when doing string formatting on subclasses of long. +- Unicode objects will no longer raise an exception when being + compared equal or unequal to a string and causing a + UnicodeDecodeError exception, e.g. as result of a decoding failure. + + Instead, the equal (==) and unequal (!=) comparison operators will + now issue a UnicodeWarning and interpret the two objects as + unequal. The UnicodeWarning can be filtered as desired using + the warning framework, e.g. silenced completely, turned into an + exception, logged, etc. -- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines - with new-style classes. - -- Fix bug related to __len__ functions returning negative values with - classic classes. - -- Patch #1538606, Fix __index__() clipping. There were some problems - discovered with the API and how integers that didn't fit into Py_ssize_t - were handled. This patch attempts to provide enough alternatives - to effectively use __index__. + Note that compare operators other than equal and unequal will still + raise UnicodeDecodeError exceptions as they've always done. - Bug #1536021: __hash__ may now return long int; the final hash value is obtained by invoking hash on the long int. @@ -99,6 +99,8 @@ C API ----- +- New API for Unicode rich comparisons: PyUnicode_RichCompare() + - Bug #1069160. Internal correctness changes were made to ``PyThreadState_SetAsyncExc()``. A test case was added, and the documentation was changed to state that the return value Modified: python/trunk/Objects/exceptions.c ============================================================================== --- python/trunk/Objects/exceptions.c (original) +++ python/trunk/Objects/exceptions.c Mon Aug 14 12:55:19 2006 @@ -1948,6 +1948,14 @@ "Base class for warnings about probable mistakes in module imports"); +/* + * UnicodeWarning extends Warning + */ +SimpleExtendsException(PyExc_Warning, UnicodeWarning, + "Base class for warnings about Unicode related problems, mostly\n" + "related to conversion problems."); + + /* Pre-computed MemoryError instance. Best to create this as early as * possible and not wait until a MemoryError is actually raised! */ @@ -2048,6 +2056,7 @@ PRE_INIT(RuntimeWarning) PRE_INIT(FutureWarning) PRE_INIT(ImportWarning) + PRE_INIT(UnicodeWarning) m = Py_InitModule4("exceptions", functions, exceptions_doc, (PyObject *)NULL, PYTHON_API_VERSION); @@ -2113,6 +2122,7 @@ POST_INIT(RuntimeWarning) POST_INIT(FutureWarning) POST_INIT(ImportWarning) + POST_INIT(UnicodeWarning) PyExc_MemoryErrorInst = BaseException_new(&_PyExc_MemoryError, NULL, NULL); if (!PyExc_MemoryErrorInst) Modified: python/trunk/Objects/object.c ============================================================================== --- python/trunk/Objects/object.c (original) +++ python/trunk/Objects/object.c Mon Aug 14 12:55:19 2006 @@ -731,23 +731,6 @@ return (vv < ww) ? -1 : (vv > ww) ? 1 : 0; } -#ifdef Py_USING_UNICODE - /* Special case for Unicode */ - if (PyUnicode_Check(v) || PyUnicode_Check(w)) { - c = PyUnicode_Compare(v, w); - if (!PyErr_Occurred()) - return c; - /* TypeErrors are ignored: if Unicode coercion fails due - to one of the arguments not having the right type, we - continue as defined by the coercion protocol (see - above). Luckily, decoding errors are reported as - ValueErrors and are not masked by this technique. */ - if (!PyErr_ExceptionMatches(PyExc_TypeError)) - return -2; - PyErr_Clear(); - } -#endif - /* None is smaller than anything */ if (v == Py_None) return -1; Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Mon Aug 14 12:55:19 2006 @@ -5405,6 +5405,82 @@ return -1; } +PyObject *PyUnicode_RichCompare(PyObject *left, + PyObject *right, + int op) +{ + int result; + + result = PyUnicode_Compare(left, right); + if (result == -1 && PyErr_Occurred()) + goto onError; + + /* Convert the return value to a Boolean */ + switch (op) { + case Py_EQ: + result = (result == 0); + break; + case Py_NE: + result = (result != 0); + break; + case Py_LE: + result = (result <= 0); + break; + case Py_GE: + result = (result >= 0); + break; + case Py_LT: + result = (result == -1); + break; + case Py_GT: + result = (result == 1); + break; + } + return PyBool_FromLong(result); + + onError: + + /* Standard case + + Type errors mean that PyUnicode_FromObject() could not convert + one of the arguments (usually the right hand side) to Unicode, + ie. we can't handle the comparison request. However, it is + possible that the other object knows a comparison method, which + is why we return Py_NotImplemented to give the other object a + chance. + + */ + if (PyErr_ExceptionMatches(PyExc_TypeError)) { + PyErr_Clear(); + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } + if (op != Py_EQ && op != Py_NE) + return NULL; + + /* Equality comparison. + + This is a special case: we silence any PyExc_UnicodeDecodeError + and instead turn it into a PyErr_UnicodeWarning. + + */ + if (!PyErr_ExceptionMatches(PyExc_UnicodeDecodeError)) + return NULL; + PyErr_Clear(); + if (PyErr_Warn(PyExc_UnicodeWarning, + (op == Py_EQ) ? + "Unicode equal comparison " + "failed to convert both arguments to Unicode - " + "interpreting them as being unequal" : + "Unicode unequal comparison " + "failed to convert both arguments to Unicode - " + "interpreting them as being unequal" + ) < 0) + return NULL; + result = (op == Py_NE); + return PyBool_FromLong(result); +} + int PyUnicode_Contains(PyObject *container, PyObject *element) { @@ -6985,11 +7061,14 @@ PyUnicode_Contains, /* sq_contains */ }; +#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX) + static PyObject* unicode_subscript(PyUnicodeObject* self, PyObject* item) { - if (PyIndex_Check(item)) { - Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + PyNumberMethods *nb = item->ob_type->tp_as_number; + if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { + Py_ssize_t i = nb->nb_index(item); if (i == -1 && PyErr_Occurred()) return NULL; if (i < 0) @@ -7859,7 +7938,7 @@ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc) unicode_compare, /* tp_compare */ + 0, /* tp_compare */ unicode_repr, /* tp_repr */ &unicode_as_number, /* tp_as_number */ &unicode_as_sequence, /* tp_as_sequence */ @@ -7875,7 +7954,7 @@ unicode_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ - 0, /* tp_richcompare */ + PyUnicode_RichCompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ From stackless-checkins-bounces at stackless.com Mon Aug 14 10:14:17 2006 From: stackless-checkins-bounces at stackless.com (stackless-checkins-bounces at stackless.com) Date: Mon, 14 Aug 2006 10:14:17 +0200 Subject: [Python-checkins] Your message to Stackless-checkins awaits moderator approval Message-ID: Your mail to 'Stackless-checkins' with the subject r51275 - in stackless/trunk: Doc/api/api.tex Doc/api/exceptions.tex Doc/api/intro.tex Doc/api/refcounts.dat Doc/commontex/boilerplate.tex Doc/dist/dist.tex Doc/doc/doc.tex Doc/ext/newtypes.tex Doc/ext/windows.tex Doc/howto/doanddont.tex Doc/inst/inst.tex Doc/lib/email.tex Doc/lib/emailgenerator.tex Doc/lib/lib.tex Doc/lib/libanydbm.tex Doc/lib/libbase64.tex Doc/lib/libbinascii.tex Doc/lib/libbsddb.tex Doc/lib/libcompileall.tex Doc/lib/libcsv.tex Doc/lib/libctypes.tex Doc/lib/libfuncs.tex Doc/lib/libgettext.tex Doc/lib/libimp.tex Doc/lib/libinspect.tex Doc/lib/liblogging.tex Doc/lib/libmailbox.tex Doc/lib/libmimetypes.tex Doc/lib/libnew.tex Doc/lib/liboptparse.tex Doc/lib/libossaudiodev.tex Doc/lib/libpickle.tex Doc/lib/libpkgutil.tex Doc/lib/libposixpath.tex Doc/lib/librandom.tex Doc/lib/libre.tex Doc/lib/libreadline.tex Doc/lib/libshelve.tex Doc/lib/libsocket.tex Doc/lib/libsocksvr.tex Doc/lib/libsqlite3.tex Doc/lib/libstdtypes.tex Doc/lib/libstringio.tex Doc/lib/l! ibsubprocess.tex Doc/lib/libsys.tex Doc/lib/libtime.tex Doc/lib/libturtle.tex Doc/lib/libtypes.tex Doc/lib/libundoc.tex Doc/lib/libunicodedata.tex Doc/lib/liburllib.tex Doc/lib/liburllib2.tex Doc/lib/libuuid.tex Doc/lib/libweakref.tex Doc/lib/libwebbrowser.tex Doc/lib/libzipfile.tex Doc/lib/sqlite3/complete_statement.py Doc/lib/tkinter.tex Doc/mac/libmacfs.tex Doc/mac/libmacos.tex Doc/mac/using.tex Doc/ref/ref3.tex Doc/whatsnew/whatsnew20.tex Doc/whatsnew/whatsnew21.tex Doc/whatsnew/whatsnew23.tex Doc/whatsnew/whatsnew24.tex Doc/whatsnew/whatsnew25.tex Include/patchlevel.h Include/pyerrors.h Include/weakrefobject.h Lib/binhex.py Lib/bsddb/test/test_basics.py Lib/compiler/future.py Lib/compiler/transformer.py Lib/ctypes/__init__.py Lib/ctypes/test/test_varsize_struct.py Lib/ctypes/util.py Lib/distutils/__init__.py Lib/distutils/msvccompiler.py Lib/doctest.py Lib/email/__init__.py Lib/email/message.py Lib/email/test/test_email.py Lib/email/test/test_email_renamed.py Lib/email! /utils.py Lib/encodings/mbcs.py Lib/gzip.py Lib/httplib.py Lib/idlelib/CREDITS.txt Lib/idlelib/CallTipWindow.py Lib/idlelib/CallTips.py Lib/idlelib/CodeContext.py Lib/idlelib/ColorDelegator.py Lib/idlelib/EditorWindow.py Lib/idlelib/NEWS.txt Lib/idlelib/ParenMatch.py Lib/idlelib/PyShell.py Lib/idlelib/ScriptBinding.py Lib/id Is being held until the list moderator can review it for approval. The reason it is being held: Message body is too big: 568776 bytes with a limit of 500 KB Either the message will get posted to the list, or you will receive notification of the moderator's decision. If you would like to cancel this posting, please visit the following URL: http://www.stackless.com/mailman/confirm/stackless-checkins/b64060fa259ae6080a6933c17d5b5567557f7bd1 From buildbot at python.org Mon Aug 14 13:17:46 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 11:17:46 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP-2 trunk Message-ID: <20060814111746.785481E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-2 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP-2%2520trunk/builds/868 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Mon Aug 14 13:17:49 2006 From: python-checkins at python.org (thomas.heller) Date: Mon, 14 Aug 2006 13:17:49 +0200 (CEST) Subject: [Python-checkins] r51277 - in python/trunk: Lib/ctypes/__init__.py Lib/ctypes/test/test_as_parameter.py Lib/ctypes/test/test_numbers.py Lib/ctypes/test/test_prototypes.py Misc/NEWS Modules/_ctypes/_ctypes.c Modules/_ctypes/callproc.c Modules/_ctypes/ctypes.h Message-ID: <20060814111749.8A2631E4002@bag.python.org> Author: thomas.heller Date: Mon Aug 14 13:17:48 2006 New Revision: 51277 Added: python/trunk/Lib/ctypes/test/test_as_parameter.py (contents, props changed) Modified: python/trunk/Lib/ctypes/__init__.py python/trunk/Lib/ctypes/test/test_numbers.py python/trunk/Lib/ctypes/test/test_prototypes.py python/trunk/Misc/NEWS python/trunk/Modules/_ctypes/_ctypes.c python/trunk/Modules/_ctypes/callproc.c python/trunk/Modules/_ctypes/ctypes.h Log: Apply the patch #1532975 plus ideas from the patch #1533481. ctypes instances no longer have the internal and undocumented '_as_parameter_' attribute which was used to adapt them to foreign function calls; this mechanism is replaced by a function pointer in the type's stgdict. In the 'from_param' class methods, try the _as_parameter_ attribute if other conversions are not possible. This makes the documented _as_parameter_ mechanism work as intended. Change the ctypes version number to 1.0.1. Modified: python/trunk/Lib/ctypes/__init__.py ============================================================================== --- python/trunk/Lib/ctypes/__init__.py (original) +++ python/trunk/Lib/ctypes/__init__.py Mon Aug 14 13:17:48 2006 @@ -5,7 +5,7 @@ import os as _os, sys as _sys -__version__ = "1.0.0" +__version__ = "1.0.1" from _ctypes import Union, Structure, Array from _ctypes import _Pointer Added: python/trunk/Lib/ctypes/test/test_as_parameter.py ============================================================================== --- (empty file) +++ python/trunk/Lib/ctypes/test/test_as_parameter.py Mon Aug 14 13:17:48 2006 @@ -0,0 +1,214 @@ +import unittest +from ctypes import * +import _ctypes_test + +dll = CDLL(_ctypes_test.__file__) + +try: + CALLBACK_FUNCTYPE = WINFUNCTYPE +except NameError: + # fake to enable this test on Linux + CALLBACK_FUNCTYPE = CFUNCTYPE + +class POINT(Structure): + _fields_ = [("x", c_int), ("y", c_int)] + +class BasicWrapTestCase(unittest.TestCase): + def wrap(self, param): + return param + + def test_wchar_parm(self): + try: + c_wchar + except NameError: + return + f = dll._testfunc_i_bhilfd + f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double] + result = f(self.wrap(1), self.wrap(u"x"), self.wrap(3), self.wrap(4), self.wrap(5.0), self.wrap(6.0)) + self.failUnlessEqual(result, 139) + self.failUnless(type(result), int) + + def test_pointers(self): + f = dll._testfunc_p_p + f.restype = POINTER(c_int) + f.argtypes = [POINTER(c_int)] + + # This only works if the value c_int(42) passed to the + # function is still alive while the pointer (the result) is + # used. + + v = c_int(42) + + self.failUnlessEqual(pointer(v).contents.value, 42) + result = f(self.wrap(pointer(v))) + self.failUnlessEqual(type(result), POINTER(c_int)) + self.failUnlessEqual(result.contents.value, 42) + + # This on works... + result = f(self.wrap(pointer(v))) + self.failUnlessEqual(result.contents.value, v.value) + + p = pointer(c_int(99)) + result = f(self.wrap(p)) + self.failUnlessEqual(result.contents.value, 99) + + def test_shorts(self): + f = dll._testfunc_callback_i_if + + args = [] + expected = [262144, 131072, 65536, 32768, 16384, 8192, 4096, 2048, + 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1] + + def callback(v): + args.append(v) + + CallBack = CFUNCTYPE(c_int, c_int) + + cb = CallBack(callback) + f(self.wrap(2**18), self.wrap(cb)) + self.failUnlessEqual(args, expected) + + ################################################################ + + def test_callbacks(self): + f = dll._testfunc_callback_i_if + f.restype = c_int + + MyCallback = CFUNCTYPE(c_int, c_int) + + def callback(value): + #print "called back with", value + return value + + cb = MyCallback(callback) + + result = f(self.wrap(-10), self.wrap(cb)) + self.failUnlessEqual(result, -18) + + # test with prototype + f.argtypes = [c_int, MyCallback] + cb = MyCallback(callback) + + result = f(self.wrap(-10), self.wrap(cb)) + self.failUnlessEqual(result, -18) + + result = f(self.wrap(-10), self.wrap(cb)) + self.failUnlessEqual(result, -18) + + AnotherCallback = CALLBACK_FUNCTYPE(c_int, c_int, c_int, c_int, c_int) + + # check that the prototype works: we call f with wrong + # argument types + cb = AnotherCallback(callback) + self.assertRaises(ArgumentError, f, self.wrap(-10), self.wrap(cb)) + + def test_callbacks_2(self): + # Can also use simple datatypes as argument type specifiers + # for the callback function. + # In this case the call receives an instance of that type + f = dll._testfunc_callback_i_if + f.restype = c_int + + MyCallback = CFUNCTYPE(c_int, c_int) + + f.argtypes = [c_int, MyCallback] + + def callback(value): + #print "called back with", value + self.failUnlessEqual(type(value), int) + return value + + cb = MyCallback(callback) + result = f(self.wrap(-10), self.wrap(cb)) + self.failUnlessEqual(result, -18) + + def test_longlong_callbacks(self): + + f = dll._testfunc_callback_q_qf + f.restype = c_longlong + + MyCallback = CFUNCTYPE(c_longlong, c_longlong) + + f.argtypes = [c_longlong, MyCallback] + + def callback(value): + self.failUnless(isinstance(value, (int, long))) + return value & 0x7FFFFFFF + + cb = MyCallback(callback) + + self.failUnlessEqual(13577625587, int(f(self.wrap(1000000000000), self.wrap(cb)))) + + def test_byval(self): + # without prototype + ptin = POINT(1, 2) + ptout = POINT() + # EXPORT int _testfunc_byval(point in, point *pout) + result = dll._testfunc_byval(ptin, byref(ptout)) + got = result, ptout.x, ptout.y + expected = 3, 1, 2 + self.failUnlessEqual(got, expected) + + # with prototype + ptin = POINT(101, 102) + ptout = POINT() + dll._testfunc_byval.argtypes = (POINT, POINTER(POINT)) + dll._testfunc_byval.restype = c_int + result = dll._testfunc_byval(self.wrap(ptin), byref(ptout)) + got = result, ptout.x, ptout.y + expected = 203, 101, 102 + self.failUnlessEqual(got, expected) + + def test_struct_return_2H(self): + class S2H(Structure): + _fields_ = [("x", c_short), + ("y", c_short)] + dll.ret_2h_func.restype = S2H + dll.ret_2h_func.argtypes = [S2H] + inp = S2H(99, 88) + s2h = dll.ret_2h_func(self.wrap(inp)) + self.failUnlessEqual((s2h.x, s2h.y), (99*2, 88*3)) + + def test_struct_return_8H(self): + class S8I(Structure): + _fields_ = [("a", c_int), + ("b", c_int), + ("c", c_int), + ("d", c_int), + ("e", c_int), + ("f", c_int), + ("g", c_int), + ("h", c_int)] + dll.ret_8i_func.restype = S8I + dll.ret_8i_func.argtypes = [S8I] + inp = S8I(9, 8, 7, 6, 5, 4, 3, 2) + s8i = dll.ret_8i_func(self.wrap(inp)) + self.failUnlessEqual((s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h), + (9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9)) + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class AsParamWrapper(object): + def __init__(self, param): + self._as_parameter_ = param + +class AsParamWrapperTestCase(BasicWrapTestCase): + wrap = AsParamWrapper + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class AsParamPropertyWrapper(object): + def __init__(self, param): + self._param = param + + def getParameter(self): + return self._param + _as_parameter_ = property(getParameter) + +class AsParamPropertyWrapperTestCase(BasicWrapTestCase): + wrap = AsParamPropertyWrapper + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +if __name__ == '__main__': + unittest.main() Modified: python/trunk/Lib/ctypes/test/test_numbers.py ============================================================================== --- python/trunk/Lib/ctypes/test/test_numbers.py (original) +++ python/trunk/Lib/ctypes/test/test_numbers.py Mon Aug 14 13:17:48 2006 @@ -19,7 +19,7 @@ result.append((min(a, b, c, d), max(a, b, c, d))) return result -ArgType = type(c_int(0)._as_parameter_) +ArgType = type(byref(c_int(0))) unsigned_types = [c_ubyte, c_ushort, c_uint, c_ulong] signed_types = [c_byte, c_short, c_int, c_long, c_longlong] @@ -80,19 +80,6 @@ for t in signed_types + unsigned_types + float_types: self.failUnlessEqual(ArgType, type(t.from_param(0))) - def test_as_parameter(self): - # The _as_parameter_ property must also - # be a PyCArgObject instance - for t in signed_types + unsigned_types + float_types: - parm = t()._as_parameter_ - self.failUnlessEqual(ArgType, type(parm)) - - # _as_parameter_ is readonly! - # - # Python 2.3 and 2.4 raise a TypeError when trying to set - # a readonly attribute, 2.5 raises an AttributeError. - self.assertRaises((AttributeError, TypeError), setattr, t(), "_as_parameter_", None) - def test_byref(self): # calling byref returns also a PyCArgObject instance for t in signed_types + unsigned_types + float_types: Modified: python/trunk/Lib/ctypes/test/test_prototypes.py ============================================================================== --- python/trunk/Lib/ctypes/test/test_prototypes.py (original) +++ python/trunk/Lib/ctypes/test/test_prototypes.py Mon Aug 14 13:17:48 2006 @@ -125,13 +125,18 @@ self.failUnlessEqual(None, func(c_wchar_p(None))) self.failUnlessEqual(u"123", func(c_wchar_p(u"123"))) -## def test_instance(self): -## func = testdll._testfunc_p_p + def test_instance(self): + func = testdll._testfunc_p_p + func.restype = c_void_p -## class X: -## _as_parameter_ = 0 + class X: + _as_parameter_ = None -## self.failUnlessEqual(0, func(X())) + func.argtypes = c_void_p, + self.failUnlessEqual(None, func(X())) + + func.argtypes = None + self.failUnlessEqual(None, func(X())) try: c_wchar Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Aug 14 13:17:48 2006 @@ -66,6 +66,10 @@ Extension Modules ----------------- +- Patch #1532975 was applied, which fixes Bug #1533481: ctypes now + uses the _as_parameter_ attribute when objects are passed to foreign + function calls. The ctypes version number was changed to 1.0.1. + - Bug #1530559, struct.pack raises TypeError where it used to convert. Passing float arguments to struct.pack when integers are expected now triggers a DeprecationWarning. Modified: python/trunk/Modules/_ctypes/_ctypes.c ============================================================================== --- python/trunk/Modules/_ctypes/_ctypes.c (original) +++ python/trunk/Modules/_ctypes/_ctypes.c Mon Aug 14 13:17:48 2006 @@ -140,6 +140,31 @@ accessible fields somehow. */ +static PyCArgObject * +StructUnionType_paramfunc(CDataObject *self) +{ + PyCArgObject *parg; + StgDictObject *stgdict; + + parg = new_CArgObject(); + if (parg == NULL) + return NULL; + + parg->tag = 'V'; + stgdict = PyObject_stgdict((PyObject *)self); + assert(stgdict); + parg->pffi_type = &stgdict->ffi_type_pointer; + /* For structure parameters (by value), parg->value doesn't contain the structure + data itself, instead parg->value.p *points* to the structure's data + See also _ctypes.c, function _call_function_pointer(). + */ + parg->value.p = self->b_ptr; + parg->size = self->b_size; + Py_INCREF(self); + parg->obj = (PyObject *)self; + return parg; +} + static PyObject * StructUnionType_new(PyTypeObject *type, PyObject *args, PyObject *kwds, int isStruct) { @@ -172,6 +197,8 @@ Py_DECREF(result->tp_dict); result->tp_dict = (PyObject *)dict; + dict->paramfunc = StructUnionType_paramfunc; + fields = PyDict_GetItemString((PyObject *)dict, "_fields_"); if (!fields) { StgDictObject *basedict = PyType_stgdict((PyObject *)result->tp_base); @@ -287,6 +314,7 @@ static PyObject * CDataType_from_param(PyObject *type, PyObject *value) { + PyObject *as_parameter; if (1 == PyObject_IsInstance(value, type)) { Py_INCREF(value); return value; @@ -330,6 +358,13 @@ } /* ... and leave the rest */ #endif + + as_parameter = PyObject_GetAttrString(value, "_as_parameter_"); + if (as_parameter) { + value = CDataType_from_param(type, as_parameter); + Py_DECREF(as_parameter); + return value; + } PyErr_Format(PyExc_TypeError, "expected %s instance instead of %s", ((PyTypeObject *)type)->tp_name, @@ -540,6 +575,23 @@ return 0; } +static PyCArgObject * +PointerType_paramfunc(CDataObject *self) +{ + PyCArgObject *parg; + + parg = new_CArgObject(); + if (parg == NULL) + return NULL; + + parg->tag = 'P'; + parg->pffi_type = &ffi_type_pointer; + Py_INCREF(self); + parg->obj = (PyObject *)self; + parg->value.p = *(void **)self->b_ptr; + return parg; +} + static PyObject * PointerType_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { @@ -563,6 +615,7 @@ stgdict->align = getentry("P")->pffi_type->alignment; stgdict->length = 1; stgdict->ffi_type_pointer = ffi_type_pointer; + stgdict->paramfunc = PointerType_paramfunc; proto = PyDict_GetItemString(typedict, "_type_"); /* Borrowed ref */ if (proto && -1 == PointerType_SetProto(stgdict, proto)) { @@ -906,6 +959,19 @@ return 0; } +static PyCArgObject * +ArrayType_paramfunc(CDataObject *self) +{ + PyCArgObject *p = new_CArgObject(); + if (p == NULL) + return NULL; + p->tag = 'P'; + p->pffi_type = &ffi_type_pointer; + p->value.p = (char *)self->b_ptr; + Py_INCREF(self); + p->obj = (PyObject *)self; + return p; +} static PyObject * ArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds) @@ -961,6 +1027,8 @@ Py_INCREF(proto); stgdict->proto = proto; + stgdict->paramfunc = &ArrayType_paramfunc; + /* Arrays are passed as pointers to function calls. */ stgdict->ffi_type_pointer = ffi_type_pointer; @@ -1055,6 +1123,7 @@ static PyObject * c_wchar_p_from_param(PyObject *type, PyObject *value) { + PyObject *as_parameter; #if (PYTHON_API_VERSION < 1012) # error not supported #endif @@ -1100,6 +1169,13 @@ return value; } } + + as_parameter = PyObject_GetAttrString(value, "_as_parameter_"); + if (as_parameter) { + value = c_wchar_p_from_param(type, as_parameter); + Py_DECREF(as_parameter); + return value; + } /* XXX better message */ PyErr_SetString(PyExc_TypeError, "wrong type"); @@ -1109,6 +1185,7 @@ static PyObject * c_char_p_from_param(PyObject *type, PyObject *value) { + PyObject *as_parameter; #if (PYTHON_API_VERSION < 1012) # error not supported #endif @@ -1154,6 +1231,13 @@ return value; } } + + as_parameter = PyObject_GetAttrString(value, "_as_parameter_"); + if (as_parameter) { + value = c_char_p_from_param(type, as_parameter); + Py_DECREF(as_parameter); + return value; + } /* XXX better message */ PyErr_SetString(PyExc_TypeError, "wrong type"); @@ -1164,6 +1248,7 @@ c_void_p_from_param(PyObject *type, PyObject *value) { StgDictObject *stgd; + PyObject *as_parameter; #if (PYTHON_API_VERSION < 1012) # error not supported #endif @@ -1275,6 +1360,13 @@ return (PyObject *)parg; } } + + as_parameter = PyObject_GetAttrString(value, "_as_parameter_"); + if (as_parameter) { + value = c_void_p_from_param(type, as_parameter); + Py_DECREF(as_parameter); + return value; + } /* XXX better message */ PyErr_SetString(PyExc_TypeError, "wrong type"); @@ -1361,6 +1453,33 @@ return (PyObject *)result; } +static PyCArgObject * +SimpleType_paramfunc(CDataObject *self) +{ + StgDictObject *dict; + char *fmt; + PyCArgObject *parg; + struct fielddesc *fd; + + dict = PyObject_stgdict((PyObject *)self); + assert(dict); + fmt = PyString_AsString(dict->proto); + assert(fmt); + + fd = getentry(fmt); + assert(fd); + + parg = new_CArgObject(); + if (parg == NULL) + return NULL; + + parg->tag = fmt[0]; + parg->pffi_type = fd->pffi_type; + Py_INCREF(self); + parg->obj = (PyObject *)self; + memcpy(&parg->value, self->b_ptr, self->b_size); + return parg; +} static PyObject * SimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds) @@ -1410,6 +1529,8 @@ stgdict->size = fmt->pffi_type->size; stgdict->setfunc = fmt->setfunc; stgdict->getfunc = fmt->getfunc; + + stgdict->paramfunc = SimpleType_paramfunc; /* if (result->tp_base != &Simple_Type) { stgdict->setfunc = NULL; @@ -1508,23 +1629,6 @@ /* * This is a *class method*. * Convert a parameter into something that ConvParam can handle. - * - * This is either an instance of the requested type, a Python integer, or a - * 'magic' 3-tuple. - * - * (These are somewhat related to Martin v. Loewis 'Enhanced Argument Tuples', - * described in PEP 286.) - * - * The tuple must contain - * - * - a format character, currently 'ifdqc' are understood - * which will inform ConvParam about how to push the argument on the stack. - * - * - a corresponding Python object: i - integer, f - float, d - float, - * q - longlong, c - integer - * - * - any object which can be used to keep the original parameter alive - * as long as the tuple lives. */ static PyObject * SimpleType_from_param(PyObject *type, PyObject *value) @@ -1533,6 +1637,7 @@ char *fmt; PyCArgObject *parg; struct fielddesc *fd; + PyObject *as_parameter; /* If the value is already an instance of the requested type, we can use it as is */ @@ -1558,11 +1663,20 @@ parg->tag = fmt[0]; parg->pffi_type = fd->pffi_type; parg->obj = fd->setfunc(&parg->value, value, 0); - if (parg->obj == NULL) { - Py_DECREF(parg); - return NULL; + if (parg->obj) + return (PyObject *)parg; + PyErr_Clear(); + Py_DECREF(parg); + + as_parameter = PyObject_GetAttrString(value, "_as_parameter_"); + if (as_parameter) { + value = SimpleType_from_param(type, as_parameter); + Py_DECREF(as_parameter); + return value; } - return (PyObject *)parg; + PyErr_SetString(PyExc_TypeError, + "wrong type"); + return NULL; } static PyMethodDef SimpleType_methods[] = { @@ -1727,6 +1841,23 @@ } +static PyCArgObject * +CFuncPtrType_paramfunc(CDataObject *self) +{ + PyCArgObject *parg; + + parg = new_CArgObject(); + if (parg == NULL) + return NULL; + + parg->tag = 'P'; + parg->pffi_type = &ffi_type_pointer; + Py_INCREF(self); + parg->obj = (PyObject *)self; + parg->value.p = *(void **)self->b_ptr; + return parg; +} + static PyObject * CFuncPtrType_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { @@ -1738,6 +1869,8 @@ if (!stgdict) return NULL; + stgdict->paramfunc = CFuncPtrType_paramfunc; + /* create the new instance (which is a class, since we are a metatype!) */ result = (PyTypeObject *)PyType_Type.tp_new(type, args, kwds); @@ -2314,23 +2447,6 @@ CFuncPtr_Type */ -static PyObject * -CFuncPtr_as_parameter(CDataObject *self) -{ - PyCArgObject *parg; - - parg = new_CArgObject(); - if (parg == NULL) - return NULL; - - parg->tag = 'P'; - parg->pffi_type = &ffi_type_pointer; - Py_INCREF(self); - parg->obj = (PyObject *)self; - parg->value.p = *(void **)self->b_ptr; - return (PyObject *)parg; -} - static int CFuncPtr_set_errcheck(CFuncPtrObject *self, PyObject *ob) { @@ -2450,9 +2566,6 @@ { "argtypes", (getter)CFuncPtr_get_argtypes, (setter)CFuncPtr_set_argtypes, "specify the argument types", NULL }, - { "_as_parameter_", (getter)CFuncPtr_as_parameter, NULL, - "return a magic value so that this can be converted to a C parameter (readonly)", - NULL }, { NULL, NULL } }; @@ -3361,30 +3474,6 @@ return -1; } -static PyObject * -Struct_as_parameter(CDataObject *self) -{ - PyCArgObject *parg; - StgDictObject *stgdict; - - parg = new_CArgObject(); - if (parg == NULL) - return NULL; - - parg->tag = 'V'; - stgdict = PyObject_stgdict((PyObject *)self); - parg->pffi_type = &stgdict->ffi_type_pointer; - /* For structure parameters (by value), parg->value doesn't contain the structure - data itself, instead parg->value.p *points* to the structure's data - See also _ctypes.c, function _call_function_pointer(). - */ - parg->value.p = self->b_ptr; - parg->size = self->b_size; - Py_INCREF(self); - parg->obj = (PyObject *)self; - return (PyObject *)parg; -} - static int Struct_init(PyObject *self, PyObject *args, PyObject *kwds) { @@ -3459,13 +3548,6 @@ return 0; } -static PyGetSetDef Struct_getsets[] = { - { "_as_parameter_", (getter)Struct_as_parameter, NULL, - "return a magic value so that this can be converted to a C parameter (readonly)", - NULL }, - { NULL, NULL } -}; - static PyTypeObject Struct_Type = { PyObject_HEAD_INIT(NULL) 0, @@ -3497,7 +3579,7 @@ 0, /* tp_iternext */ 0, /* tp_methods */ 0, /* tp_members */ - Struct_getsets, /* tp_getset */ + 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ @@ -3540,7 +3622,7 @@ 0, /* tp_iternext */ 0, /* tp_methods */ 0, /* tp_members */ - Struct_getsets, /* tp_getset */ + 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ @@ -3738,26 +3820,6 @@ 0, /* sq_inplace_repeat; */ }; -static PyObject * -Array_as_parameter(CDataObject *self) -{ - PyCArgObject *p = new_CArgObject(); - if (p == NULL) - return NULL; - p->tag = 'P'; - p->pffi_type = &ffi_type_pointer; - p->value.p = (char *)self->b_ptr; - Py_INCREF(self); - p->obj = (PyObject *)self; - return (PyObject *)p; -} - -static PyGetSetDef Array_getsets[] = { - { "_as_parameter_", (getter)Array_as_parameter, - (setter)NULL, "convert to a parameter", NULL }, - { NULL }, -}; - PyTypeObject Array_Type = { PyObject_HEAD_INIT(NULL) 0, @@ -3789,7 +3851,7 @@ 0, /* tp_iternext */ 0, /* tp_methods */ 0, /* tp_members */ - Array_getsets, /* tp_getset */ + 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ @@ -3903,35 +3965,9 @@ return dict->getfunc(self->b_ptr, self->b_size); } -static PyObject * -Simple_as_parameter(CDataObject *self) -{ - StgDictObject *dict = PyObject_stgdict((PyObject *)self); - char *fmt = PyString_AsString(dict->proto); - PyCArgObject *parg; - struct fielddesc *fd; - - fd = getentry(fmt); - assert(fd); - - parg = new_CArgObject(); - if (parg == NULL) - return NULL; - - parg->tag = fmt[0]; - parg->pffi_type = fd->pffi_type; - Py_INCREF(self); - parg->obj = (PyObject *)self; - memcpy(&parg->value, self->b_ptr, self->b_size); - return (PyObject *)parg; -} - static PyGetSetDef Simple_getsets[] = { { "value", (getter)Simple_get_value, (setter)Simple_set_value, "current value", NULL }, - { "_as_parameter_", (getter)Simple_as_parameter, NULL, - "return a magic value so that this can be converted to a C parameter (readonly)", - NULL }, { NULL, NULL } }; @@ -4206,30 +4242,10 @@ return KeepRef(self, 0, keep); } -static PyObject * -Pointer_as_parameter(CDataObject *self) -{ - PyCArgObject *parg; - - parg = new_CArgObject(); - if (parg == NULL) - return NULL; - - parg->tag = 'P'; - parg->pffi_type = &ffi_type_pointer; - Py_INCREF(self); - parg->obj = (PyObject *)self; - parg->value.p = *(void **)self->b_ptr; - return (PyObject *)parg; -} - static PyGetSetDef Pointer_getsets[] = { { "contents", (getter)Pointer_get_contents, (setter)Pointer_set_contents, "the object this pointer points to (read-write)", NULL }, - { "_as_parameter_", (getter)Pointer_as_parameter, NULL, - "return a magic value so that this can be converted to a C parameter (readonly)", - NULL }, { NULL, NULL } }; @@ -4690,7 +4706,7 @@ #endif PyModule_AddObject(m, "FUNCFLAG_CDECL", PyInt_FromLong(FUNCFLAG_CDECL)); PyModule_AddObject(m, "FUNCFLAG_PYTHONAPI", PyInt_FromLong(FUNCFLAG_PYTHONAPI)); - PyModule_AddStringConstant(m, "__version__", "1.0.0"); + PyModule_AddStringConstant(m, "__version__", "1.0.1"); PyModule_AddObject(m, "_memmove_addr", PyLong_FromVoidPtr(memmove)); PyModule_AddObject(m, "_memset_addr", PyLong_FromVoidPtr(memset)); Modified: python/trunk/Modules/_ctypes/callproc.c ============================================================================== --- python/trunk/Modules/_ctypes/callproc.c (original) +++ python/trunk/Modules/_ctypes/callproc.c Mon Aug 14 13:17:48 2006 @@ -465,7 +465,21 @@ */ static int ConvParam(PyObject *obj, int index, struct argument *pa) { + StgDictObject *dict; pa->keep = NULL; /* so we cannot forget it later */ + + dict = PyObject_stgdict(obj); + if (dict) { + PyCArgObject *carg; + assert(dict->paramfunc); + /* If it has an stgdict, it is a CDataObject */ + carg = dict->paramfunc((CDataObject *)obj); + pa->ffi_type = carg->pffi_type; + memcpy(&pa->value, &carg->value, sizeof(pa->value)); + pa->keep = (PyObject *)carg; + return 0; + } + if (PyCArg_CheckExact(obj)) { PyCArgObject *carg = (PyCArgObject *)obj; pa->ffi_type = carg->pffi_type; @@ -548,25 +562,12 @@ as parameters (they have to expose the '_as_parameter_' attribute) */ - if (arg == 0) { - PyErr_Format(PyExc_TypeError, - "Don't know how to convert parameter %d", index); - return -1; - } - if (PyCArg_CheckExact(arg)) { - PyCArgObject *carg = (PyCArgObject *)arg; - pa->ffi_type = carg->pffi_type; - memcpy(&pa->value, &carg->value, sizeof(pa->value)); - pa->keep = arg; - return 0; - } - if (PyInt_Check(arg)) { - pa->ffi_type = &ffi_type_sint; - pa->value.i = PyInt_AS_LONG(arg); - pa->keep = arg; - return 0; + if (arg) { + int result; + result = ConvParam(arg, index, pa); + Py_DECREF(arg); + return result; } - Py_DECREF(arg); PyErr_Format(PyExc_TypeError, "Don't know how to convert parameter %d", index); return -1; Modified: python/trunk/Modules/_ctypes/ctypes.h ============================================================================== --- python/trunk/Modules/_ctypes/ctypes.h (original) +++ python/trunk/Modules/_ctypes/ctypes.h Mon Aug 14 13:17:48 2006 @@ -23,9 +23,11 @@ #define PY_LONG_LONG LONG_LONG #endif +typedef struct tagPyCArgObject PyCArgObject; typedef struct tagCDataObject CDataObject; typedef PyObject *(* GETFUNC)(void *, unsigned size); typedef PyObject *(* SETFUNC)(void *, PyObject *value, unsigned size); +typedef PyCArgObject *(* PARAMFUNC)(CDataObject *obj); /* A default buffer in CDataObject, which can be used for small C types. If this buffer is too small, PyMem_Malloc will be called to create a larger one, @@ -205,6 +207,7 @@ PyObject *proto; /* Only for Pointer/ArrayObject */ SETFUNC setfunc; /* Only for simple objects */ GETFUNC getfunc; /* Only for simple objects */ + PARAMFUNC paramfunc; /* Following fields only used by CFuncPtrType_Type instances */ PyObject *argtypes; /* tuple of CDataObjects */ @@ -283,7 +286,7 @@ #define DICTFLAG_FINAL 0x1000 -typedef struct { +struct tagPyCArgObject { PyObject_HEAD ffi_type *pffi_type; char tag; @@ -302,7 +305,7 @@ } value; PyObject *obj; int size; /* for the 'V' tag */ -} PyCArgObject; +}; extern PyTypeObject PyCArg_Type; extern PyCArgObject *new_CArgObject(void); From buildbot at python.org Mon Aug 14 13:18:44 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 11:18:44 +0000 Subject: [Python-checkins] buildbot warnings in x86 gentoo trunk Message-ID: <20060814111844.67A801E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520gentoo%2520trunk/builds/1504 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Mon Aug 14 13:18:58 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 11:18:58 +0000 Subject: [Python-checkins] buildbot warnings in x86 W2k trunk Message-ID: <20060814111858.89DD51E4002@bag.python.org> The Buildbot has detected a new failure of x86 W2k trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%2520trunk/builds/1411 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Mon Aug 14 13:19:24 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 11:19:24 +0000 Subject: [Python-checkins] buildbot warnings in amd64 gentoo trunk Message-ID: <20060814111924.D98D11E4002@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%2520gentoo%2520trunk/builds/1421 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Mon Aug 14 13:20:00 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 11:20:00 +0000 Subject: [Python-checkins] buildbot warnings in x86 OpenBSD trunk Message-ID: <20060814112000.2E26A1E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%2520trunk/builds/1183 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From ncoghlan at gmail.com Mon Aug 14 13:24:33 2006 From: ncoghlan at gmail.com (Nick Coghlan) Date: Mon, 14 Aug 2006 21:24:33 +1000 Subject: [Python-checkins] r51276 - in python/trunk: Doc/api/concrete.tex Doc/api/exceptions.tex Doc/lib/libexcs.tex Doc/lib/libwarnings.tex Include/pyerrors.h Include/unicodeobject.h Lib/test/exception_hierarchy.txt Misc/NEWS Objects/exceptions.c Objects/object.c Objects/unicodeobject.c In-Reply-To: <20060814105521.1401B1E4002@bag.python.org> References: <20060814105521.1401B1E4002@bag.python.org> Message-ID: <44E05D71.508@gmail.com> marc-andre.lemburg wrote: > Modified: python/trunk/Misc/NEWS > ============================================================================== > --- python/trunk/Misc/NEWS (original) > +++ python/trunk/Misc/NEWS Mon Aug 14 12:55:19 2006 > @@ -12,18 +12,18 @@ > Core and builtins > ----------------- > > -- Fix segfault when doing string formatting on subclasses of long. > +- Unicode objects will no longer raise an exception when being > + compared equal or unequal to a string and causing a > + UnicodeDecodeError exception, e.g. as result of a decoding failure. > + > + Instead, the equal (==) and unequal (!=) comparison operators will > + now issue a UnicodeWarning and interpret the two objects as > + unequal. The UnicodeWarning can be filtered as desired using > + the warning framework, e.g. silenced completely, turned into an > + exception, logged, etc. > > -- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines > - with new-style classes. > - > -- Fix bug related to __len__ functions returning negative values with > - classic classes. > - > -- Patch #1538606, Fix __index__() clipping. There were some problems > - discovered with the API and how integers that didn't fit into Py_ssize_t > - were handled. This patch attempts to provide enough alternatives > - to effectively use __index__. > + Note that compare operators other than equal and unequal will still > + raise UnicodeDecodeError exceptions as they've always done. This looks like it lost a bunch of NEWS entries. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org From buildbot at python.org Mon Aug 14 13:33:13 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 11:33:13 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP trunk Message-ID: <20060814113313.4AD811E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%2520trunk/builds/1365 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Mon Aug 14 13:36:02 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 11:36:02 +0000 Subject: [Python-checkins] buildbot warnings in sparc solaris10 gcc trunk Message-ID: <20060814113602.7A3801E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520solaris10%2520gcc%2520trunk/builds/1361 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Mon Aug 14 13:39:25 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 11:39:25 +0000 Subject: [Python-checkins] buildbot warnings in g4 osx.4 trunk Message-ID: <20060814113926.016AA1E4002@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/g4%2520osx.4%2520trunk/builds/1349 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From mal at egenix.com Mon Aug 14 13:40:55 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 14 Aug 2006 13:40:55 +0200 Subject: [Python-checkins] r51276 - in python/trunk: Doc/api/concrete.tex Doc/api/exceptions.tex Doc/lib/libexcs.tex Doc/lib/libwarnings.tex Include/pyerrors.h Include/unicodeobject.h Lib/test/exception_hierarchy.txt Misc/NEWS Objects/exceptions.c Objects/object.c Objects/unicodeobject.c In-Reply-To: <44E05D71.508@gmail.com> References: <20060814105521.1401B1E4002@bag.python.org> <44E05D71.508@gmail.com> Message-ID: <44E06147.901@egenix.com> Nick Coghlan wrote: > marc-andre.lemburg wrote: >> Modified: python/trunk/Misc/NEWS >> ============================================================================== >> --- python/trunk/Misc/NEWS (original) >> +++ python/trunk/Misc/NEWS Mon Aug 14 12:55:19 2006 >> @@ -12,18 +12,18 @@ >> Core and builtins >> ----------------- >> >> -- Fix segfault when doing string formatting on subclasses of long. >> +- Unicode objects will no longer raise an exception when being >> + compared equal or unequal to a string and causing a >> + UnicodeDecodeError exception, e.g. as result of a decoding failure. >> + >> + Instead, the equal (==) and unequal (!=) comparison operators will >> + now issue a UnicodeWarning and interpret the two objects as >> + unequal. The UnicodeWarning can be filtered as desired using >> + the warning framework, e.g. silenced completely, turned into an >> + exception, logged, etc. >> >> -- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines >> - with new-style classes. >> - >> -- Fix bug related to __len__ functions returning negative values with >> - classic classes. >> - >> -- Patch #1538606, Fix __index__() clipping. There were some problems >> - discovered with the API and how integers that didn't fit into Py_ssize_t >> - were handled. This patch attempts to provide enough alternatives >> - to effectively use __index__. >> + Note that compare operators other than equal and unequal will still >> + raise UnicodeDecodeError exceptions as they've always done. > > This looks like it lost a bunch of NEWS entries. Good catch. Thanks. I'll readd those entries. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 14 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From python-checkins at python.org Mon Aug 14 13:44:35 2006 From: python-checkins at python.org (marc-andre.lemburg) Date: Mon, 14 Aug 2006 13:44:35 +0200 (CEST) Subject: [Python-checkins] r51278 - python/trunk/Misc/NEWS Message-ID: <20060814114435.0B0F71E4002@bag.python.org> Author: marc-andre.lemburg Date: Mon Aug 14 13:44:34 2006 New Revision: 51278 Modified: python/trunk/Misc/NEWS Log: Readd NEWS items that were accidentally removed by r51276. Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Aug 14 13:44:34 2006 @@ -25,6 +25,19 @@ Note that compare operators other than equal and unequal will still raise UnicodeDecodeError exceptions as they've always done. +- Fix segfault when doing string formatting on subclasses of long. + +- Fix bug related to __len__ functions using values > 2**32 on 64-bit machines + with new-style classes. + +- Fix bug related to __len__ functions returning negative values with + classic classes. + +- Patch #1538606, Fix __index__() clipping. There were some problems + discovered with the API and how integers that didn't fit into Py_ssize_t + were handled. This patch attempts to provide enough alternatives + to effectively use __index__. + - Bug #1536021: __hash__ may now return long int; the final hash value is obtained by invoking hash on the long int. From buildbot at python.org Mon Aug 14 13:46:00 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 11:46:00 +0000 Subject: [Python-checkins] buildbot warnings in ia64 Ubuntu trunk trunk Message-ID: <20060814114600.4A3F51E4002@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu trunk trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%2520Ubuntu%2520trunk%2520trunk/builds/16 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Mon Aug 14 13:55:31 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 11:55:31 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian trunk Message-ID: <20060814115531.E094E1E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%2520trunk/builds/406 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Mon Aug 14 13:56:19 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 11:56:19 +0000 Subject: [Python-checkins] buildbot warnings in S-390 Debian trunk Message-ID: <20060814115619.639A41E4002@bag.python.org> The Buildbot has detected a new failure of S-390 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%2520Debian%2520trunk/builds/315 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From g.brandl at gmx.net Mon Aug 14 14:25:43 2006 From: g.brandl at gmx.net (Georg Brandl) Date: Mon, 14 Aug 2006 14:25:43 +0200 Subject: [Python-checkins] r51276 - in python/trunk: Doc/api/concrete.tex Doc/api/exceptions.tex Doc/lib/libexcs.tex Doc/lib/libwarnings.tex Include/pyerrors.h Include/unicodeobject.h Lib/test/exception_hierarchy.txt Misc/NEWS Objects/exceptions.c Objects/object.c Objects/unicodeobject.c In-Reply-To: <20060814105521.1401B1E4002@bag.python.org> References: <20060814105521.1401B1E4002@bag.python.org> Message-ID: marc-andre.lemburg wrote: > Modified: python/trunk/Objects/unicodeobject.c > ============================================================================== > --- python/trunk/Objects/unicodeobject.c (original) > +++ python/trunk/Objects/unicodeobject.c Mon Aug 14 12:55:19 2006 > @@ -6985,11 +7061,14 @@ > PyUnicode_Contains, /* sq_contains */ > }; > > +#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX) > + > static PyObject* > unicode_subscript(PyUnicodeObject* self, PyObject* item) > { > - if (PyIndex_Check(item)) { > - Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); > + PyNumberMethods *nb = item->ob_type->tp_as_number; > + if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { > + Py_ssize_t i = nb->nb_index(item); > if (i == -1 && PyErr_Occurred()) > return NULL; > if (i < 0) This hunk must be reverted. The new code was introduced as part of the new __index__ handling in rev. 51236, and your patch reverted it, just like the NEWS entries. (This is causing all the buildbot failures) Georg From buildbot at python.org Mon Aug 14 14:34:01 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 12:34:01 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060814123401.4AB2C1E400A@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/17 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Mon Aug 14 14:36:09 2006 From: python-checkins at python.org (georg.brandl) Date: Mon, 14 Aug 2006 14:36:09 +0200 (CEST) Subject: [Python-checkins] r51279 - python/trunk/Doc/api/concrete.tex Message-ID: <20060814123609.C120F1E4015@bag.python.org> Author: georg.brandl Date: Mon Aug 14 14:36:06 2006 New Revision: 51279 Modified: python/trunk/Doc/api/concrete.tex Log: Improve markup in PyUnicode_RichCompare. Modified: python/trunk/Doc/api/concrete.tex ============================================================================== --- python/trunk/Doc/api/concrete.tex (original) +++ python/trunk/Doc/api/concrete.tex Mon Aug 14 14:36:06 2006 @@ -1564,25 +1564,20 @@ PyObject *right, int op} -% This entry could use some polishing - my TeX is too -% rusty these days... (MAL) - - Rich compare two strings and return one of the following: -\begin{verbatim} - - NULL in case an exception was raised - - Py_True or Py_False for successfuly comparisons - - Py_NotImplemented in case the type combination is unknown -\end{verbatim} - - Note that Py_EQ and Py_NE comparisons can cause a UnicodeWarning in - case the conversion of the arguments to Unicode fails with a - UnicodeDecodeError. - - Possible values for \var{op}: -\begin{verbatim} - Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE -\end{verbatim} - + Rich compare two unicode strings and return one of the following: + \begin{itemize} + \item \code{NULL} in case an exception was raised + \item \constant{Py_True} or \constant{Py_False} for successful comparisons + \item \constant{Py_NotImplemented} in case the type combination is unknown + \end{itemize} + + Note that \constant{Py_EQ} and \constant{Py_NE} comparisons can cause a + \exception{UnicodeWarning} in case the conversion of the arguments to + Unicode fails with a \exception{UnicodeDecodeError}. + + Possible values for \var{op} are + \constant{Py_GT}, \constant{Py_GE}, \constant{Py_EQ}, + \constant{Py_NE}, \constant{Py_LT}, and \constant{Py_LE}. \end{cfuncdesc} \begin{cfuncdesc}{PyObject*}{PyUnicode_Format}{PyObject *format, From mal at egenix.com Mon Aug 14 14:54:31 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 14 Aug 2006 14:54:31 +0200 Subject: [Python-checkins] r51276 - in python/trunk: Doc/api/concrete.tex Doc/api/exceptions.tex Doc/lib/libexcs.tex Doc/lib/libwarnings.tex Include/pyerrors.h Include/unicodeobject.h Lib/test/exception_hierarchy.txt Misc/NEWS Objects/exceptions.c Objects/object.c Objects/unicodeobject.c In-Reply-To: References: <20060814105521.1401B1E4002@bag.python.org> Message-ID: <44E07287.1030902@egenix.com> Georg Brandl wrote: > marc-andre.lemburg wrote: > >> Modified: python/trunk/Objects/unicodeobject.c >> ============================================================================== >> --- python/trunk/Objects/unicodeobject.c (original) >> +++ python/trunk/Objects/unicodeobject.c Mon Aug 14 12:55:19 2006 > >> @@ -6985,11 +7061,14 @@ >> PyUnicode_Contains, /* sq_contains */ >> }; >> >> +#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX) >> + >> static PyObject* >> unicode_subscript(PyUnicodeObject* self, PyObject* item) >> { >> - if (PyIndex_Check(item)) { >> - Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); >> + PyNumberMethods *nb = item->ob_type->tp_as_number; >> + if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { >> + Py_ssize_t i = nb->nb_index(item); >> if (i == -1 && PyErr_Occurred()) >> return NULL; >> if (i < 0) > > This hunk must be reverted. The new code was introduced as part of the new > __index__ handling in rev. 51236, and your patch reverted it, just like the > NEWS entries. (This is causing all the buildbot failures) Hmm, thanks. I'll correct this now. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 14 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From python-checkins at python.org Mon Aug 14 14:57:28 2006 From: python-checkins at python.org (marc-andre.lemburg) Date: Mon, 14 Aug 2006 14:57:28 +0200 (CEST) Subject: [Python-checkins] r51280 - python/trunk/Objects/unicodeobject.c Message-ID: <20060814125728.40EED1E4002@bag.python.org> Author: marc-andre.lemburg Date: Mon Aug 14 14:57:27 2006 New Revision: 51280 Modified: python/trunk/Objects/unicodeobject.c Log: Correct an accidentally removed previous patch. Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Mon Aug 14 14:57:27 2006 @@ -7061,14 +7061,11 @@ PyUnicode_Contains, /* sq_contains */ }; -#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX) - static PyObject* unicode_subscript(PyUnicodeObject* self, PyObject* item) { - PyNumberMethods *nb = item->ob_type->tp_as_number; - if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { - Py_ssize_t i = nb->nb_index(item); + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) return NULL; if (i < 0) From mal at egenix.com Mon Aug 14 14:59:47 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 14 Aug 2006 14:59:47 +0200 Subject: [Python-checkins] r51276 - in python/trunk: Doc/api/concrete.tex Doc/api/exceptions.tex Doc/lib/libexcs.tex Doc/lib/libwarnings.tex Include/pyerrors.h Include/unicodeobject.h Lib/test/exception_hierarchy.txt Misc/NEWS Objects/exceptions.c Objects/object.c Objects/unicodeobject.c In-Reply-To: <44E07287.1030902@egenix.com> References: <20060814105521.1401B1E4002@bag.python.org> <44E07287.1030902@egenix.com> Message-ID: <44E073C3.1020603@egenix.com> M.-A. Lemburg wrote: > Georg Brandl wrote: >> marc-andre.lemburg wrote: >> >>> Modified: python/trunk/Objects/unicodeobject.c >>> ============================================================================== >>> --- python/trunk/Objects/unicodeobject.c (original) >>> +++ python/trunk/Objects/unicodeobject.c Mon Aug 14 12:55:19 2006 >>> @@ -6985,11 +7061,14 @@ >>> PyUnicode_Contains, /* sq_contains */ >>> }; >>> >>> +#define HASINDEX(o) PyType_HasFeature((o)->ob_type, Py_TPFLAGS_HAVE_INDEX) >>> + >>> static PyObject* >>> unicode_subscript(PyUnicodeObject* self, PyObject* item) >>> { >>> - if (PyIndex_Check(item)) { >>> - Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); >>> + PyNumberMethods *nb = item->ob_type->tp_as_number; >>> + if (nb != NULL && HASINDEX(item) && nb->nb_index != NULL) { >>> + Py_ssize_t i = nb->nb_index(item); >>> if (i == -1 && PyErr_Occurred()) >>> return NULL; >>> if (i < 0) >> This hunk must be reverted. The new code was introduced as part of the new >> __index__ handling in rev. 51236, and your patch reverted it, just like the >> NEWS entries. (This is causing all the buildbot failures) > > Hmm, thanks. I'll correct this now. My patch creation setup must have picked up an updated checkout and then created these reversals. I'll double-check the checkin diff if there are more instances of this. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 14 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Aug 14 15:07:44 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 14 Aug 2006 15:07:44 +0200 Subject: [Python-checkins] r51276 - in python/trunk: Doc/api/concrete.tex Doc/api/exceptions.tex Doc/lib/libexcs.tex Doc/lib/libwarnings.tex Include/pyerrors.h Include/unicodeobject.h Lib/test/exception_hierarchy.txt Misc/NEWS Objects/exceptions.c Objects/object.c Objects/unicodeobject.c In-Reply-To: <44E073C3.1020603@egenix.com> References: <20060814105521.1401B1E4002@bag.python.org> <44E07287.1030902@egenix.com> <44E073C3.1020603@egenix.com> Message-ID: <44E075A0.7020007@egenix.com> M.-A. Lemburg wrote: > My patch creation setup must have picked up an updated checkout > and then created these reversals. > > I'll double-check the checkin diff if there are more instances > of this. I checked and found that these two were the only reversals. Thanks for picking them up. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 14 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From buildbot at python.org Mon Aug 14 15:14:50 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 13:14:50 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060814131450.37A271E4002@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/492 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg,thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Mon Aug 14 15:15:38 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 13:15:38 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060814131539.0ABD61E4002@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1080 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Mon Aug 14 18:17:42 2006 From: python-checkins at python.org (thomas.heller) Date: Mon, 14 Aug 2006 18:17:42 +0200 (CEST) Subject: [Python-checkins] r51281 - python/trunk/Modules/_ctypes/libffi/configure python/trunk/Modules/_ctypes/libffi/configure.ac python/trunk/Modules/_ctypes/libffi/fficonfig.py.in Message-ID: <20060814161742.1E4CF1E4002@bag.python.org> Author: thomas.heller Date: Mon Aug 14 18:17:41 2006 New Revision: 51281 Modified: python/trunk/Modules/_ctypes/libffi/configure python/trunk/Modules/_ctypes/libffi/configure.ac python/trunk/Modules/_ctypes/libffi/fficonfig.py.in Log: Patch #1536908: Add support for AMD64 / OpenBSD. Remove the -no-stack-protector compiler flag for OpenBSD as it has been reported to be unneeded. Modified: python/trunk/Modules/_ctypes/libffi/configure ============================================================================== --- python/trunk/Modules/_ctypes/libffi/configure (original) +++ python/trunk/Modules/_ctypes/libffi/configure Mon Aug 14 18:17:41 2006 @@ -3470,6 +3470,7 @@ TARGETDIR="unknown" case "$host" in +x86_64-*-openbsd*) TARGET=X86_64; TARGETDIR=x86;; mips*-*-openbsd*) TARGET=MIPS; TARGETDIR=mips;; sparc-*-openbsd*) TARGET=SPARC; TARGETDIR=sparc;; sparc64-*-openbsd*) TARGET=SPARC; TARGETDIR=sparc;; Modified: python/trunk/Modules/_ctypes/libffi/configure.ac ============================================================================== --- python/trunk/Modules/_ctypes/libffi/configure.ac (original) +++ python/trunk/Modules/_ctypes/libffi/configure.ac Mon Aug 14 18:17:41 2006 @@ -21,6 +21,7 @@ TARGETDIR="unknown" case "$host" in +x86_64-*-openbsd*) TARGET=X86_64; TARGETDIR=x86;; mips*-*-openbsd*) TARGET=MIPS; TARGETDIR=mips;; sparc-*-openbsd*) TARGET=SPARC; TARGETDIR=sparc;; sparc64-*-openbsd*) TARGET=SPARC; TARGETDIR=sparc;; Modified: python/trunk/Modules/_ctypes/libffi/fficonfig.py.in ============================================================================== --- python/trunk/Modules/_ctypes/libffi/fficonfig.py.in (original) +++ python/trunk/Modules/_ctypes/libffi/fficonfig.py.in Mon Aug 14 18:17:41 2006 @@ -43,6 +43,3 @@ ffi_sources = [os.path.join('@srcdir@', f) for f in ffi_sources] ffi_cflags = '@CFLAGS@' -# I think this may no longer be needed: -if sys.platform == "openbsd3": - ffi_cflags += " -fno-stack-protector" From python-checkins at python.org Mon Aug 14 18:20:07 2006 From: python-checkins at python.org (thomas.heller) Date: Mon, 14 Aug 2006 18:20:07 +0200 (CEST) Subject: [Python-checkins] r51282 - python/trunk/Misc/NEWS Message-ID: <20060814162007.9D3CD1E4002@bag.python.org> Author: thomas.heller Date: Mon Aug 14 18:20:04 2006 New Revision: 51282 Modified: python/trunk/Misc/NEWS Log: News item for rev 51281. Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Aug 14 18:20:04 2006 @@ -79,6 +79,9 @@ Extension Modules ----------------- +- Patch # 1536908: enable building ctypes on OpenBSD/AMD64. The + '-no-stack-protector' compiler flag for OpenBSD has been removed. + - Patch #1532975 was applied, which fixes Bug #1533481: ctypes now uses the _as_parameter_ attribute when objects are passed to foreign function calls. The ctypes version number was changed to 1.0.1. From buildbot at python.org Mon Aug 14 18:45:35 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 16:45:35 +0000 Subject: [Python-checkins] buildbot warnings in sparc Ubuntu dapper trunk Message-ID: <20060814164535.A86051E400C@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520Ubuntu%2520dapper%2520trunk/builds/639 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl,marc-andre.lemburg,thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From neal at metaslash.com Mon Aug 14 11:10:08 2006 From: neal at metaslash.com (Neal Norwitz) Date: Mon, 14 Aug 2006 05:10:08 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20060814091008.GA19471@python.psfb.org> test_cmd_line leaked [-17, 0, 17] references test_format leaked [1, 1, 1] references From neal at metaslash.com Sun Aug 13 23:09:33 2006 From: neal at metaslash.com (Neal Norwitz) Date: Sun, 13 Aug 2006 17:09:33 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20060813210933.GA10541@python.psfb.org> test_cmd_line leaked [0, 17, 0] references test_format leaked [1, 1, 1] references From python-checkins at python.org Mon Aug 14 22:25:40 2006 From: python-checkins at python.org (georg.brandl) Date: Mon, 14 Aug 2006 22:25:40 +0200 (CEST) Subject: [Python-checkins] r51283 - python/trunk/Objects/stringobject.c Message-ID: <20060814202540.9D5671E4002@bag.python.org> Author: georg.brandl Date: Mon Aug 14 22:25:39 2006 New Revision: 51283 Modified: python/trunk/Objects/stringobject.c Log: Fix refleak introduced in rev. 51248. Modified: python/trunk/Objects/stringobject.c ============================================================================== --- python/trunk/Objects/stringobject.c (original) +++ python/trunk/Objects/stringobject.c Mon Aug 14 22:25:39 2006 @@ -4226,8 +4226,10 @@ return NULL; buf = PyString_AsString(result); - if (!buf) + if (!buf) { + Py_DECREF(result); return NULL; + } /* To modify the string in-place, there can only be one reference. */ if (result->ob_refcnt != 1) { From python-checkins at python.org Mon Aug 14 23:34:09 2006 From: python-checkins at python.org (georg.brandl) Date: Mon, 14 Aug 2006 23:34:09 +0200 (CEST) Subject: [Python-checkins] r51284 - in python/trunk/Lib: tabnanny.py test/inspect_fodder2.py test/test_inspect.py tokenize.py Message-ID: <20060814213409.02BA31E4003@bag.python.org> Author: georg.brandl Date: Mon Aug 14 23:34:08 2006 New Revision: 51284 Modified: python/trunk/Lib/tabnanny.py python/trunk/Lib/test/inspect_fodder2.py python/trunk/Lib/test/test_inspect.py python/trunk/Lib/tokenize.py Log: Make tabnanny recognize IndentationErrors raised by tokenize. Add a test to test_inspect to make sure indented source is recognized correctly. (fixes #1224621) Modified: python/trunk/Lib/tabnanny.py ============================================================================== --- python/trunk/Lib/tabnanny.py (original) +++ python/trunk/Lib/tabnanny.py Mon Aug 14 23:34:08 2006 @@ -109,6 +109,10 @@ errprint("%r: Token Error: %s" % (file, msg)) return + except IndentationError, msg: + errprint("%r: Indentation Error: %s" % (file, msg)) + return + except NannyNag, nag: badline = nag.get_lineno() line = nag.get_line() Modified: python/trunk/Lib/test/inspect_fodder2.py ============================================================================== --- python/trunk/Lib/test/inspect_fodder2.py (original) +++ python/trunk/Lib/test/inspect_fodder2.py Mon Aug 14 23:34:08 2006 @@ -88,3 +88,12 @@ def func88(): # comment return 90 + +# line 92 +def f(): + class X: + def g(): + "doc" + return 42 + return X +method_in_dynamic_class = f().g.im_func Modified: python/trunk/Lib/test/test_inspect.py ============================================================================== --- python/trunk/Lib/test/test_inspect.py (original) +++ python/trunk/Lib/test/test_inspect.py Mon Aug 14 23:34:08 2006 @@ -274,6 +274,9 @@ def test_with_comment_instead_of_docstring(self): self.assertSourceEqual(mod2.func88, 88, 90) + def test_method_in_dynamic_class(self): + self.assertSourceEqual(mod2.method_in_dynamic_class, 95, 97) + # Helper for testing classify_class_attrs. def attrs_wo_objs(cls): return [t[:3] for t in inspect.classify_class_attrs(cls)] Modified: python/trunk/Lib/tokenize.py ============================================================================== --- python/trunk/Lib/tokenize.py (original) +++ python/trunk/Lib/tokenize.py Mon Aug 14 23:34:08 2006 @@ -273,7 +273,8 @@ while column < indents[-1]: if column not in indents: raise IndentationError( - "unindent does not match any outer indentation level") + "unindent does not match any outer indentation level", + ("", lnum, pos, line)) indents = indents[:-1] yield (DEDENT, '', (lnum, pos), (lnum, pos), line) From python-checkins at python.org Mon Aug 14 23:42:56 2006 From: python-checkins at python.org (georg.brandl) Date: Mon, 14 Aug 2006 23:42:56 +0200 (CEST) Subject: [Python-checkins] r51285 - in python/trunk: Lib/test/test_bz2.py Misc/NEWS Modules/bz2module.c Message-ID: <20060814214256.342F41E4002@bag.python.org> Author: georg.brandl Date: Mon Aug 14 23:42:55 2006 New Revision: 51285 Modified: python/trunk/Lib/test/test_bz2.py python/trunk/Misc/NEWS python/trunk/Modules/bz2module.c Log: Patch #1535500: fix segfault in BZ2File.writelines and make sure it raises the correct exceptions. Modified: python/trunk/Lib/test/test_bz2.py ============================================================================== --- python/trunk/Lib/test/test_bz2.py (original) +++ python/trunk/Lib/test/test_bz2.py Mon Aug 14 23:42:55 2006 @@ -166,6 +166,8 @@ sio = StringIO(self.TEXT) bz2f.writelines(sio.readlines()) bz2f.close() + # patch #1535500 + self.assertRaises(ValueError, bz2f.writelines, ["a"]) f = open(self.filename, 'rb') self.assertEqual(self.decompress(f.read()), self.TEXT) f.close() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Aug 14 23:42:55 2006 @@ -79,6 +79,9 @@ Extension Modules ----------------- +- Patch #1535500: fix segfault in BZ2File.writelines and make sure it + raises the correct exceptions. + - Patch # 1536908: enable building ctypes on OpenBSD/AMD64. The '-no-stack-protector' compiler flag for OpenBSD has been removed. Modified: python/trunk/Modules/bz2module.c ============================================================================== --- python/trunk/Modules/bz2module.c (original) +++ python/trunk/Modules/bz2module.c Mon Aug 14 23:42:55 2006 @@ -812,12 +812,12 @@ case MODE_CLOSED: PyErr_SetString(PyExc_ValueError, "I/O operation on closed file"); - goto cleanup;; + goto cleanup; default: PyErr_SetString(PyExc_IOError, "file is not ready for writing"); - goto cleanup;; + goto cleanup; } self->f_softspace = 0; @@ -861,6 +861,21 @@ int bzerror; ACQUIRE_LOCK(self); + switch (self->mode) { + case MODE_WRITE: + break; + + case MODE_CLOSED: + PyErr_SetString(PyExc_ValueError, + "I/O operation on closed file"); + goto error; + + default: + PyErr_SetString(PyExc_IOError, + "file is not ready for writing"); + goto error; + } + islist = PyList_Check(seq); if (!islist) { iter = PyObject_GetIter(seq); From python-checkins at python.org Mon Aug 14 23:42:59 2006 From: python-checkins at python.org (georg.brandl) Date: Mon, 14 Aug 2006 23:42:59 +0200 (CEST) Subject: [Python-checkins] r51286 - in python/branches/release24-maint: Lib/test/test_bz2.py Misc/NEWS Modules/bz2module.c Message-ID: <20060814214259.E5FED1E4002@bag.python.org> Author: georg.brandl Date: Mon Aug 14 23:42:58 2006 New Revision: 51286 Modified: python/branches/release24-maint/Lib/test/test_bz2.py python/branches/release24-maint/Misc/NEWS python/branches/release24-maint/Modules/bz2module.c Log: Patch #1535500: fix segfault in BZ2File.writelines and make sure it raises the correct exceptions. (backport from rev. 51285) Modified: python/branches/release24-maint/Lib/test/test_bz2.py ============================================================================== --- python/branches/release24-maint/Lib/test/test_bz2.py (original) +++ python/branches/release24-maint/Lib/test/test_bz2.py Mon Aug 14 23:42:58 2006 @@ -166,6 +166,8 @@ sio = StringIO(self.TEXT) bz2f.writelines(sio.readlines()) bz2f.close() + # patch #1535500 + self.assertRaises(ValueError, bz2f.writelines, ["a"]) f = open(self.filename, 'rb') self.assertEqual(self.decompress(f.read()), self.TEXT) f.close() Modified: python/branches/release24-maint/Misc/NEWS ============================================================================== --- python/branches/release24-maint/Misc/NEWS (original) +++ python/branches/release24-maint/Misc/NEWS Mon Aug 14 23:42:58 2006 @@ -36,6 +36,9 @@ Extension Modules ----------------- +- Patch #1535500: fix segfault in BZ2File.writelines and make sure it + raises the correct exceptions. + - Bug #1471938: Fix curses module build problem on Solaris 8; patch by Paul Eggert. Modified: python/branches/release24-maint/Modules/bz2module.c ============================================================================== --- python/branches/release24-maint/Modules/bz2module.c (original) +++ python/branches/release24-maint/Modules/bz2module.c Mon Aug 14 23:42:58 2006 @@ -812,12 +812,12 @@ case MODE_CLOSED: PyErr_SetString(PyExc_ValueError, "I/O operation on closed file"); - goto cleanup;; + goto cleanup; default: PyErr_SetString(PyExc_IOError, "file is not ready for writing"); - goto cleanup;; + goto cleanup; } self->f_softspace = 0; @@ -861,6 +861,21 @@ int bzerror; ACQUIRE_LOCK(self); + switch (self->mode) { + case MODE_WRITE: + break; + + case MODE_CLOSED: + PyErr_SetString(PyExc_ValueError, + "I/O operation on closed file"); + goto error; + + default: + PyErr_SetString(PyExc_IOError, + "file is not ready for writing"); + goto error; + } + islist = PyList_Check(seq); if (!islist) { iter = PyObject_GetIter(seq); @@ -985,7 +1000,6 @@ size_t readsize; int chunksize; int bzerror; - int rewind = 0; PyObject *ret = NULL; if (!PyArg_ParseTuple(args, "O|i:seek", &offobj, &where)) From python-checkins at python.org Mon Aug 14 23:45:33 2006 From: python-checkins at python.org (georg.brandl) Date: Mon, 14 Aug 2006 23:45:33 +0200 (CEST) Subject: [Python-checkins] r51287 - python/trunk/Lib/test/test_bz2.py Message-ID: <20060814214533.2E3C01E400A@bag.python.org> Author: georg.brandl Date: Mon Aug 14 23:45:32 2006 New Revision: 51287 Modified: python/trunk/Lib/test/test_bz2.py Log: Add an additional test: BZ2File write methods should raise IOError when file is read-only. Modified: python/trunk/Lib/test/test_bz2.py ============================================================================== --- python/trunk/Lib/test/test_bz2.py (original) +++ python/trunk/Lib/test/test_bz2.py Mon Aug 14 23:45:32 2006 @@ -172,6 +172,15 @@ self.assertEqual(self.decompress(f.read()), self.TEXT) f.close() + def testWriteMethodsOnReadOnlyFile(self): + bz2f = BZ2File(self.filename, "w") + bz2f.write("abc") + bz2f.close() + + bz2f = BZ2File(self.filename, "r") + self.assertRaises(IOError, bz2f.write, "a") + self.assertRaises(IOError, bz2f.writelines, ["a"]) + def testSeekForward(self): # "Test BZ2File.seek(150, 0)" self.createTempFile() From python-checkins at python.org Mon Aug 14 23:45:35 2006 From: python-checkins at python.org (georg.brandl) Date: Mon, 14 Aug 2006 23:45:35 +0200 (CEST) Subject: [Python-checkins] r51288 - python/branches/release24-maint/Lib/test/test_bz2.py Message-ID: <20060814214535.959A61E4003@bag.python.org> Author: georg.brandl Date: Mon Aug 14 23:45:35 2006 New Revision: 51288 Modified: python/branches/release24-maint/Lib/test/test_bz2.py Log: Add an additional test: BZ2File write methods should raise IOError when file is read-only. (backport from rev. 51287) Modified: python/branches/release24-maint/Lib/test/test_bz2.py ============================================================================== --- python/branches/release24-maint/Lib/test/test_bz2.py (original) +++ python/branches/release24-maint/Lib/test/test_bz2.py Mon Aug 14 23:45:35 2006 @@ -172,6 +172,15 @@ self.assertEqual(self.decompress(f.read()), self.TEXT) f.close() + def testWriteMethodsOnReadOnlyFile(self): + bz2f = BZ2File(self.filename, "w") + bz2f.write("abc") + bz2f.close() + + bz2f = BZ2File(self.filename, "r") + self.assertRaises(IOError, bz2f.write, "a") + self.assertRaises(IOError, bz2f.writelines, ["a"]) + def testSeekForward(self): # "Test BZ2File.seek(150, 0)" self.createTempFile() From buildbot at python.org Mon Aug 14 23:51:06 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 21:51:06 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060814215107.12BCA1E4013@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/22 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Mon Aug 14 23:55:30 2006 From: python-checkins at python.org (georg.brandl) Date: Mon, 14 Aug 2006 23:55:30 +0200 (CEST) Subject: [Python-checkins] r51289 - in python/trunk: Lib/trace.py Misc/NEWS Message-ID: <20060814215530.7E9F61E400B@bag.python.org> Author: georg.brandl Date: Mon Aug 14 23:55:28 2006 New Revision: 51289 Modified: python/trunk/Lib/trace.py python/trunk/Misc/NEWS Log: Patch #1536071: trace.py should now find the full module name of a file correctly even on Windows. Modified: python/trunk/Lib/trace.py ============================================================================== --- python/trunk/Lib/trace.py (original) +++ python/trunk/Lib/trace.py Mon Aug 14 23:55:28 2006 @@ -179,9 +179,11 @@ # looking in sys.path for the longest matching prefix. We'll # assume that the rest is the package name. + comparepath = os.path.normcase(path) longest = "" for dir in sys.path: - if path.startswith(dir) and path[len(dir)] == os.path.sep: + dir = os.path.normcase(dir) + if comparepath.startswith(dir) and comparepath[len(dir)] == os.sep: if len(dir) > len(longest): longest = dir Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Aug 14 23:55:28 2006 @@ -64,6 +64,9 @@ Library ------- +- Patch #1536071: trace.py should now find the full module name of a + file correctly even on Windows. + - logging's atexit hook now runs even if the rest of the module has already been cleaned up. From python-checkins at python.org Tue Aug 15 00:01:24 2006 From: python-checkins at python.org (georg.brandl) Date: Tue, 15 Aug 2006 00:01:24 +0200 (CEST) Subject: [Python-checkins] r51290 - python/trunk/Lib/Cookie.py python/trunk/Lib/string.py Message-ID: <20060814220124.D33841E400B@bag.python.org> Author: georg.brandl Date: Tue Aug 15 00:01:24 2006 New Revision: 51290 Modified: python/trunk/Lib/Cookie.py python/trunk/Lib/string.py Log: Cookie.py shouldn't "bogusly" use string._idmap. Modified: python/trunk/Lib/Cookie.py ============================================================================== --- python/trunk/Lib/Cookie.py (original) +++ python/trunk/Lib/Cookie.py Tue Aug 15 00:01:24 2006 @@ -304,9 +304,11 @@ '\372' : '\\372', '\373' : '\\373', '\374' : '\\374', '\375' : '\\375', '\376' : '\\376', '\377' : '\\377' } + +_idmap = ''.join(chr(x) for x in xrange(256)) def _quote(str, LegalChars=_LegalChars, - idmap=string._idmap, translate=string.translate): + idmap=_idmap, translate=string.translate): # # If the string does not need to be double-quoted, # then just return the string. Otherwise, surround @@ -440,7 +442,7 @@ def set(self, key, val, coded_val, LegalChars=_LegalChars, - idmap=string._idmap, translate=string.translate ): + idmap=_idmap, translate=string.translate): # First we verify that the key isn't a reserved word # Second we make sure it only contains legal characters if key.lower() in self._reserved: Modified: python/trunk/Lib/string.py ============================================================================== --- python/trunk/Lib/string.py (original) +++ python/trunk/Lib/string.py Tue Aug 15 00:01:24 2006 @@ -35,7 +35,6 @@ # Case conversion helpers # Use str to convert Unicode literal in case of -U -# Note that Cookie.py bogusly uses _idmap :( l = map(chr, xrange(256)) _idmap = str('').join(l) del l From python-checkins at python.org Tue Aug 15 00:10:25 2006 From: python-checkins at python.org (georg.brandl) Date: Tue, 15 Aug 2006 00:10:25 +0200 (CEST) Subject: [Python-checkins] r51291 - python/trunk/Modules/socketmodule.c Message-ID: <20060814221025.013F01E4013@bag.python.org> Author: georg.brandl Date: Tue Aug 15 00:10:24 2006 New Revision: 51291 Modified: python/trunk/Modules/socketmodule.c Log: Patch #1511317: don't crash on invalid hostname info Modified: python/trunk/Modules/socketmodule.c ============================================================================== --- python/trunk/Modules/socketmodule.c (original) +++ python/trunk/Modules/socketmodule.c Tue Aug 15 00:10:24 2006 @@ -3041,17 +3041,20 @@ if ((addr_list = PyList_New(0)) == NULL) goto err; - for (pch = h->h_aliases; *pch != NULL; pch++) { - int status; - tmp = PyString_FromString(*pch); - if (tmp == NULL) - goto err; + /* SF #1511317: h_aliases can be NULL */ + if (h->h_aliases) { + for (pch = h->h_aliases; *pch != NULL; pch++) { + int status; + tmp = PyString_FromString(*pch); + if (tmp == NULL) + goto err; - status = PyList_Append(name_list, tmp); - Py_DECREF(tmp); + status = PyList_Append(name_list, tmp); + Py_DECREF(tmp); - if (status) - goto err; + if (status) + goto err; + } } for (pch = h->h_addr_list; *pch != NULL; pch++) { From buildbot at python.org Tue Aug 15 00:19:55 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 22:19:55 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper 2.4 Message-ID: <20060814221955.AE0D11E4002@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%25202.4/builds/2 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Tue Aug 15 00:23:36 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 22:23:36 +0000 Subject: [Python-checkins] buildbot warnings in x86 OpenBSD 2.4 Message-ID: <20060814222336.ACD0B1E4002@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%25202.4/builds/153 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Tue Aug 15 00:26:13 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 22:26:13 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060814222614.2E79C1E4013@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1084 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Tue Aug 15 00:50:53 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 22:50:53 +0000 Subject: [Python-checkins] buildbot warnings in ppc Debian unstable 2.4 Message-ID: <20060814225053.720CC1E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%2520Debian%2520unstable%25202.4/builds/136 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Tue Aug 15 01:22:28 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 23:22:28 +0000 Subject: [Python-checkins] buildbot warnings in g4 osx.4 trunk Message-ID: <20060814232228.5F5EA1E4002@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/g4%2520osx.4%2520trunk/builds/1355 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Tue Aug 15 01:32:21 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 14 Aug 2006 23:32:21 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-2 trunk Message-ID: <20060814233221.A6A311E4002@bag.python.org> The Buildbot has detected a new failure of x86 XP-2 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP-2%2520trunk/builds/871 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Tue Aug 15 02:25:06 2006 From: python-checkins at python.org (tim.peters) Date: Tue, 15 Aug 2006 02:25:06 +0200 (CEST) Subject: [Python-checkins] r51292 - in python/trunk/Lib: Cookie.py test/test_index.py Message-ID: <20060815002506.64F8E1E4002@bag.python.org> Author: tim.peters Date: Tue Aug 15 02:25:04 2006 New Revision: 51292 Modified: python/trunk/Lib/Cookie.py python/trunk/Lib/test/test_index.py Log: Whitespace normalization. Modified: python/trunk/Lib/Cookie.py ============================================================================== --- python/trunk/Lib/Cookie.py (original) +++ python/trunk/Lib/Cookie.py Tue Aug 15 02:25:04 2006 @@ -304,7 +304,7 @@ '\372' : '\\372', '\373' : '\\373', '\374' : '\\374', '\375' : '\\375', '\376' : '\\376', '\377' : '\\377' } - + _idmap = ''.join(chr(x) for x in xrange(256)) def _quote(str, LegalChars=_LegalChars, Modified: python/trunk/Lib/test/test_index.py ============================================================================== --- python/trunk/Lib/test/test_index.py (original) +++ python/trunk/Lib/test/test_index.py Tue Aug 15 02:25:04 2006 @@ -29,7 +29,7 @@ self.n.ind = 2 self.assertEqual(operator.index(self.o), -2) self.assertEqual(operator.index(self.n), 2) - + def test_slice(self): self.o.ind = 1 self.n.ind = 2 @@ -53,7 +53,7 @@ self.failUnlessRaises(TypeError, operator.index, TrapLong()) self.failUnless(slice(TrapInt()).indices(0)==(0,0,1)) self.failUnlessRaises(TypeError, slice(TrapLong()).indices, 0) - + def test_error(self): self.o.ind = 'dumb' self.n.ind = 'bad' From buildbot at python.org Tue Aug 15 02:39:01 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 15 Aug 2006 00:39:01 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060815003901.A7CF51E4002@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/24 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Tue Aug 15 05:36:59 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 15 Aug 2006 03:36:59 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian trunk Message-ID: <20060815033700.101671E4002@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%2520trunk/builds/413 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Tue Aug 15 06:14:59 2006 From: python-checkins at python.org (neal.norwitz) Date: Tue, 15 Aug 2006 06:14:59 +0200 (CEST) Subject: [Python-checkins] r51293 - python/trunk/Misc/NEWS Message-ID: <20060815041459.412FB1E4003@bag.python.org> Author: neal.norwitz Date: Tue Aug 15 06:14:57 2006 New Revision: 51293 Modified: python/trunk/Misc/NEWS Log: Georg fixed one of my bugs, so I'll repay him with 2 NEWS entries. Now we're even. :-) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Aug 15 06:14:57 2006 @@ -64,6 +64,8 @@ Library ------- +- Bug #1224621: make tabnanny recognize IndentationErrors raised by tokenize. + - Patch #1536071: trace.py should now find the full module name of a file correctly even on Windows. @@ -82,6 +84,8 @@ Extension Modules ----------------- +- Patch #1511317: don't crash on invalid hostname (alias) info. + - Patch #1535500: fix segfault in BZ2File.writelines and make sure it raises the correct exceptions. From python-checkins at python.org Tue Aug 15 06:28:18 2006 From: python-checkins at python.org (neal.norwitz) Date: Tue, 15 Aug 2006 06:28:18 +0200 (CEST) Subject: [Python-checkins] r51294 - peps/trunk/pep-0356.txt Message-ID: <20060815042818.2217E1E4003@bag.python.org> Author: neal.norwitz Date: Tue Aug 15 06:28:12 2006 New Revision: 51294 Modified: peps/trunk/pep-0356.txt Log: No more issues blocking release that I know of. Modified: peps/trunk/pep-0356.txt ============================================================================== --- peps/trunk/pep-0356.txt (original) +++ peps/trunk/pep-0356.txt Tue Aug 15 06:28:12 2006 @@ -149,17 +149,7 @@ - Bugs that need resolving before release, ie, they block release: - /* Patch # 1538606 was checked in, needs review and testing. */ - http://mail.python.org/pipermail/python-dev/2006-July/067774.html - Problem with __index__ (patch pending) - - http://mail.python.org/pipermail/python-dev/2006-August/067926.html - str/unicode dict keys can raise an exception - - - Bugs that ought to be resolved before release: - - http://python.org/sf/1533481 - ctypes _as_parameter_ not - working as documented (work in progress) + None - Bugs that ought to be resolved before release (all exist in 2.4): http://python.org/sf/1534630 - potential crash in cElementTree From python-checkins at python.org Tue Aug 15 06:58:30 2006 From: python-checkins at python.org (neal.norwitz) Date: Tue, 15 Aug 2006 06:58:30 +0200 (CEST) Subject: [Python-checkins] r51295 - in python/trunk: Lib/test/test_socketserver.py Misc/NEWS Message-ID: <20060815045830.580C21E4003@bag.python.org> Author: neal.norwitz Date: Tue Aug 15 06:58:28 2006 New Revision: 51295 Modified: python/trunk/Lib/test/test_socketserver.py python/trunk/Misc/NEWS Log: Fix the test for SocketServer so it should pass on cygwin and not fail sporadically on other platforms. This is really a band-aid that doesn't fix the underlying issue in SocketServer. It's not clear if it's worth it to fix SocketServer, however, I opened a bug to track it: http://python.org/sf/1540386 Modified: python/trunk/Lib/test/test_socketserver.py ============================================================================== --- python/trunk/Lib/test/test_socketserver.py (original) +++ python/trunk/Lib/test/test_socketserver.py Tue Aug 15 06:58:28 2006 @@ -181,10 +181,19 @@ if hasattr(os, 'fork') and os.name not in ('os2',): dgramservers.append(ForkingUnixDatagramServer) +def sloppy_cleanup(): + # See http://python.org/sf/1540386 + # We need to reap children here otherwise a child from one server + # can be left running for the next server and cause a test failure. + time.sleep(DELAY) + reap_children() + def testall(): testloop(socket.AF_INET, tcpservers, MyStreamHandler, teststream) + sloppy_cleanup() testloop(socket.AF_INET, udpservers, MyDatagramHandler, testdgram) if hasattr(socket, 'AF_UNIX'): + sloppy_cleanup() testloop(socket.AF_UNIX, streamservers, MyStreamHandler, teststream) # Alas, on Linux (at least) recvfrom() doesn't return a meaningful # client address so this cannot work: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue Aug 15 06:58:28 2006 @@ -104,6 +104,9 @@ Tests ----- +- test_socketserver should now work on cygwin and not fail sporadically + on other platforms. + - test_mailbox should now work on cygwin versions 2006-08-10 and later. - Bug #1535182: really test the xreadlines() method of bz2 objects. From python-checkins at python.org Tue Aug 15 06:59:31 2006 From: python-checkins at python.org (neal.norwitz) Date: Tue, 15 Aug 2006 06:59:31 +0200 (CEST) Subject: [Python-checkins] r51296 - python/trunk/Lib/site.py Message-ID: <20060815045931.250821E4003@bag.python.org> Author: neal.norwitz Date: Tue Aug 15 06:59:30 2006 New Revision: 51296 Modified: python/trunk/Lib/site.py Log: Update the docstring to use a version a little newer than 1999. This was taken from a Debian patch. Should we update the version for each release? Modified: python/trunk/Lib/site.py ============================================================================== --- python/trunk/Lib/site.py (original) +++ python/trunk/Lib/site.py Tue Aug 15 06:59:30 2006 @@ -27,7 +27,7 @@ '#' are skipped. Lines starting with 'import' are executed. For example, suppose sys.prefix and sys.exec_prefix are set to -/usr/local and there is a directory /usr/local/lib/python1.5/site-packages +/usr/local and there is a directory /usr/local/lib/python2.5/site-packages with three subdirectories, foo, bar and spam, and two path configuration files, foo.pth and bar.pth. Assume foo.pth contains the following: @@ -44,8 +44,8 @@ Then the following directories are added to sys.path, in this order: - /usr/local/lib/python1.5/site-packages/bar - /usr/local/lib/python1.5/site-packages/foo + /usr/local/lib/python2.5/site-packages/bar + /usr/local/lib/python2.5/site-packages/foo Note that bletch is omitted because it doesn't exist; bar precedes foo because bar.pth comes alphabetically before foo.pth; and spam is From python-checkins at python.org Tue Aug 15 08:27:33 2006 From: python-checkins at python.org (neal.norwitz) Date: Tue, 15 Aug 2006 08:27:33 +0200 (CEST) Subject: [Python-checkins] r51297 - peps/trunk/pep-0357.txt Message-ID: <20060815062733.BFC2B1E4003@bag.python.org> Author: neal.norwitz Date: Tue Aug 15 08:27:32 2006 New Revision: 51297 Modified: peps/trunk/pep-0357.txt Log: Updates from Travis. I modified his version based on a followup mail that stated: As long as the object returned is a proper sub-class then it should work fine. The Exact checks should be removed from both the code and the PEP. Modified: peps/trunk/pep-0357.txt ============================================================================== --- peps/trunk/pep-0357.txt (original) +++ peps/trunk/pep-0357.txt Tue Aug 15 08:27:32 2006 @@ -45,31 +45,68 @@ Proposal Add an nb_index slot to PyNumberMethods, and a corresponding - __index__ special method. Objects could define a function to place - in the nb_index slot that returns an appropriate C-integer (Py_ssize_t - after PEP 353). This C-integer will be used whenever Python needs - one such as in PySequence_GetSlice, PySequence_SetSlice, and - PySequence_DelSlice. + __index__ special method. Objects could define a function to + place in the nb_index slot that returns a Python integer + (either an int or a long). This integer can + then be appropriately converted to a Py_ssize_t value whenever + Python needs one such as in PySequence_GetSlice, + PySequence_SetSlice, and PySequence_DelSlice. Specification: - 1) The nb_index slot will have the signature + 1) The nb_index slot will have the following signature - Py_ssize_t index_func (PyObject *self) + PyObject *index_func (PyObject *self) + + The returned object must be a Python IntType or + Python LongType. NULL should be returned on + error with an appropriate error set. 2) The __index__ special method will have the signature def __index__(self): return obj - where obj must be either an int or a long. + where obj must be either an int or a long. + + 3) 3 new abstract C-API functions will be added - 3) A new C-API function PyNumber_Index will be added with signature + a) The first checks to see if the object supports the index + slot and if it is filled in. - Py_ssize_t PyNumber_Index (PyObject *obj) + int PyIndex_Check(obj) - which will return obj->ob_type->tp_as_number->nb_index(obj) if it is available. - A -1 will be returned and an exception set on an error. + This will return true if the object defines the nb_index + slot. + + b) The second is a simple wrapper around the nb_index call that + raises PyExc_TypeError if the call is not available or if it + doesn't return an int or long. Because the + PyIndex_Check is performed inside the PyNumber_Index call + you can call it directly and manage any error rather than + check for compatibility first. + + PyObject *PyNumber_Index (PyObject *obj) + + c) The third call helps deal with the common situation of + actually needing a Py_ssize_t value from the object to use for + indexing or other needs. + + Py_ssize_t PyNumber_AsSsize_t(PyObject *obj, PyObject *exc) + + The function calls the nb_index slot of obj if it is + available and then converts the returned Python integer into + a Py_ssize_t value. If this goes well, then the value is + returned. The second argument allows control over what + happens if the integer returned from nb_index cannot fit + into a Py_ssize_t value. + + If exc is NULL, then the returnd value will be clipped to + PY_SSIZE_T_MAX or PY_SSIZE_T_MIN depending on whether the + nb_index slot of obj returned a positive or negative + integer. If exc is non-NULL, then it is the error object + that will be set to replace the PyExc_OverflowError that was + raised when the Python integer or long was converted to Py_ssize_t. 4) A new operator.index(obj) function will be added that calls equivalent of obj.__index__() and raises an error if obj does not implement @@ -90,13 +127,19 @@ slots for subscript access and use a special-check for integers to check for the slot as well. - 5) Add the nb_index slot to integers and long_integers. + 5) Add the nb_index slot to integers and long_integers + (which just return themselves) 6) Add PyNumber_Index C-API to return an integer from any Python Object that has the nb_index slot. 7) Add the operator.index(x) function. + 8) Alter arrayobject.c and mmapmodule.c to use the new C-API for their + sub-scripting and other needs. + + 9) Add unit-tests + Discussion Questions @@ -129,13 +172,22 @@ for examples of names that were suggested such as "__discrete__" and "__ordinal__". - Why return Py_ssize_t from nb_index? + Why return PyObject * from nb_index? - The nb_index slot is primarily intended to return an integer - needed by the sequence interface. In Python 2.5 this is - Py_ssize_t. As this is the primary purpose of the slot, it - makes sense to return the C-integer directly and not wrapped - in a Python int object. + Intially Py_ssize_t was selected as the return type for the + nb_index slot. However, this led to an inability to track and + distinguish overflow and underflow errors without ugly and brittle + hacks. As the nb_index slot is used in at least 3 different ways + in the Python core (to get an integer, to get a slice end-point, + and to get a sequence index), there is quite a bit of flexibility + needed to handle all these cases. The importance of having the + necessary flexibility to handle all the use cases is critical. + For example, the initial implementation that returned Py_ssize_t for + nb_index led to the discovery that on a 32-bit machine with >=2GB of RAM + s = 'x' * (2**100) works but len(s) was clipped at 2147483647. + Several fixes were suggested but eventually it was decided that + nb_index needed to return a Python Object similar to the nb_int + and nb_long slots in order to handle overflow correctly. Why can't __index__ return any object with the nb_index method? From python-checkins at python.org Tue Aug 15 08:29:04 2006 From: python-checkins at python.org (neal.norwitz) Date: Tue, 15 Aug 2006 08:29:04 +0200 (CEST) Subject: [Python-checkins] r51298 - in python/trunk: Lib/test/test_index.py Objects/abstract.c Message-ID: <20060815062904.039561E4005@bag.python.org> Author: neal.norwitz Date: Tue Aug 15 08:29:03 2006 New Revision: 51298 Modified: python/trunk/Lib/test/test_index.py python/trunk/Objects/abstract.c Log: Subclasses of int/long are allowed to define an __index__. Modified: python/trunk/Lib/test/test_index.py ============================================================================== --- python/trunk/Lib/test/test_index.py (original) +++ python/trunk/Lib/test/test_index.py Tue Aug 15 08:29:03 2006 @@ -48,11 +48,12 @@ self.assertEqual(self.o.__index__(), 4) self.assertEqual(self.n.__index__(), 5) - def test_infinite_recursion(self): - self.failUnlessRaises(TypeError, operator.index, TrapInt()) - self.failUnlessRaises(TypeError, operator.index, TrapLong()) - self.failUnless(slice(TrapInt()).indices(0)==(0,0,1)) - self.failUnlessRaises(TypeError, slice(TrapLong()).indices, 0) + def test_subclasses(self): + r = range(10) + self.assertEqual(r[TrapInt(5):TrapInt(10)], r[5:10]) + self.assertEqual(r[TrapLong(5):TrapLong(10)], r[5:10]) + self.assertEqual(slice(TrapInt()).indices(0), (0,0,1)) + self.assertEqual(slice(TrapLong(0)).indices(0), (0,0,1)) def test_error(self): self.o.ind = 'dumb' @@ -104,9 +105,9 @@ self.assertEqual(self.seq.__mul__(self.n), self.seq * 5) self.assertEqual(self.seq.__rmul__(self.n), self.seq * 5) - def test_infinite_recursion(self): - self.failUnlessRaises(TypeError, operator.getitem, self.seq, TrapInt()) - self.failUnlessRaises(TypeError, operator.getitem, self.seq, TrapLong()) + def test_subclasses(self): + self.assertEqual(self.seq[TrapInt()], self.seq[0]) + self.assertEqual(self.seq[TrapLong()], self.seq[0]) def test_error(self): self.o.ind = 'dumb' Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Tue Aug 15 08:29:03 2006 @@ -945,16 +945,14 @@ PyObject *result = NULL; if (item == NULL) return null_error(); - /* XXX(nnorwitz): should these be CheckExact? Aren't subclasses ok? */ - if (PyInt_CheckExact(item) || PyLong_CheckExact(item)) { + if (PyInt_Check(item) || PyLong_Check(item)) { Py_INCREF(item); return item; } if (PyIndex_Check(item)) { result = item->ob_type->tp_as_number->nb_index(item); - /* XXX(nnorwitz): Aren't subclasses ok here too? */ if (result && - !PyInt_CheckExact(result) && !PyLong_CheckExact(result)) { + !PyInt_Check(result) && !PyLong_Check(result)) { PyErr_Format(PyExc_TypeError, "__index__ returned non-(int,long) " \ "(type %.200s)", From buildbot at python.org Tue Aug 15 08:50:56 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 15 Aug 2006 06:50:56 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060815065057.110D91E4003@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/27 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Tue Aug 15 09:28:46 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 15 Aug 2006 07:28:46 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060815072846.8FF371E4004@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1088 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Tue Aug 15 12:36:01 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 15 Aug 2006 10:36:01 +0000 Subject: [Python-checkins] buildbot warnings in sparc Ubuntu dapper trunk Message-ID: <20060815103601.A246C1E400A@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520Ubuntu%2520dapper%2520trunk/builds/642 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Tue Aug 15 15:07:22 2006 From: python-checkins at python.org (thomas.heller) Date: Tue, 15 Aug 2006 15:07:22 +0200 (CEST) Subject: [Python-checkins] r51300 - python/trunk/Modules/_ctypes/_ctypes.c Message-ID: <20060815130722.AB9141E4003@bag.python.org> Author: thomas.heller Date: Tue Aug 15 15:07:21 2006 New Revision: 51300 Modified: python/trunk/Modules/_ctypes/_ctypes.c Log: Check for NULL return value from new_CArgObject calls. Modified: python/trunk/Modules/_ctypes/_ctypes.c ============================================================================== --- python/trunk/Modules/_ctypes/_ctypes.c (original) +++ python/trunk/Modules/_ctypes/_ctypes.c Tue Aug 15 15:07:21 2006 @@ -1282,6 +1282,8 @@ struct fielddesc *fd = getentry("z"); parg = new_CArgObject(); + if (parg == NULL) + return NULL; parg->pffi_type = &ffi_type_pointer; parg->tag = 'z'; parg->obj = fd->setfunc(&parg->value, value, 0); @@ -1297,6 +1299,8 @@ struct fielddesc *fd = getentry("Z"); parg = new_CArgObject(); + if (parg == NULL) + return NULL; parg->pffi_type = &ffi_type_pointer; parg->tag = 'Z'; parg->obj = fd->setfunc(&parg->value, value, 0); @@ -1333,6 +1337,8 @@ CFuncPtrObject *func; func = (CFuncPtrObject *)value; parg = new_CArgObject(); + if (parg == NULL) + return NULL; parg->pffi_type = &ffi_type_pointer; parg->tag = 'P'; Py_INCREF(value); From python-checkins at python.org Wed Aug 16 00:45:09 2006 From: python-checkins at python.org (brett.cannon) Date: Wed, 16 Aug 2006 00:45:09 +0200 (CEST) Subject: [Python-checkins] r51301 - python/branches/bcannon-objcap Message-ID: <20060815224509.5DD371E400A@bag.python.org> Author: brett.cannon Date: Wed Aug 16 00:45:08 2006 New Revision: 51301 Added: python/branches/bcannon-objcap/ - copied from r51300, python/trunk/ Log: Creating a branch for implementing object-capabilities at the interpreter level. From python-checkins at python.org Wed Aug 16 01:03:27 2006 From: python-checkins at python.org (brett.cannon) Date: Wed, 16 Aug 2006 01:03:27 +0200 (CEST) Subject: [Python-checkins] r51302 - python/branches/bcannon-objcap Message-ID: <20060815230327.398F21E400C@bag.python.org> Author: brett.cannon Date: Wed Aug 16 01:03:26 2006 New Revision: 51302 Modified: python/branches/bcannon-objcap/ (props changed) Log: Initialized merge tracking via "svnmerge" with revisions "1-51300" from svn+ssh://pythondev at svn.python.org/python/trunk From anthony at interlink.com.au Wed Aug 16 04:37:04 2006 From: anthony at interlink.com.au (Anthony Baxter) Date: Wed, 16 Aug 2006 12:37:04 +1000 Subject: [Python-checkins] TRUNK FREEZE for 2.5c1, 00:00 UTC, Thursday 17th August Message-ID: <200608161237.06556.anthony@interlink.com.au> Ok, here we go... I'm declaring the TRUNK FROZEN as of 00:00 UTC on Thursday the 17th of August. This is in about 22 hours time. At this time, I'll be cutting the release25-maint branch and 2.5c1 (and all future 2.5 releases) will be from that branch. I'll send another email once the release is done - at that point, the trunk is then available for 2.6 checkins. Anthony -- Anthony Baxter It's never too late to have a happy childhood. From python-checkins at python.org Wed Aug 16 05:15:28 2006 From: python-checkins at python.org (kurt.kaiser) Date: Wed, 16 Aug 2006 05:15:28 +0200 (CEST) Subject: [Python-checkins] r51303 - python/trunk/Lib/idlelib/CodeContext.py python/trunk/Lib/idlelib/NEWS.txt Message-ID: <20060816031528.614EB1E4004@bag.python.org> Author: kurt.kaiser Date: Wed Aug 16 05:15:26 2006 New Revision: 51303 Modified: python/trunk/Lib/idlelib/CodeContext.py python/trunk/Lib/idlelib/NEWS.txt Log: The 'with' statement is now a Code Context block opener Modified: python/trunk/Lib/idlelib/CodeContext.py ============================================================================== --- python/trunk/Lib/idlelib/CodeContext.py (original) +++ python/trunk/Lib/idlelib/CodeContext.py Wed Aug 16 05:15:26 2006 @@ -15,7 +15,7 @@ from sys import maxint as INFINITY BLOCKOPENERS = set(["class", "def", "elif", "else", "except", "finally", "for", - "if", "try", "while"]) + "if", "try", "while", "with"]) UPDATEINTERVAL = 100 # millisec FONTUPDATEINTERVAL = 1000 # millisec Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Wed Aug 16 05:15:26 2006 @@ -3,6 +3,8 @@ *Release date: XX-AUG-2006* +- The 'with' statement is now a Code Context block opener + - Retrieval of previous shell command was not always preserving indentation (since 1.2a1) Patch 1528468 Tal Einat. From python-checkins at python.org Wed Aug 16 05:42:28 2006 From: python-checkins at python.org (anthony.baxter) Date: Wed, 16 Aug 2006 05:42:28 +0200 (CEST) Subject: [Python-checkins] r51304 - in python/trunk: Doc/commontex/boilerplate.tex Include/patchlevel.h Lib/idlelib/NEWS.txt Lib/idlelib/idlever.py Misc/NEWS Misc/RPM/python-2.5.spec README Message-ID: <20060816034228.CD18C1E4004@bag.python.org> Author: anthony.baxter Date: Wed Aug 16 05:42:26 2006 New Revision: 51304 Modified: python/trunk/Doc/commontex/boilerplate.tex python/trunk/Include/patchlevel.h python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/idlever.py python/trunk/Misc/NEWS python/trunk/Misc/RPM/python-2.5.spec python/trunk/README Log: preparing for 2.5c1 Modified: python/trunk/Doc/commontex/boilerplate.tex ============================================================================== --- python/trunk/Doc/commontex/boilerplate.tex (original) +++ python/trunk/Doc/commontex/boilerplate.tex Wed Aug 16 05:42:26 2006 @@ -5,5 +5,5 @@ Email: \email{docs at python.org} } -\date{3rd August, 2006} % XXX update before final release! +\date{17th August, 2006} % XXX update before final release! \input{patchlevel} % include Python version information Modified: python/trunk/Include/patchlevel.h ============================================================================== --- python/trunk/Include/patchlevel.h (original) +++ python/trunk/Include/patchlevel.h Wed Aug 16 05:42:26 2006 @@ -22,11 +22,11 @@ #define PY_MAJOR_VERSION 2 #define PY_MINOR_VERSION 5 #define PY_MICRO_VERSION 0 -#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA +#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA #define PY_RELEASE_SERIAL 3 /* Version as a string */ -#define PY_VERSION "2.5b3" +#define PY_VERSION "2.5c1" /* Subversion Revision number of this file (not of the repository) */ #define PY_PATCHLEVEL_REVISION "$Revision$" Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Wed Aug 16 05:42:26 2006 @@ -1,7 +1,7 @@ What's New in IDLE 1.2c1? ========================= -*Release date: XX-AUG-2006* +*Release date: 17-AUG-2006* - The 'with' statement is now a Code Context block opener Modified: python/trunk/Lib/idlelib/idlever.py ============================================================================== --- python/trunk/Lib/idlelib/idlever.py (original) +++ python/trunk/Lib/idlelib/idlever.py Wed Aug 16 05:42:26 2006 @@ -1 +1 @@ -IDLE_VERSION = "1.2b3" +IDLE_VERSION = "1.2c1" Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 16 05:42:26 2006 @@ -7,7 +7,7 @@ What's New in Python 2.5 release candidate 1? ============================================= -*Release date: 18-AUG-2006* +*Release date: 17-AUG-2006* Core and builtins ----------------- Modified: python/trunk/Misc/RPM/python-2.5.spec ============================================================================== --- python/trunk/Misc/RPM/python-2.5.spec (original) +++ python/trunk/Misc/RPM/python-2.5.spec Wed Aug 16 05:42:26 2006 @@ -33,7 +33,7 @@ ################################# %define name python -%define version 2.5b3 +%define version 2.5c1 %define libvers 2.5 %define release 1pydotorg %define __prefix /usr Modified: python/trunk/README ============================================================================== --- python/trunk/README (original) +++ python/trunk/README Wed Aug 16 05:42:26 2006 @@ -1,5 +1,5 @@ -This is Python version 2.5 beta 3 -================================= +This is Python version 2.5 rc 1 +=============================== Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. All rights reserved. From python-checkins at python.org Wed Aug 16 05:58:37 2006 From: python-checkins at python.org (anthony.baxter) Date: Wed, 16 Aug 2006 05:58:37 +0200 (CEST) Subject: [Python-checkins] r51305 - python/trunk/Include/patchlevel.h Message-ID: <20060816035837.E9F301E4004@bag.python.org> Author: anthony.baxter Date: Wed Aug 16 05:58:37 2006 New Revision: 51305 Modified: python/trunk/Include/patchlevel.h Log: preparing for 2.5c1 - no, really this time Modified: python/trunk/Include/patchlevel.h ============================================================================== --- python/trunk/Include/patchlevel.h (original) +++ python/trunk/Include/patchlevel.h Wed Aug 16 05:58:37 2006 @@ -23,7 +23,7 @@ #define PY_MINOR_VERSION 5 #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA -#define PY_RELEASE_SERIAL 3 +#define PY_RELEASE_SERIAL 1 /* Version as a string */ #define PY_VERSION "2.5c1" From buildbot at python.org Wed Aug 16 06:13:49 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 04:13:49 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060816041350.06A521E4004@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/502 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: kurt.kaiser Build Had Warnings: warnings failed slave lost sincerely, -The Buildbot From python-checkins at python.org Wed Aug 16 07:01:44 2006 From: python-checkins at python.org (kurt.kaiser) Date: Wed, 16 Aug 2006 07:01:44 +0200 (CEST) Subject: [Python-checkins] r51306 - in python/trunk: Lib/idlelib/CREDITS.txt Lib/idlelib/NEWS.txt Lib/idlelib/PyShell.py Lib/site.py Misc/NEWS Message-ID: <20060816050144.9731A1E4004@bag.python.org> Author: kurt.kaiser Date: Wed Aug 16 07:01:42 2006 New Revision: 51306 Modified: python/trunk/Lib/idlelib/CREDITS.txt python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/PyShell.py python/trunk/Lib/site.py python/trunk/Misc/NEWS Log: Patch #1540892: site.py Quitter() class attempts to close sys.stdin before raising SystemExit, allowing IDLE to honor quit() and exit(). M Lib/site.py M Lib/idlelib/PyShell.py M Lib/idlelib/CREDITS.txt M Lib/idlelib/NEWS.txt M Misc/NEWS Modified: python/trunk/Lib/idlelib/CREDITS.txt ============================================================================== --- python/trunk/Lib/idlelib/CREDITS.txt (original) +++ python/trunk/Lib/idlelib/CREDITS.txt Wed Aug 16 07:01:42 2006 @@ -24,8 +24,8 @@ integration, debugger integration and persistent breakpoints). Scott David Daniels, Tal Einat, Hernan Foffani, Christos Georgiou, -Martin v. Löwis, Jason Orendorff, Josh Robb, Nigel Rowe, Bruce Sherwood, -and Jeff Shute have submitted useful patches. Thanks, guys! +Jim Jewett, Martin v. Löwis, Jason Orendorff, Josh Robb, Nigel Rowe, +Bruce Sherwood, and Jeff Shute have submitted useful patches. Thanks, guys! For additional details refer to NEWS.txt and Changelog. Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Wed Aug 16 07:01:42 2006 @@ -3,7 +3,11 @@ *Release date: 17-AUG-2006* -- The 'with' statement is now a Code Context block opener +- IDLE honors new quit() and exit() commands from site.py Quitter() object. + Patch 1540892, Jim Jewett + +- The 'with' statement is now a Code Context block opener. + Patch 1540851, Jim Jewett - Retrieval of previous shell command was not always preserving indentation (since 1.2a1) Patch 1528468 Tal Einat. Modified: python/trunk/Lib/idlelib/PyShell.py ============================================================================== --- python/trunk/Lib/idlelib/PyShell.py (original) +++ python/trunk/Lib/idlelib/PyShell.py Wed Aug 16 07:01:42 2006 @@ -478,9 +478,6 @@ import sys as _sys _sys.path = %r del _sys - _msg = 'Use File/Exit or your end-of-file key to quit IDLE' - __builtins__.quit = __builtins__.exit = _msg - del _msg \n""" % (sys.path,)) active_seq = None @@ -514,7 +511,10 @@ print >>sys.__stderr__, errmsg, what print >>console, errmsg, what # we received a response to the currently active seq number: - self.tkconsole.endexecuting() + try: + self.tkconsole.endexecuting() + except AttributeError: # shell may have closed + pass # Reschedule myself if not self.tkconsole.closing: self.tkconsole.text.after(self.tkconsole.pollinterval, @@ -730,7 +730,10 @@ self.tkconsole.endexecuting() finally: if not use_subprocess: - self.tkconsole.endexecuting() + try: + self.tkconsole.endexecuting() + except AttributeError: # shell may have closed + pass def write(self, s): "Override base class method" @@ -804,9 +807,6 @@ # OutputWindow.__init__(self, flist, None, None) # - import __builtin__ - __builtin__.quit = __builtin__.exit = "To exit, type Ctrl-D." - # ## self.config(usetabs=1, indentwidth=8, context_use_ps1=1) self.usetabs = True # indentwidth must be 8 when using tabs. See note in EditorWindow: Modified: python/trunk/Lib/site.py ============================================================================== --- python/trunk/Lib/site.py (original) +++ python/trunk/Lib/site.py Wed Aug 16 07:01:42 2006 @@ -242,6 +242,12 @@ def __repr__(self): return 'Use %s() or %s to exit' % (self.name, eof) def __call__(self, code=None): + # Shells like IDLE catch the SystemExit, but listen when their + # stdin wrapper is closed. + try: + sys.stdin.close() + except: + pass raise SystemExit(code) __builtin__.quit = Quitter('quit') __builtin__.exit = Quitter('exit') Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 16 07:01:42 2006 @@ -64,6 +64,9 @@ Library ------- +- Patch #1540892: site.py Quitter() class attempts to close sys.stdin + before raising SystemExit, allowing IDLE to honor quit() and exit(). + - Bug #1224621: make tabnanny recognize IndentationErrors raised by tokenize. - Patch #1536071: trace.py should now find the full module name of a From buildbot at python.org Wed Aug 16 07:05:17 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 05:05:17 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060816050517.2A5A21E4004@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/31 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: anthony.baxter Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Wed Aug 16 07:11:59 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 05:11:59 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP-2 trunk Message-ID: <20060816051159.3168B1E4004@bag.python.org> The Buildbot has detected a new failure of x86 XP-2 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP-2%2520trunk/builds/875 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: anthony.baxter,kurt.kaiser Build Had Warnings: warnings failed slave lost sincerely, -The Buildbot From buildbot at python.org Wed Aug 16 07:23:04 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 05:23:04 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060816052304.4AD811E4010@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1091 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: anthony.baxter Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Wed Aug 16 08:11:13 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 06:11:13 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian trunk Message-ID: <20060816061113.A92201E4012@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%2520trunk/builds/419 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: kurt.kaiser Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 16 09:02:54 2006 From: python-checkins at python.org (ka-ping.yee) Date: Wed, 16 Aug 2006 09:02:54 +0200 (CEST) Subject: [Python-checkins] r51307 - in python/trunk/Lib: test/test_uuid.py uuid.py Message-ID: <20060816070254.63BBD1E4004@bag.python.org> Author: ka-ping.yee Date: Wed Aug 16 09:02:50 2006 New Revision: 51307 Modified: python/trunk/Lib/test/test_uuid.py python/trunk/Lib/uuid.py Log: Update code and tests to support the 'bytes_le' attribute (for little-endian byte order on Windows), and to work around clocks with low resolution yielding duplicate UUIDs. Anthony Baxter has approved this change. Modified: python/trunk/Lib/test/test_uuid.py ============================================================================== --- python/trunk/Lib/test/test_uuid.py (original) +++ python/trunk/Lib/test/test_uuid.py Wed Aug 16 09:02:50 2006 @@ -16,12 +16,13 @@ def test_UUID(self): equal = self.assertEqual ascending = [] - for (string, curly, hex, bytes, fields, integer, urn, + for (string, curly, hex, bytes, bytes_le, fields, integer, urn, time, clock_seq, variant, version) in [ ('00000000-0000-0000-0000-000000000000', '{00000000-0000-0000-0000-000000000000}', '00000000000000000000000000000000', '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', + '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', (0, 0, 0, 0, 0, 0), 0, 'urn:uuid:00000000-0000-0000-0000-000000000000', @@ -30,6 +31,7 @@ '{00010203-0405-0607-0809-0a0b0c0d0e0f}', '000102030405060708090a0b0c0d0e0f', '\0\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\x0d\x0e\x0f', + '\x03\x02\x01\0\x05\x04\x07\x06\x08\t\n\x0b\x0c\x0d\x0e\x0f', (0x00010203L, 0x0405, 0x0607, 8, 9, 0x0a0b0c0d0e0fL), 0x000102030405060708090a0b0c0d0e0fL, 'urn:uuid:00010203-0405-0607-0809-0a0b0c0d0e0f', @@ -38,6 +40,7 @@ '{02d9e6d5-9467-382e-8f9b-9300a64ac3cd}', '02d9e6d59467382e8f9b9300a64ac3cd', '\x02\xd9\xe6\xd5\x94\x67\x38\x2e\x8f\x9b\x93\x00\xa6\x4a\xc3\xcd', + '\xd5\xe6\xd9\x02\x67\x94\x2e\x38\x8f\x9b\x93\x00\xa6\x4a\xc3\xcd', (0x02d9e6d5L, 0x9467, 0x382e, 0x8f, 0x9b, 0x9300a64ac3cdL), 0x02d9e6d59467382e8f9b9300a64ac3cdL, 'urn:uuid:02d9e6d5-9467-382e-8f9b-9300a64ac3cd', @@ -46,6 +49,7 @@ '{12345678-1234-5678-1234-567812345678}', '12345678123456781234567812345678', '\x12\x34\x56\x78'*4, + '\x78\x56\x34\x12\x34\x12\x78\x56\x12\x34\x56\x78\x12\x34\x56\x78', (0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678), 0x12345678123456781234567812345678, 'urn:uuid:12345678-1234-5678-1234-567812345678', @@ -54,6 +58,7 @@ '{6ba7b810-9dad-11d1-80b4-00c04fd430c8}', '6ba7b8109dad11d180b400c04fd430c8', '\x6b\xa7\xb8\x10\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', + '\x10\xb8\xa7\x6b\xad\x9d\xd1\x11\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', (0x6ba7b810L, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8L), 0x6ba7b8109dad11d180b400c04fd430c8L, 'urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8', @@ -62,6 +67,7 @@ '{6ba7b811-9dad-11d1-80b4-00c04fd430c8}', '6ba7b8119dad11d180b400c04fd430c8', '\x6b\xa7\xb8\x11\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', + '\x11\xb8\xa7\x6b\xad\x9d\xd1\x11\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', (0x6ba7b811L, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8L), 0x6ba7b8119dad11d180b400c04fd430c8L, 'urn:uuid:6ba7b811-9dad-11d1-80b4-00c04fd430c8', @@ -70,6 +76,7 @@ '{6ba7b812-9dad-11d1-80b4-00c04fd430c8}', '6ba7b8129dad11d180b400c04fd430c8', '\x6b\xa7\xb8\x12\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', + '\x12\xb8\xa7\x6b\xad\x9d\xd1\x11\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', (0x6ba7b812L, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8L), 0x6ba7b8129dad11d180b400c04fd430c8L, 'urn:uuid:6ba7b812-9dad-11d1-80b4-00c04fd430c8', @@ -78,6 +85,7 @@ '{6ba7b814-9dad-11d1-80b4-00c04fd430c8}', '6ba7b8149dad11d180b400c04fd430c8', '\x6b\xa7\xb8\x14\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', + '\x14\xb8\xa7\x6b\xad\x9d\xd1\x11\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', (0x6ba7b814L, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8L), 0x6ba7b8149dad11d180b400c04fd430c8L, 'urn:uuid:6ba7b814-9dad-11d1-80b4-00c04fd430c8', @@ -86,6 +94,7 @@ '{7d444840-9dc0-11d1-b245-5ffdce74fad2}', '7d4448409dc011d1b2455ffdce74fad2', '\x7d\x44\x48\x40\x9d\xc0\x11\xd1\xb2\x45\x5f\xfd\xce\x74\xfa\xd2', + '\x40\x48\x44\x7d\xc0\x9d\xd1\x11\xb2\x45\x5f\xfd\xce\x74\xfa\xd2', (0x7d444840L, 0x9dc0, 0x11d1, 0xb2, 0x45, 0x5ffdce74fad2L), 0x7d4448409dc011d1b2455ffdce74fad2L, 'urn:uuid:7d444840-9dc0-11d1-b245-5ffdce74fad2', @@ -94,6 +103,7 @@ '{e902893a-9d22-3c7e-a7b8-d6e313b71d9f}', 'e902893a9d223c7ea7b8d6e313b71d9f', '\xe9\x02\x89\x3a\x9d\x22\x3c\x7e\xa7\xb8\xd6\xe3\x13\xb7\x1d\x9f', + '\x3a\x89\x02\xe9\x22\x9d\x7e\x3c\xa7\xb8\xd6\xe3\x13\xb7\x1d\x9f', (0xe902893aL, 0x9d22, 0x3c7e, 0xa7, 0xb8, 0xd6e313b71d9fL), 0xe902893a9d223c7ea7b8d6e313b71d9fL, 'urn:uuid:e902893a-9d22-3c7e-a7b8-d6e313b71d9f', @@ -102,6 +112,7 @@ '{eb424026-6f54-4ef8-a4d0-bb658a1fc6cf}', 'eb4240266f544ef8a4d0bb658a1fc6cf', '\xeb\x42\x40\x26\x6f\x54\x4e\xf8\xa4\xd0\xbb\x65\x8a\x1f\xc6\xcf', + '\x26\x40\x42\xeb\x54\x6f\xf8\x4e\xa4\xd0\xbb\x65\x8a\x1f\xc6\xcf', (0xeb424026L, 0x6f54, 0x4ef8, 0xa4, 0xd0, 0xbb658a1fc6cfL), 0xeb4240266f544ef8a4d0bb658a1fc6cfL, 'urn:uuid:eb424026-6f54-4ef8-a4d0-bb658a1fc6cf', @@ -110,6 +121,7 @@ '{f81d4fae-7dec-11d0-a765-00a0c91e6bf6}', 'f81d4fae7dec11d0a76500a0c91e6bf6', '\xf8\x1d\x4f\xae\x7d\xec\x11\xd0\xa7\x65\x00\xa0\xc9\x1e\x6b\xf6', + '\xae\x4f\x1d\xf8\xec\x7d\xd0\x11\xa7\x65\x00\xa0\xc9\x1e\x6b\xf6', (0xf81d4faeL, 0x7dec, 0x11d0, 0xa7, 0x65, 0x00a0c91e6bf6L), 0xf81d4fae7dec11d0a76500a0c91e6bf6L, 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6', @@ -118,6 +130,7 @@ '{fffefdfc-fffe-fffe-fffe-fffefdfcfbfa}', 'fffefdfcfffefffefffefffefdfcfbfa', '\xff\xfe\xfd\xfc\xff\xfe\xff\xfe\xff\xfe\xff\xfe\xfd\xfc\xfb\xfa', + '\xfc\xfd\xfe\xff\xfe\xff\xfe\xff\xff\xfe\xff\xfe\xfd\xfc\xfb\xfa', (0xfffefdfcL, 0xfffe, 0xfffe, 0xff, 0xfe, 0xfffefdfcfbfaL), 0xfffefdfcfffefffefffefffefdfcfbfaL, 'urn:uuid:fffefdfc-fffe-fffe-fffe-fffefdfcfbfa', @@ -126,6 +139,7 @@ '{ffffffff-ffff-ffff-ffff-ffffffffffff}', 'ffffffffffffffffffffffffffffffff', '\xff'*16, + '\xff'*16, (0xffffffffL, 0xffffL, 0xffffL, 0xff, 0xff, 0xffffffffffffL), 0xffffffffffffffffffffffffffffffffL, 'urn:uuid:ffffffff-ffff-ffff-ffff-ffffffffffff', @@ -134,12 +148,14 @@ equivalents = [] # Construct each UUID in several different ways. for u in [uuid.UUID(string), uuid.UUID(curly), uuid.UUID(hex), - uuid.UUID(bytes=bytes), uuid.UUID(fields=fields), - uuid.UUID(int=integer), uuid.UUID(urn)]: + uuid.UUID(bytes=bytes), uuid.UUID(bytes_le=bytes_le), + uuid.UUID(fields=fields), uuid.UUID(int=integer), + uuid.UUID(urn)]: # Test all conversions and properties of the UUID object. equal(str(u), string) equal(int(u), integer) equal(u.bytes, bytes) + equal(u.bytes_le, bytes_le) equal(u.fields, fields) equal(u.time_low, fields[0]) equal(u.time_mid, fields[1]) @@ -189,6 +205,11 @@ badvalue(lambda: uuid.UUID(bytes='\0'*15)) badvalue(lambda: uuid.UUID(bytes='\0'*17)) + # Badly formed bytes_le. + badvalue(lambda: uuid.UUID(bytes_le='abc')) + badvalue(lambda: uuid.UUID(bytes_le='\0'*15)) + badvalue(lambda: uuid.UUID(bytes_le='\0'*17)) + # Badly formed fields. badvalue(lambda: uuid.UUID(fields=(1,))) badvalue(lambda: uuid.UUID(fields=(1, 2, 3, 4, 5))) @@ -221,51 +242,43 @@ uuid.UUID(h) uuid.UUID(hex=h) uuid.UUID(bytes=b) + uuid.UUID(bytes_le=b) uuid.UUID(fields=f) uuid.UUID(int=i) # Wrong number of arguments (positional). badtype(lambda: uuid.UUID()) badtype(lambda: uuid.UUID(h, b)) - badtype(lambda: uuid.UUID(h, b, f)) - badtype(lambda: uuid.UUID(h, b, f, i)) - - # Duplicate arguments (named). - badtype(lambda: uuid.UUID(hex=h, bytes=b)) - badtype(lambda: uuid.UUID(hex=h, fields=f)) - badtype(lambda: uuid.UUID(hex=h, int=i)) - badtype(lambda: uuid.UUID(bytes=b, fields=f)) - badtype(lambda: uuid.UUID(bytes=b, int=i)) - badtype(lambda: uuid.UUID(fields=f, int=i)) - badtype(lambda: uuid.UUID(hex=h, bytes=b, fields=f)) - badtype(lambda: uuid.UUID(hex=h, bytes=b, int=i)) - badtype(lambda: uuid.UUID(hex=h, fields=f, int=i)) - badtype(lambda: uuid.UUID(bytes=b, int=i, fields=f)) - badtype(lambda: uuid.UUID(hex=h, bytes=b, int=i, fields=f)) - - # Duplicate arguments (positional and named). - badtype(lambda: uuid.UUID(h, hex=h)) - badtype(lambda: uuid.UUID(h, bytes=b)) - badtype(lambda: uuid.UUID(h, fields=f)) - badtype(lambda: uuid.UUID(h, int=i)) - badtype(lambda: uuid.UUID(h, hex=h, bytes=b)) - badtype(lambda: uuid.UUID(h, hex=h, fields=f)) - badtype(lambda: uuid.UUID(h, hex=h, int=i)) - badtype(lambda: uuid.UUID(h, bytes=b, fields=f)) - badtype(lambda: uuid.UUID(h, bytes=b, int=i)) - badtype(lambda: uuid.UUID(h, fields=f, int=i)) - badtype(lambda: uuid.UUID(h, hex=h, bytes=b, fields=f)) - badtype(lambda: uuid.UUID(h, hex=h, bytes=b, int=i)) - badtype(lambda: uuid.UUID(h, hex=h, fields=f, int=i)) - badtype(lambda: uuid.UUID(h, bytes=b, int=i, fields=f)) - badtype(lambda: uuid.UUID(h, hex=h, bytes=b, int=i, fields=f)) + badtype(lambda: uuid.UUID(h, b, b)) + badtype(lambda: uuid.UUID(h, b, b, f)) + badtype(lambda: uuid.UUID(h, b, b, f, i)) + + # Duplicate arguments. + for hh in [[], [('hex', h)]]: + for bb in [[], [('bytes', b)]]: + for bble in [[], [('bytes_le', b)]]: + for ii in [[], [('int', i)]]: + for ff in [[], [('fields', f)]]: + args = dict(hh + bb + bble + ii + ff) + if len(args) != 0: + badtype(lambda: uuid.UUID(h, **args)) + if len(args) != 1: + badtype(lambda: uuid.UUID(**args)) # Immutability. u = uuid.UUID(h) badtype(lambda: setattr(u, 'hex', h)) badtype(lambda: setattr(u, 'bytes', b)) + badtype(lambda: setattr(u, 'bytes_le', b)) badtype(lambda: setattr(u, 'fields', f)) badtype(lambda: setattr(u, 'int', i)) + badtype(lambda: setattr(u, 'time_low', 0)) + badtype(lambda: setattr(u, 'time_mid', 0)) + badtype(lambda: setattr(u, 'time_hi_version', 0)) + badtype(lambda: setattr(u, 'time_hi_version', 0)) + badtype(lambda: setattr(u, 'clock_seq_hi_variant', 0)) + badtype(lambda: setattr(u, 'clock_seq_low', 0)) + badtype(lambda: setattr(u, 'node', 0)) def check_node(self, node, source): individual_group_bit = (node >> 40L) & 1 @@ -356,11 +369,17 @@ def test_uuid1(self): equal = self.assertEqual - # Make sure uuid4() generates UUIDs that are actually version 1. + # Make sure uuid1() generates UUIDs that are actually version 1. for u in [uuid.uuid1() for i in range(10)]: equal(u.variant, uuid.RFC_4122) equal(u.version, 1) + # Make sure the generated UUIDs are actually unique. + uuids = {} + for u in [uuid.uuid1() for i in range(1000)]: + uuids[u] = 1 + equal(len(uuids.keys()), 1000) + # Make sure the supplied node ID appears in the UUID. u = uuid.uuid1(0) equal(u.node, 0) @@ -408,6 +427,12 @@ equal(u.variant, uuid.RFC_4122) equal(u.version, 4) + # Make sure the generated UUIDs are actually unique. + uuids = {} + for u in [uuid.uuid1() for i in range(1000)]: + uuids[u] = 1 + equal(len(uuids.keys()), 1000) + def test_uuid5(self): equal = self.assertEqual Modified: python/trunk/Lib/uuid.py ============================================================================== --- python/trunk/Lib/uuid.py (original) +++ python/trunk/Lib/uuid.py Wed Aug 16 09:02:50 2006 @@ -45,8 +45,6 @@ """ __author__ = 'Ka-Ping Yee ' -__date__ = '$Date: 2006/06/12 23:15:40 $'.split()[1].replace('/', '-') -__version__ = '$Revision: 1.30 $'.split()[1] RESERVED_NCS, RFC_4122, RESERVED_MICROSOFT, RESERVED_FUTURE = [ 'reserved for NCS compatibility', 'specified in RFC 4122', @@ -57,15 +55,21 @@ UUID objects are immutable, hashable, and usable as dictionary keys. Converting a UUID to a string with str() yields something in the form '12345678-1234-1234-1234-123456789abc'. The UUID constructor accepts - four possible forms: a similar string of hexadecimal digits, or a - string of 16 raw bytes as an argument named 'bytes', or a tuple of - six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and - 48-bit values respectively) as an argument named 'fields', or a single - 128-bit integer as an argument named 'int'. + five possible forms: a similar string of hexadecimal digits, or a tuple + of six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and + 48-bit values respectively) as an argument named 'fields', or a string + of 16 bytes (with all the integer fields in big-endian order) as an + argument named 'bytes', or a string of 16 bytes (with the first three + fields in little-endian order) as an argument named 'bytes_le', or a + single 128-bit integer as an argument named 'int'. UUIDs have these read-only attributes: - bytes the UUID as a 16-byte string + bytes the UUID as a 16-byte string (containing the six + integer fields in big-endian byte order) + + bytes_le the UUID as a 16-byte string (with time_low, time_mid, + and time_hi_version in little-endian byte order) fields a tuple of the six integer fields of the UUID, which are also available as six individual attributes @@ -94,10 +98,11 @@ when the variant is RFC_4122) """ - def __init__(self, hex=None, bytes=None, fields=None, int=None, - version=None): + def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None, + int=None, version=None): r"""Create a UUID from either a string of 32 hexadecimal digits, - a string of 16 bytes as the 'bytes' argument, a tuple of six + a string of 16 bytes as the 'bytes' argument, a string of 16 bytes + in little-endian order as the 'bytes_le' argument, a tuple of six integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version, 8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as the 'fields' argument, or a single 128-bit integer as the 'int' @@ -109,23 +114,31 @@ UUID('12345678123456781234567812345678') UUID('urn:uuid:12345678-1234-5678-1234-567812345678') UUID(bytes='\x12\x34\x56\x78'*4) + UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' + + '\x12\x34\x56\x78\x12\x34\x56\x78') UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678)) UUID(int=0x12345678123456781234567812345678) - Exactly one of 'hex', 'bytes', 'fields', or 'int' must be given. - The 'version' argument is optional; if given, the resulting UUID - will have its variant and version number set according to RFC 4122, - overriding bits in the given 'hex', 'bytes', 'fields', or 'int'. + Exactly one of 'hex', 'bytes', 'bytes_le', 'fields', or 'int' must + be given. The 'version' argument is optional; if given, the resulting + UUID will have its variant and version set according to RFC 4122, + overriding the given 'hex', 'bytes', 'bytes_le', 'fields', or 'int'. """ - if [hex, bytes, fields, int].count(None) != 3: - raise TypeError('need just one of hex, bytes, fields, or int') + if [hex, bytes, bytes_le, fields, int].count(None) != 4: + raise TypeError('need one of hex, bytes, bytes_le, fields, or int') if hex is not None: hex = hex.replace('urn:', '').replace('uuid:', '') hex = hex.strip('{}').replace('-', '') if len(hex) != 32: raise ValueError('badly formed hexadecimal UUID string') int = long(hex, 16) + if bytes_le is not None: + if len(bytes_le) != 16: + raise ValueError('bytes_le is not a 16-char string') + bytes = (bytes_le[3] + bytes_le[2] + bytes_le[1] + bytes_le[0] + + bytes_le[5] + bytes_le[4] + bytes_le[7] + bytes_le[6] + + bytes_le[8:]) if bytes is not None: if len(bytes) != 16: raise ValueError('bytes is not a 16-char string') @@ -194,6 +207,13 @@ bytes = property(get_bytes) + def get_bytes_le(self): + bytes = self.bytes + return (bytes[3] + bytes[2] + bytes[1] + bytes[0] + + bytes[5] + bytes[4] + bytes[7] + bytes[6] + bytes[8:]) + + bytes_le = property(get_bytes_le) + def get_fields(self): return (self.time_low, self.time_mid, self.time_hi_version, self.clock_seq_hi_variant, self.clock_seq_low, self.node) @@ -448,6 +468,8 @@ if _node is not None: return _node +_last_timestamp = None + def uuid1(node=None, clock_seq=None): """Generate a UUID from a host ID, sequence number, and the current time. If 'node' is not given, getnode() is used to obtain the hardware @@ -460,11 +482,15 @@ _uuid_generate_time(_buffer) return UUID(bytes=_buffer.raw) + global _last_timestamp import time nanoseconds = int(time.time() * 1e9) # 0x01b21dd213814000 is the number of 100-ns intervals between the # UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00. timestamp = int(nanoseconds/100) + 0x01b21dd213814000L + if timestamp == _last_timestamp: + timestamp += 1 + _last_timestamp = timestamp if clock_seq is None: import random clock_seq = random.randrange(1<<14L) # instead of stable storage From python-checkins at python.org Wed Aug 16 09:04:17 2006 From: python-checkins at python.org (kurt.kaiser) Date: Wed, 16 Aug 2006 09:04:17 +0200 (CEST) Subject: [Python-checkins] r51308 - python/trunk/Lib/idlelib/PyShell.py Message-ID: <20060816070417.C23C91E4004@bag.python.org> Author: kurt.kaiser Date: Wed Aug 16 09:04:17 2006 New Revision: 51308 Modified: python/trunk/Lib/idlelib/PyShell.py Log: Get quit() and exit() to work cleanly when not using subprocess. Modified: python/trunk/Lib/idlelib/PyShell.py ============================================================================== --- python/trunk/Lib/idlelib/PyShell.py (original) +++ python/trunk/Lib/idlelib/PyShell.py Wed Aug 16 09:04:17 2006 @@ -713,14 +713,17 @@ else: exec code in self.locals except SystemExit: - if tkMessageBox.askyesno( - "Exit?", - "Do you want to exit altogether?", - default="yes", - master=self.tkconsole.text): - raise + if not self.tkconsole.closing: + if tkMessageBox.askyesno( + "Exit?", + "Do you want to exit altogether?", + default="yes", + master=self.tkconsole.text): + raise + else: + self.showtraceback() else: - self.showtraceback() + raise except: if use_subprocess: print >> self.tkconsole.stderr, \ From anthony at interlink.com.au Wed Aug 16 09:10:53 2006 From: anthony at interlink.com.au (Anthony Baxter) Date: Wed, 16 Aug 2006 17:10:53 +1000 Subject: [Python-checkins] r51307 - in python/trunk/Lib: test/test_uuid.py uuid.py In-Reply-To: <20060816070254.63BBD1E4004@bag.python.org> References: <20060816070254.63BBD1E4004@bag.python.org> Message-ID: <200608161710.56387.anthony@interlink.com.au> On Wednesday 16 August 2006 17:02, ka-ping.yee wrote: > Author: ka-ping.yee > Date: Wed Aug 16 09:02:50 2006 > New Revision: 51307 > > Modified: > python/trunk/Lib/test/test_uuid.py > python/trunk/Lib/uuid.py > Log: > Update code and tests to support the 'bytes_le' attribute (for > little-endian byte order on Windows), and to work around clocks > with low resolution yielding duplicate UUIDs. > > Anthony Baxter has approved this change. Where is (at least) the Misc/NEWS entry for this change? And preferably also a doc update. Thanks, Anthony -- Anthony Baxter It's never too late to have a happy childhood. From buildbot at python.org Wed Aug 16 09:26:24 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 07:26:24 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP-2 trunk Message-ID: <20060816072624.BC7B81E4005@bag.python.org> The Buildbot has detected a new failure of x86 XP-2 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP-2%2520trunk/builds/877 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: ka-ping.yee,kurt.kaiser Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Wed Aug 16 09:28:32 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 07:28:32 +0000 Subject: [Python-checkins] buildbot warnings in x86 W2k trunk Message-ID: <20060816072832.C7EFE1E4004@bag.python.org> The Buildbot has detected a new failure of x86 W2k trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%2520trunk/builds/1427 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: ka-ping.yee,kurt.kaiser Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Wed Aug 16 09:41:28 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 07:41:28 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP trunk Message-ID: <20060816074129.15AC31E4004@bag.python.org> The Buildbot has detected a new failure of x86 XP trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%2520trunk/builds/1381 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: ka-ping.yee,kurt.kaiser Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 16 10:13:27 2006 From: python-checkins at python.org (marc-andre.lemburg) Date: Wed, 16 Aug 2006 10:13:27 +0200 (CEST) Subject: [Python-checkins] r51309 - python/trunk/Lib/distutils/__init__.py Message-ID: <20060816081327.0BF391E4005@bag.python.org> Author: marc-andre.lemburg Date: Wed Aug 16 10:13:26 2006 New Revision: 51309 Modified: python/trunk/Lib/distutils/__init__.py Log: Revert to having static version numbers again. Modified: python/trunk/Lib/distutils/__init__.py ============================================================================== --- python/trunk/Lib/distutils/__init__.py (original) +++ python/trunk/Lib/distutils/__init__.py Wed Aug 16 10:13:26 2006 @@ -12,6 +12,12 @@ __revision__ = "$Id$" -import sys -__version__ = "%d.%d.%d" % sys.version_info[:3] -del sys +# Distutils version +# +# Please coordinate with Marc-Andre Lemburg when adding +# new features to distutils that would warrant bumping the version number. +# +# In general, major and minor version should loosely follow the Python +# version number the distutils code was shipped with. +# +__version__ = "2.5.0" From buildbot at python.org Wed Aug 16 11:08:26 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 09:08:26 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060816090826.5C74C1E4004@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1094 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Wed Aug 16 11:10:31 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 09:10:31 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060816091031.CE9C41E4004@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/34 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Wed Aug 16 12:04:06 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 10:04:06 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060816100406.9C3B41E4004@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/505 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: ka-ping.yee,kurt.kaiser Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 16 14:55:11 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 16 Aug 2006 14:55:11 +0200 (CEST) Subject: [Python-checkins] r51310 - in python/trunk: Misc/NEWS PCbuild/_ssl.mak PCbuild/_ssl.vcproj PCbuild/build_ssl.py Tools/msi/msi.py Message-ID: <20060816125511.CD9BA1E4004@bag.python.org> Author: martin.v.loewis Date: Wed Aug 16 14:55:10 2006 New Revision: 51310 Modified: python/trunk/Misc/NEWS python/trunk/PCbuild/_ssl.mak python/trunk/PCbuild/_ssl.vcproj python/trunk/PCbuild/build_ssl.py python/trunk/Tools/msi/msi.py Log: Build _hashlib on Windows. Build OpenSSL with masm assembler code. Fixes #1535502. Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 16 14:55:10 2006 @@ -127,6 +127,9 @@ Build ----- +- Bug #1535502, build _hashlib on Windows, and use masm assembler + code in OpenSSL. + - Bug #1534738, win32 debug version of _msi should be _msi_d.pyd. - Bug #1530448, ctypes buld failure on Solaris 10 was fixed. Modified: python/trunk/PCbuild/_ssl.mak ============================================================================== --- python/trunk/PCbuild/_ssl.mak (original) +++ python/trunk/PCbuild/_ssl.mak Wed Aug 16 14:55:10 2006 @@ -1,21 +1,37 @@ !IFDEF DEBUG -MODULE=_ssl_d.pyd -TEMP_DIR=x86-temp-debug/_ssl +SUFFIX=_d.pyd +TEMP=x86-temp-debug/ CFLAGS=/Od /Zi /MDd /LDd /DDEBUG /D_DEBUG /DWIN32 SSL_LIB_DIR=$(SSL_DIR)/out32.dbg !ELSE -MODULE=_ssl.pyd -TEMP_DIR=x86-temp-release/_ssl +SUFFIX=.pyd +TEMP=x86-temp-release/ CFLAGS=/Ox /MD /LD /DWIN32 SSL_LIB_DIR=$(SSL_DIR)/out32 !ENDIF INCLUDES=-I ../Include -I ../PC -I $(SSL_DIR)/inc32 -LIBS=gdi32.lib wsock32.lib user32.lib advapi32.lib /libpath:$(SSL_LIB_DIR) libeay32.lib ssleay32.lib -SOURCE=../Modules/_ssl.c $(SSL_LIB_DIR)/libeay32.lib $(SSL_LIB_DIR)/ssleay32.lib +SSL_LIBS=gdi32.lib wsock32.lib user32.lib advapi32.lib /LIBPATH:$(SSL_LIB_DIR) libeay32.lib ssleay32.lib +SSL_SOURCE=../Modules/_ssl.c $(SSL_LIB_DIR)/libeay32.lib $(SSL_LIB_DIR)/ssleay32.lib -$(MODULE): $(SOURCE) ../PC/*.h ../Include/*.h - @if not exist "$(TEMP_DIR)/." mkdir "$(TEMP_DIR)" - cl /nologo $(SOURCE) $(CFLAGS) /Fo$(TEMP_DIR)\$*.obj $(INCLUDES) /link /out:$(MODULE) $(LIBS) +HASH_LIBS=gdi32.lib user32.lib advapi32.lib /libpath:$(SSL_LIB_DIR) libeay32.lib +HASH_SOURCE=../Modules/_hashopenssl.c $(SSL_LIB_DIR)/libeay32.lib + +all: _ssl$(SUFFIX) _hashlib$(SUFFIX) + +# Split compile/link into two steps to better support VSExtComp +_ssl$(SUFFIX): $(SSL_SOURCE) ../PC/*.h ../Include/*.h + @if not exist "$(TEMP)/_ssl/." mkdir "$(TEMP)/_ssl" + cl /nologo $(SSL_SOURCE) $(CFLAGS) /Fo$(TEMP)\_ssl\$*.obj $(INCLUDES) + link /nologo @<< + /dll /out:_ssl$(SUFFIX) $(TEMP)\_ssl\$*.obj $(SSL_LIBS) +<< + +_hashlib$(SUFFIX): $(HASH_SOURCE) ../PC/*.h ../Include/*.h + @if not exist "$(TEMP)/_hashlib/." mkdir "$(TEMP)/_hashlib" + cl /nologo /c $(HASH_SOURCE) $(CFLAGS) /Fo$(TEMP)\_hashlib\$*.obj $(INCLUDES) + link /nologo @<< + /dll /out:_hashlib$(SUFFIX) $(HASH_LIBS) $(TEMP)\_hashlib\$*.obj +<< Modified: python/trunk/PCbuild/_ssl.vcproj ============================================================================== --- python/trunk/PCbuild/_ssl.vcproj (original) +++ python/trunk/PCbuild/_ssl.vcproj Wed Aug 16 14:55:10 2006 @@ -75,6 +75,9 @@ + + Modified: python/trunk/PCbuild/build_ssl.py ============================================================================== --- python/trunk/PCbuild/build_ssl.py (original) +++ python/trunk/PCbuild/build_ssl.py Wed Aug 16 14:55:10 2006 @@ -1,7 +1,7 @@ -# Script for building the _ssl module for Windows. +# Script for building the _ssl and _hashlib modules for Windows. # Uses Perl to setup the OpenSSL environment correctly # and build OpenSSL, then invokes a simple nmake session -# for _ssl.pyd itself. +# for the actual _ssl.pyd and _hashlib.pyd DLLs. # THEORETICALLY, you can: # * Unpack the latest SSL release one level above your main Python source @@ -10,8 +10,8 @@ # * Install ActivePerl and ensure it is somewhere on your path. # * Run this script from the PCBuild directory. # -# it should configure and build SSL, then build the ssl Python extension -# without intervention. +# it should configure and build SSL, then build the _ssl and _hashlib +# Python extensions without intervention. import os, sys, re @@ -59,7 +59,8 @@ candidates = [] for s in sources: try: - s = os.path.abspath(s) + # note: do not abspath s; the build will fail if any + # higher up directory name has spaces in it. fnames = os.listdir(s) except os.error: fnames = [] @@ -82,31 +83,9 @@ print "Found an SSL directory at '%s'" % (best_name,) else: print "Could not find an SSL directory in '%s'" % (sources,) + sys.stdout.flush() return best_name -def run_32all_py(): - # ms\32all.bat will reconfigure OpenSSL and then try to build - # all outputs (debug/nondebug/dll/lib). So we filter the file - # to exclude any "nmake" commands and then execute. - tempname = "ms\\32all_py.bat" - - in_bat = open("ms\\32all.bat") - temp_bat = open(tempname,"w") - while 1: - cmd = in_bat.readline() - print 'cmd', repr(cmd) - if not cmd: break - if cmd.strip()[:5].lower() == "nmake": - continue - temp_bat.write(cmd) - in_bat.close() - temp_bat.close() - os.system(tempname) - try: - os.remove(tempname) - except: - pass - def run_configure(configure, do_script): os.system("perl Configure "+configure) os.system(do_script) @@ -117,12 +96,14 @@ arch = "x86" debug = False configure = "VC-WIN32" - makefile = "32.mak" + do_script = "ms\\do_masm" + makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" - makefile="d32.mak" + do_script = "ms\\do_masm" + makefile="ms\\d32.mak" elif sys.argv[1] == "ReleaseItanium": arch = "ia64" debug = False @@ -148,8 +129,9 @@ sys.exit(1) print "Found a working perl at '%s'" % (perl,) + sys.stdout.flush() # Look for SSL 2 levels up from pcbuild - ie, same place zlib etc all live. - ssl_dir = find_best_ssl_dir(("../..",)) + ssl_dir = find_best_ssl_dir(("..\\..",)) if ssl_dir is None: sys.exit(1) @@ -159,29 +141,35 @@ # If the ssl makefiles do not exist, we invoke Perl to generate them. if not os.path.isfile(makefile): print "Creating the makefiles..." + sys.stdout.flush() # Put our working Perl at the front of our path - os.environ["PATH"] = os.path.split(perl)[0] + \ + os.environ["PATH"] = os.path.dirname(perl) + \ os.pathsep + \ os.environ["PATH"] - if arch=="x86": - run_32all_py() - else: - run_configure(configure, do_script) + if arch=="x86" and debug: + # the do_masm script in openssl doesn't generate a debug + # build makefile so we generate it here: + os.system("perl util\mk1mf.pl debug "+configure+" >"+makefile) + run_configure(configure, do_script) # Now run make. print "Executing nmake over the ssl makefiles..." - rc = os.system("nmake /nologo -f "+makefile) + sys.stdout.flush() + rc = os.system("nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)) if rc: - print "Executing d32.mak failed" + print "Executing "+makefile+" failed" print rc sys.exit(rc) finally: os.chdir(old_cd) # And finally, we can build the _ssl module itself for Python. - defs = "SSL_DIR=%s" % (ssl_dir,) + defs = "SSL_DIR=\"%s\"" % (ssl_dir,) if debug: defs = defs + " " + "DEBUG=1" - rc = os.system('nmake /nologo -f _ssl.mak ' + defs + " " + make_flags) + makeCommand = 'nmake /nologo -f _ssl.mak ' + defs + " " + make_flags + print "Executing:", makeCommand + sys.stdout.flush() + rc = os.system(makeCommand) sys.exit(rc) if __name__=='__main__': Modified: python/trunk/Tools/msi/msi.py ============================================================================== --- python/trunk/Tools/msi/msi.py (original) +++ python/trunk/Tools/msi/msi.py Wed Aug 16 14:55:10 2006 @@ -89,7 +89,8 @@ '_msi.pyd', '_ctypes.pyd', '_ctypes_test.pyd', - '_sqlite3.pyd' + '_sqlite3.pyd', + '_hashlib.pyd' ] # Well-known component UUIDs From buildbot at python.org Wed Aug 16 15:02:08 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 13:02:08 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k trunk Message-ID: <20060816130208.62E081E4004@bag.python.org> The Buildbot has detected a new failure of x86 W2k trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%2520trunk/builds/1429 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Wed Aug 16 15:03:14 2006 From: python-checkins at python.org (thomas.heller) Date: Wed, 16 Aug 2006 15:03:14 +0200 (CEST) Subject: [Python-checkins] r51311 - python/trunk/Modules/_ctypes/_ctypes.c Message-ID: <20060816130314.D44D61E4004@bag.python.org> Author: thomas.heller Date: Wed Aug 16 15:03:11 2006 New Revision: 51311 Modified: python/trunk/Modules/_ctypes/_ctypes.c Log: Add commented assert statements to check that the result of PyObject_stgdict() and PyType_stgdict() calls are non-NULL before dereferencing the result. Hopefully this fixes what klocwork is complaining about. Fix a few other nits as well. Modified: python/trunk/Modules/_ctypes/_ctypes.c ============================================================================== --- python/trunk/Modules/_ctypes/_ctypes.c (original) +++ python/trunk/Modules/_ctypes/_ctypes.c Wed Aug 16 15:03:11 2006 @@ -152,7 +152,7 @@ parg->tag = 'V'; stgdict = PyObject_stgdict((PyObject *)self); - assert(stgdict); + assert(stgdict); /* Cannot be NULL for structure/union instances */ parg->pffi_type = &stgdict->ffi_type_pointer; /* For structure parameters (by value), parg->value doesn't contain the structure data itself, instead parg->value.p *points* to the structure's data @@ -328,7 +328,6 @@ /* If we got a PyCArgObject, we must check if the object packed in it is an instance of the type's dict->proto */ -// if(dict && ob && dict->proto == (PyObject *)ob->ob_type){ if(dict && ob && PyObject_IsInstance(ob, dict->proto)) { Py_INCREF(value); @@ -693,6 +692,7 @@ the item types are the same. */ StgDictObject *v = PyObject_stgdict(value); + assert(v); /* Cannot be NULL for pointer or array objects */ if (PyObject_IsSubclass(v->proto, typedict->proto)) { Py_INCREF(value); return value; @@ -1154,7 +1154,9 @@ if (ArrayObject_Check(value) || PointerObject_Check(value)) { /* c_wchar array instance or pointer(c_wchar(...)) */ StgDictObject *dt = PyObject_stgdict(value); - StgDictObject *dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL; + StgDictObject *dict; + assert(dt); /* Cannot be NULL for pointer or array objects */ + dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL; if (dict && (dict->setfunc == getentry("u")->setfunc)) { Py_INCREF(value); return value; @@ -1216,7 +1218,9 @@ if (ArrayObject_Check(value) || PointerObject_Check(value)) { /* c_char array instance or pointer(c_char(...)) */ StgDictObject *dt = PyObject_stgdict(value); - StgDictObject *dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL; + StgDictObject *dict; + assert(dt); /* Cannot be NULL for pointer or array objects */ + dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL; if (dict && (dict->setfunc == getentry("c")->setfunc)) { Py_INCREF(value); return value; @@ -1468,7 +1472,7 @@ struct fielddesc *fd; dict = PyObject_stgdict((PyObject *)self); - assert(dict); + assert(dict); /* Cannot be NULL for CDataObject instances */ fmt = PyString_AsString(dict->proto); assert(fmt); @@ -2066,6 +2070,7 @@ CData_clear(CDataObject *self) { StgDictObject *dict = PyObject_stgdict((PyObject *)self); + assert(dict); /* Cannot be NULL for CDataObject instances */ Py_CLEAR(self->b_objects); if ((self->b_needsfree) && ((size_t)dict->size > sizeof(self->b_value))) @@ -2363,7 +2368,9 @@ StgDictObject *p1, *p2; PyObject *keep; p1 = PyObject_stgdict(value); + assert(p1); /* Cannot be NULL for array instances */ p2 = PyType_stgdict(type); + assert(p2); /* Cannot be NULL for pointer types */ if (p1->proto != p2->proto) { PyErr_Format(PyExc_TypeError, @@ -2512,7 +2519,7 @@ return self->restype; } dict = PyObject_stgdict((PyObject *)self); - assert(dict); + assert(dict); /* Cannot be NULL for CFuncPtrObject instances */ if (dict->restype) { Py_INCREF(dict->restype); return dict->restype; @@ -2554,7 +2561,7 @@ return self->argtypes; } dict = PyObject_stgdict((PyObject *)self); - assert(dict); + assert(dict); /* Cannot be NULL for CFuncPtrObject instances */ if (dict->argtypes) { Py_INCREF(dict->argtypes); return dict->argtypes; @@ -2647,8 +2654,12 @@ _validate_paramflags(PyTypeObject *type, PyObject *paramflags) { int i, len; - StgDictObject *dict = PyType_stgdict((PyObject *)type); - PyObject *argtypes = dict->argtypes; + StgDictObject *dict; + PyObject *argtypes; + + dict = PyType_stgdict((PyObject *)type); + assert(dict); /* Cannot be NULL. 'type' is a CFuncPtr type. */ + argtypes = dict->argtypes; if (paramflags == NULL || dict->argtypes == NULL) return 1; @@ -3260,7 +3271,7 @@ int outmask; unsigned int numretvals; - assert(dict); /* if not, it's a bug */ + assert(dict); /* Cannot be NULL for CFuncPtrObject instances */ restype = self->restype ? self->restype : dict->restype; converters = self->converters ? self->converters : dict->converters; checker = self->checker ? self->checker : dict->checker; @@ -3681,7 +3692,7 @@ } stgdict = PyObject_stgdict((PyObject *)self); - assert(stgdict); + assert(stgdict); /* Cannot be NULL for array instances */ /* Would it be clearer if we got the item size from stgdict->proto's stgdict? */ @@ -3712,6 +3723,7 @@ len = ihigh - ilow; stgdict = PyObject_stgdict((PyObject *)self); + assert(stgdict); /* Cannot be NULL for array object instances */ proto = stgdict->proto; itemdict = PyType_stgdict(proto); if (itemdict->getfunc == getentry("c")->getfunc) { @@ -3750,6 +3762,7 @@ } stgdict = PyObject_stgdict((PyObject *)self); + assert(stgdict); /* Cannot be NULL for array object instances */ if (index < 0 || index >= stgdict->length) { PyErr_SetString(PyExc_IndexError, "invalid index"); @@ -3941,6 +3954,7 @@ PyObject *result; StgDictObject *dict = PyObject_stgdict((PyObject *)self); + assert(dict); /* Cannot be NULL for CDataObject instances */ assert(dict->setfunc); result = dict->setfunc(self->b_ptr, value, dict->size); if (!result) @@ -3966,8 +3980,8 @@ { StgDictObject *dict; dict = PyObject_stgdict((PyObject *)self); + assert(dict); /* Cannot be NULL for CDataObject instances */ assert(dict->getfunc); - dict = PyObject_stgdict((PyObject *)self); return dict->getfunc(self->b_ptr, self->b_size); } @@ -4140,11 +4154,10 @@ } stgdict = PyObject_stgdict((PyObject *)self); - assert(stgdict); - assert(stgdict->proto); + assert(stgdict); /* Cannot be NULL for pointer object instances */ proto = stgdict->proto; - /* XXXXXX MAKE SURE PROTO IS NOT NULL! */ + assert(proto); itemdict = PyType_stgdict(proto); size = itemdict->size; offset = index * itemdict->size; @@ -4175,11 +4188,11 @@ } stgdict = PyObject_stgdict((PyObject *)self); - assert(stgdict); - assert(stgdict->proto); + assert(stgdict); /* Cannot be NULL fr pointer instances */ proto = stgdict->proto; - /* XXXXXX MAKE SURE PROTO IS NOT NULL! */ + assert(proto); + itemdict = PyType_stgdict(proto); size = itemdict->size; offset = index * itemdict->size; @@ -4200,7 +4213,7 @@ } stgdict = PyObject_stgdict((PyObject *)self); - assert(stgdict); + assert(stgdict); /* Cannot be NULL fr pointer instances */ return CData_FromBaseObj(stgdict->proto, (PyObject *)self, 0, *(void **)self->b_ptr); @@ -4219,7 +4232,7 @@ return -1; } stgdict = PyObject_stgdict((PyObject *)self); - /* should have been catched in Pointer_new() */ + assert(stgdict); /* Cannot be NULL fr pointer instances */ assert(stgdict->proto); if (!CDataObject_Check(value) || 0 == PyObject_IsInstance(value, stgdict->proto)) { @@ -4295,8 +4308,11 @@ len = ihigh - ilow; stgdict = PyObject_stgdict((PyObject *)self); + assert(stgdict); /* Cannot be NULL fr pointer instances */ proto = stgdict->proto; + assert(proto); itemdict = PyType_stgdict(proto); + assert(itemdict); if (itemdict->getfunc == getentry("c")->getfunc) { char *ptr = *(char **)self->b_ptr; return PyString_FromStringAndSize(ptr + ilow, len); From buildbot at python.org Wed Aug 16 15:03:19 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 13:03:19 +0000 Subject: [Python-checkins] buildbot failure in x86 XP trunk Message-ID: <20060816130319.B67B11E4004@bag.python.org> The Buildbot has detected a new failure of x86 XP trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%2520trunk/builds/1383 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Wed Aug 16 15:08:26 2006 From: python-checkins at python.org (anthony.baxter) Date: Wed, 16 Aug 2006 15:08:26 +0200 (CEST) Subject: [Python-checkins] r51312 - python/trunk/Misc/NEWS Message-ID: <20060816130826.F05651E4004@bag.python.org> Author: anthony.baxter Date: Wed Aug 16 15:08:25 2006 New Revision: 51312 Modified: python/trunk/Misc/NEWS Log: news entry for 51307 Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 16 15:08:25 2006 @@ -64,6 +64,11 @@ Library ------- +- uuid.UUID now has a bytes_le attribute. This returns the UUID in + little-endian byte order for Windows. In addition, uuid.py had some + workarounds for clocks with low resolution, to stop the code yielding + duplicate UUIDs. + - Patch #1540892: site.py Quitter() class attempts to close sys.stdin before raising SystemExit, allowing IDLE to honor quit() and exit(). From python-checkins at python.org Wed Aug 16 15:22:21 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 16 Aug 2006 15:22:21 +0200 (CEST) Subject: [Python-checkins] r51313 - python/trunk/Doc/whatsnew/whatsnew25.tex Message-ID: <20060816132221.5E2361E4005@bag.python.org> Author: andrew.kuchling Date: Wed Aug 16 15:22:20 2006 New Revision: 51313 Modified: python/trunk/Doc/whatsnew/whatsnew25.tex Log: Add UnicodeWarning Modified: python/trunk/Doc/whatsnew/whatsnew25.tex ============================================================================== --- python/trunk/Doc/whatsnew/whatsnew25.tex (original) +++ python/trunk/Doc/whatsnew/whatsnew25.tex Wed Aug 16 15:22:20 2006 @@ -1184,6 +1184,35 @@ # -*- coding: latin1 -*- \end{verbatim} +\item A new warning, \class{UnicodeWarning}, is triggered when +you attempt to compare a Unicode string and an 8-bit string +that can't be converted to Unicode using the default ASCII encoding. +The result of the comparison is false: + +\begin{verbatim} +>>> chr(128) == unichr(128) # Can't convert chr(128) to Unicode +__main__:1: UnicodeWarning: Unicode equal comparison failed + to convert both arguments to Unicode - interpreting them + as being unequal +False +>>> chr(127) == unichr(127) # chr(127) can be converted +True +\end{verbatim} + +Previously this would raise a \class{UnicodeDecodeError} exception, +but in 2.5 this could result in puzzling problems when accessing a +dictionary. If you looked up \code{unichr(128)} and \code{chr(128)} +was being used as a key, you'd get a \class{UnicodeDecodeError} +exception. Other changes in 2.5 resulted in this exception being +raised instead of suppressed by the code in \file{dictobject.c} that +implements dictionaries. + +Raising an exception for such a comparison is strictly correct, but +the change might have broken code, so instead +\class{UnicodeWarning} was introduced. + +(Implemented by Marc-Andr\'e Lemburg.) + \item One error that Python programmers sometimes make is forgetting to include an \file{__init__.py} module in a package directory. Debugging this mistake can be confusing, and usually requires running @@ -2423,6 +2452,11 @@ described in section~\ref{pep-342}, it's now possible for \member{gi_frame} to be \code{None}. +\item A new warning, \class{UnicodeWarning}, is triggered when +you attempt to compare a Unicode string and an 8-bit string that can't +be converted to Unicode using the default ASCII encoding. Previously +such comparisons would raise a \class{UnicodeDecodeError} exception. + \item Library: the \module{csv} module is now stricter about multi-line quoted fields. If your files contain newlines embedded within fields, the input should be split into lines in a manner which preserves the From python-checkins at python.org Wed Aug 16 15:41:53 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 16 Aug 2006 15:41:53 +0200 (CEST) Subject: [Python-checkins] r51314 - python/trunk/Doc/whatsnew/whatsnew25.tex Message-ID: <20060816134153.4E4C91E400A@bag.python.org> Author: andrew.kuchling Date: Wed Aug 16 15:41:52 2006 New Revision: 51314 Modified: python/trunk/Doc/whatsnew/whatsnew25.tex Log: Bump document version to 1.0; remove pystone paragraph Modified: python/trunk/Doc/whatsnew/whatsnew25.tex ============================================================================== --- python/trunk/Doc/whatsnew/whatsnew25.tex (original) +++ python/trunk/Doc/whatsnew/whatsnew25.tex Wed Aug 16 15:41:52 2006 @@ -5,7 +5,7 @@ % Fix XXX comments \title{What's New in Python 2.5} -\release{0.9} +\release{1.0} \author{A.M. Kuchling} \authoraddress{\email{amk at amk.ca}} @@ -1334,9 +1334,6 @@ \end{itemize} -The net result of the 2.5 optimizations is that Python 2.5 runs the -pystone benchmark around XXX\% faster than Python 2.4. - %====================================================================== \section{New, Improved, and Removed Modules\label{modules}} From python-checkins at python.org Wed Aug 16 15:51:32 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 16 Aug 2006 15:51:32 +0200 (CEST) Subject: [Python-checkins] r51315 - python/trunk/Doc/whatsnew/whatsnew25.tex Message-ID: <20060816135132.9173D1E4004@bag.python.org> Author: andrew.kuchling Date: Wed Aug 16 15:51:32 2006 New Revision: 51315 Modified: python/trunk/Doc/whatsnew/whatsnew25.tex Log: Link to docs; remove an XXX comment Modified: python/trunk/Doc/whatsnew/whatsnew25.tex ============================================================================== --- python/trunk/Doc/whatsnew/whatsnew25.tex (original) +++ python/trunk/Doc/whatsnew/whatsnew25.tex Wed Aug 16 15:51:32 2006 @@ -47,8 +47,7 @@ This article doesn't try to be a complete specification of the new features; instead changes are briefly introduced using helpful examples. For full details, you should always refer to the -documentation for Python 2.5. -% XXX add hyperlink when the documentation becomes available online. +documentation for Python 2.5 at \url{http://docs.python.org}. If you want to understand the complete implementation and design rationale, refer to the PEP for a particular new feature. @@ -751,7 +750,6 @@ database, or rolled back, meaning that the changes are all discarded and the database is unchanged. See any database textbook for more information.) -% XXX find a shorter reference? Let's assume there's an object representing a database connection. Our goal will be to let the user write code like this: From python-checkins at python.org Wed Aug 16 15:58:51 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 16 Aug 2006 15:58:51 +0200 (CEST) Subject: [Python-checkins] r51316 - python/trunk/PCbuild/_ssl.mak Message-ID: <20060816135851.96F981E4004@bag.python.org> Author: martin.v.loewis Date: Wed Aug 16 15:58:51 2006 New Revision: 51316 Modified: python/trunk/PCbuild/_ssl.mak Log: Make cl build step compile-only (/c). Remove libs from source list. Modified: python/trunk/PCbuild/_ssl.mak ============================================================================== --- python/trunk/PCbuild/_ssl.mak (original) +++ python/trunk/PCbuild/_ssl.mak Wed Aug 16 15:58:51 2006 @@ -14,22 +14,22 @@ INCLUDES=-I ../Include -I ../PC -I $(SSL_DIR)/inc32 SSL_LIBS=gdi32.lib wsock32.lib user32.lib advapi32.lib /LIBPATH:$(SSL_LIB_DIR) libeay32.lib ssleay32.lib -SSL_SOURCE=../Modules/_ssl.c $(SSL_LIB_DIR)/libeay32.lib $(SSL_LIB_DIR)/ssleay32.lib +SSL_SOURCE=../Modules/_ssl.c HASH_LIBS=gdi32.lib user32.lib advapi32.lib /libpath:$(SSL_LIB_DIR) libeay32.lib -HASH_SOURCE=../Modules/_hashopenssl.c $(SSL_LIB_DIR)/libeay32.lib +HASH_SOURCE=../Modules/_hashopenssl.c all: _ssl$(SUFFIX) _hashlib$(SUFFIX) # Split compile/link into two steps to better support VSExtComp -_ssl$(SUFFIX): $(SSL_SOURCE) ../PC/*.h ../Include/*.h +_ssl$(SUFFIX): $(SSL_SOURCE) $(SSL_LIB_DIR)/libeay32.lib $(SSL_LIB_DIR)/ssleay32.lib ../PC/*.h ../Include/*.h @if not exist "$(TEMP)/_ssl/." mkdir "$(TEMP)/_ssl" - cl /nologo $(SSL_SOURCE) $(CFLAGS) /Fo$(TEMP)\_ssl\$*.obj $(INCLUDES) + cl /nologo /c $(SSL_SOURCE) $(CFLAGS) /Fo$(TEMP)\_ssl\$*.obj $(INCLUDES) link /nologo @<< /dll /out:_ssl$(SUFFIX) $(TEMP)\_ssl\$*.obj $(SSL_LIBS) << -_hashlib$(SUFFIX): $(HASH_SOURCE) ../PC/*.h ../Include/*.h +_hashlib$(SUFFIX): $(HASH_SOURCE) $(SSL_LIB_DIR)/libeay32.lib ../PC/*.h ../Include/*.h @if not exist "$(TEMP)/_hashlib/." mkdir "$(TEMP)/_hashlib" cl /nologo /c $(HASH_SOURCE) $(CFLAGS) /Fo$(TEMP)\_hashlib\$*.obj $(INCLUDES) link /nologo @<< From python-checkins at python.org Wed Aug 16 16:07:51 2006 From: python-checkins at python.org (thomas.heller) Date: Wed, 16 Aug 2006 16:07:51 +0200 (CEST) Subject: [Python-checkins] r51317 - in python/trunk: Lib/ctypes/__init__.py Lib/ctypes/test/test_python_api.py Misc/NEWS Modules/_ctypes/cfield.c Message-ID: <20060816140751.6F0BD1E4004@bag.python.org> Author: thomas.heller Date: Wed Aug 16 16:07:44 2006 New Revision: 51317 Modified: python/trunk/Lib/ctypes/__init__.py python/trunk/Lib/ctypes/test/test_python_api.py python/trunk/Misc/NEWS python/trunk/Modules/_ctypes/cfield.c Log: The __repr__ method of a NULL py_object does no longer raise an exception. Remove a stray '?' character from the exception text when the value is retrieved of such an object. Includes tests. Modified: python/trunk/Lib/ctypes/__init__.py ============================================================================== --- python/trunk/Lib/ctypes/__init__.py (original) +++ python/trunk/Lib/ctypes/__init__.py Wed Aug 16 16:07:44 2006 @@ -135,6 +135,11 @@ class py_object(_SimpleCData): _type_ = "O" + def __repr__(self): + try: + return super(py_object, self).__repr__() + except ValueError: + return "%s()" % type(self).__name__ class c_short(_SimpleCData): _type_ = "h" Modified: python/trunk/Lib/ctypes/test/test_python_api.py ============================================================================== --- python/trunk/Lib/ctypes/test/test_python_api.py (original) +++ python/trunk/Lib/ctypes/test/test_python_api.py Wed Aug 16 16:07:44 2006 @@ -78,5 +78,10 @@ # not enough arguments self.failUnlessRaises(TypeError, PyOS_snprintf, buf) + def test_pyobject_repr(self): + self.failUnlessEqual(repr(py_object()), "py_object()") + self.failUnlessEqual(repr(py_object(42)), "py_object(42)") + self.failUnlessEqual(repr(py_object(object)), "py_object(%r)" % object) + if __name__ == "__main__": unittest.main() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 16 16:07:44 2006 @@ -64,6 +64,9 @@ Library ------- +- The __repr__ method a NULL ctypes.py_object() does no longer raise + an exception. + - uuid.UUID now has a bytes_le attribute. This returns the UUID in little-endian byte order for Windows. In addition, uuid.py had some workarounds for clocks with low resolution, to stop the code yielding Modified: python/trunk/Modules/_ctypes/cfield.c ============================================================================== --- python/trunk/Modules/_ctypes/cfield.c (original) +++ python/trunk/Modules/_ctypes/cfield.c Wed Aug 16 16:07:44 2006 @@ -1100,7 +1100,7 @@ if (!PyErr_Occurred()) /* Set an error if not yet set */ PyErr_SetString(PyExc_ValueError, - "PyObject is NULL?"); + "PyObject is NULL"); return NULL; } Py_INCREF(ob); From python-checkins at python.org Wed Aug 16 16:18:24 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 16 Aug 2006 16:18:24 +0200 (CEST) Subject: [Python-checkins] r51318 - python/trunk/Doc/whatsnew/whatsnew25.tex Message-ID: <20060816141824.093BD1E4004@bag.python.org> Author: andrew.kuchling Date: Wed Aug 16 16:18:23 2006 New Revision: 51318 Modified: python/trunk/Doc/whatsnew/whatsnew25.tex Log: Update bug/patch counts Modified: python/trunk/Doc/whatsnew/whatsnew25.tex ============================================================================== --- python/trunk/Doc/whatsnew/whatsnew25.tex (original) +++ python/trunk/Doc/whatsnew/whatsnew25.tex Wed Aug 16 16:18:23 2006 @@ -40,7 +40,7 @@ As well as the language and library additions, other improvements and bugfixes were made throughout the source tree. A search through the -SVN change logs finds there were 334 patches applied and 443 bugs +SVN change logs finds there were 353 patches applied and 458 bugs fixed between Python 2.4 and 2.5. (Both figures are likely to be underestimates.) From python-checkins at python.org Wed Aug 16 16:21:15 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 16 Aug 2006 16:21:15 +0200 (CEST) Subject: [Python-checkins] r51319 - python/trunk/Misc/NEWS Message-ID: <20060816142115.699FA1E4004@bag.python.org> Author: andrew.kuchling Date: Wed Aug 16 16:21:14 2006 New Revision: 51319 Modified: python/trunk/Misc/NEWS Log: Wording/typo fixes Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 16 16:21:14 2006 @@ -13,8 +13,8 @@ ----------------- - Unicode objects will no longer raise an exception when being - compared equal or unequal to a string and causing a - UnicodeDecodeError exception, e.g. as result of a decoding failure. + compared equal or unequal to a string and a UnicodeDecodeError + exception occurs, e.g. as result of a decoding failure. Instead, the equal (==) and unequal (!=) comparison operators will now issue a UnicodeWarning and interpret the two objects as @@ -64,11 +64,11 @@ Library ------- -- The __repr__ method a NULL ctypes.py_object() does no longer raise +- The __repr__ method of a NULL ctypes.py_object() no longer raises an exception. - uuid.UUID now has a bytes_le attribute. This returns the UUID in - little-endian byte order for Windows. In addition, uuid.py had some + little-endian byte order for Windows. In addition, uuid.py gained some workarounds for clocks with low resolution, to stop the code yielding duplicate UUIDs. @@ -83,7 +83,7 @@ - logging's atexit hook now runs even if the rest of the module has already been cleaned up. -- Bug #1112549, DoS attack on cgi.FieldStorage. +- Bug #1112549, fix DoS attack on cgi.FieldStorage. - Bug #1531405, format_exception no longer raises an exception if str(exception) raised an exception. @@ -140,7 +140,7 @@ - Bug #1534738, win32 debug version of _msi should be _msi_d.pyd. -- Bug #1530448, ctypes buld failure on Solaris 10 was fixed. +- Bug #1530448, ctypes build failure on Solaris 10 was fixed. C API @@ -166,7 +166,7 @@ Core and builtins ----------------- -- _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t, it previously +- _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t; it previously returned a long (see PEP 353). - Bug #1515471: string.replace() accepts character buffers again. @@ -208,7 +208,7 @@ This means that .pyc files generated before 2.5b3 will be regenerated. - Bug #1524317: Compiling Python ``--without-threads`` failed. - The Python core compiles again then, and, in a build without threads, the + The Python core compiles again, and, in a build without threads, the new ``sys._current_frames()`` returns a dictionary with one entry, mapping the faux "thread id" 0 to the current frame. @@ -230,8 +230,8 @@ - Bug #1002398: The documentation for os.path.sameopenfile now correctly refers to file descriptors, not file objects. -- Rename of the xml package to xmlcore, and the import hackery done to - make it appear at both names, has been removed. Bug #1511497, +- The renaming of the xml package to xmlcore, and the import hackery done + to make it appear at both names, has been removed. Bug #1511497, #1513611, and probably others. - Bug #1441397: The compiler module now recognizes module and function @@ -243,7 +243,7 @@ side effects from one test to the next affect outcomes. ``DocTestFinder`` has been changed to sort the list of tests it returns. -- The distutils version has been changed to 2.5.0, and are now kept +- The distutils version has been changed to 2.5.0, and is now kept in sync with sys.version_info[:3]. - Bug #978833: Really close underlying socket in _socketobject.close. From buildbot at python.org Wed Aug 16 16:23:02 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 14:23:02 +0000 Subject: [Python-checkins] buildbot warnings in x86 W2k trunk Message-ID: <20060816142302.380C81E4005@bag.python.org> The Buildbot has detected a new failure of x86 W2k trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%2520trunk/builds/1431 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,anthony.baxter,martin.v.loewis Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Wed Aug 16 16:34:11 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 14:34:11 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP trunk Message-ID: <20060816143411.257211E4004@bag.python.org> The Buildbot has detected a new failure of x86 XP trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%2520trunk/builds/1385 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,anthony.baxter,martin.v.loewis Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 16 17:10:14 2006 From: python-checkins at python.org (thomas.heller) Date: Wed, 16 Aug 2006 17:10:14 +0200 (CEST) Subject: [Python-checkins] r51320 - in python/trunk: Lib/ctypes/test/test_as_parameter.py Lib/ctypes/test/test_functions.py Misc/NEWS Modules/_ctypes/callbacks.c Message-ID: <20060816151014.73BD51E4004@bag.python.org> Author: thomas.heller Date: Wed Aug 16 17:10:12 2006 New Revision: 51320 Modified: python/trunk/Lib/ctypes/test/test_as_parameter.py python/trunk/Lib/ctypes/test/test_functions.py python/trunk/Misc/NEWS python/trunk/Modules/_ctypes/callbacks.c Log: Remove the special casing of Py_None when converting the return value of the Python part of a callback function to C. If it cannot be converted, call PyErr_WriteUnraisable with the exception we got. Before, arbitrary data has been passed to the calling C code in this case. (I'm not really sure the NEWS entry is understandable, but I cannot find better words) Modified: python/trunk/Lib/ctypes/test/test_as_parameter.py ============================================================================== --- python/trunk/Lib/ctypes/test/test_as_parameter.py (original) +++ python/trunk/Lib/ctypes/test/test_as_parameter.py Wed Aug 16 17:10:12 2006 @@ -61,6 +61,7 @@ def callback(v): args.append(v) + return v CallBack = CFUNCTYPE(c_int, c_int) Modified: python/trunk/Lib/ctypes/test/test_functions.py ============================================================================== --- python/trunk/Lib/ctypes/test/test_functions.py (original) +++ python/trunk/Lib/ctypes/test/test_functions.py Wed Aug 16 17:10:12 2006 @@ -222,6 +222,7 @@ def callback(v): args.append(v) + return v CallBack = CFUNCTYPE(c_int, c_int) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 16 17:10:12 2006 @@ -64,6 +64,11 @@ Library ------- +- If a the Python part of a ctypes callback function returns None, + and this cannot be converted to the required C type, an exception is + printed with PyErr_WriteUnraisable. Before this change, the C + callback did return arbitrary values to the calling code. + - The __repr__ method of a NULL ctypes.py_object() no longer raises an exception. Modified: python/trunk/Modules/_ctypes/callbacks.c ============================================================================== --- python/trunk/Modules/_ctypes/callbacks.c (original) +++ python/trunk/Modules/_ctypes/callbacks.c Wed Aug 16 17:10:12 2006 @@ -205,7 +205,7 @@ result = PyObject_CallObject(callable, arglist); CHECK("'calling callback function'", result); - if ((restype != &ffi_type_void) && result && result != Py_None) { + if ((restype != &ffi_type_void) && result) { PyObject *keep; assert(setfunc); #ifdef WORDS_BIGENDIAN From g.brandl at gmx.net Wed Aug 16 17:27:43 2006 From: g.brandl at gmx.net (Georg Brandl) Date: Wed, 16 Aug 2006 17:27:43 +0200 Subject: [Python-checkins] r51319 - python/trunk/Misc/NEWS In-Reply-To: <20060816142115.699FA1E4004@bag.python.org> References: <20060816142115.699FA1E4004@bag.python.org> Message-ID: andrew.kuchling wrote: > Author: andrew.kuchling > Date: Wed Aug 16 16:21:14 2006 > New Revision: 51319 > > Modified: > python/trunk/Misc/NEWS > Log: > Wording/typo fixes > > Modified: python/trunk/Misc/NEWS > ============================================================================== > -- The distutils version has been changed to 2.5.0, and are now kept > +- The distutils version has been changed to 2.5.0, and is now kept > in sync with sys.version_info[:3]. Hasn't that been reverted again? Georg From amk at amk.ca Wed Aug 16 18:12:46 2006 From: amk at amk.ca (A.M. Kuchling) Date: Wed, 16 Aug 2006 12:12:46 -0400 Subject: [Python-checkins] r51319 - python/trunk/Misc/NEWS In-Reply-To: References: <20060816142115.699FA1E4004@bag.python.org> Message-ID: <20060816161246.GA4830@rogue.amk.ca> On Wed, Aug 16, 2006 at 05:27:43PM +0200, Georg Brandl wrote: > > -- The distutils version has been changed to 2.5.0, and are now kept > > +- The distutils version has been changed to 2.5.0, and is now kept > > in sync with sys.version_info[:3]. > > Hasn't that been reverted again? Yes, but this is in the section describing the changes in 2.5b3. A NEWS entry should be added to the 2.5rc1 section saying that the change has been reverted. --amk From mal at egenix.com Wed Aug 16 18:07:11 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 16 Aug 2006 18:07:11 +0200 Subject: [Python-checkins] r51319 - python/trunk/Misc/NEWS In-Reply-To: <20060816161246.GA4830@rogue.amk.ca> References: <20060816142115.699FA1E4004@bag.python.org> <20060816161246.GA4830@rogue.amk.ca> Message-ID: <44E342AF.8040400@egenix.com> A.M. Kuchling wrote: > On Wed, Aug 16, 2006 at 05:27:43PM +0200, Georg Brandl wrote: >>> -- The distutils version has been changed to 2.5.0, and are now kept >>> +- The distutils version has been changed to 2.5.0, and is now kept >>> in sync with sys.version_info[:3]. >> Hasn't that been reverted again? > > Yes, but this is in the section describing the changes in 2.5b3. A > NEWS entry should be added to the 2.5rc1 section saying that the > change has been reverted. I'll add that. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 16 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From python-checkins at python.org Wed Aug 16 18:11:02 2006 From: python-checkins at python.org (marc-andre.lemburg) Date: Wed, 16 Aug 2006 18:11:02 +0200 (CEST) Subject: [Python-checkins] r51321 - python/trunk/Misc/NEWS Message-ID: <20060816161102.449D21E4004@bag.python.org> Author: marc-andre.lemburg Date: Wed Aug 16 18:11:01 2006 New Revision: 51321 Modified: python/trunk/Misc/NEWS Log: Add NEWS item mentioning the reverted distutils version number patch. Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 16 18:11:01 2006 @@ -64,6 +64,11 @@ Library ------- +- The distutils version has been changed to 2.5.0. The change to + keep it programmatically in sync with the Python version running + the code (introduced in 2.5b3) has been reverted. It will continue + to be maintained manually as static string literal. + - If a the Python part of a ctypes callback function returns None, and this cannot be converted to the required C type, an exception is printed with PyErr_WriteUnraisable. Before this change, the C From buildbot at python.org Wed Aug 16 18:35:17 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 16:35:17 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060816163518.1B12F1E4014@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/508 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,anthony.baxter,martin.v.loewis,thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Wed Aug 16 18:37:47 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 16:37:47 +0000 Subject: [Python-checkins] buildbot warnings in S-390 Debian trunk Message-ID: <20060816163747.A4F6F1E4006@bag.python.org> The Buildbot has detected a new failure of S-390 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%2520Debian%2520trunk/builds/334 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 16 18:47:08 2006 From: python-checkins at python.org (fredrik.lundh) Date: Wed, 16 Aug 2006 18:47:08 +0200 (CEST) Subject: [Python-checkins] r51322 - in python/trunk: Lib/test/test_xml_etree_c.py Modules/_elementtree.c Message-ID: <20060816164708.756101E4013@bag.python.org> Author: fredrik.lundh Date: Wed Aug 16 18:47:07 2006 New Revision: 51322 Modified: python/trunk/Lib/test/test_xml_etree_c.py python/trunk/Modules/_elementtree.c Log: SF#1534630 ignore data that arrives before the opening start tag Modified: python/trunk/Lib/test/test_xml_etree_c.py ============================================================================== --- python/trunk/Lib/test/test_xml_etree_c.py (original) +++ python/trunk/Lib/test/test_xml_etree_c.py Wed Aug 16 18:47:07 2006 @@ -204,6 +204,17 @@ "" % encoding ) +def bug_1534630(): + """ + >>> bob = ET.TreeBuilder() + >>> e = bob.data("data") + >>> e = bob.start("tag", {}) + >>> e = bob.end("tag") + >>> e = bob.close() + >>> serialize(ET, e) + '' + """ + def test_main(): from test import test_xml_etree_c test_support.run_doctest(test_xml_etree_c, verbosity=True) Modified: python/trunk/Modules/_elementtree.c ============================================================================== --- python/trunk/Modules/_elementtree.c (original) +++ python/trunk/Modules/_elementtree.c Wed Aug 16 18:47:07 2006 @@ -48,7 +48,7 @@ #include "Python.h" -#define VERSION "1.0.6-snapshot" +#define VERSION "1.0.6" /* -------------------------------------------------------------------- */ /* configuration */ @@ -1599,6 +1599,10 @@ treebuilder_handle_data(TreeBuilderObject* self, PyObject* data) { if (!self->data) { + if (self->last == (ElementObject*) Py_None) { + /* ignore calls to data before the first call to start */ + Py_RETURN_NONE; + } /* store the first item as is */ Py_INCREF(data); self->data = data; } else { From python-checkins at python.org Wed Aug 16 19:11:19 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 16 Aug 2006 19:11:19 +0200 (CEST) Subject: [Python-checkins] r51324 - python/trunk/Misc/NEWS Message-ID: <20060816171119.187C71E4004@bag.python.org> Author: andrew.kuchling Date: Wed Aug 16 19:11:18 2006 New Revision: 51324 Modified: python/trunk/Misc/NEWS Log: Grammar fix Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed Aug 16 19:11:18 2006 @@ -69,10 +69,10 @@ the code (introduced in 2.5b3) has been reverted. It will continue to be maintained manually as static string literal. -- If a the Python part of a ctypes callback function returns None, +- If the Python part of a ctypes callback function returns None, and this cannot be converted to the required C type, an exception is printed with PyErr_WriteUnraisable. Before this change, the C - callback did return arbitrary values to the calling code. + callback returned arbitrary values to the calling code. - The __repr__ method of a NULL ctypes.py_object() no longer raises an exception. From nnorwitz at gmail.com Wed Aug 16 19:12:54 2006 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 16 Aug 2006 10:12:54 -0700 Subject: [Python-checkins] r51322 - in python/trunk: Lib/test/test_xml_etree_c.py Modules/_elementtree.c In-Reply-To: <20060816164708.756101E4013@bag.python.org> References: <20060816164708.756101E4013@bag.python.org> Message-ID: Can you add a NEWS entry too? -- n On 8/16/06, fredrik.lundh wrote: > Author: fredrik.lundh > Date: Wed Aug 16 18:47:07 2006 > New Revision: 51322 > > Modified: > python/trunk/Lib/test/test_xml_etree_c.py > python/trunk/Modules/_elementtree.c > Log: > SF#1534630 > > ignore data that arrives before the opening start tag > > > > Modified: python/trunk/Lib/test/test_xml_etree_c.py > ============================================================================== > --- python/trunk/Lib/test/test_xml_etree_c.py (original) > +++ python/trunk/Lib/test/test_xml_etree_c.py Wed Aug 16 18:47:07 2006 > @@ -204,6 +204,17 @@ > "" % encoding > ) > > +def bug_1534630(): > + """ > + >>> bob = ET.TreeBuilder() > + >>> e = bob.data("data") > + >>> e = bob.start("tag", {}) > + >>> e = bob.end("tag") > + >>> e = bob.close() > + >>> serialize(ET, e) > + '' > + """ > + > def test_main(): > from test import test_xml_etree_c > test_support.run_doctest(test_xml_etree_c, verbosity=True) > > Modified: python/trunk/Modules/_elementtree.c > ============================================================================== > --- python/trunk/Modules/_elementtree.c (original) > +++ python/trunk/Modules/_elementtree.c Wed Aug 16 18:47:07 2006 > @@ -48,7 +48,7 @@ > > #include "Python.h" > > -#define VERSION "1.0.6-snapshot" > +#define VERSION "1.0.6" > > /* -------------------------------------------------------------------- */ > /* configuration */ > @@ -1599,6 +1599,10 @@ > treebuilder_handle_data(TreeBuilderObject* self, PyObject* data) > { > if (!self->data) { > + if (self->last == (ElementObject*) Py_None) { > + /* ignore calls to data before the first call to start */ > + Py_RETURN_NONE; > + } > /* store the first item as is */ > Py_INCREF(data); self->data = data; > } else { > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > From ppsadmin at tmomail.net Wed Aug 16 18:47:10 2006 From: ppsadmin at tmomail.net (Proofpoint Protection Server) Date: Wed, 16 Aug 2006 09:47:10 -0700 Subject: [Python-checkins] Failed Message Delivery Message-ID: TM550- We're Sorry- The Message you just sent contained an attachment that is an unsupported file type. The attachment was dropped. T-Mobile From python-checkins at python.org Wed Aug 16 20:02:12 2006 From: python-checkins at python.org (thomas.heller) Date: Wed, 16 Aug 2006 20:02:12 +0200 (CEST) Subject: [Python-checkins] r51328 - python/trunk/Doc/lib/libctypes.tex Message-ID: <20060816180212.0A43D1E400A@bag.python.org> Author: thomas.heller Date: Wed Aug 16 20:02:11 2006 New Revision: 51328 Modified: python/trunk/Doc/lib/libctypes.tex Log: Tutorial: Clarify somewhat how parameters are passed to functions (especially explain what integer means). Correct the table - Python integers and longs can both be used. Further clarification to the table comparing ctypes types, Python types, and C types. Reference: Replace integer by C ``int`` where it makes sense. Modified: python/trunk/Doc/lib/libctypes.tex ============================================================================== --- python/trunk/Doc/lib/libctypes.tex (original) +++ python/trunk/Doc/lib/libctypes.tex Wed Aug 16 20:02:11 2006 @@ -199,8 +199,13 @@ There are, however, enough ways to crash Python with \code{ctypes}, so you should be careful anyway. -Python integers, strings and unicode strings are the only objects that -can directly be used as parameters in these function calls. +\code{None}, integers, longs, byte strings and unicode strings are the +only native Python objects that can directly be used as parameters in +these function calls. \code{None} is passed as a C \code{NULL} pointer, +byte strings and unicode strings are passed as pointer to the memory +block that contains their data (\code{char *} or \code{wchar{\_}t *}). Python +integers and Python longs are passed as the platforms default C +\code{int} type, their value is masked to fit into the C type. Before we move on calling functions with other parameter types, we have to learn more about \code{ctypes} data types. @@ -227,7 +232,18 @@ \code{char} } { -character +1-character +string +} +\lineiii{ +\class{c{\_}wchar} +} +{ +\code{wchar{\_}t} +} +{ +1-character +unicode string } \lineiii{ \class{c{\_}byte} @@ -236,7 +252,7 @@ \code{char} } { -integer +int/long } \lineiii{ \class{c{\_}ubyte} @@ -245,7 +261,7 @@ \code{unsigned char} } { -integer +int/long } \lineiii{ \class{c{\_}short} @@ -254,7 +270,7 @@ \code{short} } { -integer +int/long } \lineiii{ \class{c{\_}ushort} @@ -263,7 +279,7 @@ \code{unsigned short} } { -integer +int/long } \lineiii{ \class{c{\_}int} @@ -272,7 +288,7 @@ \code{int} } { -integer +int/long } \lineiii{ \class{c{\_}uint} @@ -281,7 +297,7 @@ \code{unsigned int} } { -integer +int/long } \lineiii{ \class{c{\_}long} @@ -290,7 +306,7 @@ \code{long} } { -integer +int/long } \lineiii{ \class{c{\_}ulong} @@ -299,7 +315,7 @@ \code{unsigned long} } { -long +int/long } \lineiii{ \class{c{\_}longlong} @@ -309,7 +325,7 @@ \code{long long} } { -long +int/long } \lineiii{ \class{c{\_}ulonglong} @@ -319,7 +335,7 @@ \code{unsigned long long} } { -long +int/long } \lineiii{ \class{c{\_}float} @@ -368,8 +384,8 @@ \code{void *} } { -integer or -\code{None} +int/long +or \code{None} } \end{tableiii} \end{quote} @@ -554,11 +570,11 @@ \subsubsection{Return types\label{ctypes-return-types}} -By default functions are assumed to return integers. Other return -types can be specified by setting the \member{restype} attribute of the -function object. +By default functions are assumed to return the C \code{int} type. Other +return types can be specified by setting the \member{restype} attribute of +the function object. -Here is a more advanced example, it uses the strchr function, which +Here is a more advanced example, it uses the \code{strchr} function, which expects a string pointer and a char, and returns a pointer to a string: \begin{verbatim} @@ -1611,8 +1627,8 @@ \begin{datadescni}{pythonapi} An instance of \class{PyDLL} that exposes Python C api functions as -attributes. Note that all these functions are assumed to return -integers, which is of course not always the truth, so you have to +attributes. Note that all these functions are assumed to return C +\code{int}, which is of course not always the truth, so you have to assign the correct \member{restype} attribute to use these functions. \end{datadescni} @@ -1642,8 +1658,8 @@ anything. It is possible to assign a callable Python object that is not a -ctypes type, in this case the function is assumed to return an -integer, and the callable will be called with this integer, +ctypes type, in this case the function is assumed to return a +C \code{int}, and the callable will be called with this integer, allowing to do further processing or error checking. Using this is deprecated, for more flexible postprocessing or error checking use a ctypes data type as \member{restype} and assign a callable to the @@ -2283,9 +2299,12 @@ or error information for a function or method call. \end{classdesc*} -\begin{classdesc*}{py_object} -Represents the C \code{PyObject *} datatype. -\end{classdesc*} +\code{py{\_}object} : classdesc* +\begin{quote} + +Represents the C \code{PyObject *} datatype. Calling this with an +without an argument creates a \code{NULL} \code{PyObject *} pointer. +\end{quote} The \code{ctypes.wintypes} module provides quite some other Windows specific data types, for example \code{HWND}, \code{WPARAM}, or \code{DWORD}. @@ -2324,9 +2343,9 @@ the second item specifies the type of the field; it can be any ctypes data type. -For integer type fields, a third optional item can be given. It -must be a small positive integer defining the bit width of the -field. +For integer type fields like \class{c{\_}int}, a third optional item can +be given. It must be a small positive integer defining the bit +width of the field. Field names must be unique within one structure or union. This is not checked, only one field can be accessed when names are From buildbot at python.org Wed Aug 16 20:39:52 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 18:39:52 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) trunk Message-ID: <20060816183952.92C6B1E400F@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%2520trunk/builds/897 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: fredrik.lundh,marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 16 23:46:00 2006 From: python-checkins at python.org (kurt.kaiser) Date: Wed, 16 Aug 2006 23:46:00 +0200 (CEST) Subject: [Python-checkins] r51329 - python/trunk/Lib/idlelib/Bindings.py python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/PyShell.py Message-ID: <20060816214600.5DA691E4004@bag.python.org> Author: kurt.kaiser Date: Wed Aug 16 23:45:59 2006 New Revision: 51329 Modified: python/trunk/Lib/idlelib/Bindings.py python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/PyShell.py Log: File menu hotkeys: there were three 'p' assignments. Reassign the 'Save Copy As' and 'Print' hotkeys to 'y' and 't'. Change the Shell menu hotkey from 's' to 'l'. M Bindings.py M PyShell.py M NEWS.txt Modified: python/trunk/Lib/idlelib/Bindings.py ============================================================================== --- python/trunk/Lib/idlelib/Bindings.py (original) +++ python/trunk/Lib/idlelib/Bindings.py Wed Aug 16 23:45:59 2006 @@ -22,9 +22,9 @@ None, ('_Save', '<>'), ('Save _As...', '<>'), - ('Save Co_py As...', '<>'), + ('Save Cop_y As...', '<>'), None, - ('_Print Window', '<>'), + ('Prin_t Window', '<>'), None, ('_Close', '<>'), ('E_xit', '<>'), Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Wed Aug 16 23:45:59 2006 @@ -3,6 +3,10 @@ *Release date: 17-AUG-2006* +- File menu hotkeys: there were three 'p' assignments. Reassign the + 'Save Copy As' and 'Print' hotkeys to 'y' and 't'. Change the + Shell hotkey from 's' to 'l'. + - IDLE honors new quit() and exit() commands from site.py Quitter() object. Patch 1540892, Jim Jewett Modified: python/trunk/Lib/idlelib/PyShell.py ============================================================================== --- python/trunk/Lib/idlelib/PyShell.py (original) +++ python/trunk/Lib/idlelib/PyShell.py Wed Aug 16 23:45:59 2006 @@ -800,7 +800,7 @@ if use_subprocess: ms = self.menu_specs if ms[2][0] != "shell": - ms.insert(2, ("shell", "_Shell")) + ms.insert(2, ("shell", "She_ll")) self.interp = ModifiedInterpreter(self) if flist is None: root = Tk() From buildbot at python.org Thu Aug 17 01:29:21 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 16 Aug 2006 23:29:21 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060816232922.08D7A1E4005@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/511 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,kurt.kaiser,thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Thu Aug 17 01:38:06 2006 From: python-checkins at python.org (neil.schemenauer) Date: Thu, 17 Aug 2006 01:38:06 +0200 (CEST) Subject: [Python-checkins] r51330 - in python/trunk: Lib/compiler/ast.py Lib/compiler/pycodegen.py Lib/compiler/symbols.py Lib/test/test_compiler.py Misc/NEWS Message-ID: <20060816233806.B92B31E4004@bag.python.org> Author: neil.schemenauer Date: Thu Aug 17 01:38:05 2006 New Revision: 51330 Modified: python/trunk/Lib/compiler/ast.py python/trunk/Lib/compiler/pycodegen.py python/trunk/Lib/compiler/symbols.py python/trunk/Lib/test/test_compiler.py python/trunk/Misc/NEWS Log: Fix a bug in the ``compiler`` package that caused invalid code to be generated for generator expressions. Modified: python/trunk/Lib/compiler/ast.py ============================================================================== --- python/trunk/Lib/compiler/ast.py (original) +++ python/trunk/Lib/compiler/ast.py Thu Aug 17 01:38:05 2006 @@ -583,11 +583,9 @@ def __init__(self, code, lineno=None): self.code = code self.lineno = lineno - self.argnames = ['[outmost-iterable]'] + self.argnames = ['.0'] self.varargs = self.kwargs = None - - def getChildren(self): return self.code, Modified: python/trunk/Lib/compiler/pycodegen.py ============================================================================== --- python/trunk/Lib/compiler/pycodegen.py (original) +++ python/trunk/Lib/compiler/pycodegen.py Thu Aug 17 01:38:05 2006 @@ -658,18 +658,19 @@ stack = [] for i, for_ in zip(range(len(node.quals)), node.quals): - start, anchor = self.visit(for_) + start, anchor, end = self.visit(for_) cont = None for if_ in for_.ifs: if cont is None: cont = self.newBlock() self.visit(if_, cont) - stack.insert(0, (start, cont, anchor)) + stack.insert(0, (start, cont, anchor, end)) self.visit(node.expr) self.emit('YIELD_VALUE') + self.emit('POP_TOP') - for start, cont, anchor in stack: + for start, cont, anchor, end in stack: if cont: skip_one = self.newBlock() self.emit('JUMP_FORWARD', skip_one) @@ -678,14 +679,22 @@ self.nextBlock(skip_one) self.emit('JUMP_ABSOLUTE', start) self.startBlock(anchor) + self.emit('POP_BLOCK') + self.setups.pop() + self.startBlock(end) + self.emit('LOAD_CONST', None) def visitGenExprFor(self, node): start = self.newBlock() anchor = self.newBlock() + end = self.newBlock() + + self.setups.push((LOOP, start)) + self.emit('SETUP_LOOP', end) if node.is_outmost: - self.loadName('[outmost-iterable]') + self.loadName('.0') else: self.visit(node.iter) self.emit('GET_ITER') @@ -695,7 +704,7 @@ self.emit('FOR_ITER', anchor) self.nextBlock() self.visit(node.assign) - return start, anchor + return start, anchor, end def visitGenExprIf(self, node, branch): self.set_lineno(node, force=True) Modified: python/trunk/Lib/compiler/symbols.py ============================================================================== --- python/trunk/Lib/compiler/symbols.py (original) +++ python/trunk/Lib/compiler/symbols.py Thu Aug 17 01:38:05 2006 @@ -188,7 +188,7 @@ i = self.__counter self.__counter += 1 self.__super_init("generator expression<%d>"%i, module, klass) - self.add_param('[outmost-iterable]') + self.add_param('.0') def get_names(self): keys = Scope.get_names(self) Modified: python/trunk/Lib/test/test_compiler.py ============================================================================== --- python/trunk/Lib/test/test_compiler.py (original) +++ python/trunk/Lib/test/test_compiler.py Thu Aug 17 01:38:05 2006 @@ -116,6 +116,13 @@ exec c in dct self.assertEquals(dct.get('result'), 3) + def testGenExp(self): + c = compiler.compile('list((i,j) for i in range(3) if i < 3' + ' for j in range(4) if j > 2)', + '', + 'eval') + self.assertEquals(eval(c), [(0, 3), (1, 3), (2, 3)]) + NOLINENO = (compiler.ast.Module, compiler.ast.Stmt, compiler.ast.Discard) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu Aug 17 01:38:05 2006 @@ -64,6 +64,9 @@ Library ------- +- Fix a bug in the ``compiler`` package that caused invalid code to be + generated for generator expressions. + - The distutils version has been changed to 2.5.0. The change to keep it programmatically in sync with the Python version running the code (introduced in 2.5b3) has been reverted. It will continue From python-checkins at python.org Thu Aug 17 02:00:46 2006 From: python-checkins at python.org (mateusz.rukowicz) Date: Thu, 17 Aug 2006 02:00:46 +0200 (CEST) Subject: [Python-checkins] r51331 - sandbox/trunk/decimal-c/_decimal.c Message-ID: <20060817000046.3BB931E4007@bag.python.org> Author: mateusz.rukowicz Date: Thu Aug 17 02:00:45 2006 New Revision: 51331 Modified: sandbox/trunk/decimal-c/_decimal.c Log: Now unpickling old decimal object should work. I am sure it's not the best way to achieve that, but I can't see other one. Modified: sandbox/trunk/decimal-c/_decimal.c ============================================================================== --- sandbox/trunk/decimal-c/_decimal.c (original) +++ sandbox/trunk/decimal-c/_decimal.c Thu Aug 17 02:00:45 2006 @@ -2361,7 +2361,7 @@ if (!ctx) return 0; other = (decimalobject *)_convert_to_decimal(self->ob_type, - (PyObject*)other, ctx, 0); + (PyObject*)other, ctx, 1); if (!other) return 0; /* XXX ??*/ @@ -8412,16 +8412,101 @@ static PyMemberDef context_members[] = { {"prec", T_LONG, OFF(prec), 0}, {"capitals", T_INT, OFF(capitals), 0}, - {"rounding", T_INT, OFF(rounding), 0}, - {"_rounding_decision", T_INT, OFF(rounding_dec), 0}, +/* {"rounding", T_INT, OFF(rounding), 0}, */ +/* {"_rounding_decision", T_INT, OFF(rounding_dec), 0}, */ {"_clamp", T_INT, OFF(clamp), 0}, {"flags", T_OBJECT_EX, OFF(flags), 0}, {"traps", T_OBJECT_EX, OFF(traps), 0}, - {"_ignored", T_OBJECT_EX, OFF(ignored), 0}, + {"_ignored_flags", T_OBJECT_EX, OFF(ignored), 0}, {NULL} }; static PyObject * +context_get_rounding(contextobject *self) { + return PyInt_FromLong(self->rounding); +} + +static int +context_set_rounding_(contextobject *self, PyObject *value) { + int new_round = -1; + if (PyInt_Check(value)) { + new_round = PyInt_AsLong(value); + if (PyErr_Occurred()) + return -1; + } + + if (PyString_Check(value)) { + char *buffer = PyString_AS_STRING(value); + if (!strcmp("ROUND_DOWN", buffer)) + new_round = 0; + else if (!strcmp("ROUND_UP", buffer)) + new_round = 1; + else if (!strcmp("ROUND_HALF_DOWN", buffer)) + new_round = 2; + else if (!strcmp("ROUND_HALF_EVEN", buffer)) + new_round = 3; + else if (!strcmp("ROUND_HALF_UP", buffer)) + new_round = 4; + else if (!strcmp("ROUND_FLOOR", buffer)) + new_round = 5; + else if (!strcmp("ROUND_CEILING", buffer)) + new_round = 6; + } + else if (new_round == -1) { + PyErr_SetString(PyExc_TypeError, "Rounding should be int or string"); + return -1; + } + + if (!VALID_ROUND(new_round)) { + PyErr_SetString(PyExc_ValueError, "value is not a valid rounding"); + return -1; + } + + + self->rounding = new_round; + return 0; + +} + +static PyObject * +context_get_rounding_decision(contextobject *self) { + return PyInt_FromLong(self->rounding_dec); +} + +static int +context_set_rounding_decision_(contextobject *self, PyObject *value) { + int new_round_dec = -1; + + if (PyInt_Check(value)) { + new_round_dec = PyInt_AsLong(value); + if (PyErr_Occurred()) + return -1; + } + + if (PyString_Check(value)) { + char *buffer = PyString_AS_STRING(value); + + if (!strcmp("ALWAYS_ROUND", buffer)) + new_round_dec = 0; + else if (!strcmp("NEVER_ROUND", buffer)) + new_round_dec = 16; + } + + else if (new_round_dec == -1) { + PyErr_SetString(PyExc_TypeError, "Rounding should be int or string"); + return -1; + } + + if (!VALID_ROUND_DEC(new_round_dec)) { + PyErr_SetString(PyExc_ValueError, "value is not a valid rounding decision"); + return -1; + } + + self->rounding_dec = new_round_dec; + return 0; +} + +static PyObject * context_get_emax(contextobject *self) { return exp_to_pyobj(self->Emax); } @@ -8451,6 +8536,9 @@ } static PyGetSetDef context_getset[] = { + {"_rounding_decision", (getter)context_get_rounding_decision, + (setter)context_set_rounding_decision_}, + {"rounding", (getter) context_get_rounding, (setter)context_set_rounding_}, {"Emax", (getter) context_get_emax, (setter)context_set_emax}, {"Emin", (getter) context_get_emin, (setter)context_set_emin}, {NULL} From python-checkins at python.org Thu Aug 17 02:03:05 2006 From: python-checkins at python.org (mateusz.rukowicz) Date: Thu, 17 Aug 2006 02:03:05 +0200 (CEST) Subject: [Python-checkins] r51332 - sandbox/trunk/decimal-c/copy_reg.py sandbox/trunk/decimal-c/pickle.py Message-ID: <20060817000305.511611E4004@bag.python.org> Author: mateusz.rukowicz Date: Thu Aug 17 02:03:03 2006 New Revision: 51332 Added: sandbox/trunk/decimal-c/copy_reg.py (contents, props changed) sandbox/trunk/decimal-c/pickle.py (contents, props changed) Log: This should go with previous commit. Added: sandbox/trunk/decimal-c/copy_reg.py ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/copy_reg.py Thu Aug 17 02:03:03 2006 @@ -0,0 +1,202 @@ +"""Helper to provide extensibility for pickle/cPickle. + +This is only useful to add pickle support for extension types defined in +C, not for instances of user-defined classes. +""" + +from types import ClassType as _ClassType + +__all__ = ["pickle", "constructor", + "add_extension", "remove_extension", "clear_extension_cache"] + +dispatch_table = {} + +def pickle(ob_type, pickle_function, constructor_ob=None): + if type(ob_type) is _ClassType: + raise TypeError("copy_reg is not intended for use with classes") + + if not callable(pickle_function): + raise TypeError("reduction functions must be callable") + dispatch_table[ob_type] = pickle_function + + # The constructor_ob function is a vestige of safe for unpickling. + # There is no reason for the caller to pass it anymore. + if constructor_ob is not None: + constructor(constructor_ob) + +def constructor(object): + if not callable(object): + raise TypeError("constructors must be callable") + +# Example: provide pickling support for complex numbers. + +try: + complex +except NameError: + pass +else: + + def pickle_complex(c): + return complex, (c.real, c.imag) + + pickle(complex, pickle_complex, complex) + +# Support for pickling new-style objects +import _decimal +def _reconstructor(cls, base, state): + if cls is _decimal.Context: + obj = _decimal.Context() + elif base is object: + obj = object.__new__(cls) + else: + obj = base.__new__(cls, state) + base.__init__(obj, state) + return obj + +_HEAPTYPE = 1<<9 + +# Python code for object.__reduce_ex__ for protocols 0 and 1 + +def _reduce_ex(self, proto): + assert proto < 2 + for base in self.__class__.__mro__: + if hasattr(base, '__flags__') and not base.__flags__ & _HEAPTYPE: + break + else: + base = object # not really reachable + if base is object: + state = None + else: + if base is self.__class__: + raise TypeError, "can't pickle %s objects" % base.__name__ + state = base(self) + args = (self.__class__, base, state) + try: + getstate = self.__getstate__ + except AttributeError: + if getattr(self, "__slots__", None): + raise TypeError("a class that defines __slots__ without " + "defining __getstate__ cannot be pickled") + try: + dict = self.__dict__ + except AttributeError: + dict = None + else: + dict = getstate() + if dict: + return _reconstructor, args, dict + else: + return _reconstructor, args + +# Helper for __reduce_ex__ protocol 2 + +def __newobj__(cls, *args): + return cls.__new__(cls, *args) + +def _slotnames(cls): + """Return a list of slot names for a given class. + + This needs to find slots defined by the class and its bases, so we + can't simply return the __slots__ attribute. We must walk down + the Method Resolution Order and concatenate the __slots__ of each + class found there. (This assumes classes don't modify their + __slots__ attribute to misrepresent their slots after the class is + defined.) + """ + + # Get the value from a cache in the class if possible + names = cls.__dict__.get("__slotnames__") + if names is not None: + return names + + # Not cached -- calculate the value + names = [] + if not hasattr(cls, "__slots__"): + # This class has no slots + pass + else: + # Slots found -- gather slot names from all base classes + for c in cls.__mro__: + if "__slots__" in c.__dict__: + slots = c.__dict__['__slots__'] + # if class has a single slot, it can be given as a string + if isinstance(slots, basestring): + slots = (slots,) + for name in slots: + # special descriptors + if name in ("__dict__", "__weakref__"): + continue + # mangled names + elif name.startswith('__') and not name.endswith('__'): + names.append('_%s%s' % (c.__name__, name)) + else: + names.append(name) + + # Cache the outcome in the class if at all possible + try: + cls.__slotnames__ = names + except: + pass # But don't die if we can't + + return names + +# A registry of extension codes. This is an ad-hoc compression +# mechanism. Whenever a global reference to , is about +# to be pickled, the (, ) tuple is looked up here to see +# if it is a registered extension code for it. Extension codes are +# universal, so that the meaning of a pickle does not depend on +# context. (There are also some codes reserved for local use that +# don't have this restriction.) Codes are positive ints; 0 is +# reserved. + +_extension_registry = {} # key -> code +_inverted_registry = {} # code -> key +_extension_cache = {} # code -> object +# Don't ever rebind those names: cPickle grabs a reference to them when +# it's initialized, and won't see a rebinding. + +def add_extension(module, name, code): + """Register an extension code.""" + code = int(code) + if not 1 <= code <= 0x7fffffff: + raise ValueError, "code out of range" + key = (module, name) + if (_extension_registry.get(key) == code and + _inverted_registry.get(code) == key): + return # Redundant registrations are benign + if key in _extension_registry: + raise ValueError("key %s is already registered with code %s" % + (key, _extension_registry[key])) + if code in _inverted_registry: + raise ValueError("code %s is already in use for key %s" % + (code, _inverted_registry[code])) + _extension_registry[key] = code + _inverted_registry[code] = key + +def remove_extension(module, name, code): + """Unregister an extension code. For testing only.""" + key = (module, name) + if (_extension_registry.get(key) != code or + _inverted_registry.get(code) != key): + raise ValueError("key %s is not registered with code %s" % + (key, code)) + del _extension_registry[key] + del _inverted_registry[code] + if code in _extension_cache: + del _extension_cache[code] + +def clear_extension_cache(): + _extension_cache.clear() + +# Standard extension code assignments + +# Reserved ranges + +# First Last Count Purpose +# 1 127 127 Reserved for Python standard library +# 128 191 64 Reserved for Zope +# 192 239 48 Reserved for 3rd parties +# 240 255 16 Reserved for private use (will never be assigned) +# 256 Inf Inf Reserved for future assignment + +# Extension codes are assigned by the Python Software Foundation. Added: sandbox/trunk/decimal-c/pickle.py ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/pickle.py Thu Aug 17 02:03:03 2006 @@ -0,0 +1,1386 @@ +"""Create portable serialized representations of Python objects. + +See module cPickle for a (much) faster implementation. +See module copy_reg for a mechanism for registering custom picklers. +See module pickletools source for extensive comments. + +Classes: + + Pickler + Unpickler + +Functions: + + dump(object, file) + dumps(object) -> string + load(file) -> object + loads(string) -> object + +Misc variables: + + __version__ + format_version + compatible_formats + +""" + +__version__ = "$Revision: 38432 $" # Code version + +from types import * +from copy_reg import dispatch_table +from copy_reg import _extension_registry, _inverted_registry, _extension_cache +import marshal +import sys +import struct +import re + +__all__ = ["PickleError", "PicklingError", "UnpicklingError", "Pickler", + "Unpickler", "dump", "dumps", "load", "loads"] + +# These are purely informational; no code uses these. +format_version = "2.0" # File format version we write +compatible_formats = ["1.0", # Original protocol 0 + "1.1", # Protocol 0 with INST added + "1.2", # Original protocol 1 + "1.3", # Protocol 1 with BINFLOAT added + "2.0", # Protocol 2 + ] # Old format versions we can read + +# Keep in synch with cPickle. This is the highest protocol number we +# know how to read. +HIGHEST_PROTOCOL = 2 + +# Why use struct.pack() for pickling but marshal.loads() for +# unpickling? struct.pack() is 40% faster than marshal.dumps(), but +# marshal.loads() is twice as fast as struct.unpack()! +mloads = marshal.loads + +class PickleError(Exception): + """A common base class for the other pickling exceptions.""" + pass + +class PicklingError(PickleError): + """This exception is raised when an unpicklable object is passed to the + dump() method. + + """ + pass + +class UnpicklingError(PickleError): + """This exception is raised when there is a problem unpickling an object, + such as a security violation. + + Note that other exceptions may also be raised during unpickling, including + (but not necessarily limited to) AttributeError, EOFError, ImportError, + and IndexError. + + """ + pass + +# An instance of _Stop is raised by Unpickler.load_stop() in response to +# the STOP opcode, passing the object that is the result of unpickling. +class _Stop(Exception): + def __init__(self, value): + self.value = value + +# Jython has PyStringMap; it's a dict subclass with string keys +try: + from org.python.core import PyStringMap +except ImportError: + PyStringMap = None + +# UnicodeType may or may not be exported (normally imported from types) +try: + UnicodeType +except NameError: + UnicodeType = None + +# Pickle opcodes. See pickletools.py for extensive docs. The listing +# here is in kind-of alphabetical order of 1-character pickle code. +# pickletools groups them by purpose. + +MARK = '(' # push special markobject on stack +STOP = '.' # every pickle ends with STOP +POP = '0' # discard topmost stack item +POP_MARK = '1' # discard stack top through topmost markobject +DUP = '2' # duplicate top stack item +FLOAT = 'F' # push float object; decimal string argument +INT = 'I' # push integer or bool; decimal string argument +BININT = 'J' # push four-byte signed int +BININT1 = 'K' # push 1-byte unsigned int +LONG = 'L' # push long; decimal string argument +BININT2 = 'M' # push 2-byte unsigned int +NONE = 'N' # push None +PERSID = 'P' # push persistent object; id is taken from string arg +BINPERSID = 'Q' # " " " ; " " " " stack +REDUCE = 'R' # apply callable to argtuple, both on stack +STRING = 'S' # push string; NL-terminated string argument +BINSTRING = 'T' # push string; counted binary string argument +SHORT_BINSTRING = 'U' # " " ; " " " " < 256 bytes +UNICODE = 'V' # push Unicode string; raw-unicode-escaped'd argument +BINUNICODE = 'X' # " " " ; counted UTF-8 string argument +APPEND = 'a' # append stack top to list below it +BUILD = 'b' # call __setstate__ or __dict__.update() +GLOBAL = 'c' # push self.find_class(modname, name); 2 string args +DICT = 'd' # build a dict from stack items +EMPTY_DICT = '}' # push empty dict +APPENDS = 'e' # extend list on stack by topmost stack slice +GET = 'g' # push item from memo on stack; index is string arg +BINGET = 'h' # " " " " " " ; " " 1-byte arg +INST = 'i' # build & push class instance +LONG_BINGET = 'j' # push item from memo on stack; index is 4-byte arg +LIST = 'l' # build list from topmost stack items +EMPTY_LIST = ']' # push empty list +OBJ = 'o' # build & push class instance +PUT = 'p' # store stack top in memo; index is string arg +BINPUT = 'q' # " " " " " ; " " 1-byte arg +LONG_BINPUT = 'r' # " " " " " ; " " 4-byte arg +SETITEM = 's' # add key+value pair to dict +TUPLE = 't' # build tuple from topmost stack items +EMPTY_TUPLE = ')' # push empty tuple +SETITEMS = 'u' # modify dict by adding topmost key+value pairs +BINFLOAT = 'G' # push float; arg is 8-byte float encoding + +TRUE = 'I01\n' # not an opcode; see INT docs in pickletools.py +FALSE = 'I00\n' # not an opcode; see INT docs in pickletools.py + +# Protocol 2 + +PROTO = '\x80' # identify pickle protocol +NEWOBJ = '\x81' # build object by applying cls.__new__ to argtuple +EXT1 = '\x82' # push object from extension registry; 1-byte index +EXT2 = '\x83' # ditto, but 2-byte index +EXT4 = '\x84' # ditto, but 4-byte index +TUPLE1 = '\x85' # build 1-tuple from stack top +TUPLE2 = '\x86' # build 2-tuple from two topmost stack items +TUPLE3 = '\x87' # build 3-tuple from three topmost stack items +NEWTRUE = '\x88' # push True +NEWFALSE = '\x89' # push False +LONG1 = '\x8a' # push long from < 256 bytes +LONG4 = '\x8b' # push really big long + +_tuplesize2code = [EMPTY_TUPLE, TUPLE1, TUPLE2, TUPLE3] + + +__all__.extend([x for x in dir() if re.match("[A-Z][A-Z0-9_]+$",x)]) +del x + + +# Pickling machinery + +class Pickler: + + def __init__(self, file, protocol=None): + """This takes a file-like object for writing a pickle data stream. + + The optional protocol argument tells the pickler to use the + given protocol; supported protocols are 0, 1, 2. The default + protocol is 0, to be backwards compatible. (Protocol 0 is the + only protocol that can be written to a file opened in text + mode and read back successfully. When using a protocol higher + than 0, make sure the file is opened in binary mode, both when + pickling and unpickling.) + + Protocol 1 is more efficient than protocol 0; protocol 2 is + more efficient than protocol 1. + + Specifying a negative protocol version selects the highest + protocol version supported. The higher the protocol used, the + more recent the version of Python needed to read the pickle + produced. + + The file parameter must have a write() method that accepts a single + string argument. It can thus be an open file object, a StringIO + object, or any other custom object that meets this interface. + + """ + if protocol is None: + protocol = 0 + if protocol < 0: + protocol = HIGHEST_PROTOCOL + elif not 0 <= protocol <= HIGHEST_PROTOCOL: + raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL) + self.write = file.write + self.memo = {} + self.proto = int(protocol) + self.bin = protocol >= 1 + self.fast = 0 + + def clear_memo(self): + """Clears the pickler's "memo". + + The memo is the data structure that remembers which objects the + pickler has already seen, so that shared or recursive objects are + pickled by reference and not by value. This method is useful when + re-using picklers. + + """ + self.memo.clear() + + def dump(self, obj): + """Write a pickled representation of obj to the open file.""" + if self.proto >= 2: + self.write(PROTO + chr(self.proto)) + self.save(obj) + self.write(STOP) + + def memoize(self, obj): + """Store an object in the memo.""" + + # The Pickler memo is a dictionary mapping object ids to 2-tuples + # that contain the Unpickler memo key and the object being memoized. + # The memo key is written to the pickle and will become + # the key in the Unpickler's memo. The object is stored in the + # Pickler memo so that transient objects are kept alive during + # pickling. + + # The use of the Unpickler memo length as the memo key is just a + # convention. The only requirement is that the memo values be unique. + # But there appears no advantage to any other scheme, and this + # scheme allows the Unpickler memo to be implemented as a plain (but + # growable) array, indexed by memo key. + if self.fast: + return + assert id(obj) not in self.memo + memo_len = len(self.memo) + self.write(self.put(memo_len)) + self.memo[id(obj)] = memo_len, obj + + # Return a PUT (BINPUT, LONG_BINPUT) opcode string, with argument i. + def put(self, i, pack=struct.pack): + if self.bin: + if i < 256: + return BINPUT + chr(i) + else: + return LONG_BINPUT + pack("= 2 and getattr(func, "__name__", "") == "__newobj__": + # A __reduce__ implementation can direct protocol 2 to + # use the more efficient NEWOBJ opcode, while still + # allowing protocol 0 and 1 to work normally. For this to + # work, the function returned by __reduce__ should be + # called __newobj__, and its first argument should be a + # new-style class. The implementation for __newobj__ + # should be as follows, although pickle has no way to + # verify this: + # + # def __newobj__(cls, *args): + # return cls.__new__(cls, *args) + # + # Protocols 0 and 1 will pickle a reference to __newobj__, + # while protocol 2 (and above) will pickle a reference to + # cls, the remaining args tuple, and the NEWOBJ code, + # which calls cls.__new__(cls, *args) at unpickling time + # (see load_newobj below). If __reduce__ returns a + # three-tuple, the state from the third tuple item will be + # pickled regardless of the protocol, calling __setstate__ + # at unpickling time (see load_build below). + # + # Note that no standard __newobj__ implementation exists; + # you have to provide your own. This is to enforce + # compatibility with Python 2.2 (pickles written using + # protocol 0 or 1 in Python 2.3 should be unpicklable by + # Python 2.2). + cls = args[0] + if not hasattr(cls, "__new__"): + raise PicklingError( + "args[0] from __newobj__ args has no __new__") + if obj is not None and cls is not obj.__class__: + raise PicklingError( + "args[0] from __newobj__ args has the wrong class") + args = args[1:] + save(cls) + save(args) + write(NEWOBJ) + else: + save(func) + save(args) + write(REDUCE) + + if obj is not None: + self.memoize(obj) + + # More new special cases (that work with older protocols as + # well): when __reduce__ returns a tuple with 4 or 5 items, + # the 4th and 5th item should be iterators that provide list + # items and dict items (as (key, value) tuples), or None. + + if listitems is not None: + self._batch_appends(listitems) + + if dictitems is not None: + self._batch_setitems(dictitems) + + if state is not None: + save(state) + write(BUILD) + + # Methods below this point are dispatched through the dispatch table + + dispatch = {} + + def save_none(self, obj): + self.write(NONE) + dispatch[NoneType] = save_none + + def save_bool(self, obj): + if self.proto >= 2: + self.write(obj and NEWTRUE or NEWFALSE) + else: + self.write(obj and TRUE or FALSE) + dispatch[bool] = save_bool + + def save_int(self, obj, pack=struct.pack): + if self.bin: + # If the int is small enough to fit in a signed 4-byte 2's-comp + # format, we can store it more efficiently than the general + # case. + # First one- and two-byte unsigned ints: + if obj >= 0: + if obj <= 0xff: + self.write(BININT1 + chr(obj)) + return + if obj <= 0xffff: + self.write("%c%c%c" % (BININT2, obj&0xff, obj>>8)) + return + # Next check for 4-byte signed ints: + high_bits = obj >> 31 # note that Python shift sign-extends + if high_bits == 0 or high_bits == -1: + # All high bits are copies of bit 2**31, so the value + # fits in a 4-byte signed int. + self.write(BININT + pack("= 2: + bytes = encode_long(obj) + n = len(bytes) + if n < 256: + self.write(LONG1 + chr(n) + bytes) + else: + self.write(LONG4 + pack("d', obj)) + else: + self.write(FLOAT + repr(obj) + '\n') + dispatch[FloatType] = save_float + + def save_string(self, obj, pack=struct.pack): + if self.bin: + n = len(obj) + if n < 256: + self.write(SHORT_BINSTRING + chr(n) + obj) + else: + self.write(BINSTRING + pack("= 2: + for element in obj: + save(element) + # Subtle. Same as in the big comment below. + if id(obj) in memo: + get = self.get(memo[id(obj)][0]) + write(POP * n + get) + else: + write(_tuplesize2code[n]) + self.memoize(obj) + return + + # proto 0 or proto 1 and tuple isn't empty, or proto > 1 and tuple + # has more than 3 elements. + write(MARK) + for element in obj: + save(element) + + if id(obj) in memo: + # Subtle. d was not in memo when we entered save_tuple(), so + # the process of saving the tuple's elements must have saved + # the tuple itself: the tuple is recursive. The proper action + # now is to throw away everything we put on the stack, and + # simply GET the tuple (it's already constructed). This check + # could have been done in the "for element" loop instead, but + # recursive tuples are a rare thing. + get = self.get(memo[id(obj)][0]) + if proto: + write(POP_MARK + get) + else: # proto 0 -- POP_MARK not available + write(POP * (n+1) + get) + return + + # No recursion. + self.write(TUPLE) + self.memoize(obj) + + dispatch[TupleType] = save_tuple + + # save_empty_tuple() isn't used by anything in Python 2.3. However, I + # found a Pickler subclass in Zope3 that calls it, so it's not harmless + # to remove it. + def save_empty_tuple(self, obj): + self.write(EMPTY_TUPLE) + + def save_list(self, obj): + write = self.write + + if self.bin: + write(EMPTY_LIST) + else: # proto 0 -- can't use EMPTY_LIST + write(MARK + LIST) + + self.memoize(obj) + self._batch_appends(iter(obj)) + + dispatch[ListType] = save_list + + # Keep in synch with cPickle's BATCHSIZE. Nothing will break if it gets + # out of synch, though. + _BATCHSIZE = 1000 + + def _batch_appends(self, items): + # Helper to batch up APPENDS sequences + save = self.save + write = self.write + + if not self.bin: + for x in items: + save(x) + write(APPEND) + return + + r = xrange(self._BATCHSIZE) + while items is not None: + tmp = [] + for i in r: + try: + x = items.next() + tmp.append(x) + except StopIteration: + items = None + break + n = len(tmp) + if n > 1: + write(MARK) + for x in tmp: + save(x) + write(APPENDS) + elif n: + save(tmp[0]) + write(APPEND) + # else tmp is empty, and we're done + + def save_dict(self, obj): + write = self.write + + if self.bin: + write(EMPTY_DICT) + else: # proto 0 -- can't use EMPTY_DICT + write(MARK + DICT) + + self.memoize(obj) + self._batch_setitems(obj.iteritems()) + + dispatch[DictionaryType] = save_dict + if not PyStringMap is None: + dispatch[PyStringMap] = save_dict + + def _batch_setitems(self, items): + # Helper to batch up SETITEMS sequences; proto >= 1 only + save = self.save + write = self.write + + if not self.bin: + for k, v in items: + save(k) + save(v) + write(SETITEM) + return + + r = xrange(self._BATCHSIZE) + while items is not None: + tmp = [] + for i in r: + try: + tmp.append(items.next()) + except StopIteration: + items = None + break + n = len(tmp) + if n > 1: + write(MARK) + for k, v in tmp: + save(k) + save(v) + write(SETITEMS) + elif n: + k, v = tmp[0] + save(k) + save(v) + write(SETITEM) + # else tmp is empty, and we're done + + def save_inst(self, obj): + cls = obj.__class__ + + memo = self.memo + write = self.write + save = self.save + + if hasattr(obj, '__getinitargs__'): + args = obj.__getinitargs__() + len(args) # XXX Assert it's a sequence + _keep_alive(args, memo) + else: + args = () + + write(MARK) + + if self.bin: + save(cls) + for arg in args: + save(arg) + write(OBJ) + else: + for arg in args: + save(arg) + write(INST + cls.__module__ + '\n' + cls.__name__ + '\n') + + self.memoize(obj) + + try: + getstate = obj.__getstate__ + except AttributeError: + stuff = obj.__dict__ + else: + stuff = getstate() + _keep_alive(stuff, memo) + save(stuff) + write(BUILD) + + dispatch[InstanceType] = save_inst + + def save_global(self, obj, name=None, pack=struct.pack): + write = self.write + memo = self.memo + + if name is None: + name = obj.__name__ + + module = getattr(obj, "__module__", None) + if module is None: + module = whichmodule(obj, name) + + try: + __import__(module) + mod = sys.modules[module] + klass = getattr(mod, name) + except (ImportError, KeyError, AttributeError): + raise PicklingError( + "Can't pickle %r: it's not found as %s.%s" % + (obj, module, name)) + else: + if klass is not obj: + raise PicklingError( + "Can't pickle %r: it's not the same object as %s.%s" % + (obj, module, name)) + + if self.proto >= 2: + code = _extension_registry.get((module, name)) + if code: + assert code > 0 + if code <= 0xff: + write(EXT1 + chr(code)) + elif code <= 0xffff: + write("%c%c%c" % (EXT2, code&0xff, code>>8)) + else: + write(EXT4 + pack("d', self.read(8))[0]) + dispatch[BINFLOAT] = load_binfloat + + def load_string(self): + rep = self.readline()[:-1] + for q in "\"'": # double or single quote + if rep.startswith(q): + if not rep.endswith(q): + raise ValueError, "insecure string pickle" + rep = rep[len(q):-len(q)] + break + else: + raise ValueError, "insecure string pickle" + self.append(rep.decode("string-escape")) + dispatch[STRING] = load_string + + def load_binstring(self): + len = mloads('i' + self.read(4)) + self.append(self.read(len)) + dispatch[BINSTRING] = load_binstring + + def load_unicode(self): + self.append(unicode(self.readline()[:-1],'raw-unicode-escape')) + dispatch[UNICODE] = load_unicode + + def load_binunicode(self): + len = mloads('i' + self.read(4)) + self.append(unicode(self.read(len),'utf-8')) + dispatch[BINUNICODE] = load_binunicode + + def load_short_binstring(self): + len = ord(self.read(1)) + self.append(self.read(len)) + dispatch[SHORT_BINSTRING] = load_short_binstring + + def load_tuple(self): + k = self.marker() + self.stack[k:] = [tuple(self.stack[k+1:])] + dispatch[TUPLE] = load_tuple + + def load_empty_tuple(self): + self.stack.append(()) + dispatch[EMPTY_TUPLE] = load_empty_tuple + + def load_tuple1(self): + self.stack[-1] = (self.stack[-1],) + dispatch[TUPLE1] = load_tuple1 + + def load_tuple2(self): + self.stack[-2:] = [(self.stack[-2], self.stack[-1])] + dispatch[TUPLE2] = load_tuple2 + + def load_tuple3(self): + self.stack[-3:] = [(self.stack[-3], self.stack[-2], self.stack[-1])] + dispatch[TUPLE3] = load_tuple3 + + def load_empty_list(self): + self.stack.append([]) + dispatch[EMPTY_LIST] = load_empty_list + + def load_empty_dictionary(self): + self.stack.append({}) + dispatch[EMPTY_DICT] = load_empty_dictionary + + def load_list(self): + k = self.marker() + self.stack[k:] = [self.stack[k+1:]] + dispatch[LIST] = load_list + + def load_dict(self): + k = self.marker() + d = {} + items = self.stack[k+1:] + for i in range(0, len(items), 2): + key = items[i] + value = items[i+1] + d[key] = value + self.stack[k:] = [d] + dispatch[DICT] = load_dict + + # INST and OBJ differ only in how they get a class object. It's not + # only sensible to do the rest in a common routine, the two routines + # previously diverged and grew different bugs. + # klass is the class to instantiate, and k points to the topmost mark + # object, following which are the arguments for klass.__init__. + def _instantiate(self, klass, k): + args = tuple(self.stack[k+1:]) + del self.stack[k:] + instantiated = 0 + if (not args and + type(klass) is ClassType and + not hasattr(klass, "__getinitargs__")): + try: + value = _EmptyClass() + value.__class__ = klass + instantiated = 1 + except RuntimeError: + # In restricted execution, assignment to inst.__class__ is + # prohibited + pass + if not instantiated: + try: + value = klass(*args) + except TypeError, err: + raise TypeError, "in constructor for %s: %s" % ( + klass.__name__, str(err)), sys.exc_info()[2] + self.append(value) + + def load_inst(self): + module = self.readline()[:-1] + name = self.readline()[:-1] + klass = self.find_class(module, name) + self._instantiate(klass, self.marker()) + dispatch[INST] = load_inst + + def load_obj(self): + # Stack is ... markobject classobject arg1 arg2 ... + k = self.marker() + klass = self.stack.pop(k+1) + self._instantiate(klass, k) + dispatch[OBJ] = load_obj + + def load_newobj(self): + args = self.stack.pop() + cls = self.stack[-1] + obj = cls.__new__(cls, *args) + self.stack[-1] = obj + dispatch[NEWOBJ] = load_newobj + + def load_global(self): + module = self.readline()[:-1] + name = self.readline()[:-1] + klass = self.find_class(module, name) + self.append(klass) + dispatch[GLOBAL] = load_global + + def load_ext1(self): + code = ord(self.read(1)) + self.get_extension(code) + dispatch[EXT1] = load_ext1 + + def load_ext2(self): + code = mloads('i' + self.read(2) + '\000\000') + self.get_extension(code) + dispatch[EXT2] = load_ext2 + + def load_ext4(self): + code = mloads('i' + self.read(4)) + self.get_extension(code) + dispatch[EXT4] = load_ext4 + + def get_extension(self, code): + nil = [] + obj = _extension_cache.get(code, nil) + if obj is not nil: + self.append(obj) + return + key = _inverted_registry.get(code) + if not key: + raise ValueError("unregistered extension code %d" % code) + obj = self.find_class(*key) + _extension_cache[code] = obj + self.append(obj) + + def find_class(self, module, name): + # Subclasses may override this + __import__(module) + mod = sys.modules[module] + klass = getattr(mod, name) + return klass + + def load_reduce(self): + stack = self.stack + args = stack.pop() + func = stack[-1] + value = func(*args) + stack[-1] = value + dispatch[REDUCE] = load_reduce + + def load_pop(self): + del self.stack[-1] + dispatch[POP] = load_pop + + def load_pop_mark(self): + k = self.marker() + del self.stack[k:] + dispatch[POP_MARK] = load_pop_mark + + def load_dup(self): + self.append(self.stack[-1]) + dispatch[DUP] = load_dup + + def load_get(self): + self.append(self.memo[self.readline()[:-1]]) + dispatch[GET] = load_get + + def load_binget(self): + i = ord(self.read(1)) + self.append(self.memo[repr(i)]) + dispatch[BINGET] = load_binget + + def load_long_binget(self): + i = mloads('i' + self.read(4)) + self.append(self.memo[repr(i)]) + dispatch[LONG_BINGET] = load_long_binget + + def load_put(self): + self.memo[self.readline()[:-1]] = self.stack[-1] + dispatch[PUT] = load_put + + def load_binput(self): + i = ord(self.read(1)) + self.memo[repr(i)] = self.stack[-1] + dispatch[BINPUT] = load_binput + + def load_long_binput(self): + i = mloads('i' + self.read(4)) + self.memo[repr(i)] = self.stack[-1] + dispatch[LONG_BINPUT] = load_long_binput + + def load_append(self): + stack = self.stack + value = stack.pop() + list = stack[-1] + list.append(value) + dispatch[APPEND] = load_append + + def load_appends(self): + stack = self.stack + mark = self.marker() + list = stack[mark - 1] + list.extend(stack[mark + 1:]) + del stack[mark:] + dispatch[APPENDS] = load_appends + + def load_setitem(self): + stack = self.stack + value = stack.pop() + key = stack.pop() + dict = stack[-1] + dict[key] = value + dispatch[SETITEM] = load_setitem + + def load_setitems(self): + stack = self.stack + mark = self.marker() + dict = stack[mark - 1] + for i in range(mark + 1, len(stack), 2): + dict[stack[i]] = stack[i + 1] + + del stack[mark:] + dispatch[SETITEMS] = load_setitems + + def load_build(self): + stack = self.stack + state = stack.pop() + inst = stack[-1] + setstate = getattr(inst, "__setstate__", None) + if setstate: + setstate(state) + return + slotstate = None + if isinstance(state, tuple) and len(state) == 2: + state, slotstate = state + if state: + try: + inst.__dict__.update(state) + except RuntimeError: + # XXX In restricted execution, the instance's __dict__ + # is not accessible. Use the old way of unpickling + # the instance variables. This is a semantic + # difference when unpickling in restricted + # vs. unrestricted modes. + # Note, however, that cPickle has never tried to do the + # .update() business, and always uses + # PyObject_SetItem(inst.__dict__, key, value) in a + # loop over state.items(). + for k, v in state.items(): + setattr(inst, k, v) + except AttributeError: + for k, v in state.items(): + setattr(inst, k, v) + if slotstate: + for k, v in slotstate.items(): + setattr(inst, k, v) + dispatch[BUILD] = load_build + + def load_mark(self): + self.append(self.mark) + dispatch[MARK] = load_mark + + def load_stop(self): + value = self.stack.pop() + raise _Stop(value) + dispatch[STOP] = load_stop + +# Helper class for load_inst/load_obj + +class _EmptyClass: + pass + +# Encode/decode longs in linear time. + +import binascii as _binascii + +def encode_long(x): + r"""Encode a long to a two's complement little-endian binary string. + Note that 0L is a special case, returning an empty string, to save a + byte in the LONG1 pickling context. + + >>> encode_long(0L) + '' + >>> encode_long(255L) + '\xff\x00' + >>> encode_long(32767L) + '\xff\x7f' + >>> encode_long(-256L) + '\x00\xff' + >>> encode_long(-32768L) + '\x00\x80' + >>> encode_long(-128L) + '\x80' + >>> encode_long(127L) + '\x7f' + >>> + """ + + if x == 0: + return '' + if x > 0: + ashex = hex(x) + assert ashex.startswith("0x") + njunkchars = 2 + ashex.endswith('L') + nibbles = len(ashex) - njunkchars + if nibbles & 1: + # need an even # of nibbles for unhexlify + ashex = "0x0" + ashex[2:] + elif int(ashex[2], 16) >= 8: + # "looks negative", so need a byte of sign bits + ashex = "0x00" + ashex[2:] + else: + # Build the 256's-complement: (1L << nbytes) + x. The trick is + # to find the number of bytes in linear time (although that should + # really be a constant-time task). + ashex = hex(-x) + assert ashex.startswith("0x") + njunkchars = 2 + ashex.endswith('L') + nibbles = len(ashex) - njunkchars + if nibbles & 1: + # Extend to a full byte. + nibbles += 1 + nbits = nibbles * 4 + x += 1L << nbits + assert x > 0 + ashex = hex(x) + njunkchars = 2 + ashex.endswith('L') + newnibbles = len(ashex) - njunkchars + if newnibbles < nibbles: + ashex = "0x" + "0" * (nibbles - newnibbles) + ashex[2:] + if int(ashex[2], 16) < 8: + # "looks positive", so need a byte of sign bits + ashex = "0xff" + ashex[2:] + + if ashex.endswith('L'): + ashex = ashex[2:-1] + else: + ashex = ashex[2:] + assert len(ashex) & 1 == 0, (x, ashex) + binary = _binascii.unhexlify(ashex) + return binary[::-1] + +def decode_long(data): + r"""Decode a long from a two's complement little-endian binary string. + + >>> decode_long('') + 0L + >>> decode_long("\xff\x00") + 255L + >>> decode_long("\xff\x7f") + 32767L + >>> decode_long("\x00\xff") + -256L + >>> decode_long("\x00\x80") + -32768L + >>> decode_long("\x80") + -128L + >>> decode_long("\x7f") + 127L + """ + + nbytes = len(data) + if nbytes == 0: + return 0L + ashex = _binascii.hexlify(data[::-1]) + n = long(ashex, 16) # quadratic time before Python 2.3; linear now + if data[-1] >= '\x80': + n -= 1L << (nbytes * 8) + return n + +# Shorthands + +try: + from cStringIO import StringIO +except ImportError: + from StringIO import StringIO + +def dump(obj, file, protocol=None): + Pickler(file, protocol).dump(obj) + +def dumps(obj, protocol=None): + file = StringIO() + Pickler(file, protocol).dump(obj) + return file.getvalue() + +def load(file): + return Unpickler(file).load() + +def loads(str): + file = StringIO(str) + return Unpickler(file).load() + +# Doctest + +def _test(): + import doctest + return doctest.testmod() + +if __name__ == "__main__": + _test() From python-checkins at python.org Thu Aug 17 02:38:04 2006 From: python-checkins at python.org (anthony.baxter) Date: Thu, 17 Aug 2006 02:38:04 +0200 (CEST) Subject: [Python-checkins] r51333 - python/branches/release25-maint Message-ID: <20060817003804.EF8A91E4004@bag.python.org> Author: anthony.baxter Date: Thu Aug 17 02:38:04 2006 New Revision: 51333 Added: python/branches/release25-maint/ - copied from r51332, python/trunk/ Log: Branching release25-maint. All further 2.5 releases (including the release candidates, the final release and all bugfix releases) will be from this branch, not the trunk. From python-checkins at python.org Thu Aug 17 05:08:56 2006 From: python-checkins at python.org (anthony.baxter) Date: Thu, 17 Aug 2006 05:08:56 +0200 (CEST) Subject: [Python-checkins] r51334 - python/tags/r25c1 Message-ID: <20060817030856.AD4851E4004@bag.python.org> Author: anthony.baxter Date: Thu Aug 17 05:08:55 2006 New Revision: 51334 Added: python/tags/r25c1/ - copied from r51333, python/branches/release25-maint/ Log: Tagging for release of Python 2.5c1 From anthony at interlink.com.au Thu Aug 17 16:23:13 2006 From: anthony at interlink.com.au (Anthony Baxter) Date: Fri, 18 Aug 2006 00:23:13 +1000 Subject: [Python-checkins] TRUNK IS UNFROZEN, available for 2.6 work if you are so inclined Message-ID: <200608180023.14037.anthony@interlink.com.au> The release candidate is done - we creep ever closer to 2.5 final. Hoooray! All future 2.5 releases (including 2.5 final!) will now be done from the new release25-maint trunk (svn+ssh://pythondev at svn.python.org/python/branches/release25-maint) - so any changes you want to see after 2.5c1 and before 2.5 final will need to be applied to that branch as well as to the trunk. From now until the final release, I think we should say no checkins to the release25-maint branch without either myself or Neal signing off on it - for safety's sake, I'd recommend you email either the list here, or if you have to send private email, send it to both of us. If this policy offends you, please reply and let me know what you'd prefer. Right now, I don't really care about the trunk - although if you break the buildbot, I'm sure Neal will be very cranky at you :-) Anthony -- Anthony Baxter It's never too late to have a happy childhood. From g.brandl at gmx.net Thu Aug 17 16:40:45 2006 From: g.brandl at gmx.net (Georg Brandl) Date: Thu, 17 Aug 2006 16:40:45 +0200 Subject: [Python-checkins] TRUNK IS UNFROZEN, available for 2.6 work if you are so inclined In-Reply-To: <200608180023.14037.anthony@interlink.com.au> References: <200608180023.14037.anthony@interlink.com.au> Message-ID: Is the following fix for #1541682 okay? Georg Index: Doc/api/intro.tex =================================================================== --- Doc/api/intro.tex (Revision 51336) +++ Doc/api/intro.tex (Arbeitskopie) @@ -276,8 +276,12 @@ if (n < 0) return -1; for (i = 0; i < n; i++) { - if (PyObject_SetItem(target, i, item) < 0) + PyObject *index = PyInt_FromLong(i); + if (!index) return -1; + if (PyObject_SetItem(target, index, item) < 0) + return -1; + Py_DECREF(index); } return 0; } From martin at v.loewis.de Thu Aug 17 16:47:45 2006 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Thu, 17 Aug 2006 16:47:45 +0200 Subject: [Python-checkins] TRUNK IS UNFROZEN, available for 2.6 work if you are so inclined In-Reply-To: <200608180023.14037.anthony@interlink.com.au> References: <200608180023.14037.anthony@interlink.com.au> Message-ID: <44E48191.6020008@v.loewis.de> Anthony Baxter schrieb: > Right now, I don't really care about the trunk - although if you break the > buildbot [...] Thanks for reminding me. I just added a buildbot builder for the 2.5 branch (actually, the builder was already there, but I connected it with the web server), so you can now see the status of the 2.5 branch at http://www.python.org/dev/buildbot/2.5/ Regards, Martin From buildbot at python.org Thu Aug 17 17:04:06 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 15:04:06 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 2.5 Message-ID: <20060817150414.D6A321E4005@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520solaris10%2520gcc%25202.5/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 17:03:57 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 15:03:57 +0000 Subject: [Python-checkins] buildbot failure in x86 cygwin 2.5 Message-ID: <20060817150414.D60841E4004@bag.python.org> The Buildbot has detected a new failure of x86 cygwin 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520cygwin%25202.5/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 17:04:14 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 15:04:14 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD 2.5 Message-ID: <20060817150414.DBC771E4008@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%25202.5/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 17:04:05 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 15:04:05 +0000 Subject: [Python-checkins] buildbot failure in x86 Ubuntu dapper (icc) 2.5 Message-ID: <20060817150414.DF8101E4009@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%25202.5/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 17:05:00 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 15:05:00 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.5 Message-ID: <20060817150500.75C9E1E4004@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%2520Debian%2520unstable%25202.5/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 17:05:00 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 15:05:00 +0000 Subject: [Python-checkins] buildbot failure in PPC64 Debian 2.5 Message-ID: <20060817150500.77F851E4005@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%25202.5/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 17:05:14 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 15:05:14 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k 2.5 Message-ID: <20060817150514.6FE9E1E4004@bag.python.org> The Buildbot has detected a new failure of x86 W2k 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%25202.5/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 17:05:53 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 15:05:53 +0000 Subject: [Python-checkins] buildbot failure in x86 XP 2.5 Message-ID: <20060817150553.9582A1E4004@bag.python.org> The Buildbot has detected a new failure of x86 XP 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%25202.5/builds/1 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 17:52:47 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 15:52:47 +0000 Subject: [Python-checkins] buildbot warnings in ppc Debian unstable 2.5 Message-ID: <20060817155247.A11EB1E4004@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%2520Debian%2520unstable%25202.5/builds/1 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 17:54:45 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 15:54:45 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 2.5 Message-ID: <20060817155445.438CA1E4004@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%25202.5/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 17:55:03 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 15:55:03 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian 2.5 Message-ID: <20060817155503.67BF11E4004@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%25202.5/builds/1 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 18:25:12 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 16:25:12 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper 2.5 Message-ID: <20060817162512.8F0AD1E4004@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%25202.5/builds/1 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 18:58:11 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 16:58:11 +0000 Subject: [Python-checkins] buildbot warnings in x86 cygwin 2.5 Message-ID: <20060817165811.BE2341E400D@bag.python.org> The Buildbot has detected a new failure of x86 cygwin 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520cygwin%25202.5/builds/1 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter Build Had Warnings: warnings failed slave lost sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 19:12:09 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 17:12:09 +0000 Subject: [Python-checkins] buildbot warnings in S-390 Debian 2.5 Message-ID: <20060817171209.AEF5D1E4004@bag.python.org> The Buildbot has detected a new failure of S-390 Debian 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%2520Debian%25202.5/builds/1 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 19:17:07 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 17:17:07 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-2 2.5 Message-ID: <20060817171707.998631E4024@bag.python.org> The Buildbot has detected a new failure of x86 XP-2 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP-2%25202.5/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Thu Aug 17 19:27:31 2006 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 17 Aug 2006 19:27:31 +0200 (CEST) Subject: [Python-checkins] r51340 - python/branches/release25-maint/Tools/buildbot/external.bat Message-ID: <20060817172731.9A5B61E4004@bag.python.org> Author: martin.v.loewis Date: Thu Aug 17 19:27:31 2006 New Revision: 51340 Modified: python/branches/release25-maint/Tools/buildbot/external.bat Log: Leave tk build directory to restore original path. Modified: python/branches/release25-maint/Tools/buildbot/external.bat ============================================================================== --- python/branches/release25-maint/Tools/buildbot/external.bat (original) +++ python/branches/release25-maint/Tools/buildbot/external.bat Thu Aug 17 19:27:31 2006 @@ -28,6 +28,7 @@ cd tk8.4.12\win nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install + cd ..\.. ) @rem sqlite From buildbot at python.org Thu Aug 17 19:41:57 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 17:41:57 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian 2.5 Message-ID: <20060817174157.3911F1E4004@bag.python.org> The Buildbot has detected a new failure of alpha Debian 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%25202.5/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter Build Had Warnings: warnings test sincerely, -The Buildbot From jackdied at jackdied.com Thu Aug 17 20:50:49 2006 From: jackdied at jackdied.com (Jack Diederich) Date: Thu, 17 Aug 2006 14:50:49 -0400 Subject: [Python-checkins] TRUNK IS UNFROZEN, available for 2.6 work if you are so inclined In-Reply-To: References: <200608180023.14037.anthony@interlink.com.au> Message-ID: <20060817185049.GH5772@performancedrivers.com> On Thu, Aug 17, 2006 at 04:40:45PM +0200, Georg Brandl wrote: > Is the following fix for #1541682 okay? > > Index: Doc/api/intro.tex > =================================================================== > --- Doc/api/intro.tex (Revision 51336) > +++ Doc/api/intro.tex (Arbeitskopie) > @@ -276,8 +276,12 @@ > if (n < 0) > return -1; > for (i = 0; i < n; i++) { > - if (PyObject_SetItem(target, i, item) < 0) > + PyObject *index = PyInt_FromLong(i); > + if (!index) > return -1; > + if (PyObject_SetItem(target, index, item) < 0) > + return -1; > + Py_DECREF(index); > } > return 0; > } > Looks good to me. While you are on that page do you want to change l = PyList_New(3); x = PyInt_FromLong(1L); PySequence_SetItem(l, 0, x); Py_DECREF(x); x = PyInt_FromLong(2L); PySequence_SetItem(l, 1, x); Py_DECREF(x); x = PyString_FromString("three"); PySequence_SetItem(l, 2, x); Py_DECREF(x); to l = PyList_New(3); x = PyInt_FromLong(1L); PyList_SetItem(l, 0, x); x = PyInt_FromLong(2L); PyList_SetItem(l, 1, x); x = PyString_FromString("three"); PyList_SetItem(l, 2, x); The example code causes segfaults and probably always has (at last to 2.2) -Jack From python-checkins at python.org Thu Aug 17 20:54:44 2006 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 17 Aug 2006 20:54:44 +0200 (CEST) Subject: [Python-checkins] r51341 - in python/branches/release25-maint: Misc/NEWS PCbuild/build_ssl.py Message-ID: <20060817185444.A723C1E4004@bag.python.org> Author: martin.v.loewis Date: Thu Aug 17 20:54:43 2006 New Revision: 51341 Modified: python/branches/release25-maint/Misc/NEWS python/branches/release25-maint/PCbuild/build_ssl.py Log: Invoke debug mk1mf.pl after running Configure. Modified: python/branches/release25-maint/Misc/NEWS ============================================================================== --- python/branches/release25-maint/Misc/NEWS (original) +++ python/branches/release25-maint/Misc/NEWS Thu Aug 17 20:54:43 2006 @@ -4,6 +4,16 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 2.5 ? +============================================= + +*Release date: XX-SEP-2006* + +Build +----- + +- Fix OpenSSL debug build process. + What's New in Python 2.5 release candidate 1? ============================================= Modified: python/branches/release25-maint/PCbuild/build_ssl.py ============================================================================== --- python/branches/release25-maint/PCbuild/build_ssl.py (original) +++ python/branches/release25-maint/PCbuild/build_ssl.py Thu Aug 17 20:54:43 2006 @@ -139,23 +139,26 @@ try: os.chdir(ssl_dir) # If the ssl makefiles do not exist, we invoke Perl to generate them. - if not os.path.isfile(makefile): + # Due to a bug in this script, the makefile sometimes ended up empty + # Force a regeneration if it is. + if not os.path.isfile(makefile) or os.path.getsize(makefile)==0: print "Creating the makefiles..." sys.stdout.flush() # Put our working Perl at the front of our path os.environ["PATH"] = os.path.dirname(perl) + \ os.pathsep + \ os.environ["PATH"] + run_configure(configure, do_script) if arch=="x86" and debug: # the do_masm script in openssl doesn't generate a debug # build makefile so we generate it here: os.system("perl util\mk1mf.pl debug "+configure+" >"+makefile) - run_configure(configure, do_script) # Now run make. - print "Executing nmake over the ssl makefiles..." + makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile) + print "Executing ssl makefiles:", makeCommand sys.stdout.flush() - rc = os.system("nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)) + rc = os.system(makeCommand) if rc: print "Executing "+makefile+" failed" print rc From g.brandl at gmx.net Thu Aug 17 21:07:53 2006 From: g.brandl at gmx.net (Georg Brandl) Date: Thu, 17 Aug 2006 21:07:53 +0200 Subject: [Python-checkins] TRUNK IS UNFROZEN, available for 2.6 work if you are so inclined In-Reply-To: <20060817185049.GH5772@performancedrivers.com> References: <200608180023.14037.anthony@interlink.com.au> <20060817185049.GH5772@performancedrivers.com> Message-ID: Jack Diederich wrote: > Looks good to me. While you are on that page do you want to change > > l = PyList_New(3); > x = PyInt_FromLong(1L); > PySequence_SetItem(l, 0, x); Py_DECREF(x); > x = PyInt_FromLong(2L); > PySequence_SetItem(l, 1, x); Py_DECREF(x); > x = PyString_FromString("three"); > PySequence_SetItem(l, 2, x); Py_DECREF(x); > > to > > l = PyList_New(3); > x = PyInt_FromLong(1L); > PyList_SetItem(l, 0, x); > x = PyInt_FromLong(2L); > PyList_SetItem(l, 1, x); > x = PyString_FromString("three"); > PyList_SetItem(l, 2, x); > > The example code causes segfaults and probably always has (at last to 2.2) Interesting! From a naive POV, the docs' example is quite right. The segfault occurs because list_ass_item Py_DECREFs the old item (which segfaults because the old items are NULL in a newly created list). PyList_SetItem does a Py_XDECREF. The docs to PyList_New, however, do not explicitly say that the new list must only be filled using PyList_SetItem. So please, someone, decide what's broken here! Georg From python-checkins at python.org Thu Aug 17 21:19:33 2006 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 17 Aug 2006 21:19:33 +0200 (CEST) Subject: [Python-checkins] r51342 - in python/trunk: PCbuild/build_ssl.py Tools/buildbot/external.bat Message-ID: <20060817191933.09A871E4005@bag.python.org> Author: martin.v.loewis Date: Thu Aug 17 21:19:32 2006 New Revision: 51342 Modified: python/trunk/PCbuild/build_ssl.py python/trunk/Tools/buildbot/external.bat Log: Merge 51340 and 51341 from 2.5 branch: Leave tk build directory to restore original path. Invoke debug mk1mf.pl after running Configure. Modified: python/trunk/PCbuild/build_ssl.py ============================================================================== --- python/trunk/PCbuild/build_ssl.py (original) +++ python/trunk/PCbuild/build_ssl.py Thu Aug 17 21:19:32 2006 @@ -139,23 +139,26 @@ try: os.chdir(ssl_dir) # If the ssl makefiles do not exist, we invoke Perl to generate them. - if not os.path.isfile(makefile): + # Due to a bug in this script, the makefile sometimes ended up empty + # Force a regeneration if it is. + if not os.path.isfile(makefile) or os.path.getsize(makefile)==0: print "Creating the makefiles..." sys.stdout.flush() # Put our working Perl at the front of our path os.environ["PATH"] = os.path.dirname(perl) + \ os.pathsep + \ os.environ["PATH"] + run_configure(configure, do_script) if arch=="x86" and debug: # the do_masm script in openssl doesn't generate a debug # build makefile so we generate it here: os.system("perl util\mk1mf.pl debug "+configure+" >"+makefile) - run_configure(configure, do_script) # Now run make. - print "Executing nmake over the ssl makefiles..." + makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile) + print "Executing ssl makefiles:", makeCommand sys.stdout.flush() - rc = os.system("nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)) + rc = os.system(makeCommand) if rc: print "Executing "+makefile+" failed" print rc Modified: python/trunk/Tools/buildbot/external.bat ============================================================================== --- python/trunk/Tools/buildbot/external.bat (original) +++ python/trunk/Tools/buildbot/external.bat Thu Aug 17 21:19:32 2006 @@ -28,6 +28,7 @@ cd tk8.4.12\win nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install + cd ..\.. ) @rem sqlite From buildbot at python.org Thu Aug 17 21:22:03 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 19:22:03 +0000 Subject: [Python-checkins] buildbot warnings in x86 W2k 2.5 Message-ID: <20060817192203.945731E4004@bag.python.org> The Buildbot has detected a new failure of x86 W2k 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%25202.5/builds/3 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: martin.v.loewis Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 21:26:14 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 19:26:14 +0000 Subject: [Python-checkins] buildbot failure in x86 OpenBSD trunk Message-ID: <20060817192614.F2EC51E4004@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%2520trunk/builds/1208 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 21:36:20 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 19:36:20 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP 2.5 Message-ID: <20060817193620.309201E4004@bag.python.org> The Buildbot has detected a new failure of x86 XP 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%25202.5/builds/4 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: martin.v.loewis Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 17 21:47:40 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 19:47:40 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 2.5 Message-ID: <20060817194740.2CED11E4004@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%25202.5/builds/3 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: martin.v.loewis Build Had Warnings: warnings test sincerely, -The Buildbot From g.brandl at gmx.net Thu Aug 17 21:50:40 2006 From: g.brandl at gmx.net (Georg Brandl) Date: Thu, 17 Aug 2006 21:50:40 +0200 Subject: [Python-checkins] TRUNK IS UNFROZEN, available for 2.6 work if you are so inclined In-Reply-To: References: <200608180023.14037.anthony@interlink.com.au> <20060817185049.GH5772@performancedrivers.com> Message-ID: Georg Brandl wrote: > Jack Diederich wrote: > >> Looks good to me. While you are on that page do you want to change >> >> l = PyList_New(3); >> x = PyInt_FromLong(1L); >> PySequence_SetItem(l, 0, x); Py_DECREF(x); >> x = PyInt_FromLong(2L); >> PySequence_SetItem(l, 1, x); Py_DECREF(x); >> x = PyString_FromString("three"); >> PySequence_SetItem(l, 2, x); Py_DECREF(x); >> >> to >> >> l = PyList_New(3); >> x = PyInt_FromLong(1L); >> PyList_SetItem(l, 0, x); >> x = PyInt_FromLong(2L); >> PyList_SetItem(l, 1, x); >> x = PyString_FromString("three"); >> PyList_SetItem(l, 2, x); >> >> The example code causes segfaults and probably always has (at last to 2.2) > > Interesting! From a naive POV, the docs' example is quite right. > > The segfault occurs because list_ass_item Py_DECREFs the old item (which > segfaults because the old items are NULL in a newly created list). > PyList_SetItem does a Py_XDECREF. > > The docs to PyList_New, however, do not explicitly say that the new list > must only be filled using PyList_SetItem. > > So please, someone, decide what's broken here! Okay, now that I stumbled over and read the c.l.py thread, I think that we should * remove the faulty example (the correct one is already in there) * add a note to PyList_New that the new list must be filled with items before handing it to Python code or using it with abstract APIs such as PySequence_SetItem. Georg From jackdied at jackdied.com Thu Aug 17 22:00:46 2006 From: jackdied at jackdied.com (Jack Diederich) Date: Thu, 17 Aug 2006 16:00:46 -0400 Subject: [Python-checkins] TRUNK IS UNFROZEN, available for 2.6 work if you are so inclined In-Reply-To: References: <200608180023.14037.anthony@interlink.com.au> <20060817185049.GH5772@performancedrivers.com> Message-ID: <20060817200046.GI5772@performancedrivers.com> On Thu, Aug 17, 2006 at 09:07:53PM +0200, Georg Brandl wrote: > Jack Diederich wrote: > > > Looks good to me. While you are on that page do you want to change > > > > l = PyList_New(3); > > x = PyInt_FromLong(1L); > > PySequence_SetItem(l, 0, x); Py_DECREF(x); > > x = PyInt_FromLong(2L); > > PySequence_SetItem(l, 1, x); Py_DECREF(x); > > x = PyString_FromString("three"); > > PySequence_SetItem(l, 2, x); Py_DECREF(x); > > > > to > > > > l = PyList_New(3); > > x = PyInt_FromLong(1L); > > PyList_SetItem(l, 0, x); > > x = PyInt_FromLong(2L); > > PyList_SetItem(l, 1, x); > > x = PyString_FromString("three"); > > PyList_SetItem(l, 2, x); > > > > The example code causes segfaults and probably always has (at last to 2.2) > > Interesting! From a naive POV, the docs' example is quite right. > > The segfault occurs because list_ass_item Py_DECREFs the old item (which > segfaults because the old items are NULL in a newly created list). > PyList_SetItem does a Py_XDECREF. > > The docs to PyList_New, however, do not explicitly say that the new list > must only be filled using PyList_SetItem. > > So please, someone, decide what's broken here! The docs, this is from a thread yesterday and today on c.l.py http://groups.google.com/group/comp.lang.python/browse_frm/thread/158c8797ee2dccab/ -Jack From buildbot at python.org Thu Aug 17 22:04:59 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 17 Aug 2006 20:04:59 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian trunk Message-ID: <20060817200459.9D56B1E4004@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%2520trunk/builds/422 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis Build Had Warnings: warnings test sincerely, -The Buildbot From fredrik at pythonware.com Thu Aug 17 23:05:00 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Thu, 17 Aug 2006 23:05:00 +0200 Subject: [Python-checkins] TRUNK IS UNFROZEN, available for 2.6 work if you are so inclined In-Reply-To: References: <200608180023.14037.anthony@interlink.com.au> <20060817185049.GH5772@performancedrivers.com> Message-ID: Georg Brandl wrote: > Okay, now that I stumbled over and read the c.l.py thread, I think that we should > > * remove the faulty example (the correct one is already in there) > * add a note to PyList_New that the new list must be filled with items > before handing it to Python code or using it with abstract APIs such as > PySequence_SetItem. a blurb at the beginning of the abstract API section that mentions that the abstract API should only be used on fully initialized Python objects might also be a good idea. From python-checkins at python.org Fri Aug 18 05:40:14 2006 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 18 Aug 2006 05:40:14 +0200 (CEST) Subject: [Python-checkins] r51353 - in python/branches/release25-maint: Lib/test/test_uuid.py Lib/uuid.py Misc/NEWS Message-ID: <20060818034014.D2B9C1E4004@bag.python.org> Author: martin.v.loewis Date: Fri Aug 18 05:40:13 2006 New Revision: 51353 Modified: python/branches/release25-maint/Lib/test/test_uuid.py python/branches/release25-maint/Lib/uuid.py python/branches/release25-maint/Misc/NEWS Log: Bug #1541863: uuid.uuid1 failed to generate unique identifiers on systems with low clock resolution. Modified: python/branches/release25-maint/Lib/test/test_uuid.py ============================================================================== --- python/branches/release25-maint/Lib/test/test_uuid.py (original) +++ python/branches/release25-maint/Lib/test/test_uuid.py Fri Aug 18 05:40:13 2006 @@ -429,7 +429,7 @@ # Make sure the generated UUIDs are actually unique. uuids = {} - for u in [uuid.uuid1() for i in range(1000)]: + for u in [uuid.uuid4() for i in range(1000)]: uuids[u] = 1 equal(len(uuids.keys()), 1000) Modified: python/branches/release25-maint/Lib/uuid.py ============================================================================== --- python/branches/release25-maint/Lib/uuid.py (original) +++ python/branches/release25-maint/Lib/uuid.py Fri Aug 18 05:40:13 2006 @@ -488,8 +488,8 @@ # 0x01b21dd213814000 is the number of 100-ns intervals between the # UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00. timestamp = int(nanoseconds/100) + 0x01b21dd213814000L - if timestamp == _last_timestamp: - timestamp += 1 + if timestamp <= _last_timestamp: + timestamp = _last_timestamp + 1 _last_timestamp = timestamp if clock_seq is None: import random Modified: python/branches/release25-maint/Misc/NEWS ============================================================================== --- python/branches/release25-maint/Misc/NEWS (original) +++ python/branches/release25-maint/Misc/NEWS Fri Aug 18 05:40:13 2006 @@ -9,6 +9,12 @@ *Release date: XX-SEP-2006* +Library +------- + +- Bug #1541863: uuid.uuid1 failed to generate unique identifiers + on systems with low clock resolution. + Build ----- From python-checkins at python.org Fri Aug 18 05:47:18 2006 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 18 Aug 2006 05:47:18 +0200 (CEST) Subject: [Python-checkins] r51354 - in python/trunk: Lib/test/test_uuid.py Lib/uuid.py Misc/NEWS Message-ID: <20060818034718.98DD41E4004@bag.python.org> Author: martin.v.loewis Date: Fri Aug 18 05:47:18 2006 New Revision: 51354 Modified: python/trunk/Lib/test/test_uuid.py python/trunk/Lib/uuid.py python/trunk/Misc/NEWS Log: Bug #1541863: uuid.uuid1 failed to generate unique identifiers on systems with low clock resolution. Modified: python/trunk/Lib/test/test_uuid.py ============================================================================== --- python/trunk/Lib/test/test_uuid.py (original) +++ python/trunk/Lib/test/test_uuid.py Fri Aug 18 05:47:18 2006 @@ -429,7 +429,7 @@ # Make sure the generated UUIDs are actually unique. uuids = {} - for u in [uuid.uuid1() for i in range(1000)]: + for u in [uuid.uuid4() for i in range(1000)]: uuids[u] = 1 equal(len(uuids.keys()), 1000) Modified: python/trunk/Lib/uuid.py ============================================================================== --- python/trunk/Lib/uuid.py (original) +++ python/trunk/Lib/uuid.py Fri Aug 18 05:47:18 2006 @@ -488,8 +488,8 @@ # 0x01b21dd213814000 is the number of 100-ns intervals between the # UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00. timestamp = int(nanoseconds/100) + 0x01b21dd213814000L - if timestamp == _last_timestamp: - timestamp += 1 + if timestamp <= _last_timestamp: + timestamp = _last_timestamp + 1 _last_timestamp = timestamp if clock_seq is None: import random Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 18 05:47:18 2006 @@ -4,6 +4,17 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 2.5? +========================= + +*Release date: XX-SEP-2006* + +Library +------- + +- Bug #1541863: uuid.uuid1 failed to generate unique identifiers + on systems with low clock resolution. + What's New in Python 2.5 release candidate 1? ============================================= From python-checkins at python.org Fri Aug 18 05:57:55 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 18 Aug 2006 05:57:55 +0200 (CEST) Subject: [Python-checkins] r51355 - python/trunk/Misc/NEWS Message-ID: <20060818035755.822881E4004@bag.python.org> Author: neal.norwitz Date: Fri Aug 18 05:57:54 2006 New Revision: 51355 Modified: python/trunk/Misc/NEWS Log: Add template for 2.6 on HEAD Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 18 05:57:54 2006 @@ -4,10 +4,14 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) -What's New in Python 2.5? +What's New in Python 2.6? ========================= -*Release date: XX-SEP-2006* +*Release date: XX-XXX-200X* + +Core and builtins +----------------- + Library ------- @@ -15,6 +19,31 @@ - Bug #1541863: uuid.uuid1 failed to generate unique identifiers on systems with low clock resolution. + +Extension Modules +----------------- + + +Tests +----- + + +Documentation +------------- + + +Build +----- + + +C API +----- + + +Mac +--- + + What's New in Python 2.5 release candidate 1? ============================================= From python-checkins at python.org Fri Aug 18 06:01:38 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 18 Aug 2006 06:01:38 +0200 (CEST) Subject: [Python-checkins] r51356 - in python/trunk: Doc/commontex/boilerplate.tex Include/patchlevel.h Message-ID: <20060818040138.E058E1E4004@bag.python.org> Author: neal.norwitz Date: Fri Aug 18 06:01:38 2006 New Revision: 51356 Modified: python/trunk/Doc/commontex/boilerplate.tex python/trunk/Include/patchlevel.h Log: More post-release wibble Modified: python/trunk/Doc/commontex/boilerplate.tex ============================================================================== --- python/trunk/Doc/commontex/boilerplate.tex (original) +++ python/trunk/Doc/commontex/boilerplate.tex Fri Aug 18 06:01:38 2006 @@ -5,5 +5,5 @@ Email: \email{docs at python.org} } -\date{17th August, 2006} % XXX update before final release! +\date{\today} % XXX update before final release! \input{patchlevel} % include Python version information Modified: python/trunk/Include/patchlevel.h ============================================================================== --- python/trunk/Include/patchlevel.h (original) +++ python/trunk/Include/patchlevel.h Fri Aug 18 06:01:38 2006 @@ -20,13 +20,13 @@ /* Version parsed out into numeric values */ #define PY_MAJOR_VERSION 2 -#define PY_MINOR_VERSION 5 +#define PY_MINOR_VERSION 6 #define PY_MICRO_VERSION 0 -#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA -#define PY_RELEASE_SERIAL 1 +#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA +#define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "2.5c1" +#define PY_VERSION "2.6a1" /* Subversion Revision number of this file (not of the repository) */ #define PY_PATCHLEVEL_REVISION "$Revision$" From buildbot at python.org Fri Aug 18 06:34:31 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 18 Aug 2006 04:34:31 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP-2 trunk Message-ID: <20060818043431.55CE31E4004@bag.python.org> The Buildbot has detected a new failure of x86 XP-2 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP-2%2520trunk/builds/884 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 18 06:44:16 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 18 Aug 2006 04:44:16 +0000 Subject: [Python-checkins] buildbot warnings in x86 W2k trunk Message-ID: <20060818044416.5C9821E4004@bag.python.org> The Buildbot has detected a new failure of x86 W2k trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%2520trunk/builds/1439 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Fri Aug 18 06:58:33 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 18 Aug 2006 06:58:33 +0200 (CEST) Subject: [Python-checkins] r51357 - python/trunk/PC/pyconfig.h Message-ID: <20060818045833.ED8F81E4004@bag.python.org> Author: neal.norwitz Date: Fri Aug 18 06:58:33 2006 New Revision: 51357 Modified: python/trunk/PC/pyconfig.h Log: Try to get Windows bots working again Modified: python/trunk/PC/pyconfig.h ============================================================================== --- python/trunk/PC/pyconfig.h (original) +++ python/trunk/PC/pyconfig.h Fri Aug 18 06:58:33 2006 @@ -280,9 +280,9 @@ their Makefile (other compilers are generally taken care of by distutils.) */ # ifdef _DEBUG -# pragma comment(lib,"python25_d.lib") +# pragma comment(lib,"python26_d.lib") # else -# pragma comment(lib,"python25.lib") +# pragma comment(lib,"python26.lib") # endif /* _DEBUG */ # endif /* _MSC_VER */ # endif /* Py_BUILD_CORE */ From buildbot at python.org Fri Aug 18 07:05:10 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 18 Aug 2006 05:05:10 +0000 Subject: [Python-checkins] buildbot failure in x86 W2k trunk Message-ID: <20060818050510.38CC91E4004@bag.python.org> The Buildbot has detected a new failure of x86 W2k trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%2520trunk/builds/1440 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Fri Aug 18 07:05:36 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 18 Aug 2006 05:05:36 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-2 trunk Message-ID: <20060818050536.D31401E4004@bag.python.org> The Buildbot has detected a new failure of x86 XP-2 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP-2%2520trunk/builds/885 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Fri Aug 18 07:10:01 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 18 Aug 2006 07:10:01 +0200 (CEST) Subject: [Python-checkins] r51358 - python/trunk/PCbuild/pythoncore.vcproj python/trunk/PCbuild/readme.txt Message-ID: <20060818051001.0B19A1E4004@bag.python.org> Author: neal.norwitz Date: Fri Aug 18 07:10:00 2006 New Revision: 51358 Modified: python/trunk/PCbuild/pythoncore.vcproj python/trunk/PCbuild/readme.txt Log: Try to get Windows bots working again. Take 2 Modified: python/trunk/PCbuild/pythoncore.vcproj ============================================================================== --- python/trunk/PCbuild/pythoncore.vcproj (original) +++ python/trunk/PCbuild/pythoncore.vcproj Fri Aug 18 07:10:00 2006 @@ -39,15 +39,15 @@ @@ -99,15 +99,15 @@ @@ -166,15 +166,15 @@ Name="VCLinkerTool" AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK" AdditionalDependencies="getbuildinfo.o" - OutputFile="./python25.dll" + OutputFile="./python26.dll" LinkIncremental="1" SuppressStartupBanner="FALSE" IgnoreDefaultLibraryNames="libc" GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\./python25.pdb" + ProgramDatabaseFile=".\./python26.pdb" SubSystem="2" BaseAddress="0x1e000000" - ImportLibrary=".\./python25.lib" + ImportLibrary=".\./python26.lib" TargetMachine="0"/> @@ -233,15 +233,15 @@ Name="VCLinkerTool" AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK" AdditionalDependencies="getbuildinfo.o" - OutputFile="./python25.dll" + OutputFile="./python26.dll" LinkIncremental="1" SuppressStartupBanner="TRUE" IgnoreDefaultLibraryNames="libc" GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\./python25.pdb" + ProgramDatabaseFile=".\./python26.pdb" SubSystem="2" BaseAddress="0x1e000000" - ImportLibrary=".\./python25.lib" + ImportLibrary=".\./python26.lib" TargetMachine="0"/> Modified: python/trunk/PCbuild/readme.txt ============================================================================== --- python/trunk/PCbuild/readme.txt (original) +++ python/trunk/PCbuild/readme.txt Fri Aug 18 07:10:00 2006 @@ -12,7 +12,7 @@ The proper order to build subprojects: 1) pythoncore (this builds the main Python DLL and library files, - python25.{dll, lib} in Release mode) + python26.{dll, lib} in Release mode) NOTE: in previous releases, this subproject was named after the release number, e.g. python20. @@ -26,7 +26,7 @@ test slave; see SUBPROJECTS below) When using the Debug setting, the output files have a _d added to -their name: python25_d.dll, python_d.exe, parser_d.pyd, and so on. +their name: python26_d.dll, python_d.exe, parser_d.pyd, and so on. SUBPROJECTS ----------- From buildbot at python.org Fri Aug 18 07:15:11 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 18 Aug 2006 05:15:11 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP trunk Message-ID: <20060818051511.F21211E4004@bag.python.org> The Buildbot has detected a new failure of x86 XP trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%2520trunk/builds/1393 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 18 07:23:23 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 18 Aug 2006 05:23:23 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060818052323.CFAC41E4004@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1103 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis Build Had Warnings: warnings test sincerely, -The Buildbot From martin at v.loewis.de Fri Aug 18 07:37:34 2006 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Fri, 18 Aug 2006 07:37:34 +0200 Subject: [Python-checkins] r51356 - in python/trunk: Doc/commontex/boilerplate.tex Include/patchlevel.h In-Reply-To: <20060818040138.E058E1E4004@bag.python.org> References: <20060818040138.E058E1E4004@bag.python.org> Message-ID: <44E5521E.8050201@v.loewis.de> neal.norwitz schrieb: > +#define PY_VERSION "2.6a1" Shouldn't this be 2.6a0? Martin From python-checkins at python.org Fri Aug 18 07:39:21 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 18 Aug 2006 07:39:21 +0200 (CEST) Subject: [Python-checkins] r51359 - python/trunk/configure python/trunk/configure.in Message-ID: <20060818053921.D3F221E4004@bag.python.org> Author: neal.norwitz Date: Fri Aug 18 07:39:20 2006 New Revision: 51359 Modified: python/trunk/configure python/trunk/configure.in Log: Try to get Unix bots install working again. Modified: python/trunk/configure ============================================================================== --- python/trunk/configure (original) +++ python/trunk/configure Fri Aug 18 07:39:20 2006 @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Revision: 47267 . +# From configure.in Revision: 51173 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for python 2.5. +# Generated by GNU Autoconf 2.59 for python 2.6. # # Report bugs to . # @@ -270,8 +270,8 @@ # Identity of this package. PACKAGE_NAME='python' PACKAGE_TARNAME='python' -PACKAGE_VERSION='2.5' -PACKAGE_STRING='python 2.5' +PACKAGE_VERSION='2.6' +PACKAGE_STRING='python 2.6' PACKAGE_BUGREPORT='http://www.python.org/python-bugs' ac_unique_file="Include/object.h" @@ -781,7 +781,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures python 2.5 to adapt to many kinds of systems. +\`configure' configures python 2.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -838,7 +838,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of python 2.5:";; + short | recursive ) echo "Configuration of python 2.6:";; esac cat <<\_ACEOF @@ -991,7 +991,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -python configure 2.5 +python configure 2.6 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -1005,7 +1005,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by python $as_me 2.5, which was +It was created by python $as_me 2.6, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1357,7 +1357,7 @@ mv confdefs.h.new confdefs.h -VERSION=2.5 +VERSION=2.6 SOVERSION=1.0 @@ -22610,7 +22610,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by python $as_me 2.5, which was +This file was extended by python $as_me 2.6, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22670,7 +22670,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -python config.status 2.5 +python config.status 2.6 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Fri Aug 18 07:39:20 2006 @@ -1,7 +1,7 @@ dnl Process this file with autoconf 2.0 or later to make a configure script. # Set VERSION so we only need to edit in one place (i.e., here) -m4_define(PYTHON_VERSION, 2.5) +m4_define(PYTHON_VERSION, 2.6) AC_REVISION($Revision$) AC_PREREQ(2.59) From python-checkins at python.org Fri Aug 18 07:41:47 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 18 Aug 2006 07:41:47 +0200 (CEST) Subject: [Python-checkins] r51360 - python/trunk/Include/patchlevel.h Message-ID: <20060818054147.4675A1E4004@bag.python.org> Author: neal.norwitz Date: Fri Aug 18 07:41:46 2006 New Revision: 51360 Modified: python/trunk/Include/patchlevel.h Log: Set version to 2.6a0, seems more consistent. Modified: python/trunk/Include/patchlevel.h ============================================================================== --- python/trunk/Include/patchlevel.h (original) +++ python/trunk/Include/patchlevel.h Fri Aug 18 07:41:46 2006 @@ -26,7 +26,7 @@ #define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "2.6a1" +#define PY_VERSION "2.6a0" /* Subversion Revision number of this file (not of the repository) */ #define PY_PATCHLEVEL_REVISION "$Revision$" From nnorwitz at gmail.com Fri Aug 18 07:43:10 2006 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 17 Aug 2006 22:43:10 -0700 Subject: [Python-checkins] r51356 - in python/trunk: Doc/commontex/boilerplate.tex Include/patchlevel.h In-Reply-To: <44E5521E.8050201@v.loewis.de> References: <20060818040138.E058E1E4004@bag.python.org> <44E5521E.8050201@v.loewis.de> Message-ID: On 8/17/06, "Martin v. L?wis" wrote: > neal.norwitz schrieb: > > +#define PY_VERSION "2.6a1" > > Shouldn't this be 2.6a0? I kinda wondered that when I was making the change. It seems more consistent so I made the change. I don't know if I got all the other places that need to be updated. Here's the current list of what has changed so far. PCbuild/pythoncore.vcproj PCbuild/readme.txt Change python2x{,_d}.* PC/pyconfig.h Change python2x{,_d}.lib Doc/commontex/boilerplate.tex Change date to \today Misc/NEWS Add template and update version configure.in Change PYTHON_VERSION define From martin at v.loewis.de Fri Aug 18 08:00:12 2006 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Fri, 18 Aug 2006 08:00:12 +0200 Subject: [Python-checkins] r51356 - in python/trunk: Doc/commontex/boilerplate.tex Include/patchlevel.h In-Reply-To: References: <20060818040138.E058E1E4004@bag.python.org> <44E5521E.8050201@v.loewis.de> Message-ID: <44E5576C.5020708@v.loewis.de> Neal Norwitz schrieb: > I kinda wondered that when I was making the change. It seems more > consistent so I made the change. I don't know if I got all the other > places that need to be updated. There's also Misc/build.sh. Martin From python-checkins at python.org Fri Aug 18 08:04:56 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 18 Aug 2006 08:04:56 +0200 (CEST) Subject: [Python-checkins] r51361 - peps/trunk/pep-0356.txt Message-ID: <20060818060456.872171E4004@bag.python.org> Author: neal.norwitz Date: Fri Aug 18 08:04:55 2006 New Revision: 51361 Modified: peps/trunk/pep-0356.txt Log: RC1 was released. One bug was fixed. Not all these new ones really block release. We should try to fix them and get more feedback. Modified: peps/trunk/pep-0356.txt ============================================================================== --- peps/trunk/pep-0356.txt (original) +++ peps/trunk/pep-0356.txt Fri Aug 18 08:04:55 2006 @@ -38,7 +38,7 @@ beta 1: June 20, 2006 [completed] beta 2: July 11, 2006 [completed] beta 3: August 3, 2006 [completed] - rc 1: August 18, 2006 [planned] + rc 1: August 17, 2006 [completed] final: September 12, 2006 [planned] @@ -149,10 +149,12 @@ - Bugs that need resolving before release, ie, they block release: - None + http://python.org/sf/1541697 - sgmllib regexp bug causes hang + http://python.org/sf/1541420 - tools and demo missing from windows + http://python.org/sf/1541585 - buffer overrun in repr() for unicode + http://python.org/sf/1446043 - unicode() does not raise LookupError - Bugs that ought to be resolved before release (all exist in 2.4): - http://python.org/sf/1534630 - potential crash in cElementTree http://python.org/sf/1475523 - gettext.py bug (owner: Martin v. Loewis) http://python.org/sf/1467929 - %-formatting and dicts From python-checkins at python.org Fri Aug 18 08:14:53 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 18 Aug 2006 08:14:53 +0200 (CEST) Subject: [Python-checkins] r51362 - python/trunk/Misc/build.sh Message-ID: <20060818061453.621421E4004@bag.python.org> Author: neal.norwitz Date: Fri Aug 18 08:14:52 2006 New Revision: 51362 Modified: python/trunk/Misc/build.sh Log: More version wibble Modified: python/trunk/Misc/build.sh ============================================================================== --- python/trunk/Misc/build.sh (original) +++ python/trunk/Misc/build.sh Fri Aug 18 08:14:52 2006 @@ -58,7 +58,7 @@ PYTHON=$INSTALL_DIR/bin/python # Python options and regression test program that should always be run. -REGRTEST_ARGS="-E -tt $INSTALL_DIR/lib/python2.5/test/regrtest.py" +REGRTEST_ARGS="-E -tt $INSTALL_DIR/lib/python2.6/test/regrtest.py" REFLOG="build/reflog.txt.out" # These tests are not stable and falsely report leaks sometimes. From buildbot at python.org Fri Aug 18 09:15:43 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 18 Aug 2006 07:15:43 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060818071543.8C7601E4004@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/515 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Fri Aug 18 09:25:24 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 18 Aug 2006 09:25:24 +0200 (CEST) Subject: [Python-checkins] r51363 - in python/branches/release24-maint: Doc/api/abstract.tex Doc/api/concrete.tex Doc/api/intro.tex Misc/NEWS Message-ID: <20060818072524.A0E331E4004@bag.python.org> Author: georg.brandl Date: Fri Aug 18 09:25:22 2006 New Revision: 51363 Modified: python/branches/release24-maint/Doc/api/abstract.tex python/branches/release24-maint/Doc/api/concrete.tex python/branches/release24-maint/Doc/api/intro.tex python/branches/release24-maint/Misc/NEWS Log: Bug #1541682: Fix example in the "Refcount details" API docs. Additionally, remove a faulty example showing PySequence_SetItem applied to a newly created list object and add notes that this isn't a good idea. (backport) Modified: python/branches/release24-maint/Doc/api/abstract.tex ============================================================================== --- python/branches/release24-maint/Doc/api/abstract.tex (original) +++ python/branches/release24-maint/Doc/api/abstract.tex Fri Aug 18 09:25:22 2006 @@ -5,6 +5,10 @@ numerical types, or all sequence types). When used on object types for which they do not apply, they will raise a Python exception. +It is not possible to use these functions on objects that are not properly +initialized, such a list object that has been created by +\cfunction{PyList_New()}, but whose items have not been set to some +non-\code{NULL} value yet. \section{Object Protocol \label{object}} Modified: python/branches/release24-maint/Doc/api/concrete.tex ============================================================================== --- python/branches/release24-maint/Doc/api/concrete.tex (original) +++ python/branches/release24-maint/Doc/api/concrete.tex Fri Aug 18 09:25:22 2006 @@ -1766,6 +1766,11 @@ \begin{cfuncdesc}{PyObject*}{PyList_New}{int len} Return a new list of length \var{len} on success, or \NULL{} on failure. + \note{If \var{length} is greater than zero, the returned list object's + items are set to \code{NULL}. Thus you cannot use abstract + API functions such as \cfunction{PySequence_SetItem()} on it + or expose it to Python code before setting all items to a + real object with \cfunction{PyList_SetItem()}.} \end{cfuncdesc} \begin{cfuncdesc}{int}{PyList_Size}{PyObject *list} Modified: python/branches/release24-maint/Doc/api/intro.tex ============================================================================== --- python/branches/release24-maint/Doc/api/intro.tex (original) +++ python/branches/release24-maint/Doc/api/intro.tex Fri Aug 18 09:25:22 2006 @@ -225,25 +225,10 @@ \cfunction{PyTuple_SetItem()} for tuples that you are creating yourself. -Equivalent code for populating a list can be written using -\cfunction{PyList_New()} and \cfunction{PyList_SetItem()}. Such code -can also use \cfunction{PySequence_SetItem()}; this illustrates the -difference between the two (the extra \cfunction{Py_DECREF()} calls): +Equivalent code for populating a list can be written using +\cfunction{PyList_New()} and \cfunction{PyList_SetItem()}. -\begin{verbatim} -PyObject *l, *x; - -l = PyList_New(3); -x = PyInt_FromLong(1L); -PySequence_SetItem(l, 0, x); Py_DECREF(x); -x = PyInt_FromLong(2L); -PySequence_SetItem(l, 1, x); Py_DECREF(x); -x = PyString_FromString("three"); -PySequence_SetItem(l, 2, x); Py_DECREF(x); -\end{verbatim} - -You might find it strange that the ``recommended'' approach takes more -code. However, in practice, you will rarely use these ways of +However, in practice, you will rarely use these ways of creating and populating a tuple or list. There's a generic function, \cfunction{Py_BuildValue()}, that can create most common objects from C values, directed by a \dfn{format string}. For example, the @@ -251,10 +236,10 @@ also takes care of the error checking): \begin{verbatim} -PyObject *t, *l; +PyObject *tuple, *list; -t = Py_BuildValue("(iis)", 1, 2, "three"); -l = Py_BuildValue("[iis]", 1, 2, "three"); +tuple = Py_BuildValue("(iis)", 1, 2, "three"); +list = Py_BuildValue("[iis]", 1, 2, "three"); \end{verbatim} It is much more common to use \cfunction{PyObject_SetItem()} and @@ -276,8 +261,12 @@ if (n < 0) return -1; for (i = 0; i < n; i++) { - if (PyObject_SetItem(target, i, item) < 0) + PyObject *index = PyInt_FromLong(i); + if (!index) + return -1; + if (PyObject_SetItem(target, index, item) < 0) return -1; + Py_DECREF(index); } return 0; } Modified: python/branches/release24-maint/Misc/NEWS ============================================================================== --- python/branches/release24-maint/Misc/NEWS (original) +++ python/branches/release24-maint/Misc/NEWS Fri Aug 18 09:25:22 2006 @@ -166,6 +166,10 @@ Documentation ------------- +- Bug #1541682: Fix example in the "Refcount details" API docs. + Additionally, remove a faulty example showing PySequence_SetItem applied + to a newly created list object and add notes that this isn't a good idea. + - Clarified documentation for tp_as_buffer->bf_getcharbuffer. - Bug #1337990: clarified that ``doctest`` does not support examples From python-checkins at python.org Fri Aug 18 09:28:00 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 18 Aug 2006 09:28:00 +0200 (CEST) Subject: [Python-checkins] r51364 - in python/trunk: Doc/api/abstract.tex Doc/api/concrete.tex Doc/api/intro.tex Misc/NEWS Message-ID: <20060818072800.A367F1E4004@bag.python.org> Author: georg.brandl Date: Fri Aug 18 09:27:59 2006 New Revision: 51364 Modified: python/trunk/Doc/api/abstract.tex python/trunk/Doc/api/concrete.tex python/trunk/Doc/api/intro.tex python/trunk/Misc/NEWS Log: Bug #1541682: Fix example in the "Refcount details" API docs. Additionally, remove a faulty example showing PySequence_SetItem applied to a newly created list object and add notes that this isn't a good idea. Modified: python/trunk/Doc/api/abstract.tex ============================================================================== --- python/trunk/Doc/api/abstract.tex (original) +++ python/trunk/Doc/api/abstract.tex Fri Aug 18 09:27:59 2006 @@ -5,6 +5,10 @@ numerical types, or all sequence types). When used on object types for which they do not apply, they will raise a Python exception. +It is not possible to use these functions on objects that are not properly +initialized, such a list object that has been created by +\cfunction{PyList_New()}, but whose items have not been set to some +non-\code{NULL} value yet. \section{Object Protocol \label{object}} Modified: python/trunk/Doc/api/concrete.tex ============================================================================== --- python/trunk/Doc/api/concrete.tex (original) +++ python/trunk/Doc/api/concrete.tex Fri Aug 18 09:27:59 2006 @@ -1840,6 +1840,11 @@ \begin{cfuncdesc}{PyObject*}{PyList_New}{Py_ssize_t len} Return a new list of length \var{len} on success, or \NULL{} on failure. + \note{If \var{length} is greater than zero, the returned list object's + items are set to \code{NULL}. Thus you cannot use abstract + API functions such as \cfunction{PySequence_SetItem()} on it + or expose it to Python code before setting all items to a + real object with \cfunction{PyList_SetItem()}.} \end{cfuncdesc} \begin{cfuncdesc}{Py_ssize_t}{PyList_Size}{PyObject *list} Modified: python/trunk/Doc/api/intro.tex ============================================================================== --- python/trunk/Doc/api/intro.tex (original) +++ python/trunk/Doc/api/intro.tex Fri Aug 18 09:27:59 2006 @@ -225,25 +225,10 @@ \cfunction{PyTuple_SetItem()} for tuples that you are creating yourself. -Equivalent code for populating a list can be written using -\cfunction{PyList_New()} and \cfunction{PyList_SetItem()}. Such code -can also use \cfunction{PySequence_SetItem()}; this illustrates the -difference between the two (the extra \cfunction{Py_DECREF()} calls): +Equivalent code for populating a list can be written using +\cfunction{PyList_New()} and \cfunction{PyList_SetItem()}. -\begin{verbatim} -PyObject *l, *x; - -l = PyList_New(3); -x = PyInt_FromLong(1L); -PySequence_SetItem(l, 0, x); Py_DECREF(x); -x = PyInt_FromLong(2L); -PySequence_SetItem(l, 1, x); Py_DECREF(x); -x = PyString_FromString("three"); -PySequence_SetItem(l, 2, x); Py_DECREF(x); -\end{verbatim} - -You might find it strange that the ``recommended'' approach takes more -code. However, in practice, you will rarely use these ways of +However, in practice, you will rarely use these ways of creating and populating a tuple or list. There's a generic function, \cfunction{Py_BuildValue()}, that can create most common objects from C values, directed by a \dfn{format string}. For example, the @@ -251,10 +236,10 @@ also takes care of the error checking): \begin{verbatim} -PyObject *t, *l; +PyObject *tuple, *list; -t = Py_BuildValue("(iis)", 1, 2, "three"); -l = Py_BuildValue("[iis]", 1, 2, "three"); +tuple = Py_BuildValue("(iis)", 1, 2, "three"); +list = Py_BuildValue("[iis]", 1, 2, "three"); \end{verbatim} It is much more common to use \cfunction{PyObject_SetItem()} and @@ -276,8 +261,12 @@ if (n < 0) return -1; for (i = 0; i < n; i++) { - if (PyObject_SetItem(target, i, item) < 0) + PyObject *index = PyInt_FromLong(i); + if (!index) + return -1; + if (PyObject_SetItem(target, index, item) < 0) return -1; + Py_DECREF(index); } return 0; } Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Aug 18 09:27:59 2006 @@ -31,6 +31,10 @@ Documentation ------------- +- Bug #1541682: Fix example in the "Refcount details" API docs. + Additionally, remove a faulty example showing PySequence_SetItem applied + to a newly created list object and add notes that this isn't a good idea. + Build ----- From python-checkins at python.org Fri Aug 18 09:28:03 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 18 Aug 2006 09:28:03 +0200 (CEST) Subject: [Python-checkins] r51365 - in python/branches/release25-maint: Doc/api/abstract.tex Doc/api/concrete.tex Doc/api/intro.tex Misc/NEWS Message-ID: <20060818072803.C93611E4004@bag.python.org> Author: georg.brandl Date: Fri Aug 18 09:28:03 2006 New Revision: 51365 Modified: python/branches/release25-maint/Doc/api/abstract.tex python/branches/release25-maint/Doc/api/concrete.tex python/branches/release25-maint/Doc/api/intro.tex python/branches/release25-maint/Misc/NEWS Log: Bug #1541682: Fix example in the "Refcount details" API docs. Additionally, remove a faulty example showing PySequence_SetItem applied to a newly created list object and add notes that this isn't a good idea. (backport from rev. 51364) Modified: python/branches/release25-maint/Doc/api/abstract.tex ============================================================================== --- python/branches/release25-maint/Doc/api/abstract.tex (original) +++ python/branches/release25-maint/Doc/api/abstract.tex Fri Aug 18 09:28:03 2006 @@ -5,6 +5,10 @@ numerical types, or all sequence types). When used on object types for which they do not apply, they will raise a Python exception. +It is not possible to use these functions on objects that are not properly +initialized, such a list object that has been created by +\cfunction{PyList_New()}, but whose items have not been set to some +non-\code{NULL} value yet. \section{Object Protocol \label{object}} Modified: python/branches/release25-maint/Doc/api/concrete.tex ============================================================================== --- python/branches/release25-maint/Doc/api/concrete.tex (original) +++ python/branches/release25-maint/Doc/api/concrete.tex Fri Aug 18 09:28:03 2006 @@ -1840,6 +1840,11 @@ \begin{cfuncdesc}{PyObject*}{PyList_New}{Py_ssize_t len} Return a new list of length \var{len} on success, or \NULL{} on failure. + \note{If \var{length} is greater than zero, the returned list object's + items are set to \code{NULL}. Thus you cannot use abstract + API functions such as \cfunction{PySequence_SetItem()} on it + or expose it to Python code before setting all items to a + real object with \cfunction{PyList_SetItem()}.} \end{cfuncdesc} \begin{cfuncdesc}{Py_ssize_t}{PyList_Size}{PyObject *list} Modified: python/branches/release25-maint/Doc/api/intro.tex ============================================================================== --- python/branches/release25-maint/Doc/api/intro.tex (original) +++ python/branches/release25-maint/Doc/api/intro.tex Fri Aug 18 09:28:03 2006 @@ -225,25 +225,10 @@ \cfunction{PyTuple_SetItem()} for tuples that you are creating yourself. -Equivalent code for populating a list can be written using -\cfunction{PyList_New()} and \cfunction{PyList_SetItem()}. Such code -can also use \cfunction{PySequence_SetItem()}; this illustrates the -difference between the two (the extra \cfunction{Py_DECREF()} calls): +Equivalent code for populating a list can be written using +\cfunction{PyList_New()} and \cfunction{PyList_SetItem()}. -\begin{verbatim} -PyObject *l, *x; - -l = PyList_New(3); -x = PyInt_FromLong(1L); -PySequence_SetItem(l, 0, x); Py_DECREF(x); -x = PyInt_FromLong(2L); -PySequence_SetItem(l, 1, x); Py_DECREF(x); -x = PyString_FromString("three"); -PySequence_SetItem(l, 2, x); Py_DECREF(x); -\end{verbatim} - -You might find it strange that the ``recommended'' approach takes more -code. However, in practice, you will rarely use these ways of +However, in practice, you will rarely use these ways of creating and populating a tuple or list. There's a generic function, \cfunction{Py_BuildValue()}, that can create most common objects from C values, directed by a \dfn{format string}. For example, the @@ -251,10 +236,10 @@ also takes care of the error checking): \begin{verbatim} -PyObject *t, *l; +PyObject *tuple, *list; -t = Py_BuildValue("(iis)", 1, 2, "three"); -l = Py_BuildValue("[iis]", 1, 2, "three"); +tuple = Py_BuildValue("(iis)", 1, 2, "three"); +list = Py_BuildValue("[iis]", 1, 2, "three"); \end{verbatim} It is much more common to use \cfunction{PyObject_SetItem()} and @@ -276,8 +261,12 @@ if (n < 0) return -1; for (i = 0; i < n; i++) { - if (PyObject_SetItem(target, i, item) < 0) + PyObject *index = PyInt_FromLong(i); + if (!index) + return -1; + if (PyObject_SetItem(target, index, item) < 0) return -1; + Py_DECREF(index); } return 0; } Modified: python/branches/release25-maint/Misc/NEWS ============================================================================== --- python/branches/release25-maint/Misc/NEWS (original) +++ python/branches/release25-maint/Misc/NEWS Fri Aug 18 09:28:03 2006 @@ -4,7 +4,7 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) -What's New in Python 2.5 ? +What's New in Python 2.5? ============================================= *Release date: XX-SEP-2006* @@ -15,11 +15,21 @@ - Bug #1541863: uuid.uuid1 failed to generate unique identifiers on systems with low clock resolution. + +Documentation +------------- + +- Bug #1541682: Fix example in the "Refcount details" API docs. + Additionally, remove a faulty example showing PySequence_SetItem applied + to a newly created list object and add notes that this isn't a good idea. + + Build ----- - Fix OpenSSL debug build process. + What's New in Python 2.5 release candidate 1? ============================================= From python-checkins at python.org Fri Aug 18 09:29:02 2006 From: python-checkins at python.org (anthony.baxter) Date: Fri, 18 Aug 2006 09:29:02 +0200 (CEST) Subject: [Python-checkins] r51366 - python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/idlever.py Message-ID: <20060818072902.91F241E4004@bag.python.org> Author: anthony.baxter Date: Fri Aug 18 09:29:02 2006 New Revision: 51366 Modified: python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/idlever.py Log: Updating IDLE's version number to match Python's (as per python-dev discussion). Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Fri Aug 18 09:29:02 2006 @@ -1,3 +1,12 @@ +What's New in IDLE 2.6a1? +========================= + +*Release date: XX-XXX-200X* + +- IDLE's version number takes a big jump to match the version number of + the Python release of which it's a part. + + What's New in IDLE 1.2c1? ========================= Modified: python/trunk/Lib/idlelib/idlever.py ============================================================================== --- python/trunk/Lib/idlelib/idlever.py (original) +++ python/trunk/Lib/idlelib/idlever.py Fri Aug 18 09:29:02 2006 @@ -1 +1 @@ -IDLE_VERSION = "1.2c1" +IDLE_VERSION = "2.6a0" From python-checkins at python.org Fri Aug 18 09:30:07 2006 From: python-checkins at python.org (anthony.baxter) Date: Fri, 18 Aug 2006 09:30:07 +0200 (CEST) Subject: [Python-checkins] r51367 - python/trunk/Misc/RPM/python-2.5.spec python/trunk/Misc/RPM/python-2.6.spec Message-ID: <20060818073007.D7EB61E4005@bag.python.org> Author: anthony.baxter Date: Fri Aug 18 09:30:07 2006 New Revision: 51367 Added: python/trunk/Misc/RPM/python-2.6.spec - copied, changed from r51363, python/trunk/Misc/RPM/python-2.5.spec Removed: python/trunk/Misc/RPM/python-2.5.spec Log: RPM specfile updates Deleted: /python/trunk/Misc/RPM/python-2.5.spec ============================================================================== --- /python/trunk/Misc/RPM/python-2.5.spec Fri Aug 18 09:30:07 2006 +++ (empty file) @@ -1,385 +0,0 @@ -########################## -# User-modifiable configs -########################## - -# Is the resulting package and the installed binary named "python" or -# "python2"? -#WARNING: Commenting out doesn't work. Last line is what's used. -%define config_binsuffix none -%define config_binsuffix 2.5 - -# Build tkinter? "auto" enables it if /usr/bin/wish exists. -#WARNING: Commenting out doesn't work. Last line is what's used. -%define config_tkinter no -%define config_tkinter yes -%define config_tkinter auto - -# Use pymalloc? The last line (commented or not) determines wether -# pymalloc is used. -#WARNING: Commenting out doesn't work. Last line is what's used. -%define config_pymalloc no -%define config_pymalloc yes - -# Enable IPV6? -#WARNING: Commenting out doesn't work. Last line is what's used. -%define config_ipv6 yes -%define config_ipv6 no - -# Location of the HTML directory. -%define config_htmldir /var/www/html/python - -################################# -# End of user-modifiable configs -################################# - -%define name python -%define version 2.5c1 -%define libvers 2.5 -%define release 1pydotorg -%define __prefix /usr - -# kludge to get around rpm define weirdness -%define ipv6 %(if [ "%{config_ipv6}" = yes ]; then echo --enable-ipv6; else echo --disable-ipv6; fi) -%define pymalloc %(if [ "%{config_pymalloc}" = yes ]; then echo --with-pymalloc; else echo --without-pymalloc; fi) -%define binsuffix %(if [ "%{config_binsuffix}" = none ]; then echo ; else echo "%{config_binsuffix}"; fi) -%define include_tkinter %(if [ \\( "%{config_tkinter}" = auto -a -f /usr/bin/wish \\) -o "%{config_tkinter}" = yes ]; then echo 1; else echo 0; fi) -%define libdirname %(( uname -m | egrep -q '_64$' && [ -d /usr/lib64 ] && echo lib64 ) || echo lib) - -# detect if documentation is available -%define include_docs %(if [ -f "%{_sourcedir}/html-%{version}.tar.bz2" ]; then echo 1; else echo 0; fi) - -Summary: An interpreted, interactive, object-oriented programming language. -Name: %{name}%{binsuffix} -Version: %{version} -Release: %{release} -Copyright: Modified CNRI Open Source License -Group: Development/Languages -Source: Python-%{version}.tar.bz2 -%if %{include_docs} -Source1: html-%{version}.tar.bz2 -%endif -BuildRoot: %{_tmppath}/%{name}-%{version}-root -BuildPrereq: expat-devel -BuildPrereq: db4-devel -BuildPrereq: gdbm-devel -BuildPrereq: sqlite-devel -Prefix: %{__prefix} -Packager: Sean Reifschneider - -%description -Python is an interpreted, interactive, object-oriented programming -language. It incorporates modules, exceptions, dynamic typing, very high -level dynamic data types, and classes. Python combines remarkable power -with very clear syntax. It has interfaces to many system calls and -libraries, as well as to various window systems, and is extensible in C or -C++. It is also usable as an extension language for applications that need -a programmable interface. Finally, Python is portable: it runs on many -brands of UNIX, on PCs under Windows, MS-DOS, and OS/2, and on the -Mac. - -%package devel -Summary: The libraries and header files needed for Python extension development. -Prereq: python%{binsuffix} = %{PACKAGE_VERSION} -Group: Development/Libraries - -%description devel -The Python programming language's interpreter can be extended with -dynamically loaded extensions and can be embedded in other programs. -This package contains the header files and libraries needed to do -these types of tasks. - -Install python-devel if you want to develop Python extensions. The -python package will also need to be installed. You'll probably also -want to install the python-docs package, which contains Python -documentation. - -%if %{include_tkinter} -%package tkinter -Summary: A graphical user interface for the Python scripting language. -Group: Development/Languages -Prereq: python%{binsuffix} = %{PACKAGE_VERSION}-%{release} - -%description tkinter -The Tkinter (Tk interface) program is an graphical user interface for -the Python scripting language. - -You should install the tkinter package if you'd like to use a graphical -user interface for Python programming. -%endif - -%package tools -Summary: A collection of development tools included with Python. -Group: Development/Tools -Prereq: python%{binsuffix} = %{PACKAGE_VERSION}-%{release} - -%description tools -The Python package includes several development tools that are used -to build python programs. This package contains a selection of those -tools, including the IDLE Python IDE. - -Install python-tools if you want to use these tools to develop -Python programs. You will also need to install the python and -tkinter packages. - -%if %{include_docs} -%package docs -Summary: Python-related documentation. -Group: Development/Documentation - -%description docs -Documentation relating to the Python programming language in HTML and info -formats. -%endif - -%changelog -* Mon Dec 20 2004 Sean Reifschneider [2.4-2pydotorg] -- Changing the idle wrapper so that it passes arguments to idle. - -* Tue Oct 19 2004 Sean Reifschneider [2.4b1-1pydotorg] -- Updating to 2.4. - -* Thu Jul 22 2004 Sean Reifschneider [2.3.4-3pydotorg] -- Paul Tiemann fixes for %{prefix}. -- Adding permission changes for directory as suggested by reimeika.ca -- Adding code to detect when it should be using lib64. -- Adding a define for the location of /var/www/html for docs. - -* Thu May 27 2004 Sean Reifschneider [2.3.4-2pydotorg] -- Including changes from Ian Holsman to build under Red Hat 7.3. -- Fixing some problems with the /usr/local path change. - -* Sat Mar 27 2004 Sean Reifschneider [2.3.2-3pydotorg] -- Being more agressive about finding the paths to fix for - #!/usr/local/bin/python. - -* Sat Feb 07 2004 Sean Reifschneider [2.3.3-2pydotorg] -- Adding code to remove "#!/usr/local/bin/python" from particular files and - causing the RPM build to terminate if there are any unexpected files - which have that line in them. - -* Mon Oct 13 2003 Sean Reifschneider [2.3.2-1pydotorg] -- Adding code to detect wether documentation is available to build. - -* Fri Sep 19 2003 Sean Reifschneider [2.3.1-1pydotorg] -- Updating to the 2.3.1 release. - -* Mon Feb 24 2003 Sean Reifschneider [2.3b1-1pydotorg] -- Updating to 2.3b1 release. - -* Mon Feb 17 2003 Sean Reifschneider [2.3a1-1] -- Updating to 2.3 release. - -* Sun Dec 23 2001 Sean Reifschneider -[Release 2.2-2] -- Added -docs package. -- Added "auto" config_tkinter setting which only enables tk if - /usr/bin/wish exists. - -* Sat Dec 22 2001 Sean Reifschneider -[Release 2.2-1] -- Updated to 2.2. -- Changed the extension to "2" from "2.2". - -* Tue Nov 18 2001 Sean Reifschneider -[Release 2.2c1-1] -- Updated to 2.2c1. - -* Thu Nov 1 2001 Sean Reifschneider -[Release 2.2b1-3] -- Changed the way the sed for fixing the #! in pydoc works. - -* Wed Oct 24 2001 Sean Reifschneider -[Release 2.2b1-2] -- Fixed missing "email" package, thanks to anonymous report on sourceforge. -- Fixed missing "compiler" package. - -* Mon Oct 22 2001 Sean Reifschneider -[Release 2.2b1-1] -- Updated to 2.2b1. - -* Mon Oct 9 2001 Sean Reifschneider -[Release 2.2a4-4] -- otto at balinor.mat.unimi.it mentioned that the license file is missing. - -* Sun Sep 30 2001 Sean Reifschneider -[Release 2.2a4-3] -- Ignacio Vazquez-Abrams pointed out that I had a spruious double-quote in - the spec files. Thanks. - -* Wed Jul 25 2001 Sean Reifschneider -[Release 2.2a1-1] -- Updated to 2.2a1 release. -- Changed idle and pydoc to use binsuffix macro - -####### -# PREP -####### -%prep -%setup -n Python-%{version} - -######## -# BUILD -######## -%build -./configure --enable-unicode=ucs4 %{ipv6} %{pymalloc} --prefix=%{__prefix} -make - -########## -# INSTALL -########## -%install -# set the install path -echo '[install_scripts]' >setup.cfg -echo 'install_dir='"${RPM_BUILD_ROOT}%{__prefix}/bin" >>setup.cfg - -[ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT%{__prefix}/%{libdirname}/python%{libvers}/lib-dynload -make prefix=$RPM_BUILD_ROOT%{__prefix} install - -# REPLACE PATH IN PYDOC -if [ ! -z "%{binsuffix}" ] -then - ( - cd $RPM_BUILD_ROOT%{__prefix}/bin - mv pydoc pydoc.old - sed 's|#!.*|#!%{__prefix}/bin/env python'%{binsuffix}'|' \ - pydoc.old >pydoc - chmod 755 pydoc - rm -f pydoc.old - ) -fi - -# add the binsuffix -if [ ! -z "%{binsuffix}" ] -then - ( cd $RPM_BUILD_ROOT%{__prefix}/bin; rm -f python[0-9a-zA-Z]*; - mv -f python python"%{binsuffix}" ) - ( cd $RPM_BUILD_ROOT%{__prefix}/man/man1; mv python.1 python%{binsuffix}.1 ) - ( cd $RPM_BUILD_ROOT%{__prefix}/bin; mv -f pydoc pydoc"%{binsuffix}" ) - ( cd $RPM_BUILD_ROOT%{__prefix}/bin; mv -f idle idle"%{binsuffix}" ) -fi - -######## -# Tools -echo '#!%{__prefix}/bin/env python%{binsuffix}' >${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} -echo 'import os, sys' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} -echo 'os.execvp("%{__prefix}/bin/python%{binsuffix}", ["%{__prefix}/bin/python%{binsuffix}", "%{__prefix}/lib/python%{libvers}/idlelib/idle.py"] + sys.argv[1:])' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} -echo 'print "Failed to exec Idle"' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} -echo 'sys.exit(1)' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} -chmod 755 $RPM_BUILD_ROOT%{__prefix}/bin/idle%{binsuffix} -cp -a Tools $RPM_BUILD_ROOT%{__prefix}/%{libdirname}/python%{libvers} - -# MAKE FILE LISTS -rm -f mainpkg.files -find "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/lib-dynload -type f | - sed "s|^${RPM_BUILD_ROOT}|/|" | - grep -v -e '_tkinter.so$' >mainpkg.files -find "$RPM_BUILD_ROOT""%{__prefix}"/bin -type f | - sed "s|^${RPM_BUILD_ROOT}|/|" | - grep -v -e '/bin/idle%{binsuffix}$' >>mainpkg.files - -rm -f tools.files -find "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/idlelib \ - "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/Tools -type f | - sed "s|^${RPM_BUILD_ROOT}|/|" >tools.files -echo "%{__prefix}"/bin/idle%{binsuffix} >>tools.files - -###### -# Docs -%if %{include_docs} -mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir} -( - cd "$RPM_BUILD_ROOT"%{config_htmldir} - bunzip2 < %{SOURCE1} | tar x -) -%endif - -# fix the #! line in installed files -find "$RPM_BUILD_ROOT" -type f -print0 | - xargs -0 grep -l /usr/local/bin/python | while read file -do - FIXFILE="$file" - sed 's|^#!.*python|#!%{__prefix}/bin/env python'"%{binsuffix}"'|' \ - "$FIXFILE" >/tmp/fix-python-path.$$ - cat /tmp/fix-python-path.$$ >"$FIXFILE" - rm -f /tmp/fix-python-path.$$ -done - -# check to see if there are any straggling #! lines -find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \ - | grep ':1:#!' >/tmp/python-rpm-files.$$ || true -if [ -s /tmp/python-rpm-files.$$ ] -then - echo '*****************************************************' - cat /tmp/python-rpm-files.$$ - cat <<@EOF - ***************************************************** - There are still files referencing /usr/local/bin/python in the - install directory. They are listed above. Please fix the .spec - file and try again. If you are an end-user, you probably want - to report this to jafo-rpms at tummy.com as well. - ***************************************************** - at EOF - rm -f /tmp/python-rpm-files.$$ - exit 1 -fi -rm -f /tmp/python-rpm-files.$$ - -######## -# CLEAN -######## -%clean -[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT -rm -f mainpkg.files tools.files - -######## -# FILES -######## -%files -f mainpkg.files -%defattr(-,root,root) -%doc Misc/README Misc/cheatsheet Misc/Porting -%doc LICENSE Misc/ACKS Misc/HISTORY Misc/NEWS -%{__prefix}/man/man1/python%{binsuffix}.1* - -%attr(755,root,root) %dir %{__prefix}/include/python%{libvers} -%attr(755,root,root) %dir %{__prefix}/%{libdirname}/python%{libvers}/ -%{__prefix}/%{libdirname}/python%{libvers}/*.txt -%{__prefix}/%{libdirname}/python%{libvers}/*.py* -%{__prefix}/%{libdirname}/python%{libvers}/pdb.doc -%{__prefix}/%{libdirname}/python%{libvers}/profile.doc -%{__prefix}/%{libdirname}/python%{libvers}/curses -%{__prefix}/%{libdirname}/python%{libvers}/distutils -%{__prefix}/%{libdirname}/python%{libvers}/encodings -%{__prefix}/%{libdirname}/python%{libvers}/plat-linux2 -%{__prefix}/%{libdirname}/python%{libvers}/site-packages -%{__prefix}/%{libdirname}/python%{libvers}/test -%{__prefix}/%{libdirname}/python%{libvers}/xml -%{__prefix}/%{libdirname}/python%{libvers}/email -%{__prefix}/%{libdirname}/python%{libvers}/email/mime -%{__prefix}/%{libdirname}/python%{libvers}/sqlite3 -%{__prefix}/%{libdirname}/python%{libvers}/compiler -%{__prefix}/%{libdirname}/python%{libvers}/bsddb -%{__prefix}/%{libdirname}/python%{libvers}/hotshot -%{__prefix}/%{libdirname}/python%{libvers}/logging -%{__prefix}/%{libdirname}/python%{libvers}/lib-old - -%files devel -%defattr(-,root,root) -%{__prefix}/include/python%{libvers}/*.h -%{__prefix}/%{libdirname}/python%{libvers}/config - -%files -f tools.files tools -%defattr(-,root,root) - -%if %{include_tkinter} -%files tkinter -%defattr(-,root,root) -%{__prefix}/%{libdirname}/python%{libvers}/lib-tk -%{__prefix}/%{libdirname}/python%{libvers}/lib-dynload/_tkinter.so* -%endif - -%if %{include_docs} -%files docs -%defattr(-,root,root) -%{config_htmldir}/* -%endif Copied: python/trunk/Misc/RPM/python-2.6.spec (from r51363, python/trunk/Misc/RPM/python-2.5.spec) ============================================================================== --- python/trunk/Misc/RPM/python-2.5.spec (original) +++ python/trunk/Misc/RPM/python-2.6.spec Fri Aug 18 09:30:07 2006 @@ -6,7 +6,7 @@ # "python2"? #WARNING: Commenting out doesn't work. Last line is what's used. %define config_binsuffix none -%define config_binsuffix 2.5 +%define config_binsuffix 2.6 # Build tkinter? "auto" enables it if /usr/bin/wish exists. #WARNING: Commenting out doesn't work. Last line is what's used. @@ -33,8 +33,8 @@ ################################# %define name python -%define version 2.5c1 -%define libvers 2.5 +%define version 2.6a1 +%define libvers 2.6 %define release 1pydotorg %define __prefix /usr From python-checkins at python.org Fri Aug 18 09:35:47 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 18 Aug 2006 09:35:47 +0200 (CEST) Subject: [Python-checkins] r51368 - python/trunk/Doc/api/newtypes.tex Message-ID: <20060818073547.9CD391E4014@bag.python.org> Author: georg.brandl Date: Fri Aug 18 09:35:47 2006 New Revision: 51368 Modified: python/trunk/Doc/api/newtypes.tex Log: Typo in tp_clear docs. Modified: python/trunk/Doc/api/newtypes.tex ============================================================================== --- python/trunk/Doc/api/newtypes.tex (original) +++ python/trunk/Doc/api/newtypes.tex Fri Aug 18 09:35:47 2006 @@ -979,7 +979,7 @@ More information about Python's garbage collection scheme can be found in section \ref{supporting-cycle-detection}. - This field is inherited by subtypes together with \member{tp_clear} + This field is inherited by subtypes together with \member{tp_traverse} and the \constant{Py_TPFLAGS_HAVE_GC} flag bit: the flag bit, \member{tp_traverse}, and \member{tp_clear} are all inherited from the base type if they are all zero in the subtype \emph{and} the From python-checkins at python.org Fri Aug 18 09:35:51 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 18 Aug 2006 09:35:51 +0200 (CEST) Subject: [Python-checkins] r51369 - python/branches/release24-maint/Doc/api/newtypes.tex Message-ID: <20060818073551.113871E400F@bag.python.org> Author: georg.brandl Date: Fri Aug 18 09:35:50 2006 New Revision: 51369 Modified: python/branches/release24-maint/Doc/api/newtypes.tex Log: Typo in tp_clear docs. (backport from rev. 51368) Modified: python/branches/release24-maint/Doc/api/newtypes.tex ============================================================================== --- python/branches/release24-maint/Doc/api/newtypes.tex (original) +++ python/branches/release24-maint/Doc/api/newtypes.tex Fri Aug 18 09:35:50 2006 @@ -916,7 +916,7 @@ set. More information in section \ref{supporting-cycle-detection} about garbage collection. - This field is inherited by subtypes together with \member{tp_clear} + This field is inherited by subtypes together with \member{tp_traverse} and the \constant{Py_TPFLAGS_HAVE_GC} flag bit: the flag bit, \member{tp_traverse}, and \member{tp_clear} are all inherited from the base type if they are all zero in the subtype \emph{and} the From python-checkins at python.org Fri Aug 18 09:35:54 2006 From: python-checkins at python.org (georg.brandl) Date: Fri, 18 Aug 2006 09:35:54 +0200 (CEST) Subject: [Python-checkins] r51370 - python/branches/release25-maint/Doc/api/newtypes.tex Message-ID: <20060818073554.1450A1E4012@bag.python.org> Author: georg.brandl Date: Fri Aug 18 09:35:53 2006 New Revision: 51370 Modified: python/branches/release25-maint/Doc/api/newtypes.tex Log: Typo in tp_clear docs. (backport from rev. 51368) Modified: python/branches/release25-maint/Doc/api/newtypes.tex ============================================================================== --- python/branches/release25-maint/Doc/api/newtypes.tex (original) +++ python/branches/release25-maint/Doc/api/newtypes.tex Fri Aug 18 09:35:53 2006 @@ -979,7 +979,7 @@ More information about Python's garbage collection scheme can be found in section \ref{supporting-cycle-detection}. - This field is inherited by subtypes together with \member{tp_clear} + This field is inherited by subtypes together with \member{tp_traverse} and the \constant{Py_TPFLAGS_HAVE_GC} flag bit: the flag bit, \member{tp_traverse}, and \member{tp_clear} are all inherited from the base type if they are all zero in the subtype \emph{and} the From g.brandl at gmx.net Fri Aug 18 10:42:47 2006 From: g.brandl at gmx.net (Georg Brandl) Date: Fri, 18 Aug 2006 10:42:47 +0200 Subject: [Python-checkins] TRUNK IS UNFROZEN, available for 2.6 work if you are so inclined In-Reply-To: <200608180023.14037.anthony@interlink.com.au> References: <200608180023.14037.anthony@interlink.com.au> Message-ID: Anthony Baxter wrote: > The release candidate is done - we creep ever closer to 2.5 final. Hoooray! > > All future 2.5 releases (including 2.5 final!) will now be done from the new > release25-maint trunk > (svn+ssh://pythondev at svn.python.org/python/branches/release25-maint) - so any > changes you want to see after 2.5c1 and before 2.5 final will need to be > applied to that branch as well as to the trunk. > >>From now until the final release, I think we should say no checkins to the > release25-maint branch without either myself or Neal signing off on it - for > safety's sake, I'd recommend you email either the list here, or if you have > to send private email, send it to both of us. If this policy offends you, > please reply and let me know what you'd prefer. I'd like to commit this. It fixes bug 1542051. Index: Objects/exceptions.c =================================================================== --- Objects/exceptions.c (Revision 51363) +++ Objects/exceptions.c (Arbeitskopie) @@ -81,6 +81,7 @@ static void BaseException_dealloc(PyBaseExceptionObject *self) { + _PyObject_GC_UNTRACK(self); BaseException_clear(self); self->ob_type->tp_free((PyObject *)self); } @@ -456,6 +457,7 @@ static void SystemExit_dealloc(PySystemExitObject *self) { + _PyObject_GC_UNTRACK(self); SystemExit_clear(self); self->ob_type->tp_free((PyObject *)self); } @@ -562,6 +564,7 @@ static void EnvironmentError_dealloc(PyEnvironmentErrorObject *self) { + _PyObject_GC_UNTRACK(self); EnvironmentError_clear(self); self->ob_type->tp_free((PyObject *)self); } @@ -760,6 +763,7 @@ static void WindowsError_dealloc(PyWindowsErrorObject *self) { + _PyObject_GC_UNTRACK(self); WindowsError_clear(self); self->ob_type->tp_free((PyObject *)self); } @@ -1035,6 +1039,7 @@ static void SyntaxError_dealloc(PySyntaxErrorObject *self) { + _PyObject_GC_UNTRACK(self); SyntaxError_clear(self); self->ob_type->tp_free((PyObject *)self); } @@ -1551,6 +1556,7 @@ static void UnicodeError_dealloc(PyUnicodeErrorObject *self) { + _PyObject_GC_UNTRACK(self); UnicodeError_clear(self); self->ob_type->tp_free((PyObject *)self); } From buildbot at python.org Fri Aug 18 13:27:52 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 18 Aug 2006 11:27:52 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060818112752.CA1B41E4004@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/517 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: anthony.baxter,georg.brandl,neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Fri Aug 18 15:54:34 2006 From: python-checkins at python.org (andrew.kuchling) Date: Fri, 18 Aug 2006 15:54:34 +0200 (CEST) Subject: [Python-checkins] r51376 - python/branches/release25-maint/Doc/api/abstract.tex python/branches/release25-maint/Doc/api/concrete.tex Message-ID: <20060818135434.10D341E4004@bag.python.org> Author: andrew.kuchling Date: Fri Aug 18 15:54:33 2006 New Revision: 51376 Modified: python/branches/release25-maint/Doc/api/abstract.tex python/branches/release25-maint/Doc/api/concrete.tex Log: Minor edits Modified: python/branches/release25-maint/Doc/api/abstract.tex ============================================================================== --- python/branches/release25-maint/Doc/api/abstract.tex (original) +++ python/branches/release25-maint/Doc/api/abstract.tex Fri Aug 18 15:54:33 2006 @@ -6,7 +6,7 @@ for which they do not apply, they will raise a Python exception. It is not possible to use these functions on objects that are not properly -initialized, such a list object that has been created by +initialized, such as a list object that has been created by \cfunction{PyList_New()}, but whose items have not been set to some non-\code{NULL} value yet. Modified: python/branches/release25-maint/Doc/api/concrete.tex ============================================================================== --- python/branches/release25-maint/Doc/api/concrete.tex (original) +++ python/branches/release25-maint/Doc/api/concrete.tex Fri Aug 18 15:54:33 2006 @@ -1842,8 +1842,8 @@ failure. \note{If \var{length} is greater than zero, the returned list object's items are set to \code{NULL}. Thus you cannot use abstract - API functions such as \cfunction{PySequence_SetItem()} on it - or expose it to Python code before setting all items to a + API functions such as \cfunction{PySequence_SetItem()} + or expose the object to Python code before setting all items to a real object with \cfunction{PyList_SetItem()}.} \end{cfuncdesc} From python-checkins at python.org Fri Aug 18 15:56:50 2006 From: python-checkins at python.org (andrew.kuchling) Date: Fri, 18 Aug 2006 15:56:50 +0200 (CEST) Subject: [Python-checkins] r51377 - python/branches/release24-maint/Doc/api/abstract.tex python/branches/release24-maint/Doc/api/concrete.tex Message-ID: <20060818135650.96B2D1E4007@bag.python.org> Author: andrew.kuchling Date: Fri Aug 18 15:56:50 2006 New Revision: 51377 Modified: python/branches/release24-maint/Doc/api/abstract.tex python/branches/release24-maint/Doc/api/concrete.tex Log: Minor edits Modified: python/branches/release24-maint/Doc/api/abstract.tex ============================================================================== --- python/branches/release24-maint/Doc/api/abstract.tex (original) +++ python/branches/release24-maint/Doc/api/abstract.tex Fri Aug 18 15:56:50 2006 @@ -6,7 +6,7 @@ for which they do not apply, they will raise a Python exception. It is not possible to use these functions on objects that are not properly -initialized, such a list object that has been created by +initialized, such as a list object that has been created by \cfunction{PyList_New()}, but whose items have not been set to some non-\code{NULL} value yet. Modified: python/branches/release24-maint/Doc/api/concrete.tex ============================================================================== --- python/branches/release24-maint/Doc/api/concrete.tex (original) +++ python/branches/release24-maint/Doc/api/concrete.tex Fri Aug 18 15:56:50 2006 @@ -1768,8 +1768,8 @@ failure. \note{If \var{length} is greater than zero, the returned list object's items are set to \code{NULL}. Thus you cannot use abstract - API functions such as \cfunction{PySequence_SetItem()} on it - or expose it to Python code before setting all items to a + API functions such as \cfunction{PySequence_SetItem()} + or expose the object to Python code before setting all items to a real object with \cfunction{PyList_SetItem()}.} \end{cfuncdesc} From python-checkins at python.org Fri Aug 18 15:57:13 2006 From: python-checkins at python.org (andrew.kuchling) Date: Fri, 18 Aug 2006 15:57:13 +0200 (CEST) Subject: [Python-checkins] r51378 - python/trunk/Doc/api/abstract.tex python/trunk/Doc/api/concrete.tex Message-ID: <20060818135713.7E1711E4004@bag.python.org> Author: andrew.kuchling Date: Fri Aug 18 15:57:13 2006 New Revision: 51378 Modified: python/trunk/Doc/api/abstract.tex python/trunk/Doc/api/concrete.tex Log: Minor edits Modified: python/trunk/Doc/api/abstract.tex ============================================================================== --- python/trunk/Doc/api/abstract.tex (original) +++ python/trunk/Doc/api/abstract.tex Fri Aug 18 15:57:13 2006 @@ -6,7 +6,7 @@ for which they do not apply, they will raise a Python exception. It is not possible to use these functions on objects that are not properly -initialized, such a list object that has been created by +initialized, such as a list object that has been created by \cfunction{PyList_New()}, but whose items have not been set to some non-\code{NULL} value yet. Modified: python/trunk/Doc/api/concrete.tex ============================================================================== --- python/trunk/Doc/api/concrete.tex (original) +++ python/trunk/Doc/api/concrete.tex Fri Aug 18 15:57:13 2006 @@ -1842,8 +1842,8 @@ failure. \note{If \var{length} is greater than zero, the returned list object's items are set to \code{NULL}. Thus you cannot use abstract - API functions such as \cfunction{PySequence_SetItem()} on it - or expose it to Python code before setting all items to a + API functions such as \cfunction{PySequence_SetItem()} + or expose the object to Python code before setting all items to a real object with \cfunction{PyList_SetItem()}.} \end{cfuncdesc} From python-checkins at python.org Fri Aug 18 16:38:47 2006 From: python-checkins at python.org (thomas.heller) Date: Fri, 18 Aug 2006 16:38:47 +0200 (CEST) Subject: [Python-checkins] r51379 - python/trunk/Modules/_ctypes/_ctypes.c Message-ID: <20060818143847.19CE41E4004@bag.python.org> Author: thomas.heller Date: Fri Aug 18 16:38:46 2006 New Revision: 51379 Modified: python/trunk/Modules/_ctypes/_ctypes.c Log: Add asserts to check for 'impossible' NULL values, with comments. In one place where I'n not 1000% sure about the non-NULL, raise a RuntimeError for safety. This should fix the klocwork issues that Neal sent me. If so, it should be applied to the release25-maint branch also. Modified: python/trunk/Modules/_ctypes/_ctypes.c ============================================================================== --- python/trunk/Modules/_ctypes/_ctypes.c (original) +++ python/trunk/Modules/_ctypes/_ctypes.c Fri Aug 18 16:38:46 2006 @@ -672,6 +672,7 @@ return PyInt_FromLong(0); /* NULL pointer */ typedict = PyType_stgdict(type); + assert(typedict); /* Cannot be NULL for pointer types */ /* If we expect POINTER(), but receive a instance, accept it by calling byref(). @@ -3129,6 +3130,13 @@ } ob = PyTuple_GET_ITEM(argtypes, i); dict = PyType_stgdict(ob); + if (dict == NULL) { + /* Cannot happen: _validate_paramflags() + would not accept such an object */ + PyErr_Format(PyExc_RuntimeError, + "NULL stgdict unexpected"); + goto error; + } if (PyString_Check(dict->proto)) { PyErr_Format( PyExc_TypeError, @@ -3726,6 +3734,8 @@ assert(stgdict); /* Cannot be NULL for array object instances */ proto = stgdict->proto; itemdict = PyType_stgdict(proto); + assert(itemdict); /* proto is the item type of the array, a ctypes + type, so this cannot be NULL */ if (itemdict->getfunc == getentry("c")->getfunc) { char *ptr = (char *)self->b_ptr; return PyString_FromStringAndSize(ptr + ilow, len); @@ -4159,6 +4169,9 @@ proto = stgdict->proto; assert(proto); itemdict = PyType_stgdict(proto); + assert(itemdict); /* proto is the item type of the pointer, a ctypes + type, so this cannot be NULL */ + size = itemdict->size; offset = index * itemdict->size; @@ -4194,6 +4207,9 @@ assert(proto); itemdict = PyType_stgdict(proto); + assert(itemdict); /* Cannot be NULL because the itemtype of a pointer + is always a ctypes type */ + size = itemdict->size; offset = index * itemdict->size; From python-checkins at python.org Fri Aug 18 18:17:21 2006 From: python-checkins at python.org (guido.van.rossum) Date: Fri, 18 Aug 2006 18:17:21 +0200 (CEST) Subject: [Python-checkins] r51387 - peps/trunk/pep-3000.txt Message-ID: <20060818161721.9036E1E4004@bag.python.org> Author: guido.van.rossum Date: Fri Aug 18 18:17:21 2006 New Revision: 51387 Modified: peps/trunk/pep-3000.txt Log: Py3k will be implemented in C, by evolving Python 2.x. Modified: peps/trunk/pep-3000.txt ============================================================================== --- peps/trunk/pep-3000.txt (original) +++ peps/trunk/pep-3000.txt Fri Aug 18 18:17:21 2006 @@ -94,6 +94,19 @@ with -Qwarnall.) +Implementation Language +======================= + +Python 3000 will be implemented in C, and the implementation will be +derived as an evolution of the Python 2 code base. This reflects my +views (which I share with Joel Spolsky) on the dangers of complete +rewrites. Since Python 3000 as a language is a relatively mild +improvement on Python 2, we can gain a lot by not attempting to +reimplement the language from scratch. I am not against parallel +from-scratch implementation efforts, but my own efforts will be +directed at the language and implementation that I know best. + + Meta-Contributions ================== From ncoghlan at gmail.com Fri Aug 18 18:41:01 2006 From: ncoghlan at gmail.com (Nick Coghlan) Date: Sat, 19 Aug 2006 02:41:01 +1000 Subject: [Python-checkins] TRUNK IS UNFROZEN, available for 2.6 work if you are so inclined In-Reply-To: References: <200608180023.14037.anthony@interlink.com.au> Message-ID: <44E5ED9D.2040500@gmail.com> Georg Brandl wrote: > Is the following fix for #1541682 okay? > > Georg > > Index: Doc/api/intro.tex > =================================================================== > --- Doc/api/intro.tex (Revision 51336) > +++ Doc/api/intro.tex (Arbeitskopie) > @@ -276,8 +276,12 @@ > if (n < 0) > return -1; > for (i = 0; i < n; i++) { > - if (PyObject_SetItem(target, i, item) < 0) > + PyObject *index = PyInt_FromLong(i); > + if (!index) > return -1; > + if (PyObject_SetItem(target, index, item) < 0) > + return -1; > + Py_DECREF(index); > } > return 0; > } 1. Why not simply change the code to call PySequence_SetItem instead of creating a Python integer from the C long which PyObject_SetItem will simply have to convert back to a C long anyway? 2. This example code needs to change to use Py_ssize_t instead of int to hold i and n (the same goes for other examples on this page, actually...). Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org From g.brandl at gmx.net Fri Aug 18 18:49:03 2006 From: g.brandl at gmx.net (Georg Brandl) Date: Fri, 18 Aug 2006 18:49:03 +0200 Subject: [Python-checkins] TRUNK IS UNFROZEN, available for 2.6 work if you are so inclined In-Reply-To: <44E5ED9D.2040500@gmail.com> References: <200608180023.14037.anthony@interlink.com.au> <44E5ED9D.2040500@gmail.com> Message-ID: Nick Coghlan wrote: > Georg Brandl wrote: >> Is the following fix for #1541682 okay? >> >> Georg >> >> Index: Doc/api/intro.tex >> =================================================================== >> --- Doc/api/intro.tex (Revision 51336) >> +++ Doc/api/intro.tex (Arbeitskopie) >> @@ -276,8 +276,12 @@ >> if (n < 0) >> return -1; >> for (i = 0; i < n; i++) { >> - if (PyObject_SetItem(target, i, item) < 0) >> + PyObject *index = PyInt_FromLong(i); >> + if (!index) >> return -1; >> + if (PyObject_SetItem(target, index, item) < 0) >> + return -1; >> + Py_DECREF(index); >> } >> return 0; >> } > > 1. Why not simply change the code to call PySequence_SetItem instead of > creating a Python integer from the C long which PyObject_SetItem will simply > have to convert back to a C long anyway? Because this example is after a paragraph that explicitly mentions PyObject_SetItem. It could, however be changed to mention PySequence_SetItem, I think... Georg > 2. This example code needs to change to use Py_ssize_t instead of int to hold > i and n (the same goes for other examples on this page, actually...). > > Cheers, > Nick. > From nnorwitz at gmail.com Fri Aug 18 20:06:42 2006 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 18 Aug 2006 11:06:42 -0700 Subject: [Python-checkins] r51379 - python/trunk/Modules/_ctypes/_ctypes.c In-Reply-To: <20060818143847.19CE41E4004@bag.python.org> References: <20060818143847.19CE41E4004@bag.python.org> Message-ID: On 8/18/06, thomas.heller wrote: > Log: > Add asserts to check for 'impossible' NULL values, with comments. > In one place where I'n not 1000% sure about the non-NULL, raise > a RuntimeError for safety. > > This should fix the klocwork issues that Neal sent me. If so, > it should be applied to the release25-maint branch also. > > Modified: python/trunk/Modules/_ctypes/_ctypes.c > ============================================================================== > --- python/trunk/Modules/_ctypes/_ctypes.c (original) > +++ python/trunk/Modules/_ctypes/_ctypes.c Fri Aug 18 16:38:46 2006 > @@ -3129,6 +3130,13 @@ > } > ob = PyTuple_GET_ITEM(argtypes, i); > dict = PyType_stgdict(ob); > + if (dict == NULL) { > + /* Cannot happen: _validate_paramflags() > + would not accept such an object */ > + PyErr_Format(PyExc_RuntimeError, > + "NULL stgdict unexpected"); > + goto error; > + } Would a SystemError be better? n From jimjjewett at gmail.com Fri Aug 18 22:24:08 2006 From: jimjjewett at gmail.com (Jim Jewett) Date: Fri, 18 Aug 2006 16:24:08 -0400 Subject: [Python-checkins] How does this help? Re: r51366 - python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/idlever.py Message-ID: This makes things more consistent for today, but does it really ease maintenance? Why not just change it to: from sys import version as IDLE_VERSION so that it can be ignored from now on? On 8/18/06, anthony.baxter wrote: > Author: anthony.baxter > Date: Fri Aug 18 09:29:02 2006 > New Revision: 51366 > > Modified: > python/trunk/Lib/idlelib/NEWS.txt > python/trunk/Lib/idlelib/idlever.py > Log: > Updating IDLE's version number to match Python's (as per python-dev > discussion). ============================================================================== > --- python/trunk/Lib/idlelib/idlever.py (original) > +++ python/trunk/Lib/idlelib/idlever.py Fri Aug 18 09:29:02 2006 > @@ -1 +1 @@ > -IDLE_VERSION = "1.2c1" > +IDLE_VERSION = "2.6a0" From python-checkins at python.org Fri Aug 18 23:34:26 2006 From: python-checkins at python.org (guido.van.rossum) Date: Fri, 18 Aug 2006 23:34:26 +0200 (CEST) Subject: [Python-checkins] r51389 - peps/trunk/pep-3100.txt Message-ID: <20060818213426.B6B641E4004@bag.python.org> Author: guido.van.rossum Date: Fri Aug 18 23:34:25 2006 New Revision: 51389 Modified: peps/trunk/pep-3100.txt Log: Various status updates. Added some "?"s to items I'm not sure about. Modified: peps/trunk/pep-3100.txt ============================================================================== --- peps/trunk/pep-3100.txt (original) +++ peps/trunk/pep-3100.txt Fri Aug 18 23:34:25 2006 @@ -63,29 +63,26 @@ Core language ============= -* True division becomes default behavior [#pep238]_ +* True division becomes default behavior [#pep238]_ [done] * ``exec`` as a statement is not worth it -- make it a function -* Add optional declarations for static typing [11]_ -* Support only new-style classes; classic classes will be gone [1]_ +* (Maybe) add optional declarations for static typing [11]_ +* Support only new-style classes; classic classes will be gone [1]_ [done] * Replace ``print`` by a function [16]_ -* Do something so you can catch multiple exceptions using ``except E1, - E2:``. Probably use ``except E1, E2, E3 as err:`` if you want the - error variable? [3]_ -* ``None``, ``True`` and ``False`` become keywords [4]_ - (Or perhaps just ``None``?) +* Use ``except E1, E2, E3 as err:`` if you want the error variable. [3]_ +* ``None`` becomes a keyword [4]_ (What about ``True``, ``False``?) * ``...`` to become a general expression element [24]_ -* ``as`` becomes a keyword [5]_ (probably in 2.6 already) +* ``as`` becomes a keyword [5]_ (probably in 2.6 already) [done] * Have list comprehensions be syntactic sugar for passing an equivalent generator expression to ``list()``; as a consequence the loop variable will no longer be exposed [12]_ * Comparisons other than ``==`` and ``!=`` between disparate types will raise an exception unless explicitly supported by the type [6]_ -* Exceptions will grow an attribute to store the traceback [13]_ +* Exceptions might grow an attribute to store the traceback [13]_ * floats will not be acceptable as arguments in place of ints for operations where floats are inadvertantly accepted (PyArg_ParseTuple() i & l formats) -* Imports will be absolute by default. - Relative imports must be explicitly specified [#pep328]_ -* __init__.py will be optional in sub-packages. __init__.py will still +* Imports will be absolute by default. [done] + Relative imports must be explicitly specified [#pep328]_ [done] +* __init__.py might become optional in sub-packages. __init__.py will still be required for top-level packages. * Cleanup the Py_InitModule() variants {,3,4} (also import and parser APIs) * Cleanup the APIs exported in pythonrun, etc. @@ -110,17 +107,18 @@ NB. {range(x)} means set([range(x)]), NOT set(range(x)). There's no literal for an empty set; use set() (or {1}&{2} :-). There's no frozenset literal; they are too rarely needed. -* Reconsider PEP 299 [30]_: special __main__() function in modules. +* Might reconsider PEP 299 [30]_: special __main__() function in modules. To be removed: -* String exceptions: use instances of an Exception class [2]_ +* String exceptions: use instances of an Exception class [2]_ [done] * ``raise Exception, "message"``: use ``raise Exception("message")`` [14]_ * ```x```: use ``repr(x)`` [2]_ * The ``<>`` operator: use ``!=`` instead [3]_ * The __mod__ and __divmod__ special methods on float. [29]_ -* Unbound methods [7]_ -* METH_OLDARGS, WITH_CYCLE_GC +* Might drop unbound methods? [7]_ +* METH_OLDARGS +* WITH_CYCLE_GC [done] * __getslice__, __setslice__, __delslice__ [17]_ * Remove slice opcodes and use slice objects * C APIs (see code): @@ -140,17 +138,17 @@ The new string type will be called 'str'. * Return iterators instead of lists where appropriate for atomic type methods (e.g. ``dict.keys()``, ``dict.values()``, ``dict.items()``, etc.); iter* - methods will be removed - OR make keys(), etc. return views ala Java collections??? + methods will be removed. + Better: make keys(), etc. return views ala Java collections??? * Make ``string.join()`` stringify its arguments? [26]_ To be removed: * ``basestring.find()`` and ``basestring.rfind()``; use ``basestring.index()`` - or ``basestring.rindex()`` in a try/except block [15]_ -* ``file.xreadlines()`` method [#file-object]_ -* ``dict.setdefault()`` [22]_ -* ``dict.has_key()`` method + or ``basestring.rindex()`` in a try/except block??? [15]_ +* ``file.xreadlines()`` method [#file-object]_ [done] +* ``dict.setdefault()``? [22]_ +* ``dict.has_key()`` method [done] Built-in Namespace @@ -159,23 +157,23 @@ * Make built-ins return an iterator where appropriate (e.g. ``range()``, ``zip()``, etc.) * Relevant functions should consume iterators (e.g. ``min()``, - ``max()``) + ``max()``) [They already do, since 2.2.] * Introduce ``trunc()``, which would call the ``__trunc__()`` method on its argument; suggested use is for objects like float where calling ``__int__()`` - has data loss, but an integral representation is still desired [8]_ -* Exception hierarchy changes [#pep352]_ + has data loss, but an integral representation is still desired? [8]_ +* Exception hierarchy changes [#pep352]_ [done] To be removed: -* ``apply()``: use ``f(*args, **kw)`` instead [2]_ -* ``buffer()``: must die (use a bytes() type instead) [2]_ +* ``apply()``: use ``f(*args, **kw)`` instead [2]_ [done] +* ``buffer()``: must die (use a bytes() type instead) (?) [2]_ * ``callable()``: just call the object and catch the exception [2]_ * ``compile()``: put in ``sys`` (or perhaps in a module of its own) [2]_ * ``coerce()``: no longer needed [2]_ * ``execfile()``, ``reload()``: use ``exec()`` [2]_ * ``input()``: use ``eval(sys.stdin.readline())`` [2]_ * ``intern()``, ``id()``: put in ``sys`` [2]_ -* ``map()``, ``filter()``: use list comprehensions instead [1]_, [9]_ +* ``map()``, ``filter()``: use list comprehensions instead??? [1]_, [9]_ * ``reduce()``: write a loop instead [2]_, [9]_ * ``raw_input()``: use ``sys.stdin.readline()`` [2]_ * ``xrange()``: use ``range()`` instead [1]_ @@ -184,9 +182,10 @@ Standard library ================ -* Reorganize the standard library to not be as shallow +* Reorganize the standard library to not be as shallow? * Move test code to where it belongs, there will be no more test() functions in the standard library +* Convert all tests to use either doctest or unittest. * For the procedures of standard library improvement, see PEP 3001 [#pep3001]_ To be removed: @@ -222,7 +221,8 @@ ================== * Require C99, so we can use // comments, named initializers, declare variables - without introducing a new scope, among other benefits. + without introducing a new scope, among other benefits. (Also better support + for IEEE floating point issues like NaN and infinities?) * Remove support for old systems, including: BeOS, RISCOS, (SGI) Irix, Tru64 From python-checkins at python.org Sat Aug 19 01:54:15 2006 From: python-checkins at python.org (brett.cannon) Date: Sat, 19 Aug 2006 01:54:15 +0200 (CEST) Subject: [Python-checkins] r51391 - python/branches/bcannon-objcap/BRANCHNEWS Message-ID: <20060818235415.28E5E1E4004@bag.python.org> Author: brett.cannon Date: Sat Aug 19 01:54:14 2006 New Revision: 51391 Added: python/branches/bcannon-objcap/BRANCHNEWS (contents, props changed) Log: Create a file to keep track of changes. Added: python/branches/bcannon-objcap/BRANCHNEWS ============================================================================== --- (empty file) +++ python/branches/bcannon-objcap/BRANCHNEWS Sat Aug 19 01:54:14 2006 @@ -0,0 +1,7 @@ ++++++++++++ +Branch News ++++++++++++ + +Core and builtins +----------------- + From python-checkins at python.org Sat Aug 19 01:55:42 2006 From: python-checkins at python.org (brett.cannon) Date: Sat, 19 Aug 2006 01:55:42 +0200 (CEST) Subject: [Python-checkins] r51392 - in python/branches/bcannon-objcap: Lib/test/test_descr.py Lib/test/test_objcap.py Modules/objcapmodule.c Objects/typeobject.c setup.py Message-ID: <20060818235542.E2C941E4004@bag.python.org> Author: brett.cannon Date: Sat Aug 19 01:55:41 2006 New Revision: 51392 Added: python/branches/bcannon-objcap/Lib/test/test_objcap.py (contents, props changed) python/branches/bcannon-objcap/Modules/objcapmodule.c (contents, props changed) Modified: python/branches/bcannon-objcap/Lib/test/test_descr.py python/branches/bcannon-objcap/Objects/typeobject.c python/branches/bcannon-objcap/setup.py Log: Introduce objcap module to store removed abilities. Begin with moving object.__subclasses__(). Modified: python/branches/bcannon-objcap/Lib/test/test_descr.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_descr.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_descr.py Sat Aug 19 01:55:41 2006 @@ -3595,7 +3595,6 @@ vereq(e.meth(), 1) vereq(d.a, 2) vereq(e.a, 2) - vereq(C2.__subclasses__(), [D]) # stuff that shouldn't: class L(list): Added: python/branches/bcannon-objcap/Lib/test/test_objcap.py ============================================================================== --- (empty file) +++ python/branches/bcannon-objcap/Lib/test/test_objcap.py Sat Aug 19 01:55:41 2006 @@ -0,0 +1,33 @@ +import objcap +import unittest +from test import test_support + +class TestClass(object): + pass + +class ObjectSubclasses(unittest.TestCase): + + """Test object.__subclasses__() move.""" + + def test_removal(self): + # Make sure __subclasses__ is no longer on 'object'. + self.failUnless(not hasattr(object, '__subclasses__')) + + def test_argument(self): + # Make sure only proper arguments are accepted. + self.failUnlessRaises(TypeError, objcap.subclasses, object()) + + def test_result(self): + # Check return values. + self.failUnlessEqual(objcap.subclasses(TestClass), []) + self.failUnless(objcap.subclasses(object)) + + +def test_main(): + test_support.run_unittest( + ObjectSubclasses + ) + + +if __name__ == '__main__': + test_main() Added: python/branches/bcannon-objcap/Modules/objcapmodule.c ============================================================================== --- (empty file) +++ python/branches/bcannon-objcap/Modules/objcapmodule.c Sat Aug 19 01:55:41 2006 @@ -0,0 +1,70 @@ +/* + Store changes done to implement object-capabilities. +*/ + +#include "Python.h" + +PyDoc_STRVAR(module_doc, +"XXX Placeholder for code removed for object-capabilities reasons.\n\ +"); + + +/* + Return the subclasses of a class. + + Moved so that object does not expose *all* new-style classes to *every* + interpreter. Otherwise would invert direction of knowledge about + inheritance tree. +*/ +static PyObject * +object_subclasses(PyObject* self, PyTypeObject *type) +{ + PyObject *list, *raw, *ref; + Py_ssize_t i, n; + + if (!PyType_Check(type)) { + PyErr_SetString(PyExc_TypeError, + "argument must be a type or subclass thereof"); + return NULL; + } + list = PyList_New(0); + if (list == NULL) + return NULL; + raw = type->tp_subclasses; + if (raw == NULL) + return list; + assert(PyList_Check(raw)); + n = PyList_GET_SIZE(raw); + for (i = 0; i < n; i++) { + ref = PyList_GET_ITEM(raw, i); + assert(PyWeakref_CheckRef(ref)); + ref = PyWeakref_GET_OBJECT(ref); + if (ref != Py_None) { + if (PyList_Append(list, ref) < 0) { + Py_DECREF(list); + return NULL; + } + } + } + return list; +} + +PyDoc_STRVAR(object_subclass_doc, +"subclasses(object) -> return a list of subclasses.\n\ +Originally object.__subclasses__()."); + + +static PyMethodDef module_methods[] = { + {"subclasses", (PyCFunction)object_subclasses, METH_O, "XXX"}, + {NULL, NULL} +}; + +PyMODINIT_FUNC +initobjcap(void) +{ + PyObject *module; + + module = Py_InitModule3("objcap", module_methods, module_doc); + if (!module) + return; +} Modified: python/branches/bcannon-objcap/Objects/typeobject.c ============================================================================== --- python/branches/bcannon-objcap/Objects/typeobject.c (original) +++ python/branches/bcannon-objcap/Objects/typeobject.c Sat Aug 19 01:55:41 2006 @@ -2151,39 +2151,10 @@ type->ob_type->tp_free((PyObject *)type); } -static PyObject * -type_subclasses(PyTypeObject *type, PyObject *args_ignored) -{ - PyObject *list, *raw, *ref; - Py_ssize_t i, n; - - list = PyList_New(0); - if (list == NULL) - return NULL; - raw = type->tp_subclasses; - if (raw == NULL) - return list; - assert(PyList_Check(raw)); - n = PyList_GET_SIZE(raw); - for (i = 0; i < n; i++) { - ref = PyList_GET_ITEM(raw, i); - assert(PyWeakref_CheckRef(ref)); - ref = PyWeakref_GET_OBJECT(ref); - if (ref != Py_None) { - if (PyList_Append(list, ref) < 0) { - Py_DECREF(list); - return NULL; - } - } - } - return list; -} static PyMethodDef type_methods[] = { {"mro", (PyCFunction)mro_external, METH_NOARGS, PyDoc_STR("mro() -> list\nreturn a type's method resolution order")}, - {"__subclasses__", (PyCFunction)type_subclasses, METH_NOARGS, - PyDoc_STR("__subclasses__() -> list of immediate subclasses")}, {0} }; Modified: python/branches/bcannon-objcap/setup.py ============================================================================== --- python/branches/bcannon-objcap/setup.py (original) +++ python/branches/bcannon-objcap/setup.py Sat Aug 19 01:55:41 2006 @@ -349,6 +349,8 @@ # Some modules that are normally always on: exts.append( Extension('_weakref', ['_weakref.c']) ) + exts.append(Extension('objcap', ['objcapmodule.c'])) + # array objects exts.append( Extension('array', ['arraymodule.c']) ) # complex math library functions From python-checkins at python.org Sat Aug 19 01:58:13 2006 From: python-checkins at python.org (brett.cannon) Date: Sat, 19 Aug 2006 01:58:13 +0200 (CEST) Subject: [Python-checkins] r51393 - python/branches/bcannon-objcap/BRANCHNEWS Message-ID: <20060818235813.6DF291E4004@bag.python.org> Author: brett.cannon Date: Sat Aug 19 01:58:13 2006 New Revision: 51393 Modified: python/branches/bcannon-objcap/BRANCHNEWS Log: Add entry for objcap and object.__subclasses__(). Modified: python/branches/bcannon-objcap/BRANCHNEWS ============================================================================== --- python/branches/bcannon-objcap/BRANCHNEWS (original) +++ python/branches/bcannon-objcap/BRANCHNEWS Sat Aug 19 01:58:13 2006 @@ -5,3 +5,5 @@ Core and builtins ----------------- +* rev. 51392: Introduce objcap module to hold removed functions/methods. Begin + with moving object.__subclasses__(). From python-checkins at python.org Sat Aug 19 06:18:40 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 19 Aug 2006 06:18:40 +0200 (CEST) Subject: [Python-checkins] r51397 - python/branches/release25-maint/Modules/_ctypes/stgdict.c Message-ID: <20060819041840.8B1F81E4006@bag.python.org> Author: neal.norwitz Date: Sat Aug 19 06:18:39 2006 New Revision: 51397 Modified: python/branches/release25-maint/Modules/_ctypes/stgdict.c Log: Move assert to after NULL check, otherwise we deref NULL in the assert. Klocwork #307 Modified: python/branches/release25-maint/Modules/_ctypes/stgdict.c ============================================================================== --- python/branches/release25-maint/Modules/_ctypes/stgdict.c (original) +++ python/branches/release25-maint/Modules/_ctypes/stgdict.c Sat Aug 19 06:18:39 2006 @@ -208,12 +208,12 @@ continue; } new_descr = (CFieldObject *)PyObject_CallObject((PyObject *)&CField_Type, NULL); - assert(new_descr->ob_type == &CField_Type); if (new_descr == NULL) { Py_DECREF(fdescr); Py_DECREF(fieldlist); return -1; } + assert(new_descr->ob_type == &CField_Type); new_descr->size = fdescr->size; new_descr->offset = fdescr->offset + offset; new_descr->index = fdescr->index + index; From python-checkins at python.org Sat Aug 19 06:19:15 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 19 Aug 2006 06:19:15 +0200 (CEST) Subject: [Python-checkins] r51398 - python/branches/release25-maint/Objects/classobject.c Message-ID: <20060819041915.551851E4006@bag.python.org> Author: neal.norwitz Date: Sat Aug 19 06:19:14 2006 New Revision: 51398 Modified: python/branches/release25-maint/Objects/classobject.c Log: Move initialization of interned strings to before allocating the object so we don't leak op. (Fixes an earlier patch to this code) Klockwork #350 Modified: python/branches/release25-maint/Objects/classobject.c ============================================================================== --- python/branches/release25-maint/Objects/classobject.c (original) +++ python/branches/release25-maint/Objects/classobject.c Sat Aug 19 06:19:14 2006 @@ -91,8 +91,22 @@ } Py_INCREF(bases); } + + if (getattrstr == NULL) { + getattrstr = PyString_InternFromString("__getattr__"); + if (getattrstr == NULL) + goto alloc_error; + setattrstr = PyString_InternFromString("__setattr__"); + if (setattrstr == NULL) + goto alloc_error; + delattrstr = PyString_InternFromString("__delattr__"); + if (delattrstr == NULL) + goto alloc_error; + } + op = PyObject_GC_New(PyClassObject, &PyClass_Type); if (op == NULL) { +alloc_error: Py_DECREF(bases); return NULL; } @@ -101,17 +115,7 @@ op->cl_dict = dict; Py_XINCREF(name); op->cl_name = name; - if (getattrstr == NULL) { - getattrstr = PyString_InternFromString("__getattr__"); - if (getattrstr == NULL) - return NULL; - setattrstr = PyString_InternFromString("__setattr__"); - if (setattrstr == NULL) - return NULL; - delattrstr = PyString_InternFromString("__delattr__"); - if (delattrstr == NULL) - return NULL; - } + op->cl_getattr = class_lookup(op, getattrstr, &dummy); op->cl_setattr = class_lookup(op, setattrstr, &dummy); op->cl_delattr = class_lookup(op, delattrstr, &dummy); From python-checkins at python.org Sat Aug 19 06:19:44 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 19 Aug 2006 06:19:44 +0200 (CEST) Subject: [Python-checkins] r51399 - in python/branches/release25-maint: Include/import.h Misc/NEWS Message-ID: <20060819041944.5E4C61E4006@bag.python.org> Author: neal.norwitz Date: Sat Aug 19 06:19:43 2006 New Revision: 51399 Modified: python/branches/release25-maint/Include/import.h python/branches/release25-maint/Misc/NEWS Log: SF #1542693: Remove semi-colon at end of PyImport_ImportModuleEx macro Modified: python/branches/release25-maint/Include/import.h ============================================================================== --- python/branches/release25-maint/Include/import.h (original) +++ python/branches/release25-maint/Include/import.h Sat Aug 19 06:19:43 2006 @@ -22,7 +22,7 @@ PyAPI_FUNC(PyObject *) PyImport_ImportModuleEx( char *name, PyObject *globals, PyObject *locals, PyObject *fromlist); #define PyImport_ImportModuleEx(n, g, l, f) \ - PyImport_ImportModuleLevel(n, g, l, f, -1); + PyImport_ImportModuleLevel(n, g, l, f, -1) PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name); PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m); Modified: python/branches/release25-maint/Misc/NEWS ============================================================================== --- python/branches/release25-maint/Misc/NEWS (original) +++ python/branches/release25-maint/Misc/NEWS Sat Aug 19 06:19:43 2006 @@ -30,6 +30,13 @@ - Fix OpenSSL debug build process. +C API +----- + +- Bug #1542693: remove semi-colon at end of PyImport_ImportModuleEx macro + so it can be used as an expression. + + What's New in Python 2.5 release candidate 1? ============================================= @@ -193,10 +200,6 @@ is always 1 (normal) or 0 (if the specified thread wasn't found). -Mac ---- - - What's New in Python 2.5 beta 3? ================================ From python-checkins at python.org Sat Aug 19 06:22:34 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 19 Aug 2006 06:22:34 +0200 (CEST) Subject: [Python-checkins] r51400 - python/trunk/Objects/classobject.c Message-ID: <20060819042234.2D8DE1E4009@bag.python.org> Author: neal.norwitz Date: Sat Aug 19 06:22:33 2006 New Revision: 51400 Modified: python/trunk/Objects/classobject.c Log: Move initialization of interned strings to before allocating the object so we don't leak op. (Fixes an earlier patch to this code) Klockwork #350 Modified: python/trunk/Objects/classobject.c ============================================================================== --- python/trunk/Objects/classobject.c (original) +++ python/trunk/Objects/classobject.c Sat Aug 19 06:22:33 2006 @@ -91,8 +91,22 @@ } Py_INCREF(bases); } + + if (getattrstr == NULL) { + getattrstr = PyString_InternFromString("__getattr__"); + if (getattrstr == NULL) + goto alloc_error; + setattrstr = PyString_InternFromString("__setattr__"); + if (setattrstr == NULL) + goto alloc_error; + delattrstr = PyString_InternFromString("__delattr__"); + if (delattrstr == NULL) + goto alloc_error; + } + op = PyObject_GC_New(PyClassObject, &PyClass_Type); if (op == NULL) { +alloc_error: Py_DECREF(bases); return NULL; } @@ -101,17 +115,7 @@ op->cl_dict = dict; Py_XINCREF(name); op->cl_name = name; - if (getattrstr == NULL) { - getattrstr = PyString_InternFromString("__getattr__"); - if (getattrstr == NULL) - return NULL; - setattrstr = PyString_InternFromString("__setattr__"); - if (setattrstr == NULL) - return NULL; - delattrstr = PyString_InternFromString("__delattr__"); - if (delattrstr == NULL) - return NULL; - } + op->cl_getattr = class_lookup(op, getattrstr, &dummy); op->cl_setattr = class_lookup(op, setattrstr, &dummy); op->cl_delattr = class_lookup(op, delattrstr, &dummy); From python-checkins at python.org Sat Aug 19 06:23:04 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 19 Aug 2006 06:23:04 +0200 (CEST) Subject: [Python-checkins] r51401 - python/trunk/Modules/_ctypes/stgdict.c Message-ID: <20060819042304.B870A1E4006@bag.python.org> Author: neal.norwitz Date: Sat Aug 19 06:23:04 2006 New Revision: 51401 Modified: python/trunk/Modules/_ctypes/stgdict.c Log: Move assert to after NULL check, otherwise we deref NULL in the assert. Klocwork #307 Modified: python/trunk/Modules/_ctypes/stgdict.c ============================================================================== --- python/trunk/Modules/_ctypes/stgdict.c (original) +++ python/trunk/Modules/_ctypes/stgdict.c Sat Aug 19 06:23:04 2006 @@ -208,12 +208,12 @@ continue; } new_descr = (CFieldObject *)PyObject_CallObject((PyObject *)&CField_Type, NULL); - assert(new_descr->ob_type == &CField_Type); if (new_descr == NULL) { Py_DECREF(fdescr); Py_DECREF(fieldlist); return -1; } + assert(new_descr->ob_type == &CField_Type); new_descr->size = fdescr->size; new_descr->offset = fdescr->offset + offset; new_descr->index = fdescr->index + index; From python-checkins at python.org Sat Aug 19 06:25:33 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 19 Aug 2006 06:25:33 +0200 (CEST) Subject: [Python-checkins] r51402 - in python/trunk: Include/import.h Misc/NEWS Message-ID: <20060819042533.488971E4006@bag.python.org> Author: neal.norwitz Date: Sat Aug 19 06:25:29 2006 New Revision: 51402 Modified: python/trunk/Include/import.h python/trunk/Misc/NEWS Log: SF #1542693: Remove semi-colon at end of PyImport_ImportModuleEx macro Modified: python/trunk/Include/import.h ============================================================================== --- python/trunk/Include/import.h (original) +++ python/trunk/Include/import.h Sat Aug 19 06:25:29 2006 @@ -22,7 +22,7 @@ PyAPI_FUNC(PyObject *) PyImport_ImportModuleEx( char *name, PyObject *globals, PyObject *locals, PyObject *fromlist); #define PyImport_ImportModuleEx(n, g, l, f) \ - PyImport_ImportModuleLevel(n, g, l, f, -1); + PyImport_ImportModuleLevel(n, g, l, f, -1) PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name); PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m); Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat Aug 19 06:25:29 2006 @@ -43,6 +43,9 @@ C API ----- +- Bug #1542693: remove semi-colon at end of PyImport_ImportModuleEx macro + so it can be used as an expression. + Mac --- @@ -211,10 +214,6 @@ is always 1 (normal) or 0 (if the specified thread wasn't found). -Mac ---- - - What's New in Python 2.5 beta 3? ================================ From python-checkins at python.org Sat Aug 19 06:28:56 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 19 Aug 2006 06:28:56 +0200 (CEST) Subject: [Python-checkins] r51403 - python/trunk/Objects/listobject.c Message-ID: <20060819042856.8C6FA1E4006@bag.python.org> Author: neal.norwitz Date: Sat Aug 19 06:28:55 2006 New Revision: 51403 Modified: python/trunk/Objects/listobject.c Log: Move initialization to after the asserts for non-NULL values. Klocwork 286-287. (I'm not backporting this, but if someone wants to, feel free.) Modified: python/trunk/Objects/listobject.c ============================================================================== --- python/trunk/Objects/listobject.c (original) +++ python/trunk/Objects/listobject.c Sat Aug 19 06:28:55 2006 @@ -1398,7 +1398,7 @@ PyObject *compare; PyObject **dest; int result = -1; /* guilty until proved innocent */ - Py_ssize_t min_gallop = ms->min_gallop; + Py_ssize_t min_gallop; assert(ms && pa && pb && na > 0 && nb > 0 && pa + na == pb); if (MERGE_GETMEM(ms, na) < 0) @@ -1414,6 +1414,7 @@ if (na == 1) goto CopyB; + min_gallop = ms->min_gallop; compare = ms->compare; for (;;) { Py_ssize_t acount = 0; /* # of times A won in a row */ @@ -1531,7 +1532,7 @@ int result = -1; /* guilty until proved innocent */ PyObject **basea; PyObject **baseb; - Py_ssize_t min_gallop = ms->min_gallop; + Py_ssize_t min_gallop; assert(ms && pa && pb && na > 0 && nb > 0 && pa + na == pb); if (MERGE_GETMEM(ms, nb) < 0) @@ -1550,6 +1551,7 @@ if (nb == 1) goto CopyA; + min_gallop = ms->min_gallop; compare = ms->compare; for (;;) { Py_ssize_t acount = 0; /* # of times A won in a row */ From python-checkins at python.org Sat Aug 19 06:52:05 2006 From: python-checkins at python.org (neal.norwitz) Date: Sat, 19 Aug 2006 06:52:05 +0200 (CEST) Subject: [Python-checkins] r51404 - python/trunk/Python/symtable.c Message-ID: <20060819045205.256981E4006@bag.python.org> Author: neal.norwitz Date: Sat Aug 19 06:52:03 2006 New Revision: 51404 Modified: python/trunk/Python/symtable.c Log: Handle PyString_FromInternedString() failing (unlikely, but possible). Klocwork #325 (I'm not backporting this, but if someone wants to, feel free.) Modified: python/trunk/Python/symtable.c ============================================================================== --- python/trunk/Python/symtable.c (original) +++ python/trunk/Python/symtable.c Sat Aug 19 06:52:03 2006 @@ -221,8 +221,8 @@ return st; st->st_filename = filename; st->st_future = future; - if (!symtable_enter_block(st, GET_IDENTIFIER(top), ModuleBlock, - (void *)mod, 0)) { + if (!GET_IDENTIFIER(top) || + !symtable_enter_block(st, top, ModuleBlock, (void *)mod, 0)) { PySymtable_Free(st); return NULL; } @@ -1123,12 +1123,13 @@ VISIT(st, expr, e->v.UnaryOp.operand); break; case Lambda_kind: { - if (!symtable_add_def(st, GET_IDENTIFIER(lambda), DEF_LOCAL)) + if (!GET_IDENTIFIER(lambda) || + !symtable_add_def(st, lambda, DEF_LOCAL)) return 0; if (e->v.Lambda.args->defaults) VISIT_SEQ(st, expr, e->v.Lambda.args->defaults); /* XXX how to get line numbers for expressions */ - if (!symtable_enter_block(st, GET_IDENTIFIER(lambda), + if (!symtable_enter_block(st, lambda, FunctionBlock, (void *)e, 0)) return 0; VISIT_IN_BLOCK(st, arguments, e->v.Lambda.args, (void*)e); @@ -1404,8 +1405,8 @@ /* Outermost iterator is evaluated in current scope */ VISIT(st, expr, outermost->iter); /* Create generator scope for the rest */ - if (!symtable_enter_block(st, GET_IDENTIFIER(genexpr), - FunctionBlock, (void *)e, 0)) { + if (!GET_IDENTIFIER(genexpr) || + !symtable_enter_block(st, genexpr, FunctionBlock, (void *)e, 0)) { return 0; } st->st_cur->ste_generator = 1; @@ -1419,7 +1420,5 @@ VISIT_SEQ_TAIL_IN_BLOCK(st, comprehension, e->v.GeneratorExp.generators, 1, (void*)e); VISIT_IN_BLOCK(st, expr, e->v.GeneratorExp.elt, (void*)e); - if (!symtable_exit_block(st, (void *)e)) - return 0; - return 1; + return symtable_exit_block(st, (void *)e); } From buildbot at python.org Sat Aug 19 08:21:26 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 19 Aug 2006 06:21:26 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060819062126.663411E4006@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/47 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sat Aug 19 09:48:07 2006 From: python-checkins at python.org (georg.brandl) Date: Sat, 19 Aug 2006 09:48:07 +0200 (CEST) Subject: [Python-checkins] r51405 - python/branches/release24-maint/Modules/_hotshot.c Message-ID: <20060819074807.17F681E4006@bag.python.org> Author: georg.brandl Date: Sat Aug 19 09:48:06 2006 New Revision: 51405 Modified: python/branches/release24-maint/Modules/_hotshot.c Log: Patch #1540329: _hotshot.c fix backports. Modified: python/branches/release24-maint/Modules/_hotshot.c ============================================================================== --- python/branches/release24-maint/Modules/_hotshot.c (original) +++ python/branches/release24-maint/Modules/_hotshot.c Sat Aug 19 09:48:06 2006 @@ -308,7 +308,12 @@ if ((err = unpack_packed_int(self, &len, 0))) return err; - buf = malloc(len); + buf = (char *)malloc(len); + if (!buf) { + PyErr_NoMemory(); + return ERR_EXCEPTION; + } + for (i=0; i < len; i++) { ch = fgetc(self->logfp); buf[i] = ch; @@ -1398,11 +1403,11 @@ char *buffer; int i = 0; - while (*rev && !isdigit((int)*rev)) + while (*rev && !isdigit(Py_CHARMASK(*rev))) ++rev; while (rev[i] != ' ' && rev[i] != '\0') ++i; - buffer = malloc(i + 1); + buffer = (char *)malloc(i + 1); if (buffer != NULL) { memmove(buffer, rev, i); buffer[i] = '\0'; From buildbot at python.org Sat Aug 19 09:53:17 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 19 Aug 2006 07:53:17 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060819075318.2217A1E4006@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/520 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings failed slave lost sincerely, -The Buildbot From anthony at interlink.com.au Sat Aug 19 10:13:59 2006 From: anthony at interlink.com.au (Anthony Baxter) Date: Sat, 19 Aug 2006 18:13:59 +1000 Subject: [Python-checkins] [Python-Dev] How does this help? Re: r51366 - python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/idlever.py In-Reply-To: References: Message-ID: <200608191814.05404.anthony@interlink.com.au> On Saturday 19 August 2006 06:24, Jim Jewett wrote: > This makes things more consistent for today, but does it really ease > maintenance? > > Why not just change it to: > > from sys import version as IDLE_VERSION > > so that it can be ignored from now on? After the fuss about changing distutils' version number? :-) I'd very much like to do this, but I figured this was a good first step. -- Anthony Baxter It's never too late to have a happy childhood. From gbirdwellltsf at jtibs.net Fri Aug 18 22:03:34 2006 From: gbirdwellltsf at jtibs.net (gbirdwellltsf at jtibs.net) Date: Fri, 18 Aug 2006 16:03:34 -0400 Subject: [Python-checkins] EGECTI0N not lasting as it has in the past? Message-ID: <6380D62E.E5F7D06@jtibs.net> An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20060818/fba6eb19/attachment.htm From kbk at shore.net Sat Aug 19 17:40:03 2006 From: kbk at shore.net (Kurt B. Kaiser) Date: Sat, 19 Aug 2006 11:40:03 -0400 Subject: [Python-checkins] [Python-Dev] How does this help? Re: r51366 - python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/idlever.py In-Reply-To: <200608191814.05404.anthony@interlink.com.au> (Anthony Baxter's message of "Sat, 19 Aug 2006 18:13:59 +1000") References: <200608191814.05404.anthony@interlink.com.au> Message-ID: <87fyfs4tv0.fsf@hydra.bayview.thirdcreek.com> Anthony Baxter writes: > On Saturday 19 August 2006 06:24, Jim Jewett wrote: >> This makes things more consistent for today, but does it really ease >> maintenance? >> >> Why not just change it to: >> >> from sys import version as IDLE_VERSION >> >> so that it can be ignored from now on? > > After the fuss about changing distutils' version number? :-) > > I'd very much like to do this, but I figured this was a good first step. Jim Jewett's suggestion could actually be misleading, IMO. There are users, especially on Windows, who run IDLE out of svn or run their own version, but don't build Python. Here's my suggestion: we set IDLE_VERSION="" in idlever.py. If the IDLE hacker wants to set a specific version, he sets that string. I'll change the code so if the string is empty, IDLE will use the Python version, as Jim suggested; otherwise, the user supplied string. -- KBK From python-checkins at python.org Sat Aug 19 23:56:36 2006 From: python-checkins at python.org (mateusz.rukowicz) Date: Sat, 19 Aug 2006 23:56:36 +0200 (CEST) Subject: [Python-checkins] r51411 - sandbox/trunk/decimal-c/new_dt sandbox/trunk/decimal-c/new_dt/abs.decTest sandbox/trunk/decimal-c/new_dt/add.decTest sandbox/trunk/decimal-c/new_dt/base.decTest sandbox/trunk/decimal-c/new_dt/clamp.decTest sandbox/trunk/decimal-c/new_dt/compare.decTest sandbox/trunk/decimal-c/new_dt/comparetotal.decTest sandbox/trunk/decimal-c/new_dt/decimal128.decTest sandbox/trunk/decimal-c/new_dt/decimal32.decTest sandbox/trunk/decimal-c/new_dt/decimal64.decTest sandbox/trunk/decimal-c/new_dt/divide.decTest sandbox/trunk/decimal-c/new_dt/divideint.decTest sandbox/trunk/decimal-c/new_dt/exp.decTest sandbox/trunk/decimal-c/new_dt/inexact.decTest sandbox/trunk/decimal-c/new_dt/ln.decTest sandbox/trunk/decimal-c/new_dt/log10.decTest sandbox/trunk/decimal-c/new_dt/max.decTest sandbox/trunk/decimal-c/new_dt/min.decTest sandbox/trunk/decimal-c/new_dt/minus.decTest sandbox/trunk/decimal-c/new_dt/multiply.decTest sandbox/trunk/decimal-c/new_dt/normalize.decTest sandbox/trunk/decimal-c/new_dt/plus.decTest sandbox/trunk/decimal-c/new_dt/power.decTest sandbox/trunk/decimal-c/new_dt/powersqrt.decTest sandbox/trunk/decimal-c/new_dt/quantize.decTest sandbox/trunk/decimal-c/new_dt/randomBound32.decTest sandbox/trunk/decimal-c/new_dt/randombound32.decTest sandbox/trunk/decimal-c/new_dt/randoms.decTest sandbox/trunk/decimal-c/new_dt/remainder.decTest sandbox/trunk/decimal-c/new_dt/remainderNear.decTest sandbox/trunk/decimal-c/new_dt/remaindernear.decTest sandbox/trunk/decimal-c/new_dt/rescale.decTest sandbox/trunk/decimal-c/new_dt/rounding.decTest sandbox/trunk/decimal-c/new_dt/samequantum.decTest sandbox/trunk/decimal-c/new_dt/squareroot.decTest sandbox/trunk/decimal-c/new_dt/subtract.decTest sandbox/trunk/decimal-c/new_dt/testall.decTest sandbox/trunk/decimal-c/new_dt/tointegral.decTest sandbox/trunk/decimal-c/new_dt/trim.decTest Message-ID: <20060819215636.80BC01E4008@bag.python.org> Author: mateusz.rukowicz Date: Sat Aug 19 23:56:12 2006 New Revision: 51411 Added: sandbox/trunk/decimal-c/new_dt/ sandbox/trunk/decimal-c/new_dt/abs.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/add.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/base.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/clamp.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/compare.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/comparetotal.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/decimal128.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/decimal32.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/decimal64.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/divide.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/divideint.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/exp.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/inexact.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/ln.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/log10.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/max.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/min.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/minus.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/multiply.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/normalize.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/plus.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/power.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/powersqrt.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/quantize.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/randomBound32.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/randombound32.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/randoms.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/remainder.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/remainderNear.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/remaindernear.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/rescale.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/rounding.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/samequantum.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/squareroot.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/subtract.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/testall.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/tointegral.decTest (contents, props changed) sandbox/trunk/decimal-c/new_dt/trim.decTest (contents, props changed) Log: Most recent tests to decimal. Added: sandbox/trunk/decimal-c/new_dt/abs.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/abs.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,161 @@ +------------------------------------------------------------------------ +-- abs.decTest -- decimal absolute value -- +-- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- This set of tests primarily tests the existence of the operator. +-- Additon, subtraction, rounding, and more overflows are tested +-- elsewhere. + +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 +extended: 1 + +absx001 abs '1' -> '1' +absx002 abs '-1' -> '1' +absx003 abs '1.00' -> '1.00' +absx004 abs '-1.00' -> '1.00' +absx005 abs '0' -> '0' +absx006 abs '0.00' -> '0.00' +absx007 abs '00.0' -> '0.0' +absx008 abs '00.00' -> '0.00' +absx009 abs '00' -> '0' + +absx010 abs '-2' -> '2' +absx011 abs '2' -> '2' +absx012 abs '-2.00' -> '2.00' +absx013 abs '2.00' -> '2.00' +absx014 abs '-0' -> '0' +absx015 abs '-0.00' -> '0.00' +absx016 abs '-00.0' -> '0.0' +absx017 abs '-00.00' -> '0.00' +absx018 abs '-00' -> '0' + +absx020 abs '-2000000' -> '2000000' +absx021 abs '2000000' -> '2000000' +precision: 7 +absx022 abs '-2000000' -> '2000000' +absx023 abs '2000000' -> '2000000' +precision: 6 +absx024 abs '-2000000' -> '2.00000E+6' Rounded +absx025 abs '2000000' -> '2.00000E+6' Rounded +precision: 3 +absx026 abs '-2000000' -> '2.00E+6' Rounded +absx027 abs '2000000' -> '2.00E+6' Rounded + +absx030 abs '+0.1' -> '0.1' +absx031 abs '-0.1' -> '0.1' +absx032 abs '+0.01' -> '0.01' +absx033 abs '-0.01' -> '0.01' +absx034 abs '+0.001' -> '0.001' +absx035 abs '-0.001' -> '0.001' +absx036 abs '+0.000001' -> '0.000001' +absx037 abs '-0.000001' -> '0.000001' +absx038 abs '+0.000000000001' -> '1E-12' +absx039 abs '-0.000000000001' -> '1E-12' + +-- examples from decArith +precision: 9 +absx040 abs '2.1' -> '2.1' +absx041 abs '-100' -> '100' +absx042 abs '101.5' -> '101.5' +absx043 abs '-101.5' -> '101.5' + +-- more fixed, potential LHS swaps/overlays if done by subtract 0 +precision: 9 +absx060 abs '-56267E-10' -> '0.0000056267' +absx061 abs '-56267E-5' -> '0.56267' +absx062 abs '-56267E-2' -> '562.67' +absx063 abs '-56267E-1' -> '5626.7' +absx065 abs '-56267E-0' -> '56267' + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +absx120 abs 9.999E+999999999 -> Infinity Inexact Overflow Rounded + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +absx210 abs 1.00E-999 -> 1.00E-999 +absx211 abs 0.1E-999 -> 1E-1000 Subnormal +absx212 abs 0.10E-999 -> 1.0E-1000 Subnormal +absx213 abs 0.100E-999 -> 1.0E-1000 Subnormal Rounded +absx214 abs 0.01E-999 -> 1E-1001 Subnormal +-- next is rounded to Emin +absx215 abs 0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow +absx216 abs 0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +absx217 abs 0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow +absx218 abs 0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +absx219 abs 0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +absx220 abs 0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +absx230 abs -1.00E-999 -> 1.00E-999 +absx231 abs -0.1E-999 -> 1E-1000 Subnormal +absx232 abs -0.10E-999 -> 1.0E-1000 Subnormal +absx233 abs -0.100E-999 -> 1.0E-1000 Subnormal Rounded +absx234 abs -0.01E-999 -> 1E-1001 Subnormal +-- next is rounded to Emin +absx235 abs -0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow +absx236 abs -0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +absx237 abs -0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow +absx238 abs -0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +absx239 abs -0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +absx240 abs -0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +-- long operand tests +maxexponent: 999 +minexponent: -999 +precision: 9 +absx301 abs 12345678000 -> 1.23456780E+10 Rounded +absx302 abs 1234567800 -> 1.23456780E+9 Rounded +absx303 abs 1234567890 -> 1.23456789E+9 Rounded +absx304 abs 1234567891 -> 1.23456789E+9 Inexact Rounded +absx305 abs 12345678901 -> 1.23456789E+10 Inexact Rounded +absx306 abs 1234567896 -> 1.23456790E+9 Inexact Rounded + +precision: 15 +absx321 abs 12345678000 -> 12345678000 +absx322 abs 1234567800 -> 1234567800 +absx323 abs 1234567890 -> 1234567890 +absx324 abs 1234567891 -> 1234567891 +absx325 abs 12345678901 -> 12345678901 +absx326 abs 1234567896 -> 1234567896 + + +-- Specials +precision: 9 + +-- specials +absx520 abs 'Inf' -> 'Infinity' +absx521 abs '-Inf' -> 'Infinity' +absx522 abs NaN -> NaN +absx523 abs sNaN -> NaN Invalid_operation +absx524 abs NaN22 -> NaN22 +absx525 abs sNaN33 -> NaN33 Invalid_operation +absx526 abs -NaN22 -> -NaN22 +absx527 abs -sNaN33 -> -NaN33 Invalid_operation + +-- Null tests +absx900 abs # -> NaN Invalid_operation + Added: sandbox/trunk/decimal-c/new_dt/add.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/add.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,2605 @@ +------------------------------------------------------------------------ +-- add.decTest -- decimal addition -- +-- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 +extended: 1 + +-- [first group are 'quick confidence check'] +addx001 add 1 1 -> 2 +addx002 add 2 3 -> 5 +addx003 add '5.75' '3.3' -> 9.05 +addx004 add '5' '-3' -> 2 +addx005 add '-5' '-3' -> -8 +addx006 add '-7' '2.5' -> -4.5 +addx007 add '0.7' '0.3' -> 1.0 +addx008 add '1.25' '1.25' -> 2.50 +addx009 add '1.23456789' '1.00000000' -> '2.23456789' +addx010 add '1.23456789' '1.00000011' -> '2.23456800' + +addx011 add '0.4444444444' '0.5555555555' -> '1.00000000' Inexact Rounded +addx012 add '0.4444444440' '0.5555555555' -> '1.00000000' Inexact Rounded +addx013 add '0.4444444444' '0.5555555550' -> '0.999999999' Inexact Rounded +addx014 add '0.44444444449' '0' -> '0.444444444' Inexact Rounded +addx015 add '0.444444444499' '0' -> '0.444444444' Inexact Rounded +addx016 add '0.4444444444999' '0' -> '0.444444444' Inexact Rounded +addx017 add '0.4444444445000' '0' -> '0.444444445' Inexact Rounded +addx018 add '0.4444444445001' '0' -> '0.444444445' Inexact Rounded +addx019 add '0.444444444501' '0' -> '0.444444445' Inexact Rounded +addx020 add '0.44444444451' '0' -> '0.444444445' Inexact Rounded + +addx021 add 0 1 -> 1 +addx022 add 1 1 -> 2 +addx023 add 2 1 -> 3 +addx024 add 3 1 -> 4 +addx025 add 4 1 -> 5 +addx026 add 5 1 -> 6 +addx027 add 6 1 -> 7 +addx028 add 7 1 -> 8 +addx029 add 8 1 -> 9 +addx030 add 9 1 -> 10 + +-- some carrying effects +addx031 add '0.9998' '0.0000' -> '0.9998' +addx032 add '0.9998' '0.0001' -> '0.9999' +addx033 add '0.9998' '0.0002' -> '1.0000' +addx034 add '0.9998' '0.0003' -> '1.0001' + +addx035 add '70' '10000e+9' -> '1.00000000E+13' Inexact Rounded +addx036 add '700' '10000e+9' -> '1.00000000E+13' Inexact Rounded +addx037 add '7000' '10000e+9' -> '1.00000000E+13' Inexact Rounded +addx038 add '70000' '10000e+9' -> '1.00000001E+13' Inexact Rounded +addx039 add '700000' '10000e+9' -> '1.00000007E+13' Rounded + +-- symmetry: +addx040 add '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded +addx041 add '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded +addx042 add '10000e+9' '7000' -> '1.00000000E+13' Inexact Rounded +addx044 add '10000e+9' '70000' -> '1.00000001E+13' Inexact Rounded +addx045 add '10000e+9' '700000' -> '1.00000007E+13' Rounded + +-- same, higher precision +precision: 15 +addx046 add '10000e+9' '7' -> '10000000000007' +addx047 add '10000e+9' '70' -> '10000000000070' +addx048 add '10000e+9' '700' -> '10000000000700' +addx049 add '10000e+9' '7000' -> '10000000007000' +addx050 add '10000e+9' '70000' -> '10000000070000' +addx051 add '10000e+9' '700000' -> '10000000700000' + +-- examples from decarith +addx053 add '12' '7.00' -> '19.00' +addx054 add '1.3' '-1.07' -> '0.23' +addx055 add '1.3' '-1.30' -> '0.00' +addx056 add '1.3' '-2.07' -> '-0.77' +addx057 add '1E+2' '1E+4' -> '1.01E+4' + +-- zero preservation +precision: 6 +addx060 add '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded +addx061 add 1 '0.0001' -> '1.0001' +addx062 add 1 '0.00001' -> '1.00001' +addx063 add 1 '0.000001' -> '1.00000' Inexact Rounded +addx064 add 1 '0.0000001' -> '1.00000' Inexact Rounded +addx065 add 1 '0.00000001' -> '1.00000' Inexact Rounded + +-- some funny zeros [in case of bad signum] +addx070 add 1 0 -> 1 +addx071 add 1 0. -> 1 +addx072 add 1 .0 -> 1.0 +addx073 add 1 0.0 -> 1.0 +addx074 add 1 0.00 -> 1.00 +addx075 add 0 1 -> 1 +addx076 add 0. 1 -> 1 +addx077 add .0 1 -> 1.0 +addx078 add 0.0 1 -> 1.0 +addx079 add 0.00 1 -> 1.00 + +precision: 9 + +-- some carries +addx080 add 999999998 1 -> 999999999 +addx081 add 999999999 1 -> 1.00000000E+9 Rounded +addx082 add 99999999 1 -> 100000000 +addx083 add 9999999 1 -> 10000000 +addx084 add 999999 1 -> 1000000 +addx085 add 99999 1 -> 100000 +addx086 add 9999 1 -> 10000 +addx087 add 999 1 -> 1000 +addx088 add 99 1 -> 100 +addx089 add 9 1 -> 10 + + +-- more LHS swaps +addx090 add '-56267E-10' 0 -> '-0.0000056267' +addx091 add '-56267E-6' 0 -> '-0.056267' +addx092 add '-56267E-5' 0 -> '-0.56267' +addx093 add '-56267E-4' 0 -> '-5.6267' +addx094 add '-56267E-3' 0 -> '-56.267' +addx095 add '-56267E-2' 0 -> '-562.67' +addx096 add '-56267E-1' 0 -> '-5626.7' +addx097 add '-56267E-0' 0 -> '-56267' +addx098 add '-5E-10' 0 -> '-5E-10' +addx099 add '-5E-7' 0 -> '-5E-7' +addx100 add '-5E-6' 0 -> '-0.000005' +addx101 add '-5E-5' 0 -> '-0.00005' +addx102 add '-5E-4' 0 -> '-0.0005' +addx103 add '-5E-1' 0 -> '-0.5' +addx104 add '-5E0' 0 -> '-5' +addx105 add '-5E1' 0 -> '-50' +addx106 add '-5E5' 0 -> '-500000' +addx107 add '-5E8' 0 -> '-500000000' +addx108 add '-5E9' 0 -> '-5.00000000E+9' Rounded +addx109 add '-5E10' 0 -> '-5.00000000E+10' Rounded +addx110 add '-5E11' 0 -> '-5.00000000E+11' Rounded +addx111 add '-5E100' 0 -> '-5.00000000E+100' Rounded + +-- more RHS swaps +addx113 add 0 '-56267E-10' -> '-0.0000056267' +addx114 add 0 '-56267E-6' -> '-0.056267' +addx116 add 0 '-56267E-5' -> '-0.56267' +addx117 add 0 '-56267E-4' -> '-5.6267' +addx119 add 0 '-56267E-3' -> '-56.267' +addx120 add 0 '-56267E-2' -> '-562.67' +addx121 add 0 '-56267E-1' -> '-5626.7' +addx122 add 0 '-56267E-0' -> '-56267' +addx123 add 0 '-5E-10' -> '-5E-10' +addx124 add 0 '-5E-7' -> '-5E-7' +addx125 add 0 '-5E-6' -> '-0.000005' +addx126 add 0 '-5E-5' -> '-0.00005' +addx127 add 0 '-5E-4' -> '-0.0005' +addx128 add 0 '-5E-1' -> '-0.5' +addx129 add 0 '-5E0' -> '-5' +addx130 add 0 '-5E1' -> '-50' +addx131 add 0 '-5E5' -> '-500000' +addx132 add 0 '-5E8' -> '-500000000' +addx133 add 0 '-5E9' -> '-5.00000000E+9' Rounded +addx134 add 0 '-5E10' -> '-5.00000000E+10' Rounded +addx135 add 0 '-5E11' -> '-5.00000000E+11' Rounded +addx136 add 0 '-5E100' -> '-5.00000000E+100' Rounded + +-- related +addx137 add 1 '0E-12' -> '1.00000000' Rounded +addx138 add -1 '0E-12' -> '-1.00000000' Rounded +addx139 add '0E-12' 1 -> '1.00000000' Rounded +addx140 add '0E-12' -1 -> '-1.00000000' Rounded +addx141 add 1E+4 0.0000 -> '10000.0000' +addx142 add 1E+4 0.00000 -> '10000.0000' Rounded +addx143 add 0.000 1E+5 -> '100000.000' +addx144 add 0.0000 1E+5 -> '100000.000' Rounded + +-- [some of the next group are really constructor tests] +addx146 add '00.0' 0 -> '0.0' +addx147 add '0.00' 0 -> '0.00' +addx148 add 0 '0.00' -> '0.00' +addx149 add 0 '00.0' -> '0.0' +addx150 add '00.0' '0.00' -> '0.00' +addx151 add '0.00' '00.0' -> '0.00' +addx152 add '3' '.3' -> '3.3' +addx153 add '3.' '.3' -> '3.3' +addx154 add '3.0' '.3' -> '3.3' +addx155 add '3.00' '.3' -> '3.30' +addx156 add '3' '3' -> '6' +addx157 add '3' '+3' -> '6' +addx158 add '3' '-3' -> '0' +addx159 add '0.3' '-0.3' -> '0.0' +addx160 add '0.03' '-0.03' -> '0.00' + +-- try borderline precision, with carries, etc. +precision: 15 +addx161 add '1E+12' '-1' -> '999999999999' +addx162 add '1E+12' '1.11' -> '1000000000001.11' +addx163 add '1.11' '1E+12' -> '1000000000001.11' +addx164 add '-1' '1E+12' -> '999999999999' +addx165 add '7E+12' '-1' -> '6999999999999' +addx166 add '7E+12' '1.11' -> '7000000000001.11' +addx167 add '1.11' '7E+12' -> '7000000000001.11' +addx168 add '-1' '7E+12' -> '6999999999999' + +-- 123456789012345 123456789012345 1 23456789012345 +addx170 add '0.444444444444444' '0.555555555555563' -> '1.00000000000001' Inexact Rounded +addx171 add '0.444444444444444' '0.555555555555562' -> '1.00000000000001' Inexact Rounded +addx172 add '0.444444444444444' '0.555555555555561' -> '1.00000000000001' Inexact Rounded +addx173 add '0.444444444444444' '0.555555555555560' -> '1.00000000000000' Inexact Rounded +addx174 add '0.444444444444444' '0.555555555555559' -> '1.00000000000000' Inexact Rounded +addx175 add '0.444444444444444' '0.555555555555558' -> '1.00000000000000' Inexact Rounded +addx176 add '0.444444444444444' '0.555555555555557' -> '1.00000000000000' Inexact Rounded +addx177 add '0.444444444444444' '0.555555555555556' -> '1.00000000000000' Rounded +addx178 add '0.444444444444444' '0.555555555555555' -> '0.999999999999999' +addx179 add '0.444444444444444' '0.555555555555554' -> '0.999999999999998' +addx180 add '0.444444444444444' '0.555555555555553' -> '0.999999999999997' +addx181 add '0.444444444444444' '0.555555555555552' -> '0.999999999999996' +addx182 add '0.444444444444444' '0.555555555555551' -> '0.999999999999995' +addx183 add '0.444444444444444' '0.555555555555550' -> '0.999999999999994' + +-- and some more, including residue effects and different roundings +precision: 9 +rounding: half_up +addx200 add '123456789' 0 -> '123456789' +addx201 add '123456789' 0.000000001 -> '123456789' Inexact Rounded +addx202 add '123456789' 0.000001 -> '123456789' Inexact Rounded +addx203 add '123456789' 0.1 -> '123456789' Inexact Rounded +addx204 add '123456789' 0.4 -> '123456789' Inexact Rounded +addx205 add '123456789' 0.49 -> '123456789' Inexact Rounded +addx206 add '123456789' 0.499999 -> '123456789' Inexact Rounded +addx207 add '123456789' 0.499999999 -> '123456789' Inexact Rounded +addx208 add '123456789' 0.5 -> '123456790' Inexact Rounded +addx209 add '123456789' 0.500000001 -> '123456790' Inexact Rounded +addx210 add '123456789' 0.500001 -> '123456790' Inexact Rounded +addx211 add '123456789' 0.51 -> '123456790' Inexact Rounded +addx212 add '123456789' 0.6 -> '123456790' Inexact Rounded +addx213 add '123456789' 0.9 -> '123456790' Inexact Rounded +addx214 add '123456789' 0.99999 -> '123456790' Inexact Rounded +addx215 add '123456789' 0.999999999 -> '123456790' Inexact Rounded +addx216 add '123456789' 1 -> '123456790' +addx217 add '123456789' 1.000000001 -> '123456790' Inexact Rounded +addx218 add '123456789' 1.00001 -> '123456790' Inexact Rounded +addx219 add '123456789' 1.1 -> '123456790' Inexact Rounded + +rounding: half_even +addx220 add '123456789' 0 -> '123456789' +addx221 add '123456789' 0.000000001 -> '123456789' Inexact Rounded +addx222 add '123456789' 0.000001 -> '123456789' Inexact Rounded +addx223 add '123456789' 0.1 -> '123456789' Inexact Rounded +addx224 add '123456789' 0.4 -> '123456789' Inexact Rounded +addx225 add '123456789' 0.49 -> '123456789' Inexact Rounded +addx226 add '123456789' 0.499999 -> '123456789' Inexact Rounded +addx227 add '123456789' 0.499999999 -> '123456789' Inexact Rounded +addx228 add '123456789' 0.5 -> '123456790' Inexact Rounded +addx229 add '123456789' 0.500000001 -> '123456790' Inexact Rounded +addx230 add '123456789' 0.500001 -> '123456790' Inexact Rounded +addx231 add '123456789' 0.51 -> '123456790' Inexact Rounded +addx232 add '123456789' 0.6 -> '123456790' Inexact Rounded +addx233 add '123456789' 0.9 -> '123456790' Inexact Rounded +addx234 add '123456789' 0.99999 -> '123456790' Inexact Rounded +addx235 add '123456789' 0.999999999 -> '123456790' Inexact Rounded +addx236 add '123456789' 1 -> '123456790' +addx237 add '123456789' 1.00000001 -> '123456790' Inexact Rounded +addx238 add '123456789' 1.00001 -> '123456790' Inexact Rounded +addx239 add '123456789' 1.1 -> '123456790' Inexact Rounded +-- critical few with even bottom digit... +addx240 add '123456788' 0.499999999 -> '123456788' Inexact Rounded +addx241 add '123456788' 0.5 -> '123456788' Inexact Rounded +addx242 add '123456788' 0.500000001 -> '123456789' Inexact Rounded + +rounding: down +addx250 add '123456789' 0 -> '123456789' +addx251 add '123456789' 0.000000001 -> '123456789' Inexact Rounded +addx252 add '123456789' 0.000001 -> '123456789' Inexact Rounded +addx253 add '123456789' 0.1 -> '123456789' Inexact Rounded +addx254 add '123456789' 0.4 -> '123456789' Inexact Rounded +addx255 add '123456789' 0.49 -> '123456789' Inexact Rounded +addx256 add '123456789' 0.499999 -> '123456789' Inexact Rounded +addx257 add '123456789' 0.499999999 -> '123456789' Inexact Rounded +addx258 add '123456789' 0.5 -> '123456789' Inexact Rounded +addx259 add '123456789' 0.500000001 -> '123456789' Inexact Rounded +addx260 add '123456789' 0.500001 -> '123456789' Inexact Rounded +addx261 add '123456789' 0.51 -> '123456789' Inexact Rounded +addx262 add '123456789' 0.6 -> '123456789' Inexact Rounded +addx263 add '123456789' 0.9 -> '123456789' Inexact Rounded +addx264 add '123456789' 0.99999 -> '123456789' Inexact Rounded +addx265 add '123456789' 0.999999999 -> '123456789' Inexact Rounded +addx266 add '123456789' 1 -> '123456790' +addx267 add '123456789' 1.00000001 -> '123456790' Inexact Rounded +addx268 add '123456789' 1.00001 -> '123456790' Inexact Rounded +addx269 add '123456789' 1.1 -> '123456790' Inexact Rounded + +-- input preparation tests (operands should not be rounded) +precision: 3 +rounding: half_up + +addx270 add '12345678900000' 9999999999999 -> '2.23E+13' Inexact Rounded +addx271 add '9999999999999' 12345678900000 -> '2.23E+13' Inexact Rounded + +addx272 add '12E+3' '3444' -> '1.54E+4' Inexact Rounded +addx273 add '12E+3' '3446' -> '1.54E+4' Inexact Rounded +addx274 add '12E+3' '3449.9' -> '1.54E+4' Inexact Rounded +addx275 add '12E+3' '3450.0' -> '1.55E+4' Inexact Rounded +addx276 add '12E+3' '3450.1' -> '1.55E+4' Inexact Rounded +addx277 add '12E+3' '3454' -> '1.55E+4' Inexact Rounded +addx278 add '12E+3' '3456' -> '1.55E+4' Inexact Rounded + +addx281 add '3444' '12E+3' -> '1.54E+4' Inexact Rounded +addx282 add '3446' '12E+3' -> '1.54E+4' Inexact Rounded +addx283 add '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded +addx284 add '3450.0' '12E+3' -> '1.55E+4' Inexact Rounded +addx285 add '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded +addx286 add '3454' '12E+3' -> '1.55E+4' Inexact Rounded +addx287 add '3456' '12E+3' -> '1.55E+4' Inexact Rounded + +rounding: half_down +addx291 add '3444' '12E+3' -> '1.54E+4' Inexact Rounded +addx292 add '3446' '12E+3' -> '1.54E+4' Inexact Rounded +addx293 add '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded +addx294 add '3450.0' '12E+3' -> '1.54E+4' Inexact Rounded +addx295 add '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded +addx296 add '3454' '12E+3' -> '1.55E+4' Inexact Rounded +addx297 add '3456' '12E+3' -> '1.55E+4' Inexact Rounded + +-- 1 in last place tests +rounding: half_up +addx301 add -1 1 -> 0 +addx302 add 0 1 -> 1 +addx303 add 1 1 -> 2 +addx304 add 12 1 -> 13 +addx305 add 98 1 -> 99 +addx306 add 99 1 -> 100 +addx307 add 100 1 -> 101 +addx308 add 101 1 -> 102 +addx309 add -1 -1 -> -2 +addx310 add 0 -1 -> -1 +addx311 add 1 -1 -> 0 +addx312 add 12 -1 -> 11 +addx313 add 98 -1 -> 97 +addx314 add 99 -1 -> 98 +addx315 add 100 -1 -> 99 +addx316 add 101 -1 -> 100 + +addx321 add -0.01 0.01 -> 0.00 +addx322 add 0.00 0.01 -> 0.01 +addx323 add 0.01 0.01 -> 0.02 +addx324 add 0.12 0.01 -> 0.13 +addx325 add 0.98 0.01 -> 0.99 +addx326 add 0.99 0.01 -> 1.00 +addx327 add 1.00 0.01 -> 1.01 +addx328 add 1.01 0.01 -> 1.02 +addx329 add -0.01 -0.01 -> -0.02 +addx330 add 0.00 -0.01 -> -0.01 +addx331 add 0.01 -0.01 -> 0.00 +addx332 add 0.12 -0.01 -> 0.11 +addx333 add 0.98 -0.01 -> 0.97 +addx334 add 0.99 -0.01 -> 0.98 +addx335 add 1.00 -0.01 -> 0.99 +addx336 add 1.01 -0.01 -> 1.00 + +-- some more cases where adding 0 affects the coefficient +precision: 9 +addx340 add 1E+3 0 -> 1000 +addx341 add 1E+8 0 -> 100000000 +addx342 add 1E+9 0 -> 1.00000000E+9 Rounded +addx343 add 1E+10 0 -> 1.00000000E+10 Rounded +-- which simply follow from these cases ... +addx344 add 1E+3 1 -> 1001 +addx345 add 1E+8 1 -> 100000001 +addx346 add 1E+9 1 -> 1.00000000E+9 Inexact Rounded +addx347 add 1E+10 1 -> 1.00000000E+10 Inexact Rounded +addx348 add 1E+3 7 -> 1007 +addx349 add 1E+8 7 -> 100000007 +addx350 add 1E+9 7 -> 1.00000001E+9 Inexact Rounded +addx351 add 1E+10 7 -> 1.00000000E+10 Inexact Rounded + +-- tryzeros cases +precision: 7 +rounding: half_up +maxExponent: 92 +minexponent: -92 +addx361 add 0E+50 10000E+1 -> 1.0000E+5 +addx362 add 10000E+1 0E-50 -> 100000.0 Rounded +addx363 add 10000E+1 10000E-50 -> 100000.0 Rounded Inexact + +-- a curiosity from JSR 13 testing +rounding: half_down +precision: 10 +addx370 add 99999999 81512 -> 100081511 +precision: 6 +addx371 add 99999999 81512 -> 1.00082E+8 Rounded Inexact +rounding: half_up +precision: 10 +addx372 add 99999999 81512 -> 100081511 +precision: 6 +addx373 add 99999999 81512 -> 1.00082E+8 Rounded Inexact +rounding: half_even +precision: 10 +addx374 add 99999999 81512 -> 100081511 +precision: 6 +addx375 add 99999999 81512 -> 1.00082E+8 Rounded Inexact + +-- ulp replacement tests +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +addx400 add 1 77e-7 -> 1.0000077 +addx401 add 1 77e-8 -> 1.00000077 +addx402 add 1 77e-9 -> 1.00000008 Inexact Rounded +addx403 add 1 77e-10 -> 1.00000001 Inexact Rounded +addx404 add 1 77e-11 -> 1.00000000 Inexact Rounded +addx405 add 1 77e-12 -> 1.00000000 Inexact Rounded +addx406 add 1 77e-999 -> 1.00000000 Inexact Rounded +addx407 add 1 77e-9999999 -> 1.00000000 Inexact Rounded + +addx410 add 10 77e-7 -> 10.0000077 +addx411 add 10 77e-8 -> 10.0000008 Inexact Rounded +addx412 add 10 77e-9 -> 10.0000001 Inexact Rounded +addx413 add 10 77e-10 -> 10.0000000 Inexact Rounded +addx414 add 10 77e-11 -> 10.0000000 Inexact Rounded +addx415 add 10 77e-12 -> 10.0000000 Inexact Rounded +addx416 add 10 77e-999 -> 10.0000000 Inexact Rounded +addx417 add 10 77e-9999999 -> 10.0000000 Inexact Rounded + +addx420 add 77e-7 1 -> 1.0000077 +addx421 add 77e-8 1 -> 1.00000077 +addx422 add 77e-9 1 -> 1.00000008 Inexact Rounded +addx423 add 77e-10 1 -> 1.00000001 Inexact Rounded +addx424 add 77e-11 1 -> 1.00000000 Inexact Rounded +addx425 add 77e-12 1 -> 1.00000000 Inexact Rounded +addx426 add 77e-999 1 -> 1.00000000 Inexact Rounded +addx427 add 77e-9999999 1 -> 1.00000000 Inexact Rounded + +addx430 add 77e-7 10 -> 10.0000077 +addx431 add 77e-8 10 -> 10.0000008 Inexact Rounded +addx432 add 77e-9 10 -> 10.0000001 Inexact Rounded +addx433 add 77e-10 10 -> 10.0000000 Inexact Rounded +addx434 add 77e-11 10 -> 10.0000000 Inexact Rounded +addx435 add 77e-12 10 -> 10.0000000 Inexact Rounded +addx436 add 77e-999 10 -> 10.0000000 Inexact Rounded +addx437 add 77e-9999999 10 -> 10.0000000 Inexact Rounded + +-- negative ulps +addx440 add 1 -77e-7 -> 0.9999923 +addx441 add 1 -77e-8 -> 0.99999923 +addx442 add 1 -77e-9 -> 0.999999923 +addx443 add 1 -77e-10 -> 0.999999992 Inexact Rounded +addx444 add 1 -77e-11 -> 0.999999999 Inexact Rounded +addx445 add 1 -77e-12 -> 1.00000000 Inexact Rounded +addx446 add 1 -77e-999 -> 1.00000000 Inexact Rounded +addx447 add 1 -77e-9999999 -> 1.00000000 Inexact Rounded + +addx450 add 10 -77e-7 -> 9.9999923 +addx451 add 10 -77e-8 -> 9.99999923 +addx452 add 10 -77e-9 -> 9.99999992 Inexact Rounded +addx453 add 10 -77e-10 -> 9.99999999 Inexact Rounded +addx454 add 10 -77e-11 -> 10.0000000 Inexact Rounded +addx455 add 10 -77e-12 -> 10.0000000 Inexact Rounded +addx456 add 10 -77e-999 -> 10.0000000 Inexact Rounded +addx457 add 10 -77e-9999999 -> 10.0000000 Inexact Rounded + +addx460 add -77e-7 1 -> 0.9999923 +addx461 add -77e-8 1 -> 0.99999923 +addx462 add -77e-9 1 -> 0.999999923 +addx463 add -77e-10 1 -> 0.999999992 Inexact Rounded +addx464 add -77e-11 1 -> 0.999999999 Inexact Rounded +addx465 add -77e-12 1 -> 1.00000000 Inexact Rounded +addx466 add -77e-999 1 -> 1.00000000 Inexact Rounded +addx467 add -77e-9999999 1 -> 1.00000000 Inexact Rounded + +addx470 add -77e-7 10 -> 9.9999923 +addx471 add -77e-8 10 -> 9.99999923 +addx472 add -77e-9 10 -> 9.99999992 Inexact Rounded +addx473 add -77e-10 10 -> 9.99999999 Inexact Rounded +addx474 add -77e-11 10 -> 10.0000000 Inexact Rounded +addx475 add -77e-12 10 -> 10.0000000 Inexact Rounded +addx476 add -77e-999 10 -> 10.0000000 Inexact Rounded +addx477 add -77e-9999999 10 -> 10.0000000 Inexact Rounded + +-- negative ulps +addx480 add -1 77e-7 -> -0.9999923 +addx481 add -1 77e-8 -> -0.99999923 +addx482 add -1 77e-9 -> -0.999999923 +addx483 add -1 77e-10 -> -0.999999992 Inexact Rounded +addx484 add -1 77e-11 -> -0.999999999 Inexact Rounded +addx485 add -1 77e-12 -> -1.00000000 Inexact Rounded +addx486 add -1 77e-999 -> -1.00000000 Inexact Rounded +addx487 add -1 77e-9999999 -> -1.00000000 Inexact Rounded + +addx490 add -10 77e-7 -> -9.9999923 +addx491 add -10 77e-8 -> -9.99999923 +addx492 add -10 77e-9 -> -9.99999992 Inexact Rounded +addx493 add -10 77e-10 -> -9.99999999 Inexact Rounded +addx494 add -10 77e-11 -> -10.0000000 Inexact Rounded +addx495 add -10 77e-12 -> -10.0000000 Inexact Rounded +addx496 add -10 77e-999 -> -10.0000000 Inexact Rounded +addx497 add -10 77e-9999999 -> -10.0000000 Inexact Rounded + +addx500 add 77e-7 -1 -> -0.9999923 +addx501 add 77e-8 -1 -> -0.99999923 +addx502 add 77e-9 -1 -> -0.999999923 +addx503 add 77e-10 -1 -> -0.999999992 Inexact Rounded +addx504 add 77e-11 -1 -> -0.999999999 Inexact Rounded +addx505 add 77e-12 -1 -> -1.00000000 Inexact Rounded +addx506 add 77e-999 -1 -> -1.00000000 Inexact Rounded +addx507 add 77e-9999999 -1 -> -1.00000000 Inexact Rounded + +addx510 add 77e-7 -10 -> -9.9999923 +addx511 add 77e-8 -10 -> -9.99999923 +addx512 add 77e-9 -10 -> -9.99999992 Inexact Rounded +addx513 add 77e-10 -10 -> -9.99999999 Inexact Rounded +addx514 add 77e-11 -10 -> -10.0000000 Inexact Rounded +addx515 add 77e-12 -10 -> -10.0000000 Inexact Rounded +addx516 add 77e-999 -10 -> -10.0000000 Inexact Rounded +addx517 add 77e-9999999 -10 -> -10.0000000 Inexact Rounded + + +-- long operands +maxexponent: 999 +minexponent: -999 +precision: 9 +addx521 add 12345678000 0 -> 1.23456780E+10 Rounded +addx522 add 0 12345678000 -> 1.23456780E+10 Rounded +addx523 add 1234567800 0 -> 1.23456780E+9 Rounded +addx524 add 0 1234567800 -> 1.23456780E+9 Rounded +addx525 add 1234567890 0 -> 1.23456789E+9 Rounded +addx526 add 0 1234567890 -> 1.23456789E+9 Rounded +addx527 add 1234567891 0 -> 1.23456789E+9 Inexact Rounded +addx528 add 0 1234567891 -> 1.23456789E+9 Inexact Rounded +addx529 add 12345678901 0 -> 1.23456789E+10 Inexact Rounded +addx530 add 0 12345678901 -> 1.23456789E+10 Inexact Rounded +addx531 add 1234567896 0 -> 1.23456790E+9 Inexact Rounded +addx532 add 0 1234567896 -> 1.23456790E+9 Inexact Rounded + +precision: 15 +-- still checking +addx541 add 12345678000 0 -> 12345678000 +addx542 add 0 12345678000 -> 12345678000 +addx543 add 1234567800 0 -> 1234567800 +addx544 add 0 1234567800 -> 1234567800 +addx545 add 1234567890 0 -> 1234567890 +addx546 add 0 1234567890 -> 1234567890 +addx547 add 1234567891 0 -> 1234567891 +addx548 add 0 1234567891 -> 1234567891 +addx549 add 12345678901 0 -> 12345678901 +addx550 add 0 12345678901 -> 12345678901 +addx551 add 1234567896 0 -> 1234567896 +addx552 add 0 1234567896 -> 1234567896 + +-- verify a query +precision: 16 +maxExponent: +394 +minExponent: -393 +rounding: down +addx561 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded +addx562 add 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded +-- and using decimal64 bounds... +precision: 16 +maxExponent: +384 +minExponent: -383 +rounding: down +addx563 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded +addx564 add 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded + + +-- some more residue effects with extreme rounding +precision: 9 +rounding: half_up +addx601 add 123456789 0.000001 -> 123456789 Inexact Rounded +rounding: half_even +addx602 add 123456789 0.000001 -> 123456789 Inexact Rounded +rounding: half_down +addx603 add 123456789 0.000001 -> 123456789 Inexact Rounded +rounding: floor +addx604 add 123456789 0.000001 -> 123456789 Inexact Rounded +rounding: ceiling +addx605 add 123456789 0.000001 -> 123456790 Inexact Rounded +rounding: up +addx606 add 123456789 0.000001 -> 123456790 Inexact Rounded +rounding: down +addx607 add 123456789 0.000001 -> 123456789 Inexact Rounded + +rounding: half_up +addx611 add 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: half_even +addx612 add 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: half_down +addx613 add 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: floor +addx614 add 123456789 -0.000001 -> 123456788 Inexact Rounded +rounding: ceiling +addx615 add 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: up +addx616 add 123456789 -0.000001 -> 123456789 Inexact Rounded +rounding: down +addx617 add 123456789 -0.000001 -> 123456788 Inexact Rounded + +rounding: half_up +addx621 add 123456789 0.499999 -> 123456789 Inexact Rounded +rounding: half_even +addx622 add 123456789 0.499999 -> 123456789 Inexact Rounded +rounding: half_down +addx623 add 123456789 0.499999 -> 123456789 Inexact Rounded +rounding: floor +addx624 add 123456789 0.499999 -> 123456789 Inexact Rounded +rounding: ceiling +addx625 add 123456789 0.499999 -> 123456790 Inexact Rounded +rounding: up +addx626 add 123456789 0.499999 -> 123456790 Inexact Rounded +rounding: down +addx627 add 123456789 0.499999 -> 123456789 Inexact Rounded + +rounding: half_up +addx631 add 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: half_even +addx632 add 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: half_down +addx633 add 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: floor +addx634 add 123456789 -0.499999 -> 123456788 Inexact Rounded +rounding: ceiling +addx635 add 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: up +addx636 add 123456789 -0.499999 -> 123456789 Inexact Rounded +rounding: down +addx637 add 123456789 -0.499999 -> 123456788 Inexact Rounded + +rounding: half_up +addx641 add 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: half_even +addx642 add 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: half_down +addx643 add 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: floor +addx644 add 123456789 0.500001 -> 123456789 Inexact Rounded +rounding: ceiling +addx645 add 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: up +addx646 add 123456789 0.500001 -> 123456790 Inexact Rounded +rounding: down +addx647 add 123456789 0.500001 -> 123456789 Inexact Rounded + +rounding: half_up +addx651 add 123456789 -0.500001 -> 123456788 Inexact Rounded +rounding: half_even +addx652 add 123456789 -0.500001 -> 123456788 Inexact Rounded +rounding: half_down +addx653 add 123456789 -0.500001 -> 123456788 Inexact Rounded +rounding: floor +addx654 add 123456789 -0.500001 -> 123456788 Inexact Rounded +rounding: ceiling +addx655 add 123456789 -0.500001 -> 123456789 Inexact Rounded +rounding: up +addx656 add 123456789 -0.500001 -> 123456789 Inexact Rounded +rounding: down +addx657 add 123456789 -0.500001 -> 123456788 Inexact Rounded + +-- long operand triangle +rounding: half_up +precision: 37 +addx660 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114834538 +precision: 36 +addx661 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483454 Inexact Rounded +precision: 35 +addx662 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148345 Inexact Rounded +precision: 34 +addx663 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114835 Inexact Rounded +precision: 33 +addx664 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483 Inexact Rounded +precision: 32 +addx665 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148 Inexact Rounded +precision: 31 +addx666 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337115 Inexact Rounded +precision: 30 +addx667 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711 Inexact Rounded +precision: 29 +addx668 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371 Inexact Rounded +precision: 28 +addx669 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337 Inexact Rounded +precision: 27 +addx670 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892234 Inexact Rounded +precision: 26 +addx671 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223 Inexact Rounded +precision: 25 +addx672 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922 Inexact Rounded +precision: 24 +addx673 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892 Inexact Rounded +precision: 23 +addx674 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389 Inexact Rounded +precision: 22 +addx675 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023639 Inexact Rounded +precision: 21 +addx676 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102364 Inexact Rounded +precision: 20 +addx677 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236 Inexact Rounded +precision: 19 +addx678 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211024 Inexact Rounded +precision: 18 +addx679 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102 Inexact Rounded +precision: 17 +addx680 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110 Inexact Rounded +precision: 16 +addx681 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211 Inexact Rounded +precision: 15 +addx682 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221 Inexact Rounded +precision: 14 +addx683 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422 Inexact Rounded +precision: 13 +addx684 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42 Inexact Rounded +precision: 12 +addx685 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4 Inexact Rounded +precision: 11 +addx686 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166 Inexact Rounded +precision: 10 +addx687 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117417E+10 Inexact Rounded +precision: 9 +addx688 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84711742E+10 Inexact Rounded +precision: 8 +addx689 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471174E+10 Inexact Rounded +precision: 7 +addx690 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117E+10 Inexact Rounded +precision: 6 +addx691 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84712E+10 Inexact Rounded +precision: 5 +addx692 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471E+10 Inexact Rounded +precision: 4 +addx693 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847E+10 Inexact Rounded +precision: 3 +addx694 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.85E+10 Inexact Rounded +precision: 2 +addx695 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8E+10 Inexact Rounded +precision: 1 +addx696 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 1E+11 Inexact Rounded + +-- more zeros, etc. +rounding: half_up +precision: 9 + +addx701 add 5.00 1.00E-3 -> 5.00100 +addx702 add 00.00 0.000 -> 0.000 +addx703 add 00.00 0E-3 -> 0.000 +addx704 add 0E-3 00.00 -> 0.000 + +addx710 add 0E+3 00.00 -> 0.00 +addx711 add 0E+3 00.0 -> 0.0 +addx712 add 0E+3 00. -> 0 +addx713 add 0E+3 00.E+1 -> 0E+1 +addx714 add 0E+3 00.E+2 -> 0E+2 +addx715 add 0E+3 00.E+3 -> 0E+3 +addx716 add 0E+3 00.E+4 -> 0E+3 +addx717 add 0E+3 00.E+5 -> 0E+3 +addx718 add 0E+3 -00.0 -> 0.0 +addx719 add 0E+3 -00. -> 0 +addx731 add 0E+3 -00.E+1 -> 0E+1 + +addx720 add 00.00 0E+3 -> 0.00 +addx721 add 00.0 0E+3 -> 0.0 +addx722 add 00. 0E+3 -> 0 +addx723 add 00.E+1 0E+3 -> 0E+1 +addx724 add 00.E+2 0E+3 -> 0E+2 +addx725 add 00.E+3 0E+3 -> 0E+3 +addx726 add 00.E+4 0E+3 -> 0E+3 +addx727 add 00.E+5 0E+3 -> 0E+3 +addx728 add -00.00 0E+3 -> 0.00 +addx729 add -00.0 0E+3 -> 0.0 +addx730 add -00. 0E+3 -> 0 + +addx732 add 0 0 -> 0 +addx733 add 0 -0 -> 0 +addx734 add -0 0 -> 0 +addx735 add -0 -0 -> -0 -- IEEE 854 special case + +addx736 add 1 -1 -> 0 +addx737 add -1 -1 -> -2 +addx738 add 1 1 -> 2 +addx739 add -1 1 -> 0 + +addx741 add 0 -1 -> -1 +addx742 add -0 -1 -> -1 +addx743 add 0 1 -> 1 +addx744 add -0 1 -> 1 +addx745 add -1 0 -> -1 +addx746 add -1 -0 -> -1 +addx747 add 1 0 -> 1 +addx748 add 1 -0 -> 1 + +addx751 add 0.0 -1 -> -1.0 +addx752 add -0.0 -1 -> -1.0 +addx753 add 0.0 1 -> 1.0 +addx754 add -0.0 1 -> 1.0 +addx755 add -1.0 0 -> -1.0 +addx756 add -1.0 -0 -> -1.0 +addx757 add 1.0 0 -> 1.0 +addx758 add 1.0 -0 -> 1.0 + +addx761 add 0 -1.0 -> -1.0 +addx762 add -0 -1.0 -> -1.0 +addx763 add 0 1.0 -> 1.0 +addx764 add -0 1.0 -> 1.0 +addx765 add -1 0.0 -> -1.0 +addx766 add -1 -0.0 -> -1.0 +addx767 add 1 0.0 -> 1.0 +addx768 add 1 -0.0 -> 1.0 + +addx771 add 0.0 -1.0 -> -1.0 +addx772 add -0.0 -1.0 -> -1.0 +addx773 add 0.0 1.0 -> 1.0 +addx774 add -0.0 1.0 -> 1.0 +addx775 add -1.0 0.0 -> -1.0 +addx776 add -1.0 -0.0 -> -1.0 +addx777 add 1.0 0.0 -> 1.0 +addx778 add 1.0 -0.0 -> 1.0 + +-- Specials +addx780 add -Inf -Inf -> -Infinity +addx781 add -Inf -1000 -> -Infinity +addx782 add -Inf -1 -> -Infinity +addx783 add -Inf -0 -> -Infinity +addx784 add -Inf 0 -> -Infinity +addx785 add -Inf 1 -> -Infinity +addx786 add -Inf 1000 -> -Infinity +addx787 add -1000 -Inf -> -Infinity +addx788 add -Inf -Inf -> -Infinity +addx789 add -1 -Inf -> -Infinity +addx790 add -0 -Inf -> -Infinity +addx791 add 0 -Inf -> -Infinity +addx792 add 1 -Inf -> -Infinity +addx793 add 1000 -Inf -> -Infinity +addx794 add Inf -Inf -> NaN Invalid_operation + +addx800 add Inf -Inf -> NaN Invalid_operation +addx801 add Inf -1000 -> Infinity +addx802 add Inf -1 -> Infinity +addx803 add Inf -0 -> Infinity +addx804 add Inf 0 -> Infinity +addx805 add Inf 1 -> Infinity +addx806 add Inf 1000 -> Infinity +addx807 add Inf Inf -> Infinity +addx808 add -1000 Inf -> Infinity +addx809 add -Inf Inf -> NaN Invalid_operation +addx810 add -1 Inf -> Infinity +addx811 add -0 Inf -> Infinity +addx812 add 0 Inf -> Infinity +addx813 add 1 Inf -> Infinity +addx814 add 1000 Inf -> Infinity +addx815 add Inf Inf -> Infinity + +addx821 add NaN -Inf -> NaN +addx822 add NaN -1000 -> NaN +addx823 add NaN -1 -> NaN +addx824 add NaN -0 -> NaN +addx825 add NaN 0 -> NaN +addx826 add NaN 1 -> NaN +addx827 add NaN 1000 -> NaN +addx828 add NaN Inf -> NaN +addx829 add NaN NaN -> NaN +addx830 add -Inf NaN -> NaN +addx831 add -1000 NaN -> NaN +addx832 add -1 NaN -> NaN +addx833 add -0 NaN -> NaN +addx834 add 0 NaN -> NaN +addx835 add 1 NaN -> NaN +addx836 add 1000 NaN -> NaN +addx837 add Inf NaN -> NaN + +addx841 add sNaN -Inf -> NaN Invalid_operation +addx842 add sNaN -1000 -> NaN Invalid_operation +addx843 add sNaN -1 -> NaN Invalid_operation +addx844 add sNaN -0 -> NaN Invalid_operation +addx845 add sNaN 0 -> NaN Invalid_operation +addx846 add sNaN 1 -> NaN Invalid_operation +addx847 add sNaN 1000 -> NaN Invalid_operation +addx848 add sNaN NaN -> NaN Invalid_operation +addx849 add sNaN sNaN -> NaN Invalid_operation +addx850 add NaN sNaN -> NaN Invalid_operation +addx851 add -Inf sNaN -> NaN Invalid_operation +addx852 add -1000 sNaN -> NaN Invalid_operation +addx853 add -1 sNaN -> NaN Invalid_operation +addx854 add -0 sNaN -> NaN Invalid_operation +addx855 add 0 sNaN -> NaN Invalid_operation +addx856 add 1 sNaN -> NaN Invalid_operation +addx857 add 1000 sNaN -> NaN Invalid_operation +addx858 add Inf sNaN -> NaN Invalid_operation +addx859 add NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +addx861 add NaN1 -Inf -> NaN1 +addx862 add +NaN2 -1000 -> NaN2 +addx863 add NaN3 1000 -> NaN3 +addx864 add NaN4 Inf -> NaN4 +addx865 add NaN5 +NaN6 -> NaN5 +addx866 add -Inf NaN7 -> NaN7 +addx867 add -1000 NaN8 -> NaN8 +addx868 add 1000 NaN9 -> NaN9 +addx869 add Inf +NaN10 -> NaN10 +addx871 add sNaN11 -Inf -> NaN11 Invalid_operation +addx872 add sNaN12 -1000 -> NaN12 Invalid_operation +addx873 add sNaN13 1000 -> NaN13 Invalid_operation +addx874 add sNaN14 NaN17 -> NaN14 Invalid_operation +addx875 add sNaN15 sNaN18 -> NaN15 Invalid_operation +addx876 add NaN16 sNaN19 -> NaN19 Invalid_operation +addx877 add -Inf +sNaN20 -> NaN20 Invalid_operation +addx878 add -1000 sNaN21 -> NaN21 Invalid_operation +addx879 add 1000 sNaN22 -> NaN22 Invalid_operation +addx880 add Inf sNaN23 -> NaN23 Invalid_operation +addx881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation +addx882 add -NaN26 NaN28 -> -NaN26 +addx883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation +addx884 add 1000 -NaN30 -> -NaN30 +addx885 add 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- overflow, underflow and subnormal tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 9 +addx890 add 1E+999999999 9E+999999999 -> Infinity Overflow Inexact Rounded +addx891 add 9E+999999999 1E+999999999 -> Infinity Overflow Inexact Rounded +addx892 add -1.1E-999999999 1E-999999999 -> -1E-1000000000 Subnormal +addx893 add 1E-999999999 -1.1e-999999999 -> -1E-1000000000 Subnormal +addx894 add -1.0001E-999999999 1E-999999999 -> -1E-1000000003 Subnormal +addx895 add 1E-999999999 -1.0001e-999999999 -> -1E-1000000003 Subnormal +addx896 add -1E+999999999 -9E+999999999 -> -Infinity Overflow Inexact Rounded +addx897 add -9E+999999999 -1E+999999999 -> -Infinity Overflow Inexact Rounded +addx898 add +1.1E-999999999 -1E-999999999 -> 1E-1000000000 Subnormal +addx899 add -1E-999999999 +1.1e-999999999 -> 1E-1000000000 Subnormal +addx900 add +1.0001E-999999999 -1E-999999999 -> 1E-1000000003 Subnormal +addx901 add -1E-999999999 +1.0001e-999999999 -> 1E-1000000003 Subnormal +addx902 add -1E+999999999 +9E+999999999 -> 8E+999999999 +addx903 add -9E+999999999 +1E+999999999 -> -8E+999999999 + +precision: 3 +addx904 add 0 -9.999E+999999999 -> -Infinity Inexact Overflow Rounded +addx905 add -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded +addx906 add 0 9.999E+999999999 -> Infinity Inexact Overflow Rounded +addx907 add 9.999E+999999999 0 -> Infinity Inexact Overflow Rounded + +precision: 3 +maxexponent: 999 +minexponent: -999 +addx910 add 1.00E-999 0 -> 1.00E-999 +addx911 add 0.1E-999 0 -> 1E-1000 Subnormal +addx912 add 0.10E-999 0 -> 1.0E-1000 Subnormal +addx913 add 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded +addx914 add 0.01E-999 0 -> 1E-1001 Subnormal +-- next is rounded to Nmin +addx915 add 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow +addx916 add 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +addx917 add 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow +addx918 add 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +addx919 add 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +addx920 add 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +addx930 add -1.00E-999 0 -> -1.00E-999 +addx931 add -0.1E-999 0 -> -1E-1000 Subnormal +addx932 add -0.10E-999 0 -> -1.0E-1000 Subnormal +addx933 add -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded +addx934 add -0.01E-999 0 -> -1E-1001 Subnormal +-- next is rounded to Nmin +addx935 add -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow +addx936 add -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +addx937 add -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow +addx938 add -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +addx939 add -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +addx940 add -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped + +-- some non-zero subnormal adds +addx950 add 1.00E-999 0.1E-999 -> 1.10E-999 +addx951 add 0.1E-999 0.1E-999 -> 2E-1000 Subnormal +addx952 add 0.10E-999 0.1E-999 -> 2.0E-1000 Subnormal +addx953 add 0.100E-999 0.1E-999 -> 2.0E-1000 Subnormal Rounded +addx954 add 0.01E-999 0.1E-999 -> 1.1E-1000 Subnormal +addx955 add 0.999E-999 0.1E-999 -> 1.10E-999 Inexact Rounded +addx956 add 0.099E-999 0.1E-999 -> 2.0E-1000 Inexact Rounded Subnormal Underflow +addx957 add 0.009E-999 0.1E-999 -> 1.1E-1000 Inexact Rounded Subnormal Underflow +addx958 add 0.001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +addx959 add 0.0009E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +addx960 add 0.0001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +-- negatives... +addx961 add 1.00E-999 -0.1E-999 -> 9.0E-1000 Subnormal +addx962 add 0.1E-999 -0.1E-999 -> 0E-1000 +addx963 add 0.10E-999 -0.1E-999 -> 0E-1001 +addx964 add 0.100E-999 -0.1E-999 -> 0E-1001 Clamped +addx965 add 0.01E-999 -0.1E-999 -> -9E-1001 Subnormal +addx966 add 0.999E-999 -0.1E-999 -> 9.0E-1000 Inexact Rounded Subnormal Underflow +addx967 add 0.099E-999 -0.1E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +addx968 add 0.009E-999 -0.1E-999 -> -9E-1001 Inexact Rounded Subnormal Underflow +addx969 add 0.001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +addx970 add 0.0009E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +addx971 add 0.0001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow + +-- some 'real' numbers +maxExponent: 384 +minExponent: -383 +precision: 8 +addx566 add 99999061735E-394 0E-394 -> 9.999906E-384 Inexact Rounded Underflow Subnormal +precision: 7 +addx567 add 99999061735E-394 0E-394 -> 9.99991E-384 Inexact Rounded Underflow Subnormal +precision: 6 +addx568 add 99999061735E-394 0E-394 -> 9.9999E-384 Inexact Rounded Underflow Subnormal + +-- now the case where we can get underflow but the result is normal +-- [note this can't happen if the operands are also bounded, as we +-- cannot represent 1E-399, for example] +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +addx571 add 1E-383 0 -> 1E-383 +addx572 add 1E-384 0 -> 1E-384 Subnormal +addx573 add 1E-383 1E-384 -> 1.1E-383 +addx574 subtract 1E-383 1E-384 -> 9E-384 Subnormal + +-- Here we explore the boundary of rounding a subnormal to Nmin +addx575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal +addx576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal +addx577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +addx578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +--addx579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +--addx580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded + +-- check overflow edge case +precision: 7 +rounding: half_up +maxExponent: 96 +minExponent: -95 +addx972 apply 9.999999E+96 -> 9.999999E+96 +addx973 add 9.999999E+96 1 -> 9.999999E+96 Inexact Rounded +addx974 add 9999999E+90 1 -> 9.999999E+96 Inexact Rounded +addx975 add 9999999E+90 1E+90 -> Infinity Overflow Inexact Rounded +addx976 add 9999999E+90 9E+89 -> Infinity Overflow Inexact Rounded +addx977 add 9999999E+90 8E+89 -> Infinity Overflow Inexact Rounded +addx978 add 9999999E+90 7E+89 -> Infinity Overflow Inexact Rounded +addx979 add 9999999E+90 6E+89 -> Infinity Overflow Inexact Rounded +addx980 add 9999999E+90 5E+89 -> Infinity Overflow Inexact Rounded +addx981 add 9999999E+90 4E+89 -> 9.999999E+96 Inexact Rounded +addx982 add 9999999E+90 3E+89 -> 9.999999E+96 Inexact Rounded +addx983 add 9999999E+90 2E+89 -> 9.999999E+96 Inexact Rounded +addx984 add 9999999E+90 1E+89 -> 9.999999E+96 Inexact Rounded + +addx985 apply -9.999999E+96 -> -9.999999E+96 +addx986 add -9.999999E+96 -1 -> -9.999999E+96 Inexact Rounded +addx987 add -9999999E+90 -1 -> -9.999999E+96 Inexact Rounded +addx988 add -9999999E+90 -1E+90 -> -Infinity Overflow Inexact Rounded +addx989 add -9999999E+90 -9E+89 -> -Infinity Overflow Inexact Rounded +addx990 add -9999999E+90 -8E+89 -> -Infinity Overflow Inexact Rounded +addx991 add -9999999E+90 -7E+89 -> -Infinity Overflow Inexact Rounded +addx992 add -9999999E+90 -6E+89 -> -Infinity Overflow Inexact Rounded +addx993 add -9999999E+90 -5E+89 -> -Infinity Overflow Inexact Rounded +addx994 add -9999999E+90 -4E+89 -> -9.999999E+96 Inexact Rounded +addx995 add -9999999E+90 -3E+89 -> -9.999999E+96 Inexact Rounded +addx996 add -9999999E+90 -2E+89 -> -9.999999E+96 Inexact Rounded +addx997 add -9999999E+90 -1E+89 -> -9.999999E+96 Inexact Rounded + +-- check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +-- Add: lhs and rhs 0 +addx1001 add 1.52444E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1002 add 1.52445E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1003 add 1.52446E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1004 add 0 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1005 add 0 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1006 add 0 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +-- Add: lhs >> rhs and vice versa +addx1011 add 1.52444E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1012 add 1.52445E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1013 add 1.52446E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1014 add 1E-100 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1015 add 1E-100 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +addx1016 add 1E-100 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +-- Add: lhs + rhs addition carried out +addx1021 add 1.52443E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +addx1022 add 1.52444E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +addx1023 add 1.52445E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +addx1024 add 1.00001E-80 1.52443E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +addx1025 add 1.00001E-80 1.52444E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow +addx1026 add 1.00001E-80 1.52445E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow + +-- And for round down full and subnormal results +precision: 16 +maxExponent: +384 +minExponent: -383 +rounding: down + +addx1100 add 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact +addx1101 add 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact +addx1103 add +1 -1e-383 -> 0.9999999999999999 Rounded Inexact +addx1104 add 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact +addx1105 add 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact +addx1106 add 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact +addx1107 add 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact +addx1108 add 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact +addx1109 add 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact + +rounding: ceiling +addx1110 add -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact +addx1111 add -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact +addx1113 add -1 +1e-383 -> -0.9999999999999999 Rounded Inexact +addx1114 add -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact +addx1115 add -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact +addx1116 add -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact +addx1117 add -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact +addx1118 add -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact +addx1119 add -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact + +rounding: down +precision: 7 +maxExponent: +96 +minExponent: -95 +addx1130 add 1 -1e-200 -> 0.9999999 Rounded Inexact +-- subnormal boundary +addx1131 add 1.000000E-94 -1e-200 -> 9.999999E-95 Rounded Inexact +addx1132 add 1.000001E-95 -1e-200 -> 1.000000E-95 Rounded Inexact +addx1133 add 1.000000E-95 -1e-200 -> 9.99999E-96 Rounded Inexact Subnormal Underflow +addx1134 add 0.999999E-95 -1e-200 -> 9.99998E-96 Rounded Inexact Subnormal Underflow +addx1135 add 0.001000E-95 -1e-200 -> 9.99E-99 Rounded Inexact Subnormal Underflow +addx1136 add 0.000999E-95 -1e-200 -> 9.98E-99 Rounded Inexact Subnormal Underflow +addx1137 add 1.000000E-95 -1e-101 -> 9.99999E-96 Subnormal +addx1138 add 10000E-101 -1e-200 -> 9.999E-98 Subnormal Inexact Rounded Underflow +addx1139 add 1000E-101 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow +addx1140 add 100E-101 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow +addx1141 add 10E-101 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow +addx1142 add 1E-101 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped +addx1143 add 0E-101 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped +addx1144 add 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped + +addx1151 add 10000E-102 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow +addx1152 add 1000E-102 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow +addx1153 add 100E-102 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow +addx1154 add 10E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped +addx1155 add 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped +addx1156 add 0E-102 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped +addx1157 add 1E-103 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped + +addx1160 add 100E-105 -1e-101 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped +addx1161 add 100E-105 -1e-201 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped + +-- tests based on Gunnar Degnbol's edge case +precision: 15 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +addx1200 add 1E15 -0.5 -> 1.00000000000000E+15 Inexact Rounded +addx1201 add 1E15 -0.50 -> 1.00000000000000E+15 Inexact Rounded +addx1210 add 1E15 -0.51 -> 999999999999999 Inexact Rounded +addx1211 add 1E15 -0.501 -> 999999999999999 Inexact Rounded +addx1212 add 1E15 -0.5001 -> 999999999999999 Inexact Rounded +addx1213 add 1E15 -0.50001 -> 999999999999999 Inexact Rounded +addx1214 add 1E15 -0.500001 -> 999999999999999 Inexact Rounded +addx1215 add 1E15 -0.5000001 -> 999999999999999 Inexact Rounded +addx1216 add 1E15 -0.50000001 -> 999999999999999 Inexact Rounded +addx1217 add 1E15 -0.500000001 -> 999999999999999 Inexact Rounded +addx1218 add 1E15 -0.5000000001 -> 999999999999999 Inexact Rounded +addx1219 add 1E15 -0.50000000001 -> 999999999999999 Inexact Rounded +addx1220 add 1E15 -0.500000000001 -> 999999999999999 Inexact Rounded +addx1221 add 1E15 -0.5000000000001 -> 999999999999999 Inexact Rounded +addx1222 add 1E15 -0.50000000000001 -> 999999999999999 Inexact Rounded +addx1223 add 1E15 -0.500000000000001 -> 999999999999999 Inexact Rounded +addx1224 add 1E15 -0.5000000000000001 -> 999999999999999 Inexact Rounded +addx1225 add 1E15 -0.5000000000000000 -> 1.00000000000000E+15 Inexact Rounded +addx1230 add 1E15 -5000000.000000001 -> 999999995000000 Inexact Rounded + +precision: 16 + +addx1300 add 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded +addx1310 add 1E16 -0.51 -> 9999999999999999 Inexact Rounded +addx1311 add 1E16 -0.501 -> 9999999999999999 Inexact Rounded +addx1312 add 1E16 -0.5001 -> 9999999999999999 Inexact Rounded +addx1313 add 1E16 -0.50001 -> 9999999999999999 Inexact Rounded +addx1314 add 1E16 -0.500001 -> 9999999999999999 Inexact Rounded +addx1315 add 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded +addx1316 add 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded +addx1317 add 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded +addx1318 add 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded +addx1319 add 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded +addx1320 add 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded +addx1321 add 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded +addx1322 add 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded +addx1323 add 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded +addx1324 add 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded +addx1325 add 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1326 add 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1327 add 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1328 add 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1329 add 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1330 add 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1331 add 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1332 add 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded +addx1333 add 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded +addx1334 add 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded +addx1335 add 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded +addx1336 add 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded +addx1337 add 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded +addx1338 add 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded +addx1339 add 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded + +addx1340 add 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded +addx1341 add 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded + +addx1349 add 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded +addx1350 add 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded +addx1351 add 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded +addx1352 add 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded +addx1353 add 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded +addx1354 add 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded +addx1355 add 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded +addx1356 add 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded +addx1357 add 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded +addx1358 add 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded +addx1359 add 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded +addx1360 add 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded +addx1361 add 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded +addx1362 add 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded +addx1363 add 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded +addx1364 add 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded +addx1365 add 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1367 add 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1368 add 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1369 add 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1370 add 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1371 add 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1372 add 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +addx1373 add 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded +addx1374 add 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded +addx1375 add 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded +addx1376 add 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded +addx1377 add 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded +addx1378 add 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded +addx1379 add 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded +addx1380 add 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded +addx1381 add 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded +addx1382 add 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1383 add 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1384 add 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1385 add 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1386 add 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1387 add 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1388 add 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded +addx1389 add 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded +addx1390 add 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded +addx1391 add 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded +addx1392 add 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded +addx1393 add 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded +addx1394 add 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded +addx1395 add 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded +addx1396 add 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded + +-- More GD edge cases, where difference between the unadjusted +-- exponents is larger than the maximum precision and one side is 0 +precision: 15 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +addx1400 add 0 1.23456789012345 -> 1.23456789012345 +addx1401 add 0 1.23456789012345E-1 -> 0.123456789012345 +addx1402 add 0 1.23456789012345E-2 -> 0.0123456789012345 +addx1403 add 0 1.23456789012345E-3 -> 0.00123456789012345 +addx1404 add 0 1.23456789012345E-4 -> 0.000123456789012345 +addx1405 add 0 1.23456789012345E-5 -> 0.0000123456789012345 +addx1406 add 0 1.23456789012345E-6 -> 0.00000123456789012345 +addx1407 add 0 1.23456789012345E-7 -> 1.23456789012345E-7 +addx1408 add 0 1.23456789012345E-8 -> 1.23456789012345E-8 +addx1409 add 0 1.23456789012345E-9 -> 1.23456789012345E-9 +addx1410 add 0 1.23456789012345E-10 -> 1.23456789012345E-10 +addx1411 add 0 1.23456789012345E-11 -> 1.23456789012345E-11 +addx1412 add 0 1.23456789012345E-12 -> 1.23456789012345E-12 +addx1413 add 0 1.23456789012345E-13 -> 1.23456789012345E-13 +addx1414 add 0 1.23456789012345E-14 -> 1.23456789012345E-14 +addx1415 add 0 1.23456789012345E-15 -> 1.23456789012345E-15 +addx1416 add 0 1.23456789012345E-16 -> 1.23456789012345E-16 +addx1417 add 0 1.23456789012345E-17 -> 1.23456789012345E-17 +addx1418 add 0 1.23456789012345E-18 -> 1.23456789012345E-18 +addx1419 add 0 1.23456789012345E-19 -> 1.23456789012345E-19 + +-- same, precision 16.. +precision: 16 +addx1420 add 0 1.123456789012345 -> 1.123456789012345 +addx1421 add 0 1.123456789012345E-1 -> 0.1123456789012345 +addx1422 add 0 1.123456789012345E-2 -> 0.01123456789012345 +addx1423 add 0 1.123456789012345E-3 -> 0.001123456789012345 +addx1424 add 0 1.123456789012345E-4 -> 0.0001123456789012345 +addx1425 add 0 1.123456789012345E-5 -> 0.00001123456789012345 +addx1426 add 0 1.123456789012345E-6 -> 0.000001123456789012345 +addx1427 add 0 1.123456789012345E-7 -> 1.123456789012345E-7 +addx1428 add 0 1.123456789012345E-8 -> 1.123456789012345E-8 +addx1429 add 0 1.123456789012345E-9 -> 1.123456789012345E-9 +addx1430 add 0 1.123456789012345E-10 -> 1.123456789012345E-10 +addx1431 add 0 1.123456789012345E-11 -> 1.123456789012345E-11 +addx1432 add 0 1.123456789012345E-12 -> 1.123456789012345E-12 +addx1433 add 0 1.123456789012345E-13 -> 1.123456789012345E-13 +addx1434 add 0 1.123456789012345E-14 -> 1.123456789012345E-14 +addx1435 add 0 1.123456789012345E-15 -> 1.123456789012345E-15 +addx1436 add 0 1.123456789012345E-16 -> 1.123456789012345E-16 +addx1437 add 0 1.123456789012345E-17 -> 1.123456789012345E-17 +addx1438 add 0 1.123456789012345E-18 -> 1.123456789012345E-18 +addx1439 add 0 1.123456789012345E-19 -> 1.123456789012345E-19 + +-- same, reversed 0 +addx1440 add 1.123456789012345 0 -> 1.123456789012345 +addx1441 add 1.123456789012345E-1 0 -> 0.1123456789012345 +addx1442 add 1.123456789012345E-2 0 -> 0.01123456789012345 +addx1443 add 1.123456789012345E-3 0 -> 0.001123456789012345 +addx1444 add 1.123456789012345E-4 0 -> 0.0001123456789012345 +addx1445 add 1.123456789012345E-5 0 -> 0.00001123456789012345 +addx1446 add 1.123456789012345E-6 0 -> 0.000001123456789012345 +addx1447 add 1.123456789012345E-7 0 -> 1.123456789012345E-7 +addx1448 add 1.123456789012345E-8 0 -> 1.123456789012345E-8 +addx1449 add 1.123456789012345E-9 0 -> 1.123456789012345E-9 +addx1450 add 1.123456789012345E-10 0 -> 1.123456789012345E-10 +addx1451 add 1.123456789012345E-11 0 -> 1.123456789012345E-11 +addx1452 add 1.123456789012345E-12 0 -> 1.123456789012345E-12 +addx1453 add 1.123456789012345E-13 0 -> 1.123456789012345E-13 +addx1454 add 1.123456789012345E-14 0 -> 1.123456789012345E-14 +addx1455 add 1.123456789012345E-15 0 -> 1.123456789012345E-15 +addx1456 add 1.123456789012345E-16 0 -> 1.123456789012345E-16 +addx1457 add 1.123456789012345E-17 0 -> 1.123456789012345E-17 +addx1458 add 1.123456789012345E-18 0 -> 1.123456789012345E-18 +addx1459 add 1.123456789012345E-19 0 -> 1.123456789012345E-19 + +-- same, Es on the 0 +addx1460 add 1.123456789012345 0E-0 -> 1.123456789012345 +addx1461 add 1.123456789012345 0E-1 -> 1.123456789012345 +addx1462 add 1.123456789012345 0E-2 -> 1.123456789012345 +addx1463 add 1.123456789012345 0E-3 -> 1.123456789012345 +addx1464 add 1.123456789012345 0E-4 -> 1.123456789012345 +addx1465 add 1.123456789012345 0E-5 -> 1.123456789012345 +addx1466 add 1.123456789012345 0E-6 -> 1.123456789012345 +addx1467 add 1.123456789012345 0E-7 -> 1.123456789012345 +addx1468 add 1.123456789012345 0E-8 -> 1.123456789012345 +addx1469 add 1.123456789012345 0E-9 -> 1.123456789012345 +addx1470 add 1.123456789012345 0E-10 -> 1.123456789012345 +addx1471 add 1.123456789012345 0E-11 -> 1.123456789012345 +addx1472 add 1.123456789012345 0E-12 -> 1.123456789012345 +addx1473 add 1.123456789012345 0E-13 -> 1.123456789012345 +addx1474 add 1.123456789012345 0E-14 -> 1.123456789012345 +addx1475 add 1.123456789012345 0E-15 -> 1.123456789012345 +-- next four flag Rounded becuase the 0 extends the result +addx1476 add 1.123456789012345 0E-16 -> 1.123456789012345 Rounded +addx1477 add 1.123456789012345 0E-17 -> 1.123456789012345 Rounded +addx1478 add 1.123456789012345 0E-18 -> 1.123456789012345 Rounded +addx1479 add 1.123456789012345 0E-19 -> 1.123456789012345 Rounded + +-- sum of two opposite-sign operands is exactly 0 and floor => -0 +precision: 16 +maxExponent: 384 +minexponent: -383 + +rounding: half_up +-- exact zeros from zeros +addx1500 add 0 0E-19 -> 0E-19 +addx1501 add -0 0E-19 -> 0E-19 +addx1502 add 0 -0E-19 -> 0E-19 +addx1503 add -0 -0E-19 -> -0E-19 +addx1504 add 0E-400 0E-19 -> 0E-398 Clamped +addx1505 add -0E-400 0E-19 -> 0E-398 Clamped +addx1506 add 0E-400 -0E-19 -> 0E-398 Clamped +addx1507 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1511 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1512 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1513 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1514 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx1515 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1516 add -1E-401 1E-401 -> 0E-398 Clamped +addx1517 add 1E-401 -1E-401 -> 0E-398 Clamped +addx1518 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: half_down +-- exact zeros from zeros +addx1520 add 0 0E-19 -> 0E-19 +addx1521 add -0 0E-19 -> 0E-19 +addx1522 add 0 -0E-19 -> 0E-19 +addx1523 add -0 -0E-19 -> -0E-19 +addx1524 add 0E-400 0E-19 -> 0E-398 Clamped +addx1525 add -0E-400 0E-19 -> 0E-398 Clamped +addx1526 add 0E-400 -0E-19 -> 0E-398 Clamped +addx1527 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1531 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1532 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1533 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1534 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx1535 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1536 add -1E-401 1E-401 -> 0E-398 Clamped +addx1537 add 1E-401 -1E-401 -> 0E-398 Clamped +addx1538 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: half_even +-- exact zeros from zeros +addx1540 add 0 0E-19 -> 0E-19 +addx1541 add -0 0E-19 -> 0E-19 +addx1542 add 0 -0E-19 -> 0E-19 +addx1543 add -0 -0E-19 -> -0E-19 +addx1544 add 0E-400 0E-19 -> 0E-398 Clamped +addx1545 add -0E-400 0E-19 -> 0E-398 Clamped +addx1546 add 0E-400 -0E-19 -> 0E-398 Clamped +addx1547 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1551 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1552 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1553 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1554 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx1555 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1556 add -1E-401 1E-401 -> 0E-398 Clamped +addx1557 add 1E-401 -1E-401 -> 0E-398 Clamped +addx1558 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: up +-- exact zeros from zeros +addx1560 add 0 0E-19 -> 0E-19 +addx1561 add -0 0E-19 -> 0E-19 +addx1562 add 0 -0E-19 -> 0E-19 +addx1563 add -0 -0E-19 -> -0E-19 +addx1564 add 0E-400 0E-19 -> 0E-398 Clamped +addx1565 add -0E-400 0E-19 -> 0E-398 Clamped +addx1566 add 0E-400 -0E-19 -> 0E-398 Clamped +addx1567 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1571 add 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx1572 add -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx1573 add 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +addx1574 add -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +-- some exact zeros from non-zeros +addx1575 add 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow +addx1576 add -1E-401 1E-401 -> 0E-398 Clamped +addx1577 add 1E-401 -1E-401 -> 0E-398 Clamped +addx1578 add -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow + +rounding: down +-- exact zeros from zeros +addx1580 add 0 0E-19 -> 0E-19 +addx1581 add -0 0E-19 -> 0E-19 +addx1582 add 0 -0E-19 -> 0E-19 +addx1583 add -0 -0E-19 -> -0E-19 +addx1584 add 0E-400 0E-19 -> 0E-398 Clamped +addx1585 add -0E-400 0E-19 -> 0E-398 Clamped +addx1586 add 0E-400 -0E-19 -> 0E-398 Clamped +addx1587 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1591 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1592 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1593 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1594 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx1595 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1596 add -1E-401 1E-401 -> 0E-398 Clamped +addx1597 add 1E-401 -1E-401 -> 0E-398 Clamped +addx1598 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: ceiling +-- exact zeros from zeros +addx1600 add 0 0E-19 -> 0E-19 +addx1601 add -0 0E-19 -> 0E-19 +addx1602 add 0 -0E-19 -> 0E-19 +addx1603 add -0 -0E-19 -> -0E-19 +addx1604 add 0E-400 0E-19 -> 0E-398 Clamped +addx1605 add -0E-400 0E-19 -> 0E-398 Clamped +addx1606 add 0E-400 -0E-19 -> 0E-398 Clamped +addx1607 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1611 add 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx1612 add -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx1613 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1614 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx1615 add 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow +addx1616 add -1E-401 1E-401 -> 0E-398 Clamped +addx1617 add 1E-401 -1E-401 -> 0E-398 Clamped +addx1618 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +-- and the extra-special ugly case; unusual minuses marked by -- * +rounding: floor +-- exact zeros from zeros +addx1620 add 0 0E-19 -> 0E-19 +addx1621 add -0 0E-19 -> -0E-19 -- * +addx1622 add 0 -0E-19 -> -0E-19 -- * +addx1623 add -0 -0E-19 -> -0E-19 +addx1624 add 0E-400 0E-19 -> 0E-398 Clamped +addx1625 add -0E-400 0E-19 -> -0E-398 Clamped -- * +addx1626 add 0E-400 -0E-19 -> -0E-398 Clamped -- * +addx1627 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx1631 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1632 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1633 add 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +addx1634 add -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +-- some exact zeros from non-zeros +addx1635 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx1636 add -1E-401 1E-401 -> -0E-398 Clamped -- * +addx1637 add 1E-401 -1E-401 -> -0E-398 Clamped -- * +addx1638 add -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow + +-- BigDecimal problem testcases 2006.01.23 +precision: 16 +maxExponent: 384 +minexponent: -383 + +rounding: down +precision: 7 +addx1651 add 10001E+2 -2E+1 -> 1.00008E+6 +precision: 6 +addx1652 add 10001E+2 -2E+1 -> 1.00008E+6 +precision: 5 +addx1653 add 10001E+2 -2E+1 -> 1.0000E+6 Inexact Rounded +precision: 4 +addx1654 add 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded +precision: 3 +addx1655 add 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded +precision: 2 +addx1656 add 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded +precision: 1 +addx1657 add 10001E+2 -2E+1 -> 1E+6 Inexact Rounded + +rounding: half_even +precision: 7 +addx1661 add 10001E+2 -2E+1 -> 1.00008E+6 +precision: 6 +addx1662 add 10001E+2 -2E+1 -> 1.00008E+6 +precision: 5 +addx1663 add 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded +precision: 4 +addx1664 add 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded +precision: 3 +addx1665 add 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded +precision: 2 +addx1666 add 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded +precision: 1 +addx1667 add 10001E+2 -2E+1 -> 1E+6 Inexact Rounded + +rounding: up +precision: 7 +addx1671 add 10001E+2 -2E+1 -> 1.00008E+6 +precision: 6 +addx1672 add 10001E+2 -2E+1 -> 1.00008E+6 +precision: 5 +addx1673 add 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded +precision: 4 +addx1674 add 10001E+2 -2E+1 -> 1.001E+6 Inexact Rounded +precision: 3 +addx1675 add 10001E+2 -2E+1 -> 1.01E+6 Inexact Rounded +precision: 2 +addx1676 add 10001E+2 -2E+1 -> 1.1E+6 Inexact Rounded +precision: 1 +addx1677 add 10001E+2 -2E+1 -> 2E+6 Inexact Rounded + +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +-- Examples from SQL proposal (Krishna Kulkarni) +addx1701 add 130E-2 120E-2 -> 2.50 +addx1702 add 130E-2 12E-1 -> 2.50 +addx1703 add 130E-2 1E0 -> 2.30 +addx1704 add 1E2 1E4 -> 1.01E+4 +addx1705 subtract 130E-2 120E-2 -> 0.10 +addx1706 subtract 130E-2 12E-1 -> 0.10 +addx1707 subtract 130E-2 1E0 -> 0.30 +addx1708 subtract 1E2 1E4 -> -9.9E+3 + +------------------------------------------------------------------------ +-- Same as above, using decimal64default parameters -- +------------------------------------------------------------------------ +precision: 16 +rounding: half_even +maxExponent: 384 +minexponent: -383 + +-- [first group are 'quick confidence check'] +addx6001 add 1 1 -> 2 +addx6002 add 2 3 -> 5 +addx6003 add '5.75' '3.3' -> 9.05 +addx6004 add '5' '-3' -> 2 +addx6005 add '-5' '-3' -> -8 +addx6006 add '-7' '2.5' -> -4.5 +addx6007 add '0.7' '0.3' -> 1.0 +addx6008 add '1.25' '1.25' -> 2.50 +addx6009 add '1.23456789' '1.00000000' -> '2.23456789' +addx6010 add '1.23456789' '1.00000011' -> '2.23456800' + +addx6011 add '0.44444444444444444' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded +addx6012 add '0.44444444444444440' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded +addx6013 add '0.44444444444444444' '0.55555555555555550' -> '0.9999999999999999' Inexact Rounded +addx6014 add '0.444444444444444449' '0' -> '0.4444444444444444' Inexact Rounded +addx6015 add '0.4444444444444444499' '0' -> '0.4444444444444444' Inexact Rounded +addx6016 add '0.44444444444444444999' '0' -> '0.4444444444444444' Inexact Rounded +addx6017 add '0.44444444444444445000' '0' -> '0.4444444444444444' Inexact Rounded +addx6018 add '0.44444444444444445001' '0' -> '0.4444444444444445' Inexact Rounded +addx6019 add '0.4444444444444444501' '0' -> '0.4444444444444445' Inexact Rounded +addx6020 add '0.444444444444444451' '0' -> '0.4444444444444445' Inexact Rounded + +addx6021 add 0 1 -> 1 +addx6022 add 1 1 -> 2 +addx6023 add 2 1 -> 3 +addx6024 add 3 1 -> 4 +addx6025 add 4 1 -> 5 +addx6026 add 5 1 -> 6 +addx6027 add 6 1 -> 7 +addx6028 add 7 1 -> 8 +addx6029 add 8 1 -> 9 +addx6030 add 9 1 -> 10 + +-- some carrying effects +addx6031 add '0.9998' '0.0000' -> '0.9998' +addx6032 add '0.9998' '0.0001' -> '0.9999' +addx6033 add '0.9998' '0.0002' -> '1.0000' +addx6034 add '0.9998' '0.0003' -> '1.0001' + +addx6035 add '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +addx6036 add '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +addx6037 add '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded +addx6038 add '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded +addx6039 add '700000' '10000e+16' -> '1.000000000000007E+20' Rounded + +-- symmetry: +addx6040 add '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded +addx6041 add '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded +addx6042 add '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded +addx6044 add '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded +addx6045 add '10000e+16' '700000' -> '1.000000000000007E+20' Rounded + +addx6046 add '10000e+9' '7' -> '10000000000007' +addx6047 add '10000e+9' '70' -> '10000000000070' +addx6048 add '10000e+9' '700' -> '10000000000700' +addx6049 add '10000e+9' '7000' -> '10000000007000' +addx6050 add '10000e+9' '70000' -> '10000000070000' +addx6051 add '10000e+9' '700000' -> '10000000700000' + +-- examples from decarith +addx6053 add '12' '7.00' -> '19.00' +addx6054 add '1.3' '-1.07' -> '0.23' +addx6055 add '1.3' '-1.30' -> '0.00' +addx6056 add '1.3' '-2.07' -> '-0.77' +addx6057 add '1E+2' '1E+4' -> '1.01E+4' + +-- from above +addx6061 add 1 '0.1' -> '1.1' +addx6062 add 1 '0.01' -> '1.01' +addx6063 add 1 '0.001' -> '1.001' +addx6064 add 1 '0.0001' -> '1.0001' +addx6065 add 1 '0.00001' -> '1.00001' +addx6066 add 1 '0.000001' -> '1.000001' +addx6067 add 1 '0.0000001' -> '1.0000001' +addx6068 add 1 '0.00000001' -> '1.00000001' + +-- some funny zeros [in case of bad signum] +addx6070 add 1 0 -> 1 +addx6071 add 1 0. -> 1 +addx6072 add 1 .0 -> 1.0 +addx6073 add 1 0.0 -> 1.0 +addx6074 add 1 0.00 -> 1.00 +addx6075 add 0 1 -> 1 +addx6076 add 0. 1 -> 1 +addx6077 add .0 1 -> 1.0 +addx6078 add 0.0 1 -> 1.0 +addx6079 add 0.00 1 -> 1.00 + +-- some carries +addx6080 add 9999999999999998 1 -> 9999999999999999 +addx6081 add 9999999999999999 1 -> 1.000000000000000E+16 Rounded +addx6082 add 999999999999999 1 -> 1000000000000000 +addx6083 add 9999999999999 1 -> 10000000000000 +addx6084 add 99999999999 1 -> 100000000000 +addx6085 add 999999999 1 -> 1000000000 +addx6086 add 9999999 1 -> 10000000 +addx6087 add 99999 1 -> 100000 +addx6088 add 999 1 -> 1000 +addx6089 add 9 1 -> 10 + + +-- more LHS swaps +addx6090 add '-56267E-10' 0 -> '-0.0000056267' +addx6091 add '-56267E-6' 0 -> '-0.056267' +addx6092 add '-56267E-5' 0 -> '-0.56267' +addx6093 add '-56267E-4' 0 -> '-5.6267' +addx6094 add '-56267E-3' 0 -> '-56.267' +addx6095 add '-56267E-2' 0 -> '-562.67' +addx6096 add '-56267E-1' 0 -> '-5626.7' +addx6097 add '-56267E-0' 0 -> '-56267' +addx6098 add '-5E-10' 0 -> '-5E-10' +addx6099 add '-5E-7' 0 -> '-5E-7' +addx6100 add '-5E-6' 0 -> '-0.000005' +addx6101 add '-5E-5' 0 -> '-0.00005' +addx6102 add '-5E-4' 0 -> '-0.0005' +addx6103 add '-5E-1' 0 -> '-0.5' +addx6104 add '-5E0' 0 -> '-5' +addx6105 add '-5E1' 0 -> '-50' +addx6106 add '-5E5' 0 -> '-500000' +addx6107 add '-5E15' 0 -> '-5000000000000000' +addx6108 add '-5E16' 0 -> '-5.000000000000000E+16' Rounded +addx6109 add '-5E17' 0 -> '-5.000000000000000E+17' Rounded +addx6110 add '-5E18' 0 -> '-5.000000000000000E+18' Rounded +addx6111 add '-5E100' 0 -> '-5.000000000000000E+100' Rounded + +-- more RHS swaps +addx6113 add 0 '-56267E-10' -> '-0.0000056267' +addx6114 add 0 '-56267E-6' -> '-0.056267' +addx6116 add 0 '-56267E-5' -> '-0.56267' +addx6117 add 0 '-56267E-4' -> '-5.6267' +addx6119 add 0 '-56267E-3' -> '-56.267' +addx6120 add 0 '-56267E-2' -> '-562.67' +addx6121 add 0 '-56267E-1' -> '-5626.7' +addx6122 add 0 '-56267E-0' -> '-56267' +addx6123 add 0 '-5E-10' -> '-5E-10' +addx6124 add 0 '-5E-7' -> '-5E-7' +addx6125 add 0 '-5E-6' -> '-0.000005' +addx6126 add 0 '-5E-5' -> '-0.00005' +addx6127 add 0 '-5E-4' -> '-0.0005' +addx6128 add 0 '-5E-1' -> '-0.5' +addx6129 add 0 '-5E0' -> '-5' +addx6130 add 0 '-5E1' -> '-50' +addx6131 add 0 '-5E5' -> '-500000' +addx6132 add 0 '-5E15' -> '-5000000000000000' +addx6133 add 0 '-5E16' -> '-5.000000000000000E+16' Rounded +addx6134 add 0 '-5E17' -> '-5.000000000000000E+17' Rounded +addx6135 add 0 '-5E18' -> '-5.000000000000000E+18' Rounded +addx6136 add 0 '-5E100' -> '-5.000000000000000E+100' Rounded + +-- related +addx6137 add 1 '0E-19' -> '1.000000000000000' Rounded +addx6138 add -1 '0E-19' -> '-1.000000000000000' Rounded +addx6139 add '0E-19' 1 -> '1.000000000000000' Rounded +addx6140 add '0E-19' -1 -> '-1.000000000000000' Rounded +addx6141 add 1E+11 0.0000 -> '100000000000.0000' +addx6142 add 1E+11 0.00000 -> '100000000000.0000' Rounded +addx6143 add 0.000 1E+12 -> '1000000000000.000' +addx6144 add 0.0000 1E+12 -> '1000000000000.000' Rounded + +-- [some of the next group are really constructor tests] +addx6146 add '00.0' 0 -> '0.0' +addx6147 add '0.00' 0 -> '0.00' +addx6148 add 0 '0.00' -> '0.00' +addx6149 add 0 '00.0' -> '0.0' +addx6150 add '00.0' '0.00' -> '0.00' +addx6151 add '0.00' '00.0' -> '0.00' +addx6152 add '3' '.3' -> '3.3' +addx6153 add '3.' '.3' -> '3.3' +addx6154 add '3.0' '.3' -> '3.3' +addx6155 add '3.00' '.3' -> '3.30' +addx6156 add '3' '3' -> '6' +addx6157 add '3' '+3' -> '6' +addx6158 add '3' '-3' -> '0' +addx6159 add '0.3' '-0.3' -> '0.0' +addx6160 add '0.03' '-0.03' -> '0.00' + +-- try borderline precision, with carries, etc. +addx6161 add '1E+13' '-1' -> '9999999999999' +addx6162 add '1E+13' '1.11' -> '10000000000001.11' +addx6163 add '1.11' '1E+13' -> '10000000000001.11' +addx6164 add '-1' '1E+13' -> '9999999999999' +addx6165 add '7E+13' '-1' -> '69999999999999' +addx6166 add '7E+13' '1.11' -> '70000000000001.11' +addx6167 add '1.11' '7E+13' -> '70000000000001.11' +addx6168 add '-1' '7E+13' -> '69999999999999' + +-- 1234567890123456 1234567890123456 1 234567890123456 +addx6170 add '0.4444444444444444' '0.5555555555555563' -> '1.000000000000001' Inexact Rounded +addx6171 add '0.4444444444444444' '0.5555555555555562' -> '1.000000000000001' Inexact Rounded +addx6172 add '0.4444444444444444' '0.5555555555555561' -> '1.000000000000000' Inexact Rounded +addx6173 add '0.4444444444444444' '0.5555555555555560' -> '1.000000000000000' Inexact Rounded +addx6174 add '0.4444444444444444' '0.5555555555555559' -> '1.000000000000000' Inexact Rounded +addx6175 add '0.4444444444444444' '0.5555555555555558' -> '1.000000000000000' Inexact Rounded +addx6176 add '0.4444444444444444' '0.5555555555555557' -> '1.000000000000000' Inexact Rounded +addx6177 add '0.4444444444444444' '0.5555555555555556' -> '1.000000000000000' Rounded +addx6178 add '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999' +addx6179 add '0.4444444444444444' '0.5555555555555554' -> '0.9999999999999998' +addx6180 add '0.4444444444444444' '0.5555555555555553' -> '0.9999999999999997' +addx6181 add '0.4444444444444444' '0.5555555555555552' -> '0.9999999999999996' +addx6182 add '0.4444444444444444' '0.5555555555555551' -> '0.9999999999999995' +addx6183 add '0.4444444444444444' '0.5555555555555550' -> '0.9999999999999994' + +-- and some more, including residue effects and different roundings +rounding: half_up +addx6200 add '6543210123456789' 0 -> '6543210123456789' +addx6201 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +addx6202 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +addx6203 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +addx6204 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +addx6205 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +addx6206 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +addx6207 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded +addx6208 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded +addx6209 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded +addx6210 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded +addx6211 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded +addx6212 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded +addx6213 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded +addx6214 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded +addx6215 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded +addx6216 add '6543210123456789' 1 -> '6543210123456790' +addx6217 add '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded +addx6218 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +addx6219 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded + +rounding: half_even +addx6220 add '6543210123456789' 0 -> '6543210123456789' +addx6221 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +addx6222 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +addx6223 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +addx6224 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +addx6225 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +addx6226 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +addx6227 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded +addx6228 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded +addx6229 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded +addx6230 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded +addx6231 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded +addx6232 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded +addx6233 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded +addx6234 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded +addx6235 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded +addx6236 add '6543210123456789' 1 -> '6543210123456790' +addx6237 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded +addx6238 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +addx6239 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded +-- critical few with even bottom digit... +addx6240 add '6543210123456788' 0.499999999 -> '6543210123456788' Inexact Rounded +addx6241 add '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded +addx6242 add '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded + +rounding: down +addx6250 add '6543210123456789' 0 -> '6543210123456789' +addx6251 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded +addx6252 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded +addx6253 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded +addx6254 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded +addx6255 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded +addx6256 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded +addx6257 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded +addx6258 add '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded +addx6259 add '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded +addx6260 add '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded +addx6261 add '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded +addx6262 add '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded +addx6263 add '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded +addx6264 add '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded +addx6265 add '6543210123456789' 0.999999999 -> '6543210123456789' Inexact Rounded +addx6266 add '6543210123456789' 1 -> '6543210123456790' +addx6267 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded +addx6268 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded +addx6269 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded + +-- 1 in last place tests +rounding: half_even +addx6301 add -1 1 -> 0 +addx6302 add 0 1 -> 1 +addx6303 add 1 1 -> 2 +addx6304 add 12 1 -> 13 +addx6305 add 98 1 -> 99 +addx6306 add 99 1 -> 100 +addx6307 add 100 1 -> 101 +addx6308 add 101 1 -> 102 +addx6309 add -1 -1 -> -2 +addx6310 add 0 -1 -> -1 +addx6311 add 1 -1 -> 0 +addx6312 add 12 -1 -> 11 +addx6313 add 98 -1 -> 97 +addx6314 add 99 -1 -> 98 +addx6315 add 100 -1 -> 99 +addx6316 add 101 -1 -> 100 + +addx6321 add -0.01 0.01 -> 0.00 +addx6322 add 0.00 0.01 -> 0.01 +addx6323 add 0.01 0.01 -> 0.02 +addx6324 add 0.12 0.01 -> 0.13 +addx6325 add 0.98 0.01 -> 0.99 +addx6326 add 0.99 0.01 -> 1.00 +addx6327 add 1.00 0.01 -> 1.01 +addx6328 add 1.01 0.01 -> 1.02 +addx6329 add -0.01 -0.01 -> -0.02 +addx6330 add 0.00 -0.01 -> -0.01 +addx6331 add 0.01 -0.01 -> 0.00 +addx6332 add 0.12 -0.01 -> 0.11 +addx6333 add 0.98 -0.01 -> 0.97 +addx6334 add 0.99 -0.01 -> 0.98 +addx6335 add 1.00 -0.01 -> 0.99 +addx6336 add 1.01 -0.01 -> 1.00 + +-- some more cases where adding 0 affects the coefficient +addx6340 add 1E+3 0 -> 1000 +addx6341 add 1E+15 0 -> 1000000000000000 +addx6342 add 1E+16 0 -> 1.000000000000000E+16 Rounded +addx6343 add 1E+17 0 -> 1.000000000000000E+17 Rounded +-- which simply follow from these cases ... +addx6344 add 1E+3 1 -> 1001 +addx6345 add 1E+15 1 -> 1000000000000001 +addx6346 add 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded +addx6347 add 1E+17 1 -> 1.000000000000000E+17 Inexact Rounded +addx6348 add 1E+3 7 -> 1007 +addx6349 add 1E+15 7 -> 1000000000000007 +addx6350 add 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded +addx6351 add 1E+17 7 -> 1.000000000000000E+17 Inexact Rounded + +-- tryzeros cases +addx6361 add 0E+50 10000E+1 -> 1.0000E+5 +addx6362 add 10000E+1 0E-50 -> 100000.0000000000 Rounded +addx6363 add 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact + +-- ulp replacement tests +addx6400 add 1 77e-14 -> 1.00000000000077 +addx6401 add 1 77e-15 -> 1.000000000000077 +addx6402 add 1 77e-16 -> 1.000000000000008 Inexact Rounded +addx6403 add 1 77e-17 -> 1.000000000000001 Inexact Rounded +addx6404 add 1 77e-18 -> 1.000000000000000 Inexact Rounded +addx6405 add 1 77e-19 -> 1.000000000000000 Inexact Rounded +addx6406 add 1 77e-99 -> 1.000000000000000 Inexact Rounded + +addx6410 add 10 77e-14 -> 10.00000000000077 +addx6411 add 10 77e-15 -> 10.00000000000008 Inexact Rounded +addx6412 add 10 77e-16 -> 10.00000000000001 Inexact Rounded +addx6413 add 10 77e-17 -> 10.00000000000000 Inexact Rounded +addx6414 add 10 77e-18 -> 10.00000000000000 Inexact Rounded +addx6415 add 10 77e-19 -> 10.00000000000000 Inexact Rounded +addx6416 add 10 77e-99 -> 10.00000000000000 Inexact Rounded + +addx6420 add 77e-14 1 -> 1.00000000000077 +addx6421 add 77e-15 1 -> 1.000000000000077 +addx6422 add 77e-16 1 -> 1.000000000000008 Inexact Rounded +addx6423 add 77e-17 1 -> 1.000000000000001 Inexact Rounded +addx6424 add 77e-18 1 -> 1.000000000000000 Inexact Rounded +addx6425 add 77e-19 1 -> 1.000000000000000 Inexact Rounded +addx6426 add 77e-99 1 -> 1.000000000000000 Inexact Rounded + +addx6430 add 77e-14 10 -> 10.00000000000077 +addx6431 add 77e-15 10 -> 10.00000000000008 Inexact Rounded +addx6432 add 77e-16 10 -> 10.00000000000001 Inexact Rounded +addx6433 add 77e-17 10 -> 10.00000000000000 Inexact Rounded +addx6434 add 77e-18 10 -> 10.00000000000000 Inexact Rounded +addx6435 add 77e-19 10 -> 10.00000000000000 Inexact Rounded +addx6436 add 77e-99 10 -> 10.00000000000000 Inexact Rounded + +-- negative ulps +addx6440 add 1 -77e-14 -> 0.99999999999923 +addx6441 add 1 -77e-15 -> 0.999999999999923 +addx6442 add 1 -77e-16 -> 0.9999999999999923 +addx6443 add 1 -77e-17 -> 0.9999999999999992 Inexact Rounded +addx6444 add 1 -77e-18 -> 0.9999999999999999 Inexact Rounded +addx6445 add 1 -77e-19 -> 1.000000000000000 Inexact Rounded +addx6446 add 1 -77e-99 -> 1.000000000000000 Inexact Rounded + +addx6450 add 10 -77e-14 -> 9.99999999999923 +addx6451 add 10 -77e-15 -> 9.999999999999923 +addx6452 add 10 -77e-16 -> 9.999999999999992 Inexact Rounded +addx6453 add 10 -77e-17 -> 9.999999999999999 Inexact Rounded +addx6454 add 10 -77e-18 -> 10.00000000000000 Inexact Rounded +addx6455 add 10 -77e-19 -> 10.00000000000000 Inexact Rounded +addx6456 add 10 -77e-99 -> 10.00000000000000 Inexact Rounded + +addx6460 add -77e-14 1 -> 0.99999999999923 +addx6461 add -77e-15 1 -> 0.999999999999923 +addx6462 add -77e-16 1 -> 0.9999999999999923 +addx6463 add -77e-17 1 -> 0.9999999999999992 Inexact Rounded +addx6464 add -77e-18 1 -> 0.9999999999999999 Inexact Rounded +addx6465 add -77e-19 1 -> 1.000000000000000 Inexact Rounded +addx6466 add -77e-99 1 -> 1.000000000000000 Inexact Rounded + +addx6470 add -77e-14 10 -> 9.99999999999923 +addx6471 add -77e-15 10 -> 9.999999999999923 +addx6472 add -77e-16 10 -> 9.999999999999992 Inexact Rounded +addx6473 add -77e-17 10 -> 9.999999999999999 Inexact Rounded +addx6474 add -77e-18 10 -> 10.00000000000000 Inexact Rounded +addx6475 add -77e-19 10 -> 10.00000000000000 Inexact Rounded +addx6476 add -77e-99 10 -> 10.00000000000000 Inexact Rounded + +-- negative ulps +addx6480 add -1 77e-14 -> -0.99999999999923 +addx6481 add -1 77e-15 -> -0.999999999999923 +addx6482 add -1 77e-16 -> -0.9999999999999923 +addx6483 add -1 77e-17 -> -0.9999999999999992 Inexact Rounded +addx6484 add -1 77e-18 -> -0.9999999999999999 Inexact Rounded +addx6485 add -1 77e-19 -> -1.000000000000000 Inexact Rounded +addx6486 add -1 77e-99 -> -1.000000000000000 Inexact Rounded + +addx6490 add -10 77e-14 -> -9.99999999999923 +addx6491 add -10 77e-15 -> -9.999999999999923 +addx6492 add -10 77e-16 -> -9.999999999999992 Inexact Rounded +addx6493 add -10 77e-17 -> -9.999999999999999 Inexact Rounded +addx6494 add -10 77e-18 -> -10.00000000000000 Inexact Rounded +addx6495 add -10 77e-19 -> -10.00000000000000 Inexact Rounded +addx6496 add -10 77e-99 -> -10.00000000000000 Inexact Rounded + +addx6500 add 77e-14 -1 -> -0.99999999999923 +addx6501 add 77e-15 -1 -> -0.999999999999923 +addx6502 add 77e-16 -1 -> -0.9999999999999923 +addx6503 add 77e-17 -1 -> -0.9999999999999992 Inexact Rounded +addx6504 add 77e-18 -1 -> -0.9999999999999999 Inexact Rounded +addx6505 add 77e-19 -1 -> -1.000000000000000 Inexact Rounded +addx6506 add 77e-99 -1 -> -1.000000000000000 Inexact Rounded + +addx6510 add 77e-14 -10 -> -9.99999999999923 +addx6511 add 77e-15 -10 -> -9.999999999999923 +addx6512 add 77e-16 -10 -> -9.999999999999992 Inexact Rounded +addx6513 add 77e-17 -10 -> -9.999999999999999 Inexact Rounded +addx6514 add 77e-18 -10 -> -10.00000000000000 Inexact Rounded +addx6515 add 77e-19 -10 -> -10.00000000000000 Inexact Rounded +addx6516 add 77e-99 -10 -> -10.00000000000000 Inexact Rounded + + +-- long operands +addx6521 add 101234562345678000 0 -> 1.012345623456780E+17 Rounded +addx6522 add 0 101234562345678000 -> 1.012345623456780E+17 Rounded +addx6523 add 10123456234567800 0 -> 1.012345623456780E+16 Rounded +addx6524 add 0 10123456234567800 -> 1.012345623456780E+16 Rounded +addx6525 add 10123456234567890 0 -> 1.012345623456789E+16 Rounded +addx6526 add 0 10123456234567890 -> 1.012345623456789E+16 Rounded +addx6527 add 10123456234567891 0 -> 1.012345623456789E+16 Inexact Rounded +addx6528 add 0 10123456234567891 -> 1.012345623456789E+16 Inexact Rounded +addx6529 add 101234562345678901 0 -> 1.012345623456789E+17 Inexact Rounded +addx6530 add 0 101234562345678901 -> 1.012345623456789E+17 Inexact Rounded +addx6531 add 10123456234567896 0 -> 1.012345623456790E+16 Inexact Rounded +addx6532 add 0 10123456234567896 -> 1.012345623456790E+16 Inexact Rounded + +-- verify a query +rounding: down +addx6561 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded +addx6562 add 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded +-- and using decimal64 bounds... +rounding: down +addx6563 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded +addx6564 add 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded + +-- more zeros, etc. +rounding: half_even + +addx6701 add 5.00 1.00E-3 -> 5.00100 +addx6702 add 00.00 0.000 -> 0.000 +addx6703 add 00.00 0E-3 -> 0.000 +addx6704 add 0E-3 00.00 -> 0.000 + +addx6710 add 0E+3 00.00 -> 0.00 +addx6711 add 0E+3 00.0 -> 0.0 +addx6712 add 0E+3 00. -> 0 +addx6713 add 0E+3 00.E+1 -> 0E+1 +addx6714 add 0E+3 00.E+2 -> 0E+2 +addx6715 add 0E+3 00.E+3 -> 0E+3 +addx6716 add 0E+3 00.E+4 -> 0E+3 +addx6717 add 0E+3 00.E+5 -> 0E+3 +addx6718 add 0E+3 -00.0 -> 0.0 +addx6719 add 0E+3 -00. -> 0 +addx6731 add 0E+3 -00.E+1 -> 0E+1 + +addx6720 add 00.00 0E+3 -> 0.00 +addx6721 add 00.0 0E+3 -> 0.0 +addx6722 add 00. 0E+3 -> 0 +addx6723 add 00.E+1 0E+3 -> 0E+1 +addx6724 add 00.E+2 0E+3 -> 0E+2 +addx6725 add 00.E+3 0E+3 -> 0E+3 +addx6726 add 00.E+4 0E+3 -> 0E+3 +addx6727 add 00.E+5 0E+3 -> 0E+3 +addx6728 add -00.00 0E+3 -> 0.00 +addx6729 add -00.0 0E+3 -> 0.0 +addx6730 add -00. 0E+3 -> 0 + +addx6732 add 0 0 -> 0 +addx6733 add 0 -0 -> 0 +addx6734 add -0 0 -> 0 +addx6735 add -0 -0 -> -0 -- IEEE 854 special case + +addx6736 add 1 -1 -> 0 +addx6737 add -1 -1 -> -2 +addx6738 add 1 1 -> 2 +addx6739 add -1 1 -> 0 + +addx6741 add 0 -1 -> -1 +addx6742 add -0 -1 -> -1 +addx6743 add 0 1 -> 1 +addx6744 add -0 1 -> 1 +addx6745 add -1 0 -> -1 +addx6746 add -1 -0 -> -1 +addx6747 add 1 0 -> 1 +addx6748 add 1 -0 -> 1 + +addx6751 add 0.0 -1 -> -1.0 +addx6752 add -0.0 -1 -> -1.0 +addx6753 add 0.0 1 -> 1.0 +addx6754 add -0.0 1 -> 1.0 +addx6755 add -1.0 0 -> -1.0 +addx6756 add -1.0 -0 -> -1.0 +addx6757 add 1.0 0 -> 1.0 +addx6758 add 1.0 -0 -> 1.0 + +addx6761 add 0 -1.0 -> -1.0 +addx6762 add -0 -1.0 -> -1.0 +addx6763 add 0 1.0 -> 1.0 +addx6764 add -0 1.0 -> 1.0 +addx6765 add -1 0.0 -> -1.0 +addx6766 add -1 -0.0 -> -1.0 +addx6767 add 1 0.0 -> 1.0 +addx6768 add 1 -0.0 -> 1.0 + +addx6771 add 0.0 -1.0 -> -1.0 +addx6772 add -0.0 -1.0 -> -1.0 +addx6773 add 0.0 1.0 -> 1.0 +addx6774 add -0.0 1.0 -> 1.0 +addx6775 add -1.0 0.0 -> -1.0 +addx6776 add -1.0 -0.0 -> -1.0 +addx6777 add 1.0 0.0 -> 1.0 +addx6778 add 1.0 -0.0 -> 1.0 + +-- Specials +addx6780 add -Inf -Inf -> -Infinity +addx6781 add -Inf -1000 -> -Infinity +addx6782 add -Inf -1 -> -Infinity +addx6783 add -Inf -0 -> -Infinity +addx6784 add -Inf 0 -> -Infinity +addx6785 add -Inf 1 -> -Infinity +addx6786 add -Inf 1000 -> -Infinity +addx6787 add -1000 -Inf -> -Infinity +addx6788 add -Inf -Inf -> -Infinity +addx6789 add -1 -Inf -> -Infinity +addx6790 add -0 -Inf -> -Infinity +addx6791 add 0 -Inf -> -Infinity +addx6792 add 1 -Inf -> -Infinity +addx6793 add 1000 -Inf -> -Infinity +addx6794 add Inf -Inf -> NaN Invalid_operation + +addx6800 add Inf -Inf -> NaN Invalid_operation +addx6801 add Inf -1000 -> Infinity +addx6802 add Inf -1 -> Infinity +addx6803 add Inf -0 -> Infinity +addx6804 add Inf 0 -> Infinity +addx6805 add Inf 1 -> Infinity +addx6806 add Inf 1000 -> Infinity +addx6807 add Inf Inf -> Infinity +addx6808 add -1000 Inf -> Infinity +addx6809 add -Inf Inf -> NaN Invalid_operation +addx6810 add -1 Inf -> Infinity +addx6811 add -0 Inf -> Infinity +addx6812 add 0 Inf -> Infinity +addx6813 add 1 Inf -> Infinity +addx6814 add 1000 Inf -> Infinity +addx6815 add Inf Inf -> Infinity + +addx6821 add NaN -Inf -> NaN +addx6822 add NaN -1000 -> NaN +addx6823 add NaN -1 -> NaN +addx6824 add NaN -0 -> NaN +addx6825 add NaN 0 -> NaN +addx6826 add NaN 1 -> NaN +addx6827 add NaN 1000 -> NaN +addx6828 add NaN Inf -> NaN +addx6829 add NaN NaN -> NaN +addx6830 add -Inf NaN -> NaN +addx6831 add -1000 NaN -> NaN +addx6832 add -1 NaN -> NaN +addx6833 add -0 NaN -> NaN +addx6834 add 0 NaN -> NaN +addx6835 add 1 NaN -> NaN +addx6836 add 1000 NaN -> NaN +addx6837 add Inf NaN -> NaN + +addx6841 add sNaN -Inf -> NaN Invalid_operation +addx6842 add sNaN -1000 -> NaN Invalid_operation +addx6843 add sNaN -1 -> NaN Invalid_operation +addx6844 add sNaN -0 -> NaN Invalid_operation +addx6845 add sNaN 0 -> NaN Invalid_operation +addx6846 add sNaN 1 -> NaN Invalid_operation +addx6847 add sNaN 1000 -> NaN Invalid_operation +addx6848 add sNaN NaN -> NaN Invalid_operation +addx6849 add sNaN sNaN -> NaN Invalid_operation +addx6850 add NaN sNaN -> NaN Invalid_operation +addx6851 add -Inf sNaN -> NaN Invalid_operation +addx6852 add -1000 sNaN -> NaN Invalid_operation +addx6853 add -1 sNaN -> NaN Invalid_operation +addx6854 add -0 sNaN -> NaN Invalid_operation +addx6855 add 0 sNaN -> NaN Invalid_operation +addx6856 add 1 sNaN -> NaN Invalid_operation +addx6857 add 1000 sNaN -> NaN Invalid_operation +addx6858 add Inf sNaN -> NaN Invalid_operation +addx6859 add NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +addx6861 add NaN1 -Inf -> NaN1 +addx6862 add +NaN2 -1000 -> NaN2 +addx6863 add NaN3 1000 -> NaN3 +addx6864 add NaN4 Inf -> NaN4 +addx6865 add NaN5 +NaN6 -> NaN5 +addx6866 add -Inf NaN7 -> NaN7 +addx6867 add -1000 NaN8 -> NaN8 +addx6868 add 1000 NaN9 -> NaN9 +addx6869 add Inf +NaN10 -> NaN10 +addx6871 add sNaN11 -Inf -> NaN11 Invalid_operation +addx6872 add sNaN12 -1000 -> NaN12 Invalid_operation +addx6873 add sNaN13 1000 -> NaN13 Invalid_operation +addx6874 add sNaN14 NaN17 -> NaN14 Invalid_operation +addx6875 add sNaN15 sNaN18 -> NaN15 Invalid_operation +addx6876 add NaN16 sNaN19 -> NaN19 Invalid_operation +addx6877 add -Inf +sNaN20 -> NaN20 Invalid_operation +addx6878 add -1000 sNaN21 -> NaN21 Invalid_operation +addx6879 add 1000 sNaN22 -> NaN22 Invalid_operation +addx6880 add Inf sNaN23 -> NaN23 Invalid_operation +addx6881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation +addx6882 add -NaN26 NaN28 -> -NaN26 +addx6883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation +addx6884 add 1000 -NaN30 -> -NaN30 +addx6885 add 1000 -sNaN31 -> -NaN31 Invalid_operation + +-- now the case where we can get underflow but the result is normal +-- [note this can't happen if the operands are also bounded, as we +-- cannot represent 1E-399, for example] + +addx6571 add 1E-383 0 -> 1E-383 +addx6572 add 1E-384 0 -> 1E-384 Subnormal +addx6573 add 1E-383 1E-384 -> 1.1E-383 +addx6574 subtract 1E-383 1E-384 -> 9E-384 Subnormal + +-- Here we explore the boundary of rounding a subnormal to Nmin +addx6575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal +addx6576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal +addx6577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +addx6578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +--addx6579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +--addx6580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded + +-- check overflow edge case +-- 1234567890123456 +addx6972 apply 9.999999999999999E+384 -> 9.999999999999999E+384 +addx6973 add 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded +addx6974 add 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded +addx6975 add 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded +addx6976 add 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded +addx6977 add 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded +addx6978 add 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded +addx6979 add 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded +addx6980 add 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded +addx6981 add 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded +addx6982 add 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded +addx6983 add 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded +addx6984 add 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded + +addx6985 apply -9.999999999999999E+384 -> -9.999999999999999E+384 +addx6986 add -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded +addx6987 add -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded +addx6988 add -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded +addx6989 add -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded +addx6990 add -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded +addx6991 add -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded +addx6992 add -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded +addx6993 add -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded +addx6994 add -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded +addx6995 add -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded +addx6996 add -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded +addx6997 add -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded + +-- And for round down full and subnormal results +rounding: down +addx61100 add 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact +addx61101 add 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact +addx61103 add +1 -1e-383 -> 0.9999999999999999 Rounded Inexact +addx61104 add 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact +addx61105 add 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact +addx61106 add 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact +addx61107 add 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact +addx61108 add 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact +addx61109 add 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact + +rounding: ceiling +addx61110 add -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact +addx61111 add -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact +addx61113 add -1 +1e-383 -> -0.9999999999999999 Rounded Inexact +addx61114 add -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact +addx61115 add -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact +addx61116 add -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact +addx61117 add -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact +addx61118 add -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact +addx61119 add -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact + +-- tests based on Gunnar Degnbol's edge case +rounding: half_even + +addx61300 add 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded +addx61310 add 1E16 -0.51 -> 9999999999999999 Inexact Rounded +addx61311 add 1E16 -0.501 -> 9999999999999999 Inexact Rounded +addx61312 add 1E16 -0.5001 -> 9999999999999999 Inexact Rounded +addx61313 add 1E16 -0.50001 -> 9999999999999999 Inexact Rounded +addx61314 add 1E16 -0.500001 -> 9999999999999999 Inexact Rounded +addx61315 add 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded +addx61316 add 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded +addx61317 add 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded +addx61318 add 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded +addx61319 add 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded +addx61320 add 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded +addx61321 add 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded +addx61322 add 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded +addx61323 add 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded +addx61324 add 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded +addx61325 add 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61326 add 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61327 add 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61328 add 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61329 add 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61330 add 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61331 add 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61332 add 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded +addx61333 add 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded +addx61334 add 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded +addx61335 add 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded +addx61336 add 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded +addx61337 add 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded +addx61338 add 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded +addx61339 add 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded + +addx61340 add 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded +addx61341 add 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded + +addx61349 add 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded +addx61350 add 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded +addx61351 add 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded +addx61352 add 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded +addx61353 add 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded +addx61354 add 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded +addx61355 add 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded +addx61356 add 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded +addx61357 add 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded +addx61358 add 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded +addx61359 add 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded +addx61360 add 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded +addx61361 add 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded +addx61362 add 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded +addx61363 add 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded +addx61364 add 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded +addx61365 add 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61367 add 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61368 add 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61369 add 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61370 add 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61371 add 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61372 add 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded +addx61373 add 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded +addx61374 add 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded +addx61375 add 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded +addx61376 add 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded +addx61377 add 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded +addx61378 add 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded +addx61379 add 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded +addx61380 add 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded +addx61381 add 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded +addx61382 add 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61383 add 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61384 add 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61385 add 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61386 add 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61387 add 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61388 add 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded +addx61389 add 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded +addx61390 add 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded +addx61391 add 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded +addx61392 add 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded +addx61393 add 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded +addx61394 add 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded +addx61395 add 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded +addx61396 add 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded + +-- More GD edge cases, where difference between the unadjusted +-- exponents is larger than the maximum precision and one side is 0 +addx61420 add 0 1.123456789012345 -> 1.123456789012345 +addx61421 add 0 1.123456789012345E-1 -> 0.1123456789012345 +addx61422 add 0 1.123456789012345E-2 -> 0.01123456789012345 +addx61423 add 0 1.123456789012345E-3 -> 0.001123456789012345 +addx61424 add 0 1.123456789012345E-4 -> 0.0001123456789012345 +addx61425 add 0 1.123456789012345E-5 -> 0.00001123456789012345 +addx61426 add 0 1.123456789012345E-6 -> 0.000001123456789012345 +addx61427 add 0 1.123456789012345E-7 -> 1.123456789012345E-7 +addx61428 add 0 1.123456789012345E-8 -> 1.123456789012345E-8 +addx61429 add 0 1.123456789012345E-9 -> 1.123456789012345E-9 +addx61430 add 0 1.123456789012345E-10 -> 1.123456789012345E-10 +addx61431 add 0 1.123456789012345E-11 -> 1.123456789012345E-11 +addx61432 add 0 1.123456789012345E-12 -> 1.123456789012345E-12 +addx61433 add 0 1.123456789012345E-13 -> 1.123456789012345E-13 +addx61434 add 0 1.123456789012345E-14 -> 1.123456789012345E-14 +addx61435 add 0 1.123456789012345E-15 -> 1.123456789012345E-15 +addx61436 add 0 1.123456789012345E-16 -> 1.123456789012345E-16 +addx61437 add 0 1.123456789012345E-17 -> 1.123456789012345E-17 +addx61438 add 0 1.123456789012345E-18 -> 1.123456789012345E-18 +addx61439 add 0 1.123456789012345E-19 -> 1.123456789012345E-19 + +-- same, reversed 0 +addx61440 add 1.123456789012345 0 -> 1.123456789012345 +addx61441 add 1.123456789012345E-1 0 -> 0.1123456789012345 +addx61442 add 1.123456789012345E-2 0 -> 0.01123456789012345 +addx61443 add 1.123456789012345E-3 0 -> 0.001123456789012345 +addx61444 add 1.123456789012345E-4 0 -> 0.0001123456789012345 +addx61445 add 1.123456789012345E-5 0 -> 0.00001123456789012345 +addx61446 add 1.123456789012345E-6 0 -> 0.000001123456789012345 +addx61447 add 1.123456789012345E-7 0 -> 1.123456789012345E-7 +addx61448 add 1.123456789012345E-8 0 -> 1.123456789012345E-8 +addx61449 add 1.123456789012345E-9 0 -> 1.123456789012345E-9 +addx61450 add 1.123456789012345E-10 0 -> 1.123456789012345E-10 +addx61451 add 1.123456789012345E-11 0 -> 1.123456789012345E-11 +addx61452 add 1.123456789012345E-12 0 -> 1.123456789012345E-12 +addx61453 add 1.123456789012345E-13 0 -> 1.123456789012345E-13 +addx61454 add 1.123456789012345E-14 0 -> 1.123456789012345E-14 +addx61455 add 1.123456789012345E-15 0 -> 1.123456789012345E-15 +addx61456 add 1.123456789012345E-16 0 -> 1.123456789012345E-16 +addx61457 add 1.123456789012345E-17 0 -> 1.123456789012345E-17 +addx61458 add 1.123456789012345E-18 0 -> 1.123456789012345E-18 +addx61459 add 1.123456789012345E-19 0 -> 1.123456789012345E-19 + +-- same, Es on the 0 +addx61460 add 1.123456789012345 0E-0 -> 1.123456789012345 +addx61461 add 1.123456789012345 0E-1 -> 1.123456789012345 +addx61462 add 1.123456789012345 0E-2 -> 1.123456789012345 +addx61463 add 1.123456789012345 0E-3 -> 1.123456789012345 +addx61464 add 1.123456789012345 0E-4 -> 1.123456789012345 +addx61465 add 1.123456789012345 0E-5 -> 1.123456789012345 +addx61466 add 1.123456789012345 0E-6 -> 1.123456789012345 +addx61467 add 1.123456789012345 0E-7 -> 1.123456789012345 +addx61468 add 1.123456789012345 0E-8 -> 1.123456789012345 +addx61469 add 1.123456789012345 0E-9 -> 1.123456789012345 +addx61470 add 1.123456789012345 0E-10 -> 1.123456789012345 +addx61471 add 1.123456789012345 0E-11 -> 1.123456789012345 +addx61472 add 1.123456789012345 0E-12 -> 1.123456789012345 +addx61473 add 1.123456789012345 0E-13 -> 1.123456789012345 +addx61474 add 1.123456789012345 0E-14 -> 1.123456789012345 +addx61475 add 1.123456789012345 0E-15 -> 1.123456789012345 +-- next four flag Rounded becuase the 0 extends the result +addx61476 add 1.123456789012345 0E-16 -> 1.123456789012345 Rounded +addx61477 add 1.123456789012345 0E-17 -> 1.123456789012345 Rounded +addx61478 add 1.123456789012345 0E-18 -> 1.123456789012345 Rounded +addx61479 add 1.123456789012345 0E-19 -> 1.123456789012345 Rounded + +-- sum of two opposite-sign operands is exactly 0 and floor => -0 +rounding: half_up +-- exact zeros from zeros +addx61500 add 0 0E-19 -> 0E-19 +addx61501 add -0 0E-19 -> 0E-19 +addx61502 add 0 -0E-19 -> 0E-19 +addx61503 add -0 -0E-19 -> -0E-19 +addx61504 add 0E-400 0E-19 -> 0E-398 Clamped +addx61505 add -0E-400 0E-19 -> 0E-398 Clamped +addx61506 add 0E-400 -0E-19 -> 0E-398 Clamped +addx61507 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61511 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61512 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61513 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61514 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx61515 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61516 add -1E-401 1E-401 -> 0E-398 Clamped +addx61517 add 1E-401 -1E-401 -> 0E-398 Clamped +addx61518 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: half_down +-- exact zeros from zeros +addx61520 add 0 0E-19 -> 0E-19 +addx61521 add -0 0E-19 -> 0E-19 +addx61522 add 0 -0E-19 -> 0E-19 +addx61523 add -0 -0E-19 -> -0E-19 +addx61524 add 0E-400 0E-19 -> 0E-398 Clamped +addx61525 add -0E-400 0E-19 -> 0E-398 Clamped +addx61526 add 0E-400 -0E-19 -> 0E-398 Clamped +addx61527 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61531 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61532 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61533 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61534 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx61535 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61536 add -1E-401 1E-401 -> 0E-398 Clamped +addx61537 add 1E-401 -1E-401 -> 0E-398 Clamped +addx61538 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: half_even +-- exact zeros from zeros +addx61540 add 0 0E-19 -> 0E-19 +addx61541 add -0 0E-19 -> 0E-19 +addx61542 add 0 -0E-19 -> 0E-19 +addx61543 add -0 -0E-19 -> -0E-19 +addx61544 add 0E-400 0E-19 -> 0E-398 Clamped +addx61545 add -0E-400 0E-19 -> 0E-398 Clamped +addx61546 add 0E-400 -0E-19 -> 0E-398 Clamped +addx61547 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61551 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61552 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61553 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61554 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx61555 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61556 add -1E-401 1E-401 -> 0E-398 Clamped +addx61557 add 1E-401 -1E-401 -> 0E-398 Clamped +addx61558 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: up +-- exact zeros from zeros +addx61560 add 0 0E-19 -> 0E-19 +addx61561 add -0 0E-19 -> 0E-19 +addx61562 add 0 -0E-19 -> 0E-19 +addx61563 add -0 -0E-19 -> -0E-19 +addx61564 add 0E-400 0E-19 -> 0E-398 Clamped +addx61565 add -0E-400 0E-19 -> 0E-398 Clamped +addx61566 add 0E-400 -0E-19 -> 0E-398 Clamped +addx61567 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61571 add 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx61572 add -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx61573 add 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +addx61574 add -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +-- some exact zeros from non-zeros +addx61575 add 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow +addx61576 add -1E-401 1E-401 -> 0E-398 Clamped +addx61577 add 1E-401 -1E-401 -> 0E-398 Clamped +addx61578 add -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow + +rounding: down +-- exact zeros from zeros +addx61580 add 0 0E-19 -> 0E-19 +addx61581 add -0 0E-19 -> 0E-19 +addx61582 add 0 -0E-19 -> 0E-19 +addx61583 add -0 -0E-19 -> -0E-19 +addx61584 add 0E-400 0E-19 -> 0E-398 Clamped +addx61585 add -0E-400 0E-19 -> 0E-398 Clamped +addx61586 add 0E-400 -0E-19 -> 0E-398 Clamped +addx61587 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61591 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61592 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61593 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61594 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx61595 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61596 add -1E-401 1E-401 -> 0E-398 Clamped +addx61597 add 1E-401 -1E-401 -> 0E-398 Clamped +addx61598 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +rounding: ceiling +-- exact zeros from zeros +addx61600 add 0 0E-19 -> 0E-19 +addx61601 add -0 0E-19 -> 0E-19 +addx61602 add 0 -0E-19 -> 0E-19 +addx61603 add -0 -0E-19 -> -0E-19 +addx61604 add 0E-400 0E-19 -> 0E-398 Clamped +addx61605 add -0E-400 0E-19 -> 0E-398 Clamped +addx61606 add 0E-400 -0E-19 -> 0E-398 Clamped +addx61607 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61611 add 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx61612 add -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow +addx61613 add 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61614 add -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped +-- some exact zeros from non-zeros +addx61615 add 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow +addx61616 add -1E-401 1E-401 -> 0E-398 Clamped +addx61617 add 1E-401 -1E-401 -> 0E-398 Clamped +addx61618 add -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped + +-- and the extra-special ugly case; unusual minuses marked by -- * +rounding: floor +-- exact zeros from zeros +addx61620 add 0 0E-19 -> 0E-19 +addx61621 add -0 0E-19 -> -0E-19 -- * +addx61622 add 0 -0E-19 -> -0E-19 -- * +addx61623 add -0 -0E-19 -> -0E-19 +addx61624 add 0E-400 0E-19 -> 0E-398 Clamped +addx61625 add -0E-400 0E-19 -> -0E-398 Clamped -- * +addx61626 add 0E-400 -0E-19 -> -0E-398 Clamped -- * +addx61627 add -0E-400 -0E-19 -> -0E-398 Clamped +-- inexact zeros +addx61631 add 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61632 add -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61633 add 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +addx61634 add -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow +-- some exact zeros from non-zeros +addx61635 add 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped +addx61636 add -1E-401 1E-401 -> -0E-398 Clamped -- * +addx61637 add 1E-401 -1E-401 -> -0E-398 Clamped -- * +addx61638 add -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow + +-- Examples from SQL proposal (Krishna Kulkarni) +addx61701 add 130E-2 120E-2 -> 2.50 +addx61702 add 130E-2 12E-1 -> 2.50 +addx61703 add 130E-2 1E0 -> 2.30 +addx61704 add 1E2 1E4 -> 1.01E+4 +addx61705 subtract 130E-2 120E-2 -> 0.10 +addx61706 subtract 130E-2 12E-1 -> 0.10 +addx61707 subtract 130E-2 1E0 -> 0.30 +addx61708 subtract 1E2 1E4 -> -9.9E+3 + +-- Null tests +addx9990 add 10 # -> NaN Invalid_operation +addx9991 add # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal-c/new_dt/base.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/base.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,1311 @@ +------------------------------------------------------------------------ +-- base.decTest -- base decimal <--> string conversions -- +-- Copyright (c) IBM Corporation, 1981, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- This file tests base conversions from string to a decimal number +-- and back to a string (in either Scientific or Engineering form) + +-- Note that unlike other operations the operand is subject to rounding +-- to conform to emax and precision settings (that is, numbers will +-- conform to rules and exponent will be in permitted range). + +precision: 15 +rounding: half_up +maxExponent: 999999999 +minExponent: -999999999 +extended: 1 + +basx001 toSci 0 -> 0 +basx002 toSci 1 -> 1 +basx003 toSci 1.0 -> 1.0 +basx004 toSci 1.00 -> 1.00 +basx005 toSci 10 -> 10 +basx006 toSci 1000 -> 1000 +basx007 toSci 10.0 -> 10.0 +basx008 toSci 10.1 -> 10.1 +basx009 toSci 10.4 -> 10.4 +basx010 toSci 10.5 -> 10.5 +basx011 toSci 10.6 -> 10.6 +basx012 toSci 10.9 -> 10.9 +basx013 toSci 11.0 -> 11.0 +basx014 toSci 1.234 -> 1.234 +basx015 toSci 0.123 -> 0.123 +basx016 toSci 0.012 -> 0.012 +basx017 toSci -0 -> -0 +basx018 toSci -0.0 -> -0.0 +basx019 toSci -00.00 -> -0.00 + +basx021 toSci -1 -> -1 +basx022 toSci -1.0 -> -1.0 +basx023 toSci -0.1 -> -0.1 +basx024 toSci -9.1 -> -9.1 +basx025 toSci -9.11 -> -9.11 +basx026 toSci -9.119 -> -9.119 +basx027 toSci -9.999 -> -9.999 + +basx030 toSci '123456789.123456' -> '123456789.123456' +basx031 toSci '123456789.000000' -> '123456789.000000' +basx032 toSci '123456789123456' -> '123456789123456' +basx033 toSci '0.0000123456789' -> '0.0000123456789' +basx034 toSci '0.00000123456789' -> '0.00000123456789' +basx035 toSci '0.000000123456789' -> '1.23456789E-7' +basx036 toSci '0.0000000123456789' -> '1.23456789E-8' + +basx037 toSci '0.123456789012344' -> '0.123456789012344' +basx038 toSci '0.123456789012345' -> '0.123456789012345' + +-- String [many more examples are implicitly tested elsewhere] +-- strings without E cannot generate E in result +basx100 toSci "12" -> '12' +basx101 toSci "-76" -> '-76' +basx102 toSci "12.76" -> '12.76' +basx103 toSci "+12.76" -> '12.76' +basx104 toSci "012.76" -> '12.76' +basx105 toSci "+0.003" -> '0.003' +basx106 toSci "17." -> '17' +basx107 toSci ".5" -> '0.5' +basx108 toSci "044" -> '44' +basx109 toSci "0044" -> '44' +basx110 toSci "0.0005" -> '0.0005' +basx111 toSci "00.00005" -> '0.00005' +basx112 toSci "0.000005" -> '0.000005' +basx113 toSci "0.0000050" -> '0.0000050' +basx114 toSci "0.0000005" -> '5E-7' +basx115 toSci "0.00000005" -> '5E-8' +basx116 toSci "12345678.543210" -> '12345678.543210' +basx117 toSci "2345678.543210" -> '2345678.543210' +basx118 toSci "345678.543210" -> '345678.543210' +basx119 toSci "0345678.54321" -> '345678.54321' +basx120 toSci "345678.5432" -> '345678.5432' +basx121 toSci "+345678.5432" -> '345678.5432' +basx122 toSci "+0345678.5432" -> '345678.5432' +basx123 toSci "+00345678.5432" -> '345678.5432' +basx124 toSci "-345678.5432" -> '-345678.5432' +basx125 toSci "-0345678.5432" -> '-345678.5432' +basx126 toSci "-00345678.5432" -> '-345678.5432' +-- examples +basx127 toSci "5E-6" -> '0.000005' +basx128 toSci "50E-7" -> '0.0000050' +basx129 toSci "5E-7" -> '5E-7' + + +-- [No exotics as no Unicode] + +-- Numbers with E +basx130 toSci "0.000E-1" -> '0.0000' +basx131 toSci "0.000E-2" -> '0.00000' +basx132 toSci "0.000E-3" -> '0.000000' +basx133 toSci "0.000E-4" -> '0E-7' +basx134 toSci "0.00E-2" -> '0.0000' +basx135 toSci "0.00E-3" -> '0.00000' +basx136 toSci "0.00E-4" -> '0.000000' +basx137 toSci "0.00E-5" -> '0E-7' +basx138 toSci "+0E+9" -> '0E+9' +basx139 toSci "-0E+9" -> '-0E+9' +basx140 toSci "1E+9" -> '1E+9' +basx141 toSci "1e+09" -> '1E+9' +basx142 toSci "1E+90" -> '1E+90' +basx143 toSci "+1E+009" -> '1E+9' +basx144 toSci "0E+9" -> '0E+9' +basx145 toSci "1E+9" -> '1E+9' +basx146 toSci "1E+09" -> '1E+9' +basx147 toSci "1e+90" -> '1E+90' +basx148 toSci "1E+009" -> '1E+9' +basx149 toSci "000E+9" -> '0E+9' +basx150 toSci "1E9" -> '1E+9' +basx151 toSci "1e09" -> '1E+9' +basx152 toSci "1E90" -> '1E+90' +basx153 toSci "1E009" -> '1E+9' +basx154 toSci "0E9" -> '0E+9' +basx155 toSci "0.000e+0" -> '0.000' +basx156 toSci "0.000E-1" -> '0.0000' +basx157 toSci "4E+9" -> '4E+9' +basx158 toSci "44E+9" -> '4.4E+10' +basx159 toSci "0.73e-7" -> '7.3E-8' +basx160 toSci "00E+9" -> '0E+9' +basx161 toSci "00E-9" -> '0E-9' +basx162 toSci "10E+9" -> '1.0E+10' +basx163 toSci "10E+09" -> '1.0E+10' +basx164 toSci "10e+90" -> '1.0E+91' +basx165 toSci "10E+009" -> '1.0E+10' +basx166 toSci "100e+9" -> '1.00E+11' +basx167 toSci "100e+09" -> '1.00E+11' +basx168 toSci "100E+90" -> '1.00E+92' +basx169 toSci "100e+009" -> '1.00E+11' + +basx170 toSci "1.265" -> '1.265' +basx171 toSci "1.265E-20" -> '1.265E-20' +basx172 toSci "1.265E-8" -> '1.265E-8' +basx173 toSci "1.265E-4" -> '0.0001265' +basx174 toSci "1.265E-3" -> '0.001265' +basx175 toSci "1.265E-2" -> '0.01265' +basx176 toSci "1.265E-1" -> '0.1265' +basx177 toSci "1.265E-0" -> '1.265' +basx178 toSci "1.265E+1" -> '12.65' +basx179 toSci "1.265E+2" -> '126.5' +basx180 toSci "1.265E+3" -> '1265' +basx181 toSci "1.265E+4" -> '1.265E+4' +basx182 toSci "1.265E+8" -> '1.265E+8' +basx183 toSci "1.265E+20" -> '1.265E+20' + +basx190 toSci "12.65" -> '12.65' +basx191 toSci "12.65E-20" -> '1.265E-19' +basx192 toSci "12.65E-8" -> '1.265E-7' +basx193 toSci "12.65E-4" -> '0.001265' +basx194 toSci "12.65E-3" -> '0.01265' +basx195 toSci "12.65E-2" -> '0.1265' +basx196 toSci "12.65E-1" -> '1.265' +basx197 toSci "12.65E-0" -> '12.65' +basx198 toSci "12.65E+1" -> '126.5' +basx199 toSci "12.65E+2" -> '1265' +basx200 toSci "12.65E+3" -> '1.265E+4' +basx201 toSci "12.65E+4" -> '1.265E+5' +basx202 toSci "12.65E+8" -> '1.265E+9' +basx203 toSci "12.65E+20" -> '1.265E+21' + +basx210 toSci "126.5" -> '126.5' +basx211 toSci "126.5E-20" -> '1.265E-18' +basx212 toSci "126.5E-8" -> '0.000001265' +basx213 toSci "126.5E-4" -> '0.01265' +basx214 toSci "126.5E-3" -> '0.1265' +basx215 toSci "126.5E-2" -> '1.265' +basx216 toSci "126.5E-1" -> '12.65' +basx217 toSci "126.5E-0" -> '126.5' +basx218 toSci "126.5E+1" -> '1265' +basx219 toSci "126.5E+2" -> '1.265E+4' +basx220 toSci "126.5E+3" -> '1.265E+5' +basx221 toSci "126.5E+4" -> '1.265E+6' +basx222 toSci "126.5E+8" -> '1.265E+10' +basx223 toSci "126.5E+20" -> '1.265E+22' + +basx230 toSci "1265" -> '1265' +basx231 toSci "1265E-20" -> '1.265E-17' +basx232 toSci "1265E-8" -> '0.00001265' +basx233 toSci "1265E-4" -> '0.1265' +basx234 toSci "1265E-3" -> '1.265' +basx235 toSci "1265E-2" -> '12.65' +basx236 toSci "1265E-1" -> '126.5' +basx237 toSci "1265E-0" -> '1265' +basx238 toSci "1265E+1" -> '1.265E+4' +basx239 toSci "1265E+2" -> '1.265E+5' +basx240 toSci "1265E+3" -> '1.265E+6' +basx241 toSci "1265E+4" -> '1.265E+7' +basx242 toSci "1265E+8" -> '1.265E+11' +basx243 toSci "1265E+20" -> '1.265E+23' + +basx250 toSci "0.1265" -> '0.1265' +basx251 toSci "0.1265E-20" -> '1.265E-21' +basx252 toSci "0.1265E-8" -> '1.265E-9' +basx253 toSci "0.1265E-4" -> '0.00001265' +basx254 toSci "0.1265E-3" -> '0.0001265' +basx255 toSci "0.1265E-2" -> '0.001265' +basx256 toSci "0.1265E-1" -> '0.01265' +basx257 toSci "0.1265E-0" -> '0.1265' +basx258 toSci "0.1265E+1" -> '1.265' +basx259 toSci "0.1265E+2" -> '12.65' +basx260 toSci "0.1265E+3" -> '126.5' +basx261 toSci "0.1265E+4" -> '1265' +basx262 toSci "0.1265E+8" -> '1.265E+7' +basx263 toSci "0.1265E+20" -> '1.265E+19' + +basx270 toSci "0.09e999" -> '9E+997' +basx271 toSci "0.9e999" -> '9E+998' +basx272 toSci "9e999" -> '9E+999' +basx273 toSci "9.9e999" -> '9.9E+999' +basx274 toSci "9.99e999" -> '9.99E+999' +basx275 toSci "9.99e-999" -> '9.99E-999' +basx276 toSci "9.9e-999" -> '9.9E-999' +basx277 toSci "9e-999" -> '9E-999' +basx279 toSci "99e-999" -> '9.9E-998' +basx280 toSci "999e-999" -> '9.99E-997' +basx281 toSci '0.9e-998' -> '9E-999' +basx282 toSci '0.09e-997' -> '9E-999' +basx283 toSci '0.1e1000' -> '1E+999' +basx284 toSci '10e-1000' -> '1.0E-999' + +-- some more negative zeros [systematic tests below] +basx290 toSci "-0.000E-1" -> '-0.0000' +basx291 toSci "-0.000E-2" -> '-0.00000' +basx292 toSci "-0.000E-3" -> '-0.000000' +basx293 toSci "-0.000E-4" -> '-0E-7' +basx294 toSci "-0.00E-2" -> '-0.0000' +basx295 toSci "-0.00E-3" -> '-0.00000' +basx296 toSci "-0.0E-2" -> '-0.000' +basx297 toSci "-0.0E-3" -> '-0.0000' +basx298 toSci "-0E-2" -> '-0.00' +basx299 toSci "-0E-3" -> '-0.000' + +-- Engineering notation tests +basx301 toSci 10e12 -> 1.0E+13 +basx302 toEng 10e12 -> 10E+12 +basx303 toSci 10e11 -> 1.0E+12 +basx304 toEng 10e11 -> 1.0E+12 +basx305 toSci 10e10 -> 1.0E+11 +basx306 toEng 10e10 -> 100E+9 +basx307 toSci 10e9 -> 1.0E+10 +basx308 toEng 10e9 -> 10E+9 +basx309 toSci 10e8 -> 1.0E+9 +basx310 toEng 10e8 -> 1.0E+9 +basx311 toSci 10e7 -> 1.0E+8 +basx312 toEng 10e7 -> 100E+6 +basx313 toSci 10e6 -> 1.0E+7 +basx314 toEng 10e6 -> 10E+6 +basx315 toSci 10e5 -> 1.0E+6 +basx316 toEng 10e5 -> 1.0E+6 +basx317 toSci 10e4 -> 1.0E+5 +basx318 toEng 10e4 -> 100E+3 +basx319 toSci 10e3 -> 1.0E+4 +basx320 toEng 10e3 -> 10E+3 +basx321 toSci 10e2 -> 1.0E+3 +basx322 toEng 10e2 -> 1.0E+3 +basx323 toSci 10e1 -> 1.0E+2 +basx324 toEng 10e1 -> 100 +basx325 toSci 10e0 -> 10 +basx326 toEng 10e0 -> 10 +basx327 toSci 10e-1 -> 1.0 +basx328 toEng 10e-1 -> 1.0 +basx329 toSci 10e-2 -> 0.10 +basx330 toEng 10e-2 -> 0.10 +basx331 toSci 10e-3 -> 0.010 +basx332 toEng 10e-3 -> 0.010 +basx333 toSci 10e-4 -> 0.0010 +basx334 toEng 10e-4 -> 0.0010 +basx335 toSci 10e-5 -> 0.00010 +basx336 toEng 10e-5 -> 0.00010 +basx337 toSci 10e-6 -> 0.000010 +basx338 toEng 10e-6 -> 0.000010 +basx339 toSci 10e-7 -> 0.0000010 +basx340 toEng 10e-7 -> 0.0000010 +basx341 toSci 10e-8 -> 1.0E-7 +basx342 toEng 10e-8 -> 100E-9 +basx343 toSci 10e-9 -> 1.0E-8 +basx344 toEng 10e-9 -> 10E-9 +basx345 toSci 10e-10 -> 1.0E-9 +basx346 toEng 10e-10 -> 1.0E-9 +basx347 toSci 10e-11 -> 1.0E-10 +basx348 toEng 10e-11 -> 100E-12 +basx349 toSci 10e-12 -> 1.0E-11 +basx350 toEng 10e-12 -> 10E-12 +basx351 toSci 10e-13 -> 1.0E-12 +basx352 toEng 10e-13 -> 1.0E-12 + +basx361 toSci 7E12 -> 7E+12 +basx362 toEng 7E12 -> 7E+12 +basx363 toSci 7E11 -> 7E+11 +basx364 toEng 7E11 -> 700E+9 +basx365 toSci 7E10 -> 7E+10 +basx366 toEng 7E10 -> 70E+9 +basx367 toSci 7E9 -> 7E+9 +basx368 toEng 7E9 -> 7E+9 +basx369 toSci 7E8 -> 7E+8 +basx370 toEng 7E8 -> 700E+6 +basx371 toSci 7E7 -> 7E+7 +basx372 toEng 7E7 -> 70E+6 +basx373 toSci 7E6 -> 7E+6 +basx374 toEng 7E6 -> 7E+6 +basx375 toSci 7E5 -> 7E+5 +basx376 toEng 7E5 -> 700E+3 +basx377 toSci 7E4 -> 7E+4 +basx378 toEng 7E4 -> 70E+3 +basx379 toSci 7E3 -> 7E+3 +basx380 toEng 7E3 -> 7E+3 +basx381 toSci 7E2 -> 7E+2 +basx382 toEng 7E2 -> 700 +basx383 toSci 7E1 -> 7E+1 +basx384 toEng 7E1 -> 70 +basx385 toSci 7E0 -> 7 +basx386 toEng 7E0 -> 7 +basx387 toSci 7E-1 -> 0.7 +basx388 toEng 7E-1 -> 0.7 +basx389 toSci 7E-2 -> 0.07 +basx390 toEng 7E-2 -> 0.07 +basx391 toSci 7E-3 -> 0.007 +basx392 toEng 7E-3 -> 0.007 +basx393 toSci 7E-4 -> 0.0007 +basx394 toEng 7E-4 -> 0.0007 +basx395 toSci 7E-5 -> 0.00007 +basx396 toEng 7E-5 -> 0.00007 +basx397 toSci 7E-6 -> 0.000007 +basx398 toEng 7E-6 -> 0.000007 +basx399 toSci 7E-7 -> 7E-7 +basx400 toEng 7E-7 -> 700E-9 +basx401 toSci 7E-8 -> 7E-8 +basx402 toEng 7E-8 -> 70E-9 +basx403 toSci 7E-9 -> 7E-9 +basx404 toEng 7E-9 -> 7E-9 +basx405 toSci 7E-10 -> 7E-10 +basx406 toEng 7E-10 -> 700E-12 +basx407 toSci 7E-11 -> 7E-11 +basx408 toEng 7E-11 -> 70E-12 +basx409 toSci 7E-12 -> 7E-12 +basx410 toEng 7E-12 -> 7E-12 +basx411 toSci 7E-13 -> 7E-13 +basx412 toEng 7E-13 -> 700E-15 + +-- Exacts remain exact up to precision .. +precision: 9 +basx420 toSci 100 -> 100 +basx421 toEng 100 -> 100 +basx422 toSci 1000 -> 1000 +basx423 toEng 1000 -> 1000 +basx424 toSci 999.9 -> 999.9 +basx425 toEng 999.9 -> 999.9 +basx426 toSci 1000.0 -> 1000.0 +basx427 toEng 1000.0 -> 1000.0 +basx428 toSci 1000.1 -> 1000.1 +basx429 toEng 1000.1 -> 1000.1 +basx430 toSci 10000 -> 10000 +basx431 toEng 10000 -> 10000 +basx432 toSci 100000 -> 100000 +basx433 toEng 100000 -> 100000 +basx434 toSci 1000000 -> 1000000 +basx435 toEng 1000000 -> 1000000 +basx436 toSci 10000000 -> 10000000 +basx437 toEng 10000000 -> 10000000 +basx438 toSci 100000000 -> 100000000 +basx439 toEng 100000000 -> 100000000 +basx440 toSci 1000000000 -> 1.00000000E+9 Rounded +basx441 toEng 1000000000 -> 1.00000000E+9 Rounded +basx442 toSci 1000000000 -> 1.00000000E+9 Rounded +basx443 toEng 1000000000 -> 1.00000000E+9 Rounded +basx444 toSci 1000000003 -> 1.00000000E+9 Rounded Inexact +basx445 toEng 1000000003 -> 1.00000000E+9 Rounded Inexact +basx446 toSci 1000000005 -> 1.00000001E+9 Rounded Inexact +basx447 toEng 1000000005 -> 1.00000001E+9 Rounded Inexact +basx448 toSci 10000000050 -> 1.00000001E+10 Rounded Inexact +basx449 toEng 10000000050 -> 10.0000001E+9 Rounded Inexact +basx450 toSci 1000000009 -> 1.00000001E+9 Rounded Inexact +basx451 toEng 1000000009 -> 1.00000001E+9 Rounded Inexact +basx452 toSci 10000000000 -> 1.00000000E+10 Rounded +basx453 toEng 10000000000 -> 10.0000000E+9 Rounded +basx454 toSci 10000000003 -> 1.00000000E+10 Rounded Inexact +basx455 toEng 10000000003 -> 10.0000000E+9 Rounded Inexact +basx456 toSci 10000000005 -> 1.00000000E+10 Rounded Inexact +basx457 toEng 10000000005 -> 10.0000000E+9 Rounded Inexact +basx458 toSci 10000000009 -> 1.00000000E+10 Rounded Inexact +basx459 toEng 10000000009 -> 10.0000000E+9 Rounded Inexact +basx460 toSci 100000000000 -> 1.00000000E+11 Rounded +basx461 toEng 100000000000 -> 100.000000E+9 Rounded +basx462 toSci 100000000300 -> 1.00000000E+11 Rounded Inexact +basx463 toEng 100000000300 -> 100.000000E+9 Rounded Inexact +basx464 toSci 100000000500 -> 1.00000001E+11 Rounded Inexact +basx465 toEng 100000000500 -> 100.000001E+9 Rounded Inexact +basx466 toSci 100000000900 -> 1.00000001E+11 Rounded Inexact +basx467 toEng 100000000900 -> 100.000001E+9 Rounded Inexact +basx468 toSci 1000000000000 -> 1.00000000E+12 Rounded +basx469 toEng 1000000000000 -> 1.00000000E+12 Rounded +basx470 toSci 1000000003000 -> 1.00000000E+12 Rounded Inexact +basx471 toEng 1000000003000 -> 1.00000000E+12 Rounded Inexact +basx472 toSci 1000000005000 -> 1.00000001E+12 Rounded Inexact +basx473 toEng 1000000005000 -> 1.00000001E+12 Rounded Inexact +basx474 toSci 1000000009000 -> 1.00000001E+12 Rounded Inexact +basx475 toEng 1000000009000 -> 1.00000001E+12 Rounded Inexact + +-- check rounding modes heeded +precision: 5 +rounding: ceiling +bsrx401 toSci 1.23450 -> 1.2345 Rounded +bsrx402 toSci 1.234549 -> 1.2346 Rounded Inexact +bsrx403 toSci 1.234550 -> 1.2346 Rounded Inexact +bsrx404 toSci 1.234551 -> 1.2346 Rounded Inexact +rounding: down +bsrx405 toSci 1.23450 -> 1.2345 Rounded +bsrx406 toSci 1.234549 -> 1.2345 Rounded Inexact +bsrx407 toSci 1.234550 -> 1.2345 Rounded Inexact +bsrx408 toSci 1.234551 -> 1.2345 Rounded Inexact +rounding: floor +bsrx410 toSci 1.23450 -> 1.2345 Rounded +bsrx411 toSci 1.234549 -> 1.2345 Rounded Inexact +bsrx412 toSci 1.234550 -> 1.2345 Rounded Inexact +bsrx413 toSci 1.234551 -> 1.2345 Rounded Inexact +rounding: half_down +bsrx415 toSci 1.23450 -> 1.2345 Rounded +bsrx416 toSci 1.234549 -> 1.2345 Rounded Inexact +bsrx417 toSci 1.234550 -> 1.2345 Rounded Inexact +bsrx418 toSci 1.234650 -> 1.2346 Rounded Inexact +bsrx419 toSci 1.234551 -> 1.2346 Rounded Inexact +rounding: half_even +bsrx421 toSci 1.23450 -> 1.2345 Rounded +bsrx422 toSci 1.234549 -> 1.2345 Rounded Inexact +bsrx423 toSci 1.234550 -> 1.2346 Rounded Inexact +bsrx424 toSci 1.234650 -> 1.2346 Rounded Inexact +bsrx425 toSci 1.234551 -> 1.2346 Rounded Inexact +rounding: down +bsrx426 toSci 1.23450 -> 1.2345 Rounded +bsrx427 toSci 1.234549 -> 1.2345 Rounded Inexact +bsrx428 toSci 1.234550 -> 1.2345 Rounded Inexact +bsrx429 toSci 1.234551 -> 1.2345 Rounded Inexact +rounding: half_up +bsrx431 toSci 1.23450 -> 1.2345 Rounded +bsrx432 toSci 1.234549 -> 1.2345 Rounded Inexact +bsrx433 toSci 1.234550 -> 1.2346 Rounded Inexact +bsrx434 toSci 1.234650 -> 1.2347 Rounded Inexact +bsrx435 toSci 1.234551 -> 1.2346 Rounded Inexact +-- negatives +rounding: ceiling +bsrx501 toSci -1.23450 -> -1.2345 Rounded +bsrx502 toSci -1.234549 -> -1.2345 Rounded Inexact +bsrx503 toSci -1.234550 -> -1.2345 Rounded Inexact +bsrx504 toSci -1.234551 -> -1.2345 Rounded Inexact +rounding: down +bsrx505 toSci -1.23450 -> -1.2345 Rounded +bsrx506 toSci -1.234549 -> -1.2345 Rounded Inexact +bsrx507 toSci -1.234550 -> -1.2345 Rounded Inexact +bsrx508 toSci -1.234551 -> -1.2345 Rounded Inexact +rounding: floor +bsrx510 toSci -1.23450 -> -1.2345 Rounded +bsrx511 toSci -1.234549 -> -1.2346 Rounded Inexact +bsrx512 toSci -1.234550 -> -1.2346 Rounded Inexact +bsrx513 toSci -1.234551 -> -1.2346 Rounded Inexact +rounding: half_down +bsrx515 toSci -1.23450 -> -1.2345 Rounded +bsrx516 toSci -1.234549 -> -1.2345 Rounded Inexact +bsrx517 toSci -1.234550 -> -1.2345 Rounded Inexact +bsrx518 toSci -1.234650 -> -1.2346 Rounded Inexact +bsrx519 toSci -1.234551 -> -1.2346 Rounded Inexact +rounding: half_even +bsrx521 toSci -1.23450 -> -1.2345 Rounded +bsrx522 toSci -1.234549 -> -1.2345 Rounded Inexact +bsrx523 toSci -1.234550 -> -1.2346 Rounded Inexact +bsrx524 toSci -1.234650 -> -1.2346 Rounded Inexact +bsrx525 toSci -1.234551 -> -1.2346 Rounded Inexact +rounding: down +bsrx526 toSci -1.23450 -> -1.2345 Rounded +bsrx527 toSci -1.234549 -> -1.2345 Rounded Inexact +bsrx528 toSci -1.234550 -> -1.2345 Rounded Inexact +bsrx529 toSci -1.234551 -> -1.2345 Rounded Inexact +rounding: half_up +bsrx531 toSci -1.23450 -> -1.2345 Rounded +bsrx532 toSci -1.234549 -> -1.2345 Rounded Inexact +bsrx533 toSci -1.234550 -> -1.2346 Rounded Inexact +bsrx534 toSci -1.234650 -> -1.2347 Rounded Inexact +bsrx535 toSci -1.234551 -> -1.2346 Rounded Inexact + +rounding: half_up +precision: 9 + +-- The 'baddies' tests from DiagBigDecimal, plus some new ones +basx500 toSci '1..2' -> NaN Conversion_syntax +basx501 toSci '.' -> NaN Conversion_syntax +basx502 toSci '..' -> NaN Conversion_syntax +basx503 toSci '++1' -> NaN Conversion_syntax +basx504 toSci '--1' -> NaN Conversion_syntax +basx505 toSci '-+1' -> NaN Conversion_syntax +basx506 toSci '+-1' -> NaN Conversion_syntax +basx507 toSci '12e' -> NaN Conversion_syntax +basx508 toSci '12e++' -> NaN Conversion_syntax +basx509 toSci '12f4' -> NaN Conversion_syntax +basx510 toSci ' +1' -> NaN Conversion_syntax +basx511 toSci '+ 1' -> NaN Conversion_syntax +basx512 toSci '12 ' -> NaN Conversion_syntax +basx513 toSci ' + 1' -> NaN Conversion_syntax +basx514 toSci ' - 1 ' -> NaN Conversion_syntax +basx515 toSci 'x' -> NaN Conversion_syntax +basx516 toSci '-1-' -> NaN Conversion_syntax +basx517 toSci '12-' -> NaN Conversion_syntax +basx518 toSci '3+' -> NaN Conversion_syntax +basx519 toSci '' -> NaN Conversion_syntax +basx520 toSci '1e-' -> NaN Conversion_syntax +basx521 toSci '7e99999a' -> NaN Conversion_syntax +basx522 toSci '7e123567890x' -> NaN Conversion_syntax +basx523 toSci '7e12356789012x' -> NaN Conversion_syntax +basx524 toSci '' -> NaN Conversion_syntax +basx525 toSci 'e100' -> NaN Conversion_syntax +basx526 toSci '\u0e5a' -> NaN Conversion_syntax +basx527 toSci '\u0b65' -> NaN Conversion_syntax +basx528 toSci '123,65' -> NaN Conversion_syntax +basx529 toSci '1.34.5' -> NaN Conversion_syntax +basx530 toSci '.123.5' -> NaN Conversion_syntax +basx531 toSci '01.35.' -> NaN Conversion_syntax +basx532 toSci '01.35-' -> NaN Conversion_syntax +basx533 toSci '0000..' -> NaN Conversion_syntax +basx534 toSci '.0000.' -> NaN Conversion_syntax +basx535 toSci '00..00' -> NaN Conversion_syntax +basx536 toSci '111e*123' -> NaN Conversion_syntax +basx537 toSci '111e123-' -> NaN Conversion_syntax +basx538 toSci '111e+12+' -> NaN Conversion_syntax +basx539 toSci '111e1-3-' -> NaN Conversion_syntax +basx540 toSci '111e1*23' -> NaN Conversion_syntax +basx541 toSci '111e1e+3' -> NaN Conversion_syntax +basx542 toSci '1e1.0' -> NaN Conversion_syntax +basx543 toSci '1e123e' -> NaN Conversion_syntax +basx544 toSci 'ten' -> NaN Conversion_syntax +basx545 toSci 'ONE' -> NaN Conversion_syntax +basx546 toSci '1e.1' -> NaN Conversion_syntax +basx547 toSci '1e1.' -> NaN Conversion_syntax +basx548 toSci '1ee' -> NaN Conversion_syntax +basx549 toSci 'e+1' -> NaN Conversion_syntax +basx550 toSci '1.23.4' -> NaN Conversion_syntax +basx551 toSci '1.2.1' -> NaN Conversion_syntax +basx552 toSci '1E+1.2' -> NaN Conversion_syntax +basx553 toSci '1E+1.2.3' -> NaN Conversion_syntax +basx554 toSci '1E++1' -> NaN Conversion_syntax +basx555 toSci '1E--1' -> NaN Conversion_syntax +basx556 toSci '1E+-1' -> NaN Conversion_syntax +basx557 toSci '1E-+1' -> NaN Conversion_syntax +basx558 toSci '1E''1' -> NaN Conversion_syntax +basx559 toSci "1E""1" -> NaN Conversion_syntax +basx560 toSci "1E""""" -> NaN Conversion_syntax +-- Near-specials +basx561 toSci "qNaN" -> NaN Conversion_syntax +basx562 toSci "NaNq" -> NaN Conversion_syntax +basx563 toSci "NaNs" -> NaN Conversion_syntax +basx564 toSci "Infi" -> NaN Conversion_syntax +basx565 toSci "Infin" -> NaN Conversion_syntax +basx566 toSci "Infini" -> NaN Conversion_syntax +basx567 toSci "Infinit" -> NaN Conversion_syntax +basx568 toSci "-Infinit" -> NaN Conversion_syntax +basx569 toSci "0Inf" -> NaN Conversion_syntax +basx570 toSci "9Inf" -> NaN Conversion_syntax +basx571 toSci "-0Inf" -> NaN Conversion_syntax +basx572 toSci "-9Inf" -> NaN Conversion_syntax +basx573 toSci "-sNa" -> NaN Conversion_syntax +basx574 toSci "xNaN" -> NaN Conversion_syntax +basx575 toSci "0sNaN" -> NaN Conversion_syntax + +-- subnormals and overflows +basx576 toSci '99e999999999' -> Infinity Overflow Inexact Rounded +basx577 toSci '999e999999999' -> Infinity Overflow Inexact Rounded +basx578 toSci '0.9e-999999999' -> 9E-1000000000 Subnormal +basx579 toSci '0.09e-999999999' -> 9E-1000000001 Subnormal +basx580 toSci '0.1e1000000000' -> 1E+999999999 +basx581 toSci '10e-1000000000' -> 1.0E-999999999 +basx582 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded +basx583 toSci '99e-9999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +basx584 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded +basx585 toSci '1111e-9999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +basx586 toSci '1111e-99999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +basx587 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded +-- negatives the same +basx588 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded +basx589 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded +basx590 toSci '-0.9e-999999999' -> -9E-1000000000 Subnormal +basx591 toSci '-0.09e-999999999' -> -9E-1000000001 Subnormal +basx592 toSci '-0.1e1000000000' -> -1E+999999999 +basx593 toSci '-10e-1000000000' -> -1.0E-999999999 +basx594 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded +basx595 toSci '-99e-9999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +basx596 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded +basx597 toSci '-1111e-9999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +basx598 toSci '-1111e-99999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +basx599 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded + +-- Zeros +basx601 toSci 0.000000000 -> 0E-9 +basx602 toSci 0.00000000 -> 0E-8 +basx603 toSci 0.0000000 -> 0E-7 +basx604 toSci 0.000000 -> 0.000000 +basx605 toSci 0.00000 -> 0.00000 +basx606 toSci 0.0000 -> 0.0000 +basx607 toSci 0.000 -> 0.000 +basx608 toSci 0.00 -> 0.00 +basx609 toSci 0.0 -> 0.0 +basx610 toSci .0 -> 0.0 +basx611 toSci 0. -> 0 +basx612 toSci -.0 -> -0.0 +basx613 toSci -0. -> -0 +basx614 toSci -0.0 -> -0.0 +basx615 toSci -0.00 -> -0.00 +basx616 toSci -0.000 -> -0.000 +basx617 toSci -0.0000 -> -0.0000 +basx618 toSci -0.00000 -> -0.00000 +basx619 toSci -0.000000 -> -0.000000 +basx620 toSci -0.0000000 -> -0E-7 +basx621 toSci -0.00000000 -> -0E-8 +basx622 toSci -0.000000000 -> -0E-9 + +basx630 toSci 0.00E+0 -> 0.00 +basx631 toSci 0.00E+1 -> 0.0 +basx632 toSci 0.00E+2 -> 0 +basx633 toSci 0.00E+3 -> 0E+1 +basx634 toSci 0.00E+4 -> 0E+2 +basx635 toSci 0.00E+5 -> 0E+3 +basx636 toSci 0.00E+6 -> 0E+4 +basx637 toSci 0.00E+7 -> 0E+5 +basx638 toSci 0.00E+8 -> 0E+6 +basx639 toSci 0.00E+9 -> 0E+7 + +basx640 toSci 0.0E+0 -> 0.0 +basx641 toSci 0.0E+1 -> 0 +basx642 toSci 0.0E+2 -> 0E+1 +basx643 toSci 0.0E+3 -> 0E+2 +basx644 toSci 0.0E+4 -> 0E+3 +basx645 toSci 0.0E+5 -> 0E+4 +basx646 toSci 0.0E+6 -> 0E+5 +basx647 toSci 0.0E+7 -> 0E+6 +basx648 toSci 0.0E+8 -> 0E+7 +basx649 toSci 0.0E+9 -> 0E+8 + +basx650 toSci 0E+0 -> 0 +basx651 toSci 0E+1 -> 0E+1 +basx652 toSci 0E+2 -> 0E+2 +basx653 toSci 0E+3 -> 0E+3 +basx654 toSci 0E+4 -> 0E+4 +basx655 toSci 0E+5 -> 0E+5 +basx656 toSci 0E+6 -> 0E+6 +basx657 toSci 0E+7 -> 0E+7 +basx658 toSci 0E+8 -> 0E+8 +basx659 toSci 0E+9 -> 0E+9 + +basx660 toSci 0.0E-0 -> 0.0 +basx661 toSci 0.0E-1 -> 0.00 +basx662 toSci 0.0E-2 -> 0.000 +basx663 toSci 0.0E-3 -> 0.0000 +basx664 toSci 0.0E-4 -> 0.00000 +basx665 toSci 0.0E-5 -> 0.000000 +basx666 toSci 0.0E-6 -> 0E-7 +basx667 toSci 0.0E-7 -> 0E-8 +basx668 toSci 0.0E-8 -> 0E-9 +basx669 toSci 0.0E-9 -> 0E-10 + +basx670 toSci 0.00E-0 -> 0.00 +basx671 toSci 0.00E-1 -> 0.000 +basx672 toSci 0.00E-2 -> 0.0000 +basx673 toSci 0.00E-3 -> 0.00000 +basx674 toSci 0.00E-4 -> 0.000000 +basx675 toSci 0.00E-5 -> 0E-7 +basx676 toSci 0.00E-6 -> 0E-8 +basx677 toSci 0.00E-7 -> 0E-9 +basx678 toSci 0.00E-8 -> 0E-10 +basx679 toSci 0.00E-9 -> 0E-11 + +basx680 toSci 000000. -> 0 +basx681 toSci 00000. -> 0 +basx682 toSci 0000. -> 0 +basx683 toSci 000. -> 0 +basx684 toSci 00. -> 0 +basx685 toSci 0. -> 0 +basx686 toSci +00000. -> 0 +basx687 toSci -00000. -> -0 +basx688 toSci +0. -> 0 +basx689 toSci -0. -> -0 + +-- some baddies with dots and Es +basx690 toSci 'e+1' -> NaN Conversion_syntax +basx691 toSci '.e+1' -> NaN Conversion_syntax +basx692 toSci '+.e+1' -> NaN Conversion_syntax +basx693 toSci '-.e+' -> NaN Conversion_syntax +basx694 toSci '-.e' -> NaN Conversion_syntax +basx695 toSci 'E+1' -> NaN Conversion_syntax +basx696 toSci '.E+1' -> NaN Conversion_syntax +basx697 toSci '+.E+1' -> NaN Conversion_syntax +basx698 toSci '-.E+' -> NaN Conversion_syntax +basx699 toSci '-.E' -> NaN Conversion_syntax + +-- Specials +precision: 4 +basx700 toSci "NaN" -> NaN +basx701 toSci "nan" -> NaN +basx702 toSci "nAn" -> NaN +basx703 toSci "NAN" -> NaN +basx704 toSci "+NaN" -> NaN +basx705 toSci "+nan" -> NaN +basx706 toSci "+nAn" -> NaN +basx707 toSci "+NAN" -> NaN +basx708 toSci "-NaN" -> -NaN +basx709 toSci "-nan" -> -NaN +basx710 toSci "-nAn" -> -NaN +basx711 toSci "-NAN" -> -NaN +basx712 toSci 'NaN0' -> NaN +basx713 toSci 'NaN1' -> NaN1 +basx714 toSci 'NaN12' -> NaN12 +basx715 toSci 'NaN123' -> NaN123 +basx716 toSci 'NaN1234' -> NaN1234 +basx717 toSci 'NaN01' -> NaN1 +basx718 toSci 'NaN012' -> NaN12 +basx719 toSci 'NaN0123' -> NaN123 +basx720 toSci 'NaN01234' -> NaN1234 +basx721 toSci 'NaN001' -> NaN1 +basx722 toSci 'NaN0012' -> NaN12 +basx723 toSci 'NaN00123' -> NaN123 +basx724 toSci 'NaN001234' -> NaN1234 +basx725 toSci 'NaN12345' -> NaN Conversion_syntax +basx726 toSci 'NaN123e+1' -> NaN Conversion_syntax +basx727 toSci 'NaN12.45' -> NaN Conversion_syntax +basx728 toSci 'NaN-12' -> NaN Conversion_syntax +basx729 toSci 'NaN+12' -> NaN Conversion_syntax + +basx730 toSci "sNaN" -> sNaN +basx731 toSci "snan" -> sNaN +basx732 toSci "SnAn" -> sNaN +basx733 toSci "SNAN" -> sNaN +basx734 toSci "+sNaN" -> sNaN +basx735 toSci "+snan" -> sNaN +basx736 toSci "+SnAn" -> sNaN +basx737 toSci "+SNAN" -> sNaN +basx738 toSci "-sNaN" -> -sNaN +basx739 toSci "-snan" -> -sNaN +basx740 toSci "-SnAn" -> -sNaN +basx741 toSci "-SNAN" -> -sNaN +basx742 toSci 'sNaN0000' -> sNaN +basx743 toSci 'sNaN7' -> sNaN7 +basx744 toSci 'sNaN007234' -> sNaN7234 +basx745 toSci 'sNaN72345' -> NaN Conversion_syntax +basx746 toSci 'sNaN72.45' -> NaN Conversion_syntax +basx747 toSci 'sNaN-72' -> NaN Conversion_syntax + +basx748 toSci "Inf" -> Infinity +basx749 toSci "inf" -> Infinity +basx750 toSci "iNf" -> Infinity +basx751 toSci "INF" -> Infinity +basx752 toSci "+Inf" -> Infinity +basx753 toSci "+inf" -> Infinity +basx754 toSci "+iNf" -> Infinity +basx755 toSci "+INF" -> Infinity +basx756 toSci "-Inf" -> -Infinity +basx757 toSci "-inf" -> -Infinity +basx758 toSci "-iNf" -> -Infinity +basx759 toSci "-INF" -> -Infinity + +basx760 toSci "Infinity" -> Infinity +basx761 toSci "infinity" -> Infinity +basx762 toSci "iNfInItY" -> Infinity +basx763 toSci "INFINITY" -> Infinity +basx764 toSci "+Infinity" -> Infinity +basx765 toSci "+infinity" -> Infinity +basx766 toSci "+iNfInItY" -> Infinity +basx767 toSci "+INFINITY" -> Infinity +basx768 toSci "-Infinity" -> -Infinity +basx769 toSci "-infinity" -> -Infinity +basx770 toSci "-iNfInItY" -> -Infinity +basx771 toSci "-INFINITY" -> -Infinity + +-- Specials and zeros for toEng +basx772 toEng "NaN" -> NaN +basx773 toEng "-Infinity" -> -Infinity +basx774 toEng "-sNaN" -> -sNaN +basx775 toEng "-NaN" -> -NaN +basx776 toEng "+Infinity" -> Infinity +basx778 toEng "+sNaN" -> sNaN +basx779 toEng "+NaN" -> NaN +basx780 toEng "INFINITY" -> Infinity +basx781 toEng "SNAN" -> sNaN +basx782 toEng "NAN" -> NaN +basx783 toEng "infinity" -> Infinity +basx784 toEng "snan" -> sNaN +basx785 toEng "nan" -> NaN +basx786 toEng "InFINITY" -> Infinity +basx787 toEng "SnAN" -> sNaN +basx788 toEng "nAN" -> NaN +basx789 toEng "iNfinity" -> Infinity +basx790 toEng "sNan" -> sNaN +basx791 toEng "Nan" -> NaN +basx792 toEng "Infinity" -> Infinity +basx793 toEng "sNaN" -> sNaN + +-- Zero toEng, etc. +basx800 toEng 0e+1 -> "0.00E+3" -- doc example + +basx801 toEng 0.000000000 -> 0E-9 +basx802 toEng 0.00000000 -> 0.00E-6 +basx803 toEng 0.0000000 -> 0.0E-6 +basx804 toEng 0.000000 -> 0.000000 +basx805 toEng 0.00000 -> 0.00000 +basx806 toEng 0.0000 -> 0.0000 +basx807 toEng 0.000 -> 0.000 +basx808 toEng 0.00 -> 0.00 +basx809 toEng 0.0 -> 0.0 +basx810 toEng .0 -> 0.0 +basx811 toEng 0. -> 0 +basx812 toEng -.0 -> -0.0 +basx813 toEng -0. -> -0 +basx814 toEng -0.0 -> -0.0 +basx815 toEng -0.00 -> -0.00 +basx816 toEng -0.000 -> -0.000 +basx817 toEng -0.0000 -> -0.0000 +basx818 toEng -0.00000 -> -0.00000 +basx819 toEng -0.000000 -> -0.000000 +basx820 toEng -0.0000000 -> -0.0E-6 +basx821 toEng -0.00000000 -> -0.00E-6 +basx822 toEng -0.000000000 -> -0E-9 + +basx830 toEng 0.00E+0 -> 0.00 +basx831 toEng 0.00E+1 -> 0.0 +basx832 toEng 0.00E+2 -> 0 +basx833 toEng 0.00E+3 -> 0.00E+3 +basx834 toEng 0.00E+4 -> 0.0E+3 +basx835 toEng 0.00E+5 -> 0E+3 +basx836 toEng 0.00E+6 -> 0.00E+6 +basx837 toEng 0.00E+7 -> 0.0E+6 +basx838 toEng 0.00E+8 -> 0E+6 +basx839 toEng 0.00E+9 -> 0.00E+9 + +basx840 toEng 0.0E+0 -> 0.0 +basx841 toEng 0.0E+1 -> 0 +basx842 toEng 0.0E+2 -> 0.00E+3 +basx843 toEng 0.0E+3 -> 0.0E+3 +basx844 toEng 0.0E+4 -> 0E+3 +basx845 toEng 0.0E+5 -> 0.00E+6 +basx846 toEng 0.0E+6 -> 0.0E+6 +basx847 toEng 0.0E+7 -> 0E+6 +basx848 toEng 0.0E+8 -> 0.00E+9 +basx849 toEng 0.0E+9 -> 0.0E+9 + +basx850 toEng 0E+0 -> 0 +basx851 toEng 0E+1 -> 0.00E+3 +basx852 toEng 0E+2 -> 0.0E+3 +basx853 toEng 0E+3 -> 0E+3 +basx854 toEng 0E+4 -> 0.00E+6 +basx855 toEng 0E+5 -> 0.0E+6 +basx856 toEng 0E+6 -> 0E+6 +basx857 toEng 0E+7 -> 0.00E+9 +basx858 toEng 0E+8 -> 0.0E+9 +basx859 toEng 0E+9 -> 0E+9 + +basx860 toEng 0.0E-0 -> 0.0 +basx861 toEng 0.0E-1 -> 0.00 +basx862 toEng 0.0E-2 -> 0.000 +basx863 toEng 0.0E-3 -> 0.0000 +basx864 toEng 0.0E-4 -> 0.00000 +basx865 toEng 0.0E-5 -> 0.000000 +basx866 toEng 0.0E-6 -> 0.0E-6 +basx867 toEng 0.0E-7 -> 0.00E-6 +basx868 toEng 0.0E-8 -> 0E-9 +basx869 toEng 0.0E-9 -> 0.0E-9 + +basx870 toEng 0.00E-0 -> 0.00 +basx871 toEng 0.00E-1 -> 0.000 +basx872 toEng 0.00E-2 -> 0.0000 +basx873 toEng 0.00E-3 -> 0.00000 +basx874 toEng 0.00E-4 -> 0.000000 +basx875 toEng 0.00E-5 -> 0.0E-6 +basx876 toEng 0.00E-6 -> 0.00E-6 +basx877 toEng 0.00E-7 -> 0E-9 +basx878 toEng 0.00E-8 -> 0.0E-9 +basx879 toEng 0.00E-9 -> 0.00E-9 + +-- Giga exponent initial tests +maxExponent: 999999999 +minExponent: -999999999 + +basx951 toSci '99e999' -> '9.9E+1000' +basx952 toSci '999e999' -> '9.99E+1001' +basx953 toSci '0.9e-999' -> '9E-1000' +basx954 toSci '0.09e-999' -> '9E-1001' +basx955 toSci '0.1e1001' -> '1E+1000' +basx956 toSci '10e-1001' -> '1.0E-1000' +basx957 toSci '0.9e9999' -> '9E+9998' +basx958 toSci '99e-9999' -> '9.9E-9998' +basx959 toSci '111e9997' -> '1.11E+9999' +basx960 toSci '1111e-9999' -> '1.111E-9996' +basx961 toSci '99e9999' -> '9.9E+10000' +basx962 toSci '999e9999' -> '9.99E+10001' +basx963 toSci '0.9e-9999' -> '9E-10000' +basx964 toSci '0.09e-9999' -> '9E-10001' +basx965 toSci '0.1e10001' -> '1E+10000' +basx966 toSci '10e-10001' -> '1.0E-10000' +basx967 toSci '0.9e99999' -> '9E+99998' +basx968 toSci '99e-99999' -> '9.9E-99998' +basx969 toSci '111e99999' -> '1.11E+100001' +basx970 toSci '1111e-99999' -> '1.111E-99996' +basx971 toSci "0.09e999999999" -> '9E+999999997' +basx972 toSci "0.9e999999999" -> '9E+999999998' +basx973 toSci "9e999999999" -> '9E+999999999' +basx974 toSci "9.9e999999999" -> '9.9E+999999999' +basx975 toSci "9.99e999999999" -> '9.99E+999999999' +basx976 toSci "9.99e-999999999" -> '9.99E-999999999' +basx977 toSci "9.9e-999999999" -> '9.9E-999999999' +basx978 toSci "9e-999999999" -> '9E-999999999' +basx979 toSci "99e-999999999" -> '9.9E-999999998' +basx980 toSci "999e-999999999" -> '9.99E-999999997' + +-- Varying exponent maximums +precision: 5 +maxexponent: 0 +minexponent: 0 +emax001 toSci -1E+2 -> -Infinity Overflow Inexact Rounded +emax002 toSci -100 -> -Infinity Overflow Inexact Rounded +emax003 toSci -10 -> -Infinity Overflow Inexact Rounded +emax004 toSci -9.9 -> -9.9 +emax005 toSci -9 -> -9 +emax006 toSci -1 -> -1 +emax007 toSci 0 -> 0 +emax008 toSci 1 -> 1 +emax009 toSci 9 -> 9 +emax010 toSci 9.9 -> 9.9 +emax011 toSci 10 -> Infinity Overflow Inexact Rounded +emax012 toSci 100 -> Infinity Overflow Inexact Rounded +emax013 toSci 1E+2 -> Infinity Overflow Inexact Rounded +emax014 toSci 0.99 -> 0.99 Subnormal +emax015 toSci 0.1 -> 0.1 Subnormal +emax016 toSci 0.01 -> 0.01 Subnormal +emax017 toSci 1E-1 -> 0.1 Subnormal +emax018 toSci 1E-2 -> 0.01 Subnormal + +maxexponent: 1 +minexponent: -1 +emax100 toSci -1E+3 -> -Infinity Overflow Inexact Rounded +emax101 toSci -1E+2 -> -Infinity Overflow Inexact Rounded +emax102 toSci -100 -> -Infinity Overflow Inexact Rounded +emax103 toSci -10 -> -10 +emax104 toSci -9.9 -> -9.9 +emax105 toSci -9 -> -9 +emax106 toSci -1 -> -1 +emax107 toSci 0 -> 0 +emax108 toSci 1 -> 1 +emax109 toSci 9 -> 9 +emax110 toSci 9.9 -> 9.9 +emax111 toSci 10 -> 10 +emax112 toSci 100 -> Infinity Overflow Inexact Rounded +emax113 toSci 1E+2 -> Infinity Overflow Inexact Rounded +emax114 toSci 1E+3 -> Infinity Overflow Inexact Rounded +emax115 toSci 0.99 -> 0.99 +emax116 toSci 0.1 -> 0.1 +emax117 toSci 0.01 -> 0.01 Subnormal +emax118 toSci 1E-1 -> 0.1 +emax119 toSci 1E-2 -> 0.01 Subnormal +emax120 toSci 1E-3 -> 0.001 Subnormal +emax121 toSci 1.1E-3 -> 0.0011 Subnormal +emax122 toSci 1.11E-3 -> 0.00111 Subnormal +emax123 toSci 1.111E-3 -> 0.00111 Subnormal Underflow Inexact Rounded +emax124 toSci 1.1111E-3 -> 0.00111 Subnormal Underflow Inexact Rounded +emax125 toSci 1.11111E-3 -> 0.00111 Subnormal Underflow Inexact Rounded + +maxexponent: 2 +minexponent: -2 +precision: 9 +emax200 toSci -1E+3 -> -Infinity Overflow Inexact Rounded +emax201 toSci -1E+2 -> -1E+2 +emax202 toSci -100 -> -100 +emax203 toSci -10 -> -10 +emax204 toSci -9.9 -> -9.9 +emax205 toSci -9 -> -9 +emax206 toSci -1 -> -1 +emax207 toSci 0 -> 0 +emax208 toSci 1 -> 1 +emax209 toSci 9 -> 9 +emax210 toSci 9.9 -> 9.9 +emax211 toSci 10 -> 10 +emax212 toSci 100 -> 100 +emax213 toSci 1E+2 -> 1E+2 +emax214 toSci 1E+3 -> Infinity Overflow Inexact Rounded +emax215 toSci 0.99 -> 0.99 +emax216 toSci 0.1 -> 0.1 +emax217 toSci 0.01 -> 0.01 +emax218 toSci 0.001 -> 0.001 Subnormal +emax219 toSci 1E-1 -> 0.1 +emax220 toSci 1E-2 -> 0.01 +emax221 toSci 1E-3 -> 0.001 Subnormal +emax222 toSci 1E-4 -> 0.0001 Subnormal +emax223 toSci 1E-5 -> 0.00001 Subnormal +emax224 toSci 1E-6 -> 0.000001 Subnormal +emax225 toSci 1E-7 -> 1E-7 Subnormal +emax226 toSci 1E-8 -> 1E-8 Subnormal +emax227 toSci 1E-9 -> 1E-9 Subnormal +emax228 toSci 1E-10 -> 1E-10 Subnormal +emax229 toSci 1E-11 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped +emax230 toSci 1E-12 -> 0E-10 Underflow Subnormal Inexact Rounded Clamped + +maxexponent: 7 +minexponent: -7 +emax231 toSci 1E-8 -> 1E-8 Subnormal +emax232 toSci 1E-7 -> 1E-7 +emax233 toSci 1E-6 -> 0.000001 +emax234 toSci 1E-5 -> 0.00001 +emax235 toSci 1E+5 -> 1E+5 +emax236 toSci 1E+6 -> 1E+6 +emax237 toSci 1E+7 -> 1E+7 +emax238 toSci 1E+8 -> Infinity Overflow Inexact Rounded + +maxexponent: 9 +minexponent: -9 +emax240 toSci 1E-21 -> 0E-17 Subnormal Underflow Inexact Rounded Clamped +emax241 toSci 1E-10 -> 1E-10 Subnormal +emax242 toSci 1E-9 -> 1E-9 +emax243 toSci 1E-8 -> 1E-8 +emax244 toSci 1E-7 -> 1E-7 +emax245 toSci 1E+7 -> 1E+7 +emax246 toSci 1E+8 -> 1E+8 +emax247 toSci 1E+9 -> 1E+9 +emax248 toSci 1E+10 -> Infinity Overflow Inexact Rounded + +maxexponent: 10 -- boundary +minexponent: -10 +emax250 toSci 1E-21 -> 0E-18 Underflow Subnormal Inexact Rounded Clamped +emax251 toSci 1E-11 -> 1E-11 Subnormal +emax252 toSci 1E-10 -> 1E-10 +emax253 toSci 1E-9 -> 1E-9 +emax254 toSci 1E-8 -> 1E-8 +emax255 toSci 1E+8 -> 1E+8 +emax256 toSci 1E+9 -> 1E+9 +emax257 toSci 1E+10 -> 1E+10 +emax258 toSci 1E+11 -> Infinity Overflow Inexact Rounded + +emax260 toSci 1.00E-21 -> 0E-18 Underflow Subnormal Inexact Rounded Clamped +emax261 toSci 1.00E-11 -> 1.00E-11 Subnormal +emax262 toSci 1.00E-10 -> 1.00E-10 +emax263 toSci 1.00E-9 -> 1.00E-9 +emax264 toSci 1.00E-8 -> 1.00E-8 +emax265 toSci 1.00E+8 -> 1.00E+8 +emax266 toSci 1.00E+9 -> 1.00E+9 +emax267 toSci 1.00E+10 -> 1.00E+10 +emax268 toSci 1.00E+11 -> Infinity Overflow Inexact Rounded +emax270 toSci 9.99E-21 -> 0E-18 Underflow Subnormal Inexact Rounded Clamped +emax271 toSci 9.99E-11 -> 9.99E-11 Subnormal +emax272 toSci 9.99E-10 -> 9.99E-10 +emax273 toSci 9.99E-9 -> 9.99E-9 +emax274 toSci 9.99E-8 -> 9.99E-8 +emax275 toSci 9.99E+8 -> 9.99E+8 +emax276 toSci 9.99E+9 -> 9.99E+9 +emax277 toSci 9.99E+10 -> 9.99E+10 +emax278 toSci 9.99E+11 -> Infinity Overflow Inexact Rounded + +maxexponent: 99 +minexponent: -99 +emax280 toSci 1E-120 -> 0E-107 Underflow Subnormal Inexact Rounded Clamped +emax281 toSci 1E-100 -> 1E-100 Subnormal +emax282 toSci 1E-99 -> 1E-99 +emax283 toSci 1E-98 -> 1E-98 +emax284 toSci 1E+98 -> 1E+98 +emax285 toSci 1E+99 -> 1E+99 +emax286 toSci 1E+100 -> Infinity Overflow Inexact Rounded + +maxexponent: 999 +minexponent: -999 +emax291 toSci 1E-1000 -> 1E-1000 Subnormal +emax292 toSci 1E-999 -> 1E-999 +emax293 toSci 1E+999 -> 1E+999 +emax294 toSci 1E+1000 -> Infinity Overflow Inexact Rounded +maxexponent: 9999 +minexponent: -9999 +emax301 toSci 1E-10000 -> 1E-10000 Subnormal +emax302 toSci 1E-9999 -> 1E-9999 +emax303 toSci 1E+9999 -> 1E+9999 +emax304 toSci 1E+10000 -> Infinity Overflow Inexact Rounded +maxexponent: 99999 +minexponent: -99999 +emax311 toSci 1E-100000 -> 1E-100000 Subnormal +emax312 toSci 1E-99999 -> 1E-99999 +emax313 toSci 1E+99999 -> 1E+99999 +emax314 toSci 1E+100000 -> Infinity Overflow Inexact Rounded +maxexponent: 999999 +minexponent: -999999 +emax321 toSci 1E-1000000 -> 1E-1000000 Subnormal +emax322 toSci 1E-999999 -> 1E-999999 +emax323 toSci 1E+999999 -> 1E+999999 +emax324 toSci 1E+1000000 -> Infinity Overflow Inexact Rounded +maxexponent: 9999999 +minexponent: -9999999 +emax331 toSci 1E-10000000 -> 1E-10000000 Subnormal +emax332 toSci 1E-9999999 -> 1E-9999999 +emax333 toSci 1E+9999999 -> 1E+9999999 +emax334 toSci 1E+10000000 -> Infinity Overflow Inexact Rounded +maxexponent: 99999999 +minexponent: -99999999 +emax341 toSci 1E-100000000 -> 1E-100000000 Subnormal +emax342 toSci 1E-99999999 -> 1E-99999999 +emax343 toSci 1E+99999999 -> 1E+99999999 +emax344 toSci 1E+100000000 -> Infinity Overflow Inexact Rounded + +maxexponent: 999999999 +minexponent: -999999999 +emax347 toSci 1E-1000000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +emax348 toSci 1E-1000000007 -> 1E-1000000007 Subnormal +emax349 toSci 1E-1000000000 -> 1E-1000000000 Subnormal +emax350 toSci 1E-999999999 -> 1E-999999999 +emax351 toSci 1E+999999999 -> 1E+999999999 +emax352 toSci 1E+1000000000 -> Infinity Overflow Inexact Rounded +emax353 toSci 1.000E-1000000000 -> 1.000E-1000000000 Subnormal +emax354 toSci 1.000E-999999999 -> 1.000E-999999999 +emax355 toSci 1.000E+999999999 -> 1.000E+999999999 +emax356 toSci 1.000E+1000000000 -> Infinity Overflow Inexact Rounded +emax357 toSci 1.001E-1000000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +emax358 toSci 1.001E-1000000007 -> 1E-1000000007 Subnormal Inexact Rounded Underflow +emax359 toSci 1.001E-1000000000 -> 1.001E-1000000000 Subnormal +emax360 toSci 1.001E-999999999 -> 1.001E-999999999 +emax361 toSci 1.001E+999999999 -> 1.001E+999999999 +emax362 toSci 1.001E+1000000000 -> Infinity Overflow Inexact Rounded +emax363 toSci 9.000E-1000000000 -> 9.000E-1000000000 Subnormal +emax364 toSci 9.000E-999999999 -> 9.000E-999999999 +emax365 toSci 9.000E+999999999 -> 9.000E+999999999 +emax366 toSci 9.000E+1000000000 -> Infinity Overflow Inexact Rounded +emax367 toSci 9.999E-1000000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +emax368 toSci 9.999E-1000000008 -> 1E-1000000007 Underflow Subnormal Inexact Rounded +emax369 toSci 9.999E-1000000007 -> 1.0E-1000000006 Underflow Subnormal Inexact Rounded +emax370 toSci 9.999E-1000000000 -> 9.999E-1000000000 Subnormal +emax371 toSci 9.999E-999999999 -> 9.999E-999999999 +emax372 toSci 9.999E+999999999 -> 9.999E+999999999 + +emax373 toSci 9.999E+1000000000 -> Infinity Overflow Inexact Rounded +emax374 toSci -1E-1000000000 -> -1E-1000000000 Subnormal +emax375 toSci -1E-999999999 -> -1E-999999999 +emax376 toSci -1E+999999999 -> -1E+999999999 +emax377 toSci -1E+1000000000 -> -Infinity Overflow Inexact Rounded +emax378 toSci -1.000E-1000000000 -> -1.000E-1000000000 Subnormal +emax379 toSci -1.000E-999999999 -> -1.000E-999999999 +emax380 toSci -1.000E+999999999 -> -1.000E+999999999 +emax381 toSci -1.000E+1000000000 -> -Infinity Overflow Inexact Rounded +emax382 toSci -1.001E-1000000008 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +emax383 toSci -1.001E-999999999 -> -1.001E-999999999 +emax384 toSci -1.001E+999999999 -> -1.001E+999999999 +emax385 toSci -1.001E+1000000000 -> -Infinity Overflow Inexact Rounded +emax386 toSci -9.000E-1000000123 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +emax387 toSci -9.000E-999999999 -> -9.000E-999999999 +emax388 toSci -9.000E+999999999 -> -9.000E+999999999 +emax389 toSci -9.000E+1000000000 -> -Infinity Overflow Inexact Rounded +emax390 toSci -9.999E-1000000008 -> -1E-1000000007 Underflow Subnormal Inexact Rounded +emax391 toSci -9.999E-999999999 -> -9.999E-999999999 +emax392 toSci -9.999E+999999999 -> -9.999E+999999999 +emax393 toSci -9.999E+1000000000 -> -Infinity Overflow Inexact Rounded + +-- Now check 854 rounding of subnormals and proper underflow to 0 +precision: 5 +maxExponent: 999 +minexponent: -999 +rounding: half_even + +emax400 toSci 1.0000E-999 -> 1.0000E-999 +emax401 toSci 0.1E-999 -> 1E-1000 Subnormal +emax402 toSci 0.1000E-999 -> 1.000E-1000 Subnormal +emax403 toSci 0.0100E-999 -> 1.00E-1001 Subnormal +emax404 toSci 0.0010E-999 -> 1.0E-1002 Subnormal +emax405 toSci 0.0001E-999 -> 1E-1003 Subnormal +emax406 toSci 0.00010E-999 -> 1E-1003 Subnormal Rounded +emax407 toSci 0.00013E-999 -> 1E-1003 Underflow Subnormal Inexact Rounded +emax408 toSci 0.00015E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax409 toSci 0.00017E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax410 toSci 0.00023E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax411 toSci 0.00025E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax412 toSci 0.00027E-999 -> 3E-1003 Underflow Subnormal Inexact Rounded +emax413 toSci 0.000149E-999 -> 1E-1003 Underflow Subnormal Inexact Rounded +emax414 toSci 0.000150E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax415 toSci 0.000151E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax416 toSci 0.000249E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax417 toSci 0.000250E-999 -> 2E-1003 Underflow Subnormal Inexact Rounded +emax418 toSci 0.000251E-999 -> 3E-1003 Underflow Subnormal Inexact Rounded +emax419 toSci 0.00009E-999 -> 1E-1003 Underflow Subnormal Inexact Rounded +emax420 toSci 0.00005E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +emax421 toSci 0.00003E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +emax422 toSci 0.000009E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +emax423 toSci 0.000005E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +emax424 toSci 0.000003E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped + +emax425 toSci 0.001049E-999 -> 1.0E-1002 Underflow Subnormal Inexact Rounded +emax426 toSci 0.001050E-999 -> 1.0E-1002 Underflow Subnormal Inexact Rounded +emax427 toSci 0.001051E-999 -> 1.1E-1002 Underflow Subnormal Inexact Rounded +emax428 toSci 0.001149E-999 -> 1.1E-1002 Underflow Subnormal Inexact Rounded +emax429 toSci 0.001150E-999 -> 1.2E-1002 Underflow Subnormal Inexact Rounded +emax430 toSci 0.001151E-999 -> 1.2E-1002 Underflow Subnormal Inexact Rounded + +emax432 toSci 0.010049E-999 -> 1.00E-1001 Underflow Subnormal Inexact Rounded +emax433 toSci 0.010050E-999 -> 1.00E-1001 Underflow Subnormal Inexact Rounded +emax434 toSci 0.010051E-999 -> 1.01E-1001 Underflow Subnormal Inexact Rounded +emax435 toSci 0.010149E-999 -> 1.01E-1001 Underflow Subnormal Inexact Rounded +emax436 toSci 0.010150E-999 -> 1.02E-1001 Underflow Subnormal Inexact Rounded +emax437 toSci 0.010151E-999 -> 1.02E-1001 Underflow Subnormal Inexact Rounded + +emax440 toSci 0.10103E-999 -> 1.010E-1000 Underflow Subnormal Inexact Rounded +emax441 toSci 0.10105E-999 -> 1.010E-1000 Underflow Subnormal Inexact Rounded +emax442 toSci 0.10107E-999 -> 1.011E-1000 Underflow Subnormal Inexact Rounded +emax443 toSci 0.10113E-999 -> 1.011E-1000 Underflow Subnormal Inexact Rounded +emax444 toSci 0.10115E-999 -> 1.012E-1000 Underflow Subnormal Inexact Rounded +emax445 toSci 0.10117E-999 -> 1.012E-1000 Underflow Subnormal Inexact Rounded + +emax450 toSci 1.10730E-1000 -> 1.107E-1000 Underflow Subnormal Inexact Rounded +emax451 toSci 1.10750E-1000 -> 1.108E-1000 Underflow Subnormal Inexact Rounded +emax452 toSci 1.10770E-1000 -> 1.108E-1000 Underflow Subnormal Inexact Rounded +emax453 toSci 1.10830E-1000 -> 1.108E-1000 Underflow Subnormal Inexact Rounded +emax454 toSci 1.10850E-1000 -> 1.108E-1000 Underflow Subnormal Inexact Rounded +emax455 toSci 1.10870E-1000 -> 1.109E-1000 Underflow Subnormal Inexact Rounded + +-- make sure sign OK +emax456 toSci -0.10103E-999 -> -1.010E-1000 Underflow Subnormal Inexact Rounded +emax457 toSci -0.10105E-999 -> -1.010E-1000 Underflow Subnormal Inexact Rounded +emax458 toSci -0.10107E-999 -> -1.011E-1000 Underflow Subnormal Inexact Rounded +emax459 toSci -0.10113E-999 -> -1.011E-1000 Underflow Subnormal Inexact Rounded +emax460 toSci -0.10115E-999 -> -1.012E-1000 Underflow Subnormal Inexact Rounded +emax461 toSci -0.10117E-999 -> -1.012E-1000 Underflow Subnormal Inexact Rounded + +-- '999s' cases +emax464 toSci 999999E-999 -> 1.0000E-993 Inexact Rounded +emax465 toSci 99999.0E-999 -> 9.9999E-995 Rounded +emax466 toSci 99999.E-999 -> 9.9999E-995 +emax467 toSci 9999.9E-999 -> 9.9999E-996 +emax468 toSci 999.99E-999 -> 9.9999E-997 +emax469 toSci 99.999E-999 -> 9.9999E-998 +emax470 toSci 9.9999E-999 -> 9.9999E-999 +emax471 toSci 0.99999E-999 -> 1.0000E-999 Underflow Subnormal Inexact Rounded +emax472 toSci 0.099999E-999 -> 1.000E-1000 Underflow Subnormal Inexact Rounded +emax473 toSci 0.0099999E-999 -> 1.00E-1001 Underflow Subnormal Inexact Rounded +emax474 toSci 0.00099999E-999 -> 1.0E-1002 Underflow Subnormal Inexact Rounded +emax475 toSci 0.000099999E-999 -> 1E-1003 Underflow Subnormal Inexact Rounded +emax476 toSci 0.0000099999E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +emax477 toSci 0.00000099999E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +emax478 toSci 0.000000099999E-999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped + +-- Exponents with insignificant leading zeros +precision: 16 +maxExponent: 999999999 +minexponent: -999999999 +basx1001 toSci 1e999999999 -> 1E+999999999 +basx1002 toSci 1e0999999999 -> 1E+999999999 +basx1003 toSci 1e00999999999 -> 1E+999999999 +basx1004 toSci 1e000999999999 -> 1E+999999999 +basx1005 toSci 1e000000000000999999999 -> 1E+999999999 +basx1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded +basx1007 toSci 1e-999999999 -> 1E-999999999 +basx1008 toSci 1e-0999999999 -> 1E-999999999 +basx1009 toSci 1e-00999999999 -> 1E-999999999 +basx1010 toSci 1e-000999999999 -> 1E-999999999 +basx1011 toSci 1e-000000000000999999999 -> 1E-999999999 +basx1012 toSci 1e-000000000001000000007 -> 1E-1000000007 Subnormal + +-- Edge cases for int32 exponents... +basx1021 tosci 1e+2147483649 -> Infinity Overflow Inexact Rounded +basx1022 tosci 1e+2147483648 -> Infinity Overflow Inexact Rounded +basx1023 tosci 1e+2147483647 -> Infinity Overflow Inexact Rounded +basx1024 tosci 1e-2147483647 -> 0E-1000000014 Underflow Subnormal Inexact Rounded Clamped +basx1025 tosci 1e-2147483648 -> 0E-1000000014 Underflow Subnormal Inexact Rounded Clamped +basx1026 tosci 1e-2147483649 -> 0E-1000000014 Underflow Subnormal Inexact Rounded Clamped +-- same unbalanced +precision: 7 +maxExponent: 96 +minexponent: -95 +basx1031 tosci 1e+2147483649 -> Infinity Overflow Inexact Rounded +basx1032 tosci 1e+2147483648 -> Infinity Overflow Inexact Rounded +basx1033 tosci 1e+2147483647 -> Infinity Overflow Inexact Rounded +basx1034 tosci 1e-2147483647 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +basx1035 tosci 1e-2147483648 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +basx1036 tosci 1e-2147483649 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped + +-- check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +basx1041 toSci 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +basx1042 toSci 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow +basx1043 toSci 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +-- clamped zeros [see also clamped.decTest] +precision: 34 +maxExponent: 6144 +minExponent: -6143 + +basx1061 apply 0e+10000 -> 0E+6144 Clamped +basx1062 apply 0e-10000 -> 0E-6176 Clamped +basx1063 apply -0e+10000 -> -0E+6144 Clamped +basx1064 apply -0e-10000 -> -0E-6176 Clamped + + + + + + + Added: sandbox/trunk/decimal-c/new_dt/clamp.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/clamp.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,211 @@ +------------------------------------------------------------------------ +-- clamp.decTest -- clamped exponent tests (format-independent) -- +-- Copyright (c) IBM Corporation, 2000, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- This set of tests uses the same limits as the 8-byte concrete +-- representation, but applies clamping without using format-specific +-- conversions. + +extended: 1 +precision: 16 +rounding: half_even +maxExponent: 384 +minExponent: -383 +clamp: 1 + +-- General testcases + +-- Normality +clam010 apply 1234567890123456 -> 1234567890123456 +clam011 apply 1234567890123456.0 -> 1234567890123456 Rounded +clam012 apply 1234567890123456.1 -> 1234567890123456 Rounded Inexact +clam013 apply -1234567890123456 -> -1234567890123456 +clam014 apply -1234567890123456.0 -> -1234567890123456 Rounded +clam015 apply -1234567890123456.1 -> -1234567890123456 Rounded Inexact + + +-- Nmax and similar +clam022 apply 9.999999999999999E+384 -> 9.999999999999999E+384 +clam024 apply 1.234567890123456E+384 -> 1.234567890123456E+384 +-- fold-downs (more below) +clam030 apply 1.23E+384 -> 1.230000000000000E+384 Clamped +clam032 apply 1E+384 -> 1.000000000000000E+384 Clamped + +clam051 apply 12345 -> 12345 +clam053 apply 1234 -> 1234 +clam055 apply 123 -> 123 +clam057 apply 12 -> 12 +clam059 apply 1 -> 1 +clam061 apply 1.23 -> 1.23 +clam063 apply 123.45 -> 123.45 + +-- Nmin and below +clam071 apply 1E-383 -> 1E-383 +clam073 apply 1.000000000000000E-383 -> 1.000000000000000E-383 +clam075 apply 1.000000000000001E-383 -> 1.000000000000001E-383 + +clam077 apply 0.100000000000000E-383 -> 1.00000000000000E-384 Subnormal +clam079 apply 0.000000000000010E-383 -> 1.0E-397 Subnormal +clam081 apply 0.00000000000001E-383 -> 1E-397 Subnormal +clam083 apply 0.000000000000001E-383 -> 1E-398 Subnormal + +-- underflows +clam090 apply 1e-398 -> #0000000000000001 Subnormal +clam091 apply 1.9e-398 -> #0000000000000002 Subnormal Underflow Inexact Rounded +clam092 apply 1.1e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded +clam093 apply 1.00000000001e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded +clam094 apply 1.00000000000001e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded +clam095 apply 1.000000000000001e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded +clam096 apply 0.1e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped +clam097 apply 0.00000000001e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped +clam098 apply 0.00000000000001e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped +clam099 apply 0.000000000000001e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped + +-- Same again, negatives +-- Nmax and similar +clam122 apply -9.999999999999999E+384 -> -9.999999999999999E+384 +clam124 apply -1.234567890123456E+384 -> -1.234567890123456E+384 +-- fold-downs (more below) +clam130 apply -1.23E+384 -> -1.230000000000000E+384 Clamped +clam132 apply -1E+384 -> -1.000000000000000E+384 Clamped + +clam151 apply -12345 -> -12345 +clam153 apply -1234 -> -1234 +clam155 apply -123 -> -123 +clam157 apply -12 -> -12 +clam159 apply -1 -> -1 +clam161 apply -1.23 -> -1.23 +clam163 apply -123.45 -> -123.45 + +-- Nmin and below +clam171 apply -1E-383 -> -1E-383 +clam173 apply -1.000000000000000E-383 -> -1.000000000000000E-383 +clam175 apply -1.000000000000001E-383 -> -1.000000000000001E-383 + +clam177 apply -0.100000000000000E-383 -> -1.00000000000000E-384 Subnormal +clam179 apply -0.000000000000010E-383 -> -1.0E-397 Subnormal +clam181 apply -0.00000000000001E-383 -> -1E-397 Subnormal +clam183 apply -0.000000000000001E-383 -> -1E-398 Subnormal + +-- underflows +clam189 apply -1e-398 -> #8000000000000001 Subnormal +clam190 apply -1.0e-398 -> #8000000000000001 Subnormal Rounded +clam191 apply -1.9e-398 -> #8000000000000002 Subnormal Underflow Inexact Rounded +clam192 apply -1.1e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded +clam193 apply -1.00000000001e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded +clam194 apply -1.00000000000001e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded +clam195 apply -1.000000000000001e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded +clam196 apply -0.1e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped +clam197 apply -0.00000000001e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped +clam198 apply -0.00000000000001e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped +clam199 apply -0.000000000000001e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped + +-- zeros +clam401 apply 0E-500 -> 0E-398 Clamped +clam402 apply 0E-400 -> 0E-398 Clamped +clam403 apply 0E-398 -> 0E-398 +clam404 apply 0.000000000000000E-383 -> 0E-398 +clam405 apply 0E-2 -> 0.00 +clam406 apply 0 -> 0 +clam407 apply 0E+3 -> 0E+3 +clam408 apply 0E+369 -> 0E+369 +-- clamped zeros... +clam410 apply 0E+370 -> 0E+369 Clamped +clam411 apply 0E+384 -> 0E+369 Clamped +clam412 apply 0E+400 -> 0E+369 Clamped +clam413 apply 0E+500 -> 0E+369 Clamped + +-- negative zeros +clam420 apply -0E-500 -> -0E-398 Clamped +clam421 apply -0E-400 -> -0E-398 Clamped +clam422 apply -0E-398 -> -0E-398 +clam423 apply -0.000000000000000E-383 -> -0E-398 +clam424 apply -0E-2 -> -0.00 +clam425 apply -0 -> -0 +clam426 apply -0E+3 -> -0E+3 +clam427 apply -0E+369 -> -0E+369 +-- clamped zeros... +clam431 apply -0E+370 -> -0E+369 Clamped +clam432 apply -0E+384 -> -0E+369 Clamped +clam433 apply -0E+400 -> -0E+369 Clamped +clam434 apply -0E+500 -> -0E+369 Clamped + +-- fold-down full sequence +clam601 apply 1E+384 -> 1.000000000000000E+384 Clamped +clam603 apply 1E+383 -> 1.00000000000000E+383 Clamped +clam605 apply 1E+382 -> 1.0000000000000E+382 Clamped +clam607 apply 1E+381 -> 1.000000000000E+381 Clamped +clam609 apply 1E+380 -> 1.00000000000E+380 Clamped +clam611 apply 1E+379 -> 1.0000000000E+379 Clamped +clam613 apply 1E+378 -> 1.000000000E+378 Clamped +clam615 apply 1E+377 -> 1.00000000E+377 Clamped +clam617 apply 1E+376 -> 1.0000000E+376 Clamped +clam619 apply 1E+375 -> 1.000000E+375 Clamped +clam621 apply 1E+374 -> 1.00000E+374 Clamped +clam623 apply 1E+373 -> 1.0000E+373 Clamped +clam625 apply 1E+372 -> 1.000E+372 Clamped +clam627 apply 1E+371 -> 1.00E+371 Clamped +clam629 apply 1E+370 -> 1.0E+370 Clamped +clam631 apply 1E+369 -> 1E+369 +clam633 apply 1E+368 -> 1E+368 +-- same with 9s +clam641 apply 9E+384 -> 9.000000000000000E+384 Clamped +clam643 apply 9E+383 -> 9.00000000000000E+383 Clamped +clam645 apply 9E+382 -> 9.0000000000000E+382 Clamped +clam647 apply 9E+381 -> 9.000000000000E+381 Clamped +clam649 apply 9E+380 -> 9.00000000000E+380 Clamped +clam651 apply 9E+379 -> 9.0000000000E+379 Clamped +clam653 apply 9E+378 -> 9.000000000E+378 Clamped +clam655 apply 9E+377 -> 9.00000000E+377 Clamped +clam657 apply 9E+376 -> 9.0000000E+376 Clamped +clam659 apply 9E+375 -> 9.000000E+375 Clamped +clam661 apply 9E+374 -> 9.00000E+374 Clamped +clam663 apply 9E+373 -> 9.0000E+373 Clamped +clam665 apply 9E+372 -> 9.000E+372 Clamped +clam667 apply 9E+371 -> 9.00E+371 Clamped +clam669 apply 9E+370 -> 9.0E+370 Clamped +clam671 apply 9E+369 -> 9E+369 +clam673 apply 9E+368 -> 9E+368 + +-- subnormals clamped to 0-Etiny +precision: 16 +maxExponent: 384 +minExponent: -383 +clam681 apply 7E-398 -> 7E-398 Subnormal +clam682 apply 0E-398 -> 0E-398 +clam683 apply 7E-399 -> 1E-398 Subnormal Underflow Inexact Rounded +clam684 apply 4E-399 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded +clam685 apply 7E-400 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded +clam686 apply 7E-401 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded +clam687 apply 0E-399 -> 0E-398 Clamped +clam688 apply 0E-400 -> 0E-398 Clamped +clam689 apply 0E-401 -> 0E-398 Clamped + +-- example from documentation +precision: 7 +rounding: half_even +maxExponent: +96 +minExponent: -95 + +clamp: 0 +clam700 apply 1.23E+96 -> 1.23E+96 + +clamp: 1 +clam701 apply 1.23E+96 -> 1.230000E+96 Clamped Added: sandbox/trunk/decimal-c/new_dt/compare.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/compare.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,717 @@ +------------------------------------------------------------------------ +-- compare.decTest -- decimal comparison -- +-- Copyright (c) IBM Corporation, 1981, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- Note that we cannot assume add/subtract tests cover paths adequately, +-- here, because the code might be quite different (comparison cannot +-- overflow or underflow, so actual subtractions are not necessary). + +extended: 1 + +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +-- sanity checks +comx001 compare -2 -2 -> 0 +comx002 compare -2 -1 -> -1 +comx003 compare -2 0 -> -1 +comx004 compare -2 1 -> -1 +comx005 compare -2 2 -> -1 +comx006 compare -1 -2 -> 1 +comx007 compare -1 -1 -> 0 +comx008 compare -1 0 -> -1 +comx009 compare -1 1 -> -1 +comx010 compare -1 2 -> -1 +comx011 compare 0 -2 -> 1 +comx012 compare 0 -1 -> 1 +comx013 compare 0 0 -> 0 +comx014 compare 0 1 -> -1 +comx015 compare 0 2 -> -1 +comx016 compare 1 -2 -> 1 +comx017 compare 1 -1 -> 1 +comx018 compare 1 0 -> 1 +comx019 compare 1 1 -> 0 +comx020 compare 1 2 -> -1 +comx021 compare 2 -2 -> 1 +comx022 compare 2 -1 -> 1 +comx023 compare 2 0 -> 1 +comx025 compare 2 1 -> 1 +comx026 compare 2 2 -> 0 + +comx031 compare -20 -20 -> 0 +comx032 compare -20 -10 -> -1 +comx033 compare -20 00 -> -1 +comx034 compare -20 10 -> -1 +comx035 compare -20 20 -> -1 +comx036 compare -10 -20 -> 1 +comx037 compare -10 -10 -> 0 +comx038 compare -10 00 -> -1 +comx039 compare -10 10 -> -1 +comx040 compare -10 20 -> -1 +comx041 compare 00 -20 -> 1 +comx042 compare 00 -10 -> 1 +comx043 compare 00 00 -> 0 +comx044 compare 00 10 -> -1 +comx045 compare 00 20 -> -1 +comx046 compare 10 -20 -> 1 +comx047 compare 10 -10 -> 1 +comx048 compare 10 00 -> 1 +comx049 compare 10 10 -> 0 +comx050 compare 10 20 -> -1 +comx051 compare 20 -20 -> 1 +comx052 compare 20 -10 -> 1 +comx053 compare 20 00 -> 1 +comx055 compare 20 10 -> 1 +comx056 compare 20 20 -> 0 + +comx061 compare -2.0 -2.0 -> 0 +comx062 compare -2.0 -1.0 -> -1 +comx063 compare -2.0 0.0 -> -1 +comx064 compare -2.0 1.0 -> -1 +comx065 compare -2.0 2.0 -> -1 +comx066 compare -1.0 -2.0 -> 1 +comx067 compare -1.0 -1.0 -> 0 +comx068 compare -1.0 0.0 -> -1 +comx069 compare -1.0 1.0 -> -1 +comx070 compare -1.0 2.0 -> -1 +comx071 compare 0.0 -2.0 -> 1 +comx072 compare 0.0 -1.0 -> 1 +comx073 compare 0.0 0.0 -> 0 +comx074 compare 0.0 1.0 -> -1 +comx075 compare 0.0 2.0 -> -1 +comx076 compare 1.0 -2.0 -> 1 +comx077 compare 1.0 -1.0 -> 1 +comx078 compare 1.0 0.0 -> 1 +comx079 compare 1.0 1.0 -> 0 +comx080 compare 1.0 2.0 -> -1 +comx081 compare 2.0 -2.0 -> 1 +comx082 compare 2.0 -1.0 -> 1 +comx083 compare 2.0 0.0 -> 1 +comx085 compare 2.0 1.0 -> 1 +comx086 compare 2.0 2.0 -> 0 + +-- now some cases which might overflow if subtract were used +maxexponent: 999999999 +minexponent: -999999999 +comx090 compare 9.99999999E+999999999 9.99999999E+999999999 -> 0 +comx091 compare -9.99999999E+999999999 9.99999999E+999999999 -> -1 +comx092 compare 9.99999999E+999999999 -9.99999999E+999999999 -> 1 +comx093 compare -9.99999999E+999999999 -9.99999999E+999999999 -> 0 + +-- some differing length/exponent cases +comx100 compare 7.0 7.0 -> 0 +comx101 compare 7.0 7 -> 0 +comx102 compare 7 7.0 -> 0 +comx103 compare 7E+0 7.0 -> 0 +comx104 compare 70E-1 7.0 -> 0 +comx105 compare 0.7E+1 7 -> 0 +comx106 compare 70E-1 7 -> 0 +comx107 compare 7.0 7E+0 -> 0 +comx108 compare 7.0 70E-1 -> 0 +comx109 compare 7 0.7E+1 -> 0 +comx110 compare 7 70E-1 -> 0 + +comx120 compare 8.0 7.0 -> 1 +comx121 compare 8.0 7 -> 1 +comx122 compare 8 7.0 -> 1 +comx123 compare 8E+0 7.0 -> 1 +comx124 compare 80E-1 7.0 -> 1 +comx125 compare 0.8E+1 7 -> 1 +comx126 compare 80E-1 7 -> 1 +comx127 compare 8.0 7E+0 -> 1 +comx128 compare 8.0 70E-1 -> 1 +comx129 compare 8 0.7E+1 -> 1 +comx130 compare 8 70E-1 -> 1 + +comx140 compare 8.0 9.0 -> -1 +comx141 compare 8.0 9 -> -1 +comx142 compare 8 9.0 -> -1 +comx143 compare 8E+0 9.0 -> -1 +comx144 compare 80E-1 9.0 -> -1 +comx145 compare 0.8E+1 9 -> -1 +comx146 compare 80E-1 9 -> -1 +comx147 compare 8.0 9E+0 -> -1 +comx148 compare 8.0 90E-1 -> -1 +comx149 compare 8 0.9E+1 -> -1 +comx150 compare 8 90E-1 -> -1 + +-- and again, with sign changes -+ .. +comx200 compare -7.0 7.0 -> -1 +comx201 compare -7.0 7 -> -1 +comx202 compare -7 7.0 -> -1 +comx203 compare -7E+0 7.0 -> -1 +comx204 compare -70E-1 7.0 -> -1 +comx205 compare -0.7E+1 7 -> -1 +comx206 compare -70E-1 7 -> -1 +comx207 compare -7.0 7E+0 -> -1 +comx208 compare -7.0 70E-1 -> -1 +comx209 compare -7 0.7E+1 -> -1 +comx210 compare -7 70E-1 -> -1 + +comx220 compare -8.0 7.0 -> -1 +comx221 compare -8.0 7 -> -1 +comx222 compare -8 7.0 -> -1 +comx223 compare -8E+0 7.0 -> -1 +comx224 compare -80E-1 7.0 -> -1 +comx225 compare -0.8E+1 7 -> -1 +comx226 compare -80E-1 7 -> -1 +comx227 compare -8.0 7E+0 -> -1 +comx228 compare -8.0 70E-1 -> -1 +comx229 compare -8 0.7E+1 -> -1 +comx230 compare -8 70E-1 -> -1 + +comx240 compare -8.0 9.0 -> -1 +comx241 compare -8.0 9 -> -1 +comx242 compare -8 9.0 -> -1 +comx243 compare -8E+0 9.0 -> -1 +comx244 compare -80E-1 9.0 -> -1 +comx245 compare -0.8E+1 9 -> -1 +comx246 compare -80E-1 9 -> -1 +comx247 compare -8.0 9E+0 -> -1 +comx248 compare -8.0 90E-1 -> -1 +comx249 compare -8 0.9E+1 -> -1 +comx250 compare -8 90E-1 -> -1 + +-- and again, with sign changes +- .. +comx300 compare 7.0 -7.0 -> 1 +comx301 compare 7.0 -7 -> 1 +comx302 compare 7 -7.0 -> 1 +comx303 compare 7E+0 -7.0 -> 1 +comx304 compare 70E-1 -7.0 -> 1 +comx305 compare .7E+1 -7 -> 1 +comx306 compare 70E-1 -7 -> 1 +comx307 compare 7.0 -7E+0 -> 1 +comx308 compare 7.0 -70E-1 -> 1 +comx309 compare 7 -.7E+1 -> 1 +comx310 compare 7 -70E-1 -> 1 + +comx320 compare 8.0 -7.0 -> 1 +comx321 compare 8.0 -7 -> 1 +comx322 compare 8 -7.0 -> 1 +comx323 compare 8E+0 -7.0 -> 1 +comx324 compare 80E-1 -7.0 -> 1 +comx325 compare .8E+1 -7 -> 1 +comx326 compare 80E-1 -7 -> 1 +comx327 compare 8.0 -7E+0 -> 1 +comx328 compare 8.0 -70E-1 -> 1 +comx329 compare 8 -.7E+1 -> 1 +comx330 compare 8 -70E-1 -> 1 + +comx340 compare 8.0 -9.0 -> 1 +comx341 compare 8.0 -9 -> 1 +comx342 compare 8 -9.0 -> 1 +comx343 compare 8E+0 -9.0 -> 1 +comx344 compare 80E-1 -9.0 -> 1 +comx345 compare .8E+1 -9 -> 1 +comx346 compare 80E-1 -9 -> 1 +comx347 compare 8.0 -9E+0 -> 1 +comx348 compare 8.0 -90E-1 -> 1 +comx349 compare 8 -.9E+1 -> 1 +comx350 compare 8 -90E-1 -> 1 + +-- and again, with sign changes -- .. +comx400 compare -7.0 -7.0 -> 0 +comx401 compare -7.0 -7 -> 0 +comx402 compare -7 -7.0 -> 0 +comx403 compare -7E+0 -7.0 -> 0 +comx404 compare -70E-1 -7.0 -> 0 +comx405 compare -.7E+1 -7 -> 0 +comx406 compare -70E-1 -7 -> 0 +comx407 compare -7.0 -7E+0 -> 0 +comx408 compare -7.0 -70E-1 -> 0 +comx409 compare -7 -.7E+1 -> 0 +comx410 compare -7 -70E-1 -> 0 + +comx420 compare -8.0 -7.0 -> -1 +comx421 compare -8.0 -7 -> -1 +comx422 compare -8 -7.0 -> -1 +comx423 compare -8E+0 -7.0 -> -1 +comx424 compare -80E-1 -7.0 -> -1 +comx425 compare -.8E+1 -7 -> -1 +comx426 compare -80E-1 -7 -> -1 +comx427 compare -8.0 -7E+0 -> -1 +comx428 compare -8.0 -70E-1 -> -1 +comx429 compare -8 -.7E+1 -> -1 +comx430 compare -8 -70E-1 -> -1 + +comx440 compare -8.0 -9.0 -> 1 +comx441 compare -8.0 -9 -> 1 +comx442 compare -8 -9.0 -> 1 +comx443 compare -8E+0 -9.0 -> 1 +comx444 compare -80E-1 -9.0 -> 1 +comx445 compare -.8E+1 -9 -> 1 +comx446 compare -80E-1 -9 -> 1 +comx447 compare -8.0 -9E+0 -> 1 +comx448 compare -8.0 -90E-1 -> 1 +comx449 compare -8 -.9E+1 -> 1 +comx450 compare -8 -90E-1 -> 1 + + +-- testcases that subtract to lots of zeros at boundaries [pgr] +precision: 40 +comx470 compare 123.4560000000000000E789 123.456E789 -> 0 +comx471 compare 123.456000000000000E-89 123.456E-89 -> 0 +comx472 compare 123.45600000000000E789 123.456E789 -> 0 +comx473 compare 123.4560000000000E-89 123.456E-89 -> 0 +comx474 compare 123.456000000000E789 123.456E789 -> 0 +comx475 compare 123.45600000000E-89 123.456E-89 -> 0 +comx476 compare 123.4560000000E789 123.456E789 -> 0 +comx477 compare 123.456000000E-89 123.456E-89 -> 0 +comx478 compare 123.45600000E789 123.456E789 -> 0 +comx479 compare 123.4560000E-89 123.456E-89 -> 0 +comx480 compare 123.456000E789 123.456E789 -> 0 +comx481 compare 123.45600E-89 123.456E-89 -> 0 +comx482 compare 123.4560E789 123.456E789 -> 0 +comx483 compare 123.456E-89 123.456E-89 -> 0 +comx484 compare 123.456E-89 123.4560000000000000E-89 -> 0 +comx485 compare 123.456E789 123.456000000000000E789 -> 0 +comx486 compare 123.456E-89 123.45600000000000E-89 -> 0 +comx487 compare 123.456E789 123.4560000000000E789 -> 0 +comx488 compare 123.456E-89 123.456000000000E-89 -> 0 +comx489 compare 123.456E789 123.45600000000E789 -> 0 +comx490 compare 123.456E-89 123.4560000000E-89 -> 0 +comx491 compare 123.456E789 123.456000000E789 -> 0 +comx492 compare 123.456E-89 123.45600000E-89 -> 0 +comx493 compare 123.456E789 123.4560000E789 -> 0 +comx494 compare 123.456E-89 123.456000E-89 -> 0 +comx495 compare 123.456E789 123.45600E789 -> 0 +comx496 compare 123.456E-89 123.4560E-89 -> 0 +comx497 compare 123.456E789 123.456E789 -> 0 + +-- wide-ranging, around precision; signs equal +precision: 9 +comx500 compare 1 1E-15 -> 1 +comx501 compare 1 1E-14 -> 1 +comx502 compare 1 1E-13 -> 1 +comx503 compare 1 1E-12 -> 1 +comx504 compare 1 1E-11 -> 1 +comx505 compare 1 1E-10 -> 1 +comx506 compare 1 1E-9 -> 1 +comx507 compare 1 1E-8 -> 1 +comx508 compare 1 1E-7 -> 1 +comx509 compare 1 1E-6 -> 1 +comx510 compare 1 1E-5 -> 1 +comx511 compare 1 1E-4 -> 1 +comx512 compare 1 1E-3 -> 1 +comx513 compare 1 1E-2 -> 1 +comx514 compare 1 1E-1 -> 1 +comx515 compare 1 1E-0 -> 0 +comx516 compare 1 1E+1 -> -1 +comx517 compare 1 1E+2 -> -1 +comx518 compare 1 1E+3 -> -1 +comx519 compare 1 1E+4 -> -1 +comx521 compare 1 1E+5 -> -1 +comx522 compare 1 1E+6 -> -1 +comx523 compare 1 1E+7 -> -1 +comx524 compare 1 1E+8 -> -1 +comx525 compare 1 1E+9 -> -1 +comx526 compare 1 1E+10 -> -1 +comx527 compare 1 1E+11 -> -1 +comx528 compare 1 1E+12 -> -1 +comx529 compare 1 1E+13 -> -1 +comx530 compare 1 1E+14 -> -1 +comx531 compare 1 1E+15 -> -1 +-- LR swap +comx540 compare 1E-15 1 -> -1 +comx541 compare 1E-14 1 -> -1 +comx542 compare 1E-13 1 -> -1 +comx543 compare 1E-12 1 -> -1 +comx544 compare 1E-11 1 -> -1 +comx545 compare 1E-10 1 -> -1 +comx546 compare 1E-9 1 -> -1 +comx547 compare 1E-8 1 -> -1 +comx548 compare 1E-7 1 -> -1 +comx549 compare 1E-6 1 -> -1 +comx550 compare 1E-5 1 -> -1 +comx551 compare 1E-4 1 -> -1 +comx552 compare 1E-3 1 -> -1 +comx553 compare 1E-2 1 -> -1 +comx554 compare 1E-1 1 -> -1 +comx555 compare 1E-0 1 -> 0 +comx556 compare 1E+1 1 -> 1 +comx557 compare 1E+2 1 -> 1 +comx558 compare 1E+3 1 -> 1 +comx559 compare 1E+4 1 -> 1 +comx561 compare 1E+5 1 -> 1 +comx562 compare 1E+6 1 -> 1 +comx563 compare 1E+7 1 -> 1 +comx564 compare 1E+8 1 -> 1 +comx565 compare 1E+9 1 -> 1 +comx566 compare 1E+10 1 -> 1 +comx567 compare 1E+11 1 -> 1 +comx568 compare 1E+12 1 -> 1 +comx569 compare 1E+13 1 -> 1 +comx570 compare 1E+14 1 -> 1 +comx571 compare 1E+15 1 -> 1 +-- similar with an useful coefficient, one side only +comx580 compare 0.000000987654321 1E-15 -> 1 +comx581 compare 0.000000987654321 1E-14 -> 1 +comx582 compare 0.000000987654321 1E-13 -> 1 +comx583 compare 0.000000987654321 1E-12 -> 1 +comx584 compare 0.000000987654321 1E-11 -> 1 +comx585 compare 0.000000987654321 1E-10 -> 1 +comx586 compare 0.000000987654321 1E-9 -> 1 +comx587 compare 0.000000987654321 1E-8 -> 1 +comx588 compare 0.000000987654321 1E-7 -> 1 +comx589 compare 0.000000987654321 1E-6 -> -1 +comx590 compare 0.000000987654321 1E-5 -> -1 +comx591 compare 0.000000987654321 1E-4 -> -1 +comx592 compare 0.000000987654321 1E-3 -> -1 +comx593 compare 0.000000987654321 1E-2 -> -1 +comx594 compare 0.000000987654321 1E-1 -> -1 +comx595 compare 0.000000987654321 1E-0 -> -1 +comx596 compare 0.000000987654321 1E+1 -> -1 +comx597 compare 0.000000987654321 1E+2 -> -1 +comx598 compare 0.000000987654321 1E+3 -> -1 +comx599 compare 0.000000987654321 1E+4 -> -1 + +-- check some unit-y traps +precision: 20 +comx600 compare 12 12.2345 -> -1 +comx601 compare 12.0 12.2345 -> -1 +comx602 compare 12.00 12.2345 -> -1 +comx603 compare 12.000 12.2345 -> -1 +comx604 compare 12.0000 12.2345 -> -1 +comx605 compare 12.00000 12.2345 -> -1 +comx606 compare 12.000000 12.2345 -> -1 +comx607 compare 12.0000000 12.2345 -> -1 +comx608 compare 12.00000000 12.2345 -> -1 +comx609 compare 12.000000000 12.2345 -> -1 +comx610 compare 12.1234 12 -> 1 +comx611 compare 12.1234 12.0 -> 1 +comx612 compare 12.1234 12.00 -> 1 +comx613 compare 12.1234 12.000 -> 1 +comx614 compare 12.1234 12.0000 -> 1 +comx615 compare 12.1234 12.00000 -> 1 +comx616 compare 12.1234 12.000000 -> 1 +comx617 compare 12.1234 12.0000000 -> 1 +comx618 compare 12.1234 12.00000000 -> 1 +comx619 compare 12.1234 12.000000000 -> 1 +comx620 compare -12 -12.2345 -> 1 +comx621 compare -12.0 -12.2345 -> 1 +comx622 compare -12.00 -12.2345 -> 1 +comx623 compare -12.000 -12.2345 -> 1 +comx624 compare -12.0000 -12.2345 -> 1 +comx625 compare -12.00000 -12.2345 -> 1 +comx626 compare -12.000000 -12.2345 -> 1 +comx627 compare -12.0000000 -12.2345 -> 1 +comx628 compare -12.00000000 -12.2345 -> 1 +comx629 compare -12.000000000 -12.2345 -> 1 +comx630 compare -12.1234 -12 -> -1 +comx631 compare -12.1234 -12.0 -> -1 +comx632 compare -12.1234 -12.00 -> -1 +comx633 compare -12.1234 -12.000 -> -1 +comx634 compare -12.1234 -12.0000 -> -1 +comx635 compare -12.1234 -12.00000 -> -1 +comx636 compare -12.1234 -12.000000 -> -1 +comx637 compare -12.1234 -12.0000000 -> -1 +comx638 compare -12.1234 -12.00000000 -> -1 +comx639 compare -12.1234 -12.000000000 -> -1 +precision: 9 + +-- extended zeros +comx640 compare 0 0 -> 0 +comx641 compare 0 -0 -> 0 +comx642 compare 0 -0.0 -> 0 +comx643 compare 0 0.0 -> 0 +comx644 compare -0 0 -> 0 +comx645 compare -0 -0 -> 0 +comx646 compare -0 -0.0 -> 0 +comx647 compare -0 0.0 -> 0 +comx648 compare 0.0 0 -> 0 +comx649 compare 0.0 -0 -> 0 +comx650 compare 0.0 -0.0 -> 0 +comx651 compare 0.0 0.0 -> 0 +comx652 compare -0.0 0 -> 0 +comx653 compare -0.0 -0 -> 0 +comx654 compare -0.0 -0.0 -> 0 +comx655 compare -0.0 0.0 -> 0 + +comx656 compare -0E1 0.0 -> 0 +comx657 compare -0E2 0.0 -> 0 +comx658 compare 0E1 0.0 -> 0 +comx659 compare 0E2 0.0 -> 0 +comx660 compare -0E1 0 -> 0 +comx661 compare -0E2 0 -> 0 +comx662 compare 0E1 0 -> 0 +comx663 compare 0E2 0 -> 0 +comx664 compare -0E1 -0E1 -> 0 +comx665 compare -0E2 -0E1 -> 0 +comx666 compare 0E1 -0E1 -> 0 +comx667 compare 0E2 -0E1 -> 0 +comx668 compare -0E1 -0E2 -> 0 +comx669 compare -0E2 -0E2 -> 0 +comx670 compare 0E1 -0E2 -> 0 +comx671 compare 0E2 -0E2 -> 0 +comx672 compare -0E1 0E1 -> 0 +comx673 compare -0E2 0E1 -> 0 +comx674 compare 0E1 0E1 -> 0 +comx675 compare 0E2 0E1 -> 0 +comx676 compare -0E1 0E2 -> 0 +comx677 compare -0E2 0E2 -> 0 +comx678 compare 0E1 0E2 -> 0 +comx679 compare 0E2 0E2 -> 0 + +-- trailing zeros; unit-y +precision: 20 +comx680 compare 12 12 -> 0 +comx681 compare 12 12.0 -> 0 +comx682 compare 12 12.00 -> 0 +comx683 compare 12 12.000 -> 0 +comx684 compare 12 12.0000 -> 0 +comx685 compare 12 12.00000 -> 0 +comx686 compare 12 12.000000 -> 0 +comx687 compare 12 12.0000000 -> 0 +comx688 compare 12 12.00000000 -> 0 +comx689 compare 12 12.000000000 -> 0 +comx690 compare 12 12 -> 0 +comx691 compare 12.0 12 -> 0 +comx692 compare 12.00 12 -> 0 +comx693 compare 12.000 12 -> 0 +comx694 compare 12.0000 12 -> 0 +comx695 compare 12.00000 12 -> 0 +comx696 compare 12.000000 12 -> 0 +comx697 compare 12.0000000 12 -> 0 +comx698 compare 12.00000000 12 -> 0 +comx699 compare 12.000000000 12 -> 0 + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +comx701 compare 12345678000 1 -> 1 +comx702 compare 1 12345678000 -> -1 +comx703 compare 1234567800 1 -> 1 +comx704 compare 1 1234567800 -> -1 +comx705 compare 1234567890 1 -> 1 +comx706 compare 1 1234567890 -> -1 +comx707 compare 1234567891 1 -> 1 +comx708 compare 1 1234567891 -> -1 +comx709 compare 12345678901 1 -> 1 +comx710 compare 1 12345678901 -> -1 +comx711 compare 1234567896 1 -> 1 +comx712 compare 1 1234567896 -> -1 +comx713 compare -1234567891 1 -> -1 +comx714 compare 1 -1234567891 -> 1 +comx715 compare -12345678901 1 -> -1 +comx716 compare 1 -12345678901 -> 1 +comx717 compare -1234567896 1 -> -1 +comx718 compare 1 -1234567896 -> 1 + +precision: 15 +-- same with plenty of precision +comx721 compare 12345678000 1 -> 1 +comx722 compare 1 12345678000 -> -1 +comx723 compare 1234567800 1 -> 1 +comx724 compare 1 1234567800 -> -1 +comx725 compare 1234567890 1 -> 1 +comx726 compare 1 1234567890 -> -1 +comx727 compare 1234567891 1 -> 1 +comx728 compare 1 1234567891 -> -1 +comx729 compare 12345678901 1 -> 1 +comx730 compare 1 12345678901 -> -1 +comx731 compare 1234567896 1 -> 1 +comx732 compare 1 1234567896 -> -1 + +-- residue cases +precision: 5 +comx740 compare 1 0.9999999 -> 1 +comx741 compare 1 0.999999 -> 1 +comx742 compare 1 0.99999 -> 1 +comx743 compare 1 1.0000 -> 0 +comx744 compare 1 1.00001 -> -1 +comx745 compare 1 1.000001 -> -1 +comx746 compare 1 1.0000001 -> -1 +comx750 compare 0.9999999 1 -> -1 +comx751 compare 0.999999 1 -> -1 +comx752 compare 0.99999 1 -> -1 +comx753 compare 1.0000 1 -> 0 +comx754 compare 1.00001 1 -> 1 +comx755 compare 1.000001 1 -> 1 +comx756 compare 1.0000001 1 -> 1 + +-- a selection of longies +comx760 compare -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> -1 +comx761 compare -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0 +comx762 compare -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> -1 +comx763 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +-- precisions above or below the difference should have no effect +precision: 11 +comx764 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 10 +comx765 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 9 +comx766 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 8 +comx767 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 7 +comx768 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 6 +comx769 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 5 +comx770 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 4 +comx771 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 3 +comx772 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 2 +comx773 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 1 +comx774 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 + +-- Specials +precision: 9 +comx780 compare Inf -Inf -> 1 +comx781 compare Inf -1000 -> 1 +comx782 compare Inf -1 -> 1 +comx783 compare Inf -0 -> 1 +comx784 compare Inf 0 -> 1 +comx785 compare Inf 1 -> 1 +comx786 compare Inf 1000 -> 1 +comx787 compare Inf Inf -> 0 +comx788 compare -1000 Inf -> -1 +comx789 compare -Inf Inf -> -1 +comx790 compare -1 Inf -> -1 +comx791 compare -0 Inf -> -1 +comx792 compare 0 Inf -> -1 +comx793 compare 1 Inf -> -1 +comx794 compare 1000 Inf -> -1 +comx795 compare Inf Inf -> 0 + +comx800 compare -Inf -Inf -> 0 +comx801 compare -Inf -1000 -> -1 +comx802 compare -Inf -1 -> -1 +comx803 compare -Inf -0 -> -1 +comx804 compare -Inf 0 -> -1 +comx805 compare -Inf 1 -> -1 +comx806 compare -Inf 1000 -> -1 +comx807 compare -Inf Inf -> -1 +comx808 compare -Inf -Inf -> 0 +comx809 compare -1000 -Inf -> 1 +comx810 compare -1 -Inf -> 1 +comx811 compare -0 -Inf -> 1 +comx812 compare 0 -Inf -> 1 +comx813 compare 1 -Inf -> 1 +comx814 compare 1000 -Inf -> 1 +comx815 compare Inf -Inf -> 1 + +comx821 compare NaN -Inf -> NaN +comx822 compare NaN -1000 -> NaN +comx823 compare NaN -1 -> NaN +comx824 compare NaN -0 -> NaN +comx825 compare NaN 0 -> NaN +comx826 compare NaN 1 -> NaN +comx827 compare NaN 1000 -> NaN +comx828 compare NaN Inf -> NaN +comx829 compare NaN NaN -> NaN +comx830 compare -Inf NaN -> NaN +comx831 compare -1000 NaN -> NaN +comx832 compare -1 NaN -> NaN +comx833 compare -0 NaN -> NaN +comx834 compare 0 NaN -> NaN +comx835 compare 1 NaN -> NaN +comx836 compare 1000 NaN -> NaN +comx837 compare Inf NaN -> NaN +comx838 compare -NaN -NaN -> -NaN +comx839 compare +NaN -NaN -> NaN +comx840 compare -NaN +NaN -> -NaN + +comx841 compare sNaN -Inf -> NaN Invalid_operation +comx842 compare sNaN -1000 -> NaN Invalid_operation +comx843 compare sNaN -1 -> NaN Invalid_operation +comx844 compare sNaN -0 -> NaN Invalid_operation +comx845 compare sNaN 0 -> NaN Invalid_operation +comx846 compare sNaN 1 -> NaN Invalid_operation +comx847 compare sNaN 1000 -> NaN Invalid_operation +comx848 compare sNaN NaN -> NaN Invalid_operation +comx849 compare sNaN sNaN -> NaN Invalid_operation +comx850 compare NaN sNaN -> NaN Invalid_operation +comx851 compare -Inf sNaN -> NaN Invalid_operation +comx852 compare -1000 sNaN -> NaN Invalid_operation +comx853 compare -1 sNaN -> NaN Invalid_operation +comx854 compare -0 sNaN -> NaN Invalid_operation +comx855 compare 0 sNaN -> NaN Invalid_operation +comx856 compare 1 sNaN -> NaN Invalid_operation +comx857 compare 1000 sNaN -> NaN Invalid_operation +comx858 compare Inf sNaN -> NaN Invalid_operation +comx859 compare NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +comx860 compare NaN9 -Inf -> NaN9 +comx861 compare NaN8 999 -> NaN8 +comx862 compare NaN77 Inf -> NaN77 +comx863 compare -NaN67 NaN5 -> -NaN67 +comx864 compare -Inf -NaN4 -> -NaN4 +comx865 compare -999 -NaN33 -> -NaN33 +comx866 compare Inf NaN2 -> NaN2 +comx867 compare -NaN41 -NaN42 -> -NaN41 +comx868 compare +NaN41 -NaN42 -> NaN41 +comx869 compare -NaN41 +NaN42 -> -NaN41 +comx870 compare +NaN41 +NaN42 -> NaN41 + +comx871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation +comx872 compare sNaN98 -11 -> NaN98 Invalid_operation +comx873 compare sNaN97 NaN -> NaN97 Invalid_operation +comx874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation +comx875 compare NaN85 sNaN83 -> NaN83 Invalid_operation +comx876 compare -Inf sNaN92 -> NaN92 Invalid_operation +comx877 compare 088 sNaN81 -> NaN81 Invalid_operation +comx878 compare Inf sNaN90 -> NaN90 Invalid_operation +comx879 compare NaN -sNaN89 -> -NaN89 Invalid_operation + +-- overflow and underflow tests .. subnormal results now allowed +maxExponent: 999999999 +minexponent: -999999999 +comx880 compare +1.23456789012345E-0 9E+999999999 -> -1 +comx881 compare 9E+999999999 +1.23456789012345E-0 -> 1 +comx882 compare +0.100 9E-999999999 -> 1 +comx883 compare 9E-999999999 +0.100 -> -1 +comx885 compare -1.23456789012345E-0 9E+999999999 -> -1 +comx886 compare 9E+999999999 -1.23456789012345E-0 -> 1 +comx887 compare -0.100 9E-999999999 -> -1 +comx888 compare 9E-999999999 -0.100 -> 1 + +comx889 compare 1e-599999999 1e-400000001 -> -1 +comx890 compare 1e-599999999 1e-400000000 -> -1 +comx891 compare 1e-600000000 1e-400000000 -> -1 +comx892 compare 9e-999999998 0.01 -> -1 +comx893 compare 9e-999999998 0.1 -> -1 +comx894 compare 0.01 9e-999999998 -> 1 +comx895 compare 1e599999999 1e400000001 -> 1 +comx896 compare 1e599999999 1e400000000 -> 1 +comx897 compare 1e600000000 1e400000000 -> 1 +comx898 compare 9e999999998 100 -> 1 +comx899 compare 9e999999998 10 -> 1 +comx900 compare 100 9e999999998 -> -1 +-- signs +comx901 compare 1e+777777777 1e+411111111 -> 1 +comx902 compare 1e+777777777 -1e+411111111 -> 1 +comx903 compare -1e+777777777 1e+411111111 -> -1 +comx904 compare -1e+777777777 -1e+411111111 -> -1 +comx905 compare 1e-777777777 1e-411111111 -> -1 +comx906 compare 1e-777777777 -1e-411111111 -> 1 +comx907 compare -1e-777777777 1e-411111111 -> -1 +comx908 compare -1e-777777777 -1e-411111111 -> 1 + +-- Null tests +comx990 compare 10 # -> NaN Invalid_operation +comx991 compare # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal-c/new_dt/comparetotal.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/comparetotal.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,763 @@ +------------------------------------------------------------------------ +-- comparetotal.decTest -- decimal comparison using total ordering -- +-- Copyright (c) IBM Corporation, 1981, 2006. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- Note that we cannot assume add/subtract tests cover paths adequately, +-- here, because the code might be quite different (comparison cannot +-- overflow or underflow, so actual subtractions are not necessary). +-- Similarly, comparetotal will have some radically different paths +-- than compare. + +extended: 1 +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +-- sanity checks +cotx001 comparetotal -2 -2 -> 0 +cotx002 comparetotal -2 -1 -> -1 +cotx003 comparetotal -2 0 -> -1 +cotx004 comparetotal -2 1 -> -1 +cotx005 comparetotal -2 2 -> -1 +cotx006 comparetotal -1 -2 -> 1 +cotx007 comparetotal -1 -1 -> 0 +cotx008 comparetotal -1 0 -> -1 +cotx009 comparetotal -1 1 -> -1 +cotx010 comparetotal -1 2 -> -1 +cotx011 comparetotal 0 -2 -> 1 +cotx012 comparetotal 0 -1 -> 1 +cotx013 comparetotal 0 0 -> 0 +cotx014 comparetotal 0 1 -> -1 +cotx015 comparetotal 0 2 -> -1 +cotx016 comparetotal 1 -2 -> 1 +cotx017 comparetotal 1 -1 -> 1 +cotx018 comparetotal 1 0 -> 1 +cotx019 comparetotal 1 1 -> 0 +cotx020 comparetotal 1 2 -> -1 +cotx021 comparetotal 2 -2 -> 1 +cotx022 comparetotal 2 -1 -> 1 +cotx023 comparetotal 2 0 -> 1 +cotx025 comparetotal 2 1 -> 1 +cotx026 comparetotal 2 2 -> 0 + +cotx031 comparetotal -20 -20 -> 0 +cotx032 comparetotal -20 -10 -> -1 +cotx033 comparetotal -20 00 -> -1 +cotx034 comparetotal -20 10 -> -1 +cotx035 comparetotal -20 20 -> -1 +cotx036 comparetotal -10 -20 -> 1 +cotx037 comparetotal -10 -10 -> 0 +cotx038 comparetotal -10 00 -> -1 +cotx039 comparetotal -10 10 -> -1 +cotx040 comparetotal -10 20 -> -1 +cotx041 comparetotal 00 -20 -> 1 +cotx042 comparetotal 00 -10 -> 1 +cotx043 comparetotal 00 00 -> 0 +cotx044 comparetotal 00 10 -> -1 +cotx045 comparetotal 00 20 -> -1 +cotx046 comparetotal 10 -20 -> 1 +cotx047 comparetotal 10 -10 -> 1 +cotx048 comparetotal 10 00 -> 1 +cotx049 comparetotal 10 10 -> 0 +cotx050 comparetotal 10 20 -> -1 +cotx051 comparetotal 20 -20 -> 1 +cotx052 comparetotal 20 -10 -> 1 +cotx053 comparetotal 20 00 -> 1 +cotx055 comparetotal 20 10 -> 1 +cotx056 comparetotal 20 20 -> 0 + +cotx061 comparetotal -2.0 -2.0 -> 0 +cotx062 comparetotal -2.0 -1.0 -> -1 +cotx063 comparetotal -2.0 0.0 -> -1 +cotx064 comparetotal -2.0 1.0 -> -1 +cotx065 comparetotal -2.0 2.0 -> -1 +cotx066 comparetotal -1.0 -2.0 -> 1 +cotx067 comparetotal -1.0 -1.0 -> 0 +cotx068 comparetotal -1.0 0.0 -> -1 +cotx069 comparetotal -1.0 1.0 -> -1 +cotx070 comparetotal -1.0 2.0 -> -1 +cotx071 comparetotal 0.0 -2.0 -> 1 +cotx072 comparetotal 0.0 -1.0 -> 1 +cotx073 comparetotal 0.0 0.0 -> 0 +cotx074 comparetotal 0.0 1.0 -> -1 +cotx075 comparetotal 0.0 2.0 -> -1 +cotx076 comparetotal 1.0 -2.0 -> 1 +cotx077 comparetotal 1.0 -1.0 -> 1 +cotx078 comparetotal 1.0 0.0 -> 1 +cotx079 comparetotal 1.0 1.0 -> 0 +cotx080 comparetotal 1.0 2.0 -> -1 +cotx081 comparetotal 2.0 -2.0 -> 1 +cotx082 comparetotal 2.0 -1.0 -> 1 +cotx083 comparetotal 2.0 0.0 -> 1 +cotx085 comparetotal 2.0 1.0 -> 1 +cotx086 comparetotal 2.0 2.0 -> 0 + +-- now some cases which might overflow if subtract were used +maxexponent: 999999999 +minexponent: -999999999 +cotx090 comparetotal 9.99999999E+999999999 9.99999999E+999999999 -> 0 +cotx091 comparetotal -9.99999999E+999999999 9.99999999E+999999999 -> -1 +cotx092 comparetotal 9.99999999E+999999999 -9.99999999E+999999999 -> 1 +cotx093 comparetotal -9.99999999E+999999999 -9.99999999E+999999999 -> 0 + +-- some differing length/exponent cases +-- in this first group, compare would compare all equal +cotx100 comparetotal 7.0 7.0 -> 0 +cotx101 comparetotal 7.0 7 -> -1 +cotx102 comparetotal 7 7.0 -> 1 +cotx103 comparetotal 7E+0 7.0 -> 1 +cotx104 comparetotal 70E-1 7.0 -> 0 +cotx105 comparetotal 0.7E+1 7 -> 0 +cotx106 comparetotal 70E-1 7 -> -1 +cotx107 comparetotal 7.0 7E+0 -> -1 +cotx108 comparetotal 7.0 70E-1 -> 0 +cotx109 comparetotal 7 0.7E+1 -> 0 +cotx110 comparetotal 7 70E-1 -> 1 + +cotx120 comparetotal 8.0 7.0 -> 1 +cotx121 comparetotal 8.0 7 -> 1 +cotx122 comparetotal 8 7.0 -> 1 +cotx123 comparetotal 8E+0 7.0 -> 1 +cotx124 comparetotal 80E-1 7.0 -> 1 +cotx125 comparetotal 0.8E+1 7 -> 1 +cotx126 comparetotal 80E-1 7 -> 1 +cotx127 comparetotal 8.0 7E+0 -> 1 +cotx128 comparetotal 8.0 70E-1 -> 1 +cotx129 comparetotal 8 0.7E+1 -> 1 +cotx130 comparetotal 8 70E-1 -> 1 + +cotx140 comparetotal 8.0 9.0 -> -1 +cotx141 comparetotal 8.0 9 -> -1 +cotx142 comparetotal 8 9.0 -> -1 +cotx143 comparetotal 8E+0 9.0 -> -1 +cotx144 comparetotal 80E-1 9.0 -> -1 +cotx145 comparetotal 0.8E+1 9 -> -1 +cotx146 comparetotal 80E-1 9 -> -1 +cotx147 comparetotal 8.0 9E+0 -> -1 +cotx148 comparetotal 8.0 90E-1 -> -1 +cotx149 comparetotal 8 0.9E+1 -> -1 +cotx150 comparetotal 8 90E-1 -> -1 + +-- and again, with sign changes -+ .. +cotx200 comparetotal -7.0 7.0 -> -1 +cotx201 comparetotal -7.0 7 -> -1 +cotx202 comparetotal -7 7.0 -> -1 +cotx203 comparetotal -7E+0 7.0 -> -1 +cotx204 comparetotal -70E-1 7.0 -> -1 +cotx205 comparetotal -0.7E+1 7 -> -1 +cotx206 comparetotal -70E-1 7 -> -1 +cotx207 comparetotal -7.0 7E+0 -> -1 +cotx208 comparetotal -7.0 70E-1 -> -1 +cotx209 comparetotal -7 0.7E+1 -> -1 +cotx210 comparetotal -7 70E-1 -> -1 + +cotx220 comparetotal -8.0 7.0 -> -1 +cotx221 comparetotal -8.0 7 -> -1 +cotx222 comparetotal -8 7.0 -> -1 +cotx223 comparetotal -8E+0 7.0 -> -1 +cotx224 comparetotal -80E-1 7.0 -> -1 +cotx225 comparetotal -0.8E+1 7 -> -1 +cotx226 comparetotal -80E-1 7 -> -1 +cotx227 comparetotal -8.0 7E+0 -> -1 +cotx228 comparetotal -8.0 70E-1 -> -1 +cotx229 comparetotal -8 0.7E+1 -> -1 +cotx230 comparetotal -8 70E-1 -> -1 + +cotx240 comparetotal -8.0 9.0 -> -1 +cotx241 comparetotal -8.0 9 -> -1 +cotx242 comparetotal -8 9.0 -> -1 +cotx243 comparetotal -8E+0 9.0 -> -1 +cotx244 comparetotal -80E-1 9.0 -> -1 +cotx245 comparetotal -0.8E+1 9 -> -1 +cotx246 comparetotal -80E-1 9 -> -1 +cotx247 comparetotal -8.0 9E+0 -> -1 +cotx248 comparetotal -8.0 90E-1 -> -1 +cotx249 comparetotal -8 0.9E+1 -> -1 +cotx250 comparetotal -8 90E-1 -> -1 + +-- and again, with sign changes +- .. +cotx300 comparetotal 7.0 -7.0 -> 1 +cotx301 comparetotal 7.0 -7 -> 1 +cotx302 comparetotal 7 -7.0 -> 1 +cotx303 comparetotal 7E+0 -7.0 -> 1 +cotx304 comparetotal 70E-1 -7.0 -> 1 +cotx305 comparetotal .7E+1 -7 -> 1 +cotx306 comparetotal 70E-1 -7 -> 1 +cotx307 comparetotal 7.0 -7E+0 -> 1 +cotx308 comparetotal 7.0 -70E-1 -> 1 +cotx309 comparetotal 7 -.7E+1 -> 1 +cotx310 comparetotal 7 -70E-1 -> 1 + +cotx320 comparetotal 8.0 -7.0 -> 1 +cotx321 comparetotal 8.0 -7 -> 1 +cotx322 comparetotal 8 -7.0 -> 1 +cotx323 comparetotal 8E+0 -7.0 -> 1 +cotx324 comparetotal 80E-1 -7.0 -> 1 +cotx325 comparetotal .8E+1 -7 -> 1 +cotx326 comparetotal 80E-1 -7 -> 1 +cotx327 comparetotal 8.0 -7E+0 -> 1 +cotx328 comparetotal 8.0 -70E-1 -> 1 +cotx329 comparetotal 8 -.7E+1 -> 1 +cotx330 comparetotal 8 -70E-1 -> 1 + +cotx340 comparetotal 8.0 -9.0 -> 1 +cotx341 comparetotal 8.0 -9 -> 1 +cotx342 comparetotal 8 -9.0 -> 1 +cotx343 comparetotal 8E+0 -9.0 -> 1 +cotx344 comparetotal 80E-1 -9.0 -> 1 +cotx345 comparetotal .8E+1 -9 -> 1 +cotx346 comparetotal 80E-1 -9 -> 1 +cotx347 comparetotal 8.0 -9E+0 -> 1 +cotx348 comparetotal 8.0 -90E-1 -> 1 +cotx349 comparetotal 8 -.9E+1 -> 1 +cotx350 comparetotal 8 -90E-1 -> 1 + +-- and again, with sign changes -- .. +cotx400 comparetotal -7.0 -7.0 -> 0 +cotx401 comparetotal -7.0 -7 -> 1 +cotx402 comparetotal -7 -7.0 -> -1 +cotx403 comparetotal -7E+0 -7.0 -> -1 +cotx404 comparetotal -70E-1 -7.0 -> 0 +cotx405 comparetotal -.7E+1 -7 -> 0 +cotx406 comparetotal -70E-1 -7 -> 1 +cotx407 comparetotal -7.0 -7E+0 -> 1 +cotx408 comparetotal -7.0 -70E-1 -> 0 +cotx409 comparetotal -7 -.7E+1 -> 0 +cotx410 comparetotal -7 -70E-1 -> -1 + +cotx420 comparetotal -8.0 -7.0 -> -1 +cotx421 comparetotal -8.0 -7 -> -1 +cotx422 comparetotal -8 -7.0 -> -1 +cotx423 comparetotal -8E+0 -7.0 -> -1 +cotx424 comparetotal -80E-1 -7.0 -> -1 +cotx425 comparetotal -.8E+1 -7 -> -1 +cotx426 comparetotal -80E-1 -7 -> -1 +cotx427 comparetotal -8.0 -7E+0 -> -1 +cotx428 comparetotal -8.0 -70E-1 -> -1 +cotx429 comparetotal -8 -.7E+1 -> -1 +cotx430 comparetotal -8 -70E-1 -> -1 + +cotx440 comparetotal -8.0 -9.0 -> 1 +cotx441 comparetotal -8.0 -9 -> 1 +cotx442 comparetotal -8 -9.0 -> 1 +cotx443 comparetotal -8E+0 -9.0 -> 1 +cotx444 comparetotal -80E-1 -9.0 -> 1 +cotx445 comparetotal -.8E+1 -9 -> 1 +cotx446 comparetotal -80E-1 -9 -> 1 +cotx447 comparetotal -8.0 -9E+0 -> 1 +cotx448 comparetotal -8.0 -90E-1 -> 1 +cotx449 comparetotal -8 -.9E+1 -> 1 +cotx450 comparetotal -8 -90E-1 -> 1 + + +-- testcases that subtract to lots of zeros at boundaries [pgr] +precision: 40 +cotx470 comparetotal 123.4560000000000000E789 123.456E789 -> -1 +cotx471 comparetotal 123.456000000000000E-89 123.456E-89 -> -1 +cotx472 comparetotal 123.45600000000000E789 123.456E789 -> -1 +cotx473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1 +cotx474 comparetotal 123.456000000000E789 123.456E789 -> -1 +cotx475 comparetotal 123.45600000000E-89 123.456E-89 -> -1 +cotx476 comparetotal 123.4560000000E789 123.456E789 -> -1 +cotx477 comparetotal 123.456000000E-89 123.456E-89 -> -1 +cotx478 comparetotal 123.45600000E789 123.456E789 -> -1 +cotx479 comparetotal 123.4560000E-89 123.456E-89 -> -1 +cotx480 comparetotal 123.456000E789 123.456E789 -> -1 +cotx481 comparetotal 123.45600E-89 123.456E-89 -> -1 +cotx482 comparetotal 123.4560E789 123.456E789 -> -1 +cotx483 comparetotal 123.456E-89 123.456E-89 -> 0 +cotx484 comparetotal 123.456E-89 123.4560000000000000E-89 -> 1 +cotx485 comparetotal 123.456E789 123.456000000000000E789 -> 1 +cotx486 comparetotal 123.456E-89 123.45600000000000E-89 -> 1 +cotx487 comparetotal 123.456E789 123.4560000000000E789 -> 1 +cotx488 comparetotal 123.456E-89 123.456000000000E-89 -> 1 +cotx489 comparetotal 123.456E789 123.45600000000E789 -> 1 +cotx490 comparetotal 123.456E-89 123.4560000000E-89 -> 1 +cotx491 comparetotal 123.456E789 123.456000000E789 -> 1 +cotx492 comparetotal 123.456E-89 123.45600000E-89 -> 1 +cotx493 comparetotal 123.456E789 123.4560000E789 -> 1 +cotx494 comparetotal 123.456E-89 123.456000E-89 -> 1 +cotx495 comparetotal 123.456E789 123.45600E789 -> 1 +cotx496 comparetotal 123.456E-89 123.4560E-89 -> 1 +cotx497 comparetotal 123.456E789 123.456E789 -> 0 + +-- wide-ranging, around precision; signs equal +precision: 9 +cotx500 comparetotal 1 1E-15 -> 1 +cotx501 comparetotal 1 1E-14 -> 1 +cotx502 comparetotal 1 1E-13 -> 1 +cotx503 comparetotal 1 1E-12 -> 1 +cotx504 comparetotal 1 1E-11 -> 1 +cotx505 comparetotal 1 1E-10 -> 1 +cotx506 comparetotal 1 1E-9 -> 1 +cotx507 comparetotal 1 1E-8 -> 1 +cotx508 comparetotal 1 1E-7 -> 1 +cotx509 comparetotal 1 1E-6 -> 1 +cotx510 comparetotal 1 1E-5 -> 1 +cotx511 comparetotal 1 1E-4 -> 1 +cotx512 comparetotal 1 1E-3 -> 1 +cotx513 comparetotal 1 1E-2 -> 1 +cotx514 comparetotal 1 1E-1 -> 1 +cotx515 comparetotal 1 1E-0 -> 0 +cotx516 comparetotal 1 1E+1 -> -1 +cotx517 comparetotal 1 1E+2 -> -1 +cotx518 comparetotal 1 1E+3 -> -1 +cotx519 comparetotal 1 1E+4 -> -1 +cotx521 comparetotal 1 1E+5 -> -1 +cotx522 comparetotal 1 1E+6 -> -1 +cotx523 comparetotal 1 1E+7 -> -1 +cotx524 comparetotal 1 1E+8 -> -1 +cotx525 comparetotal 1 1E+9 -> -1 +cotx526 comparetotal 1 1E+10 -> -1 +cotx527 comparetotal 1 1E+11 -> -1 +cotx528 comparetotal 1 1E+12 -> -1 +cotx529 comparetotal 1 1E+13 -> -1 +cotx530 comparetotal 1 1E+14 -> -1 +cotx531 comparetotal 1 1E+15 -> -1 +-- LR swap +cotx540 comparetotal 1E-15 1 -> -1 +cotx541 comparetotal 1E-14 1 -> -1 +cotx542 comparetotal 1E-13 1 -> -1 +cotx543 comparetotal 1E-12 1 -> -1 +cotx544 comparetotal 1E-11 1 -> -1 +cotx545 comparetotal 1E-10 1 -> -1 +cotx546 comparetotal 1E-9 1 -> -1 +cotx547 comparetotal 1E-8 1 -> -1 +cotx548 comparetotal 1E-7 1 -> -1 +cotx549 comparetotal 1E-6 1 -> -1 +cotx550 comparetotal 1E-5 1 -> -1 +cotx551 comparetotal 1E-4 1 -> -1 +cotx552 comparetotal 1E-3 1 -> -1 +cotx553 comparetotal 1E-2 1 -> -1 +cotx554 comparetotal 1E-1 1 -> -1 +cotx555 comparetotal 1E-0 1 -> 0 +cotx556 comparetotal 1E+1 1 -> 1 +cotx557 comparetotal 1E+2 1 -> 1 +cotx558 comparetotal 1E+3 1 -> 1 +cotx559 comparetotal 1E+4 1 -> 1 +cotx561 comparetotal 1E+5 1 -> 1 +cotx562 comparetotal 1E+6 1 -> 1 +cotx563 comparetotal 1E+7 1 -> 1 +cotx564 comparetotal 1E+8 1 -> 1 +cotx565 comparetotal 1E+9 1 -> 1 +cotx566 comparetotal 1E+10 1 -> 1 +cotx567 comparetotal 1E+11 1 -> 1 +cotx568 comparetotal 1E+12 1 -> 1 +cotx569 comparetotal 1E+13 1 -> 1 +cotx570 comparetotal 1E+14 1 -> 1 +cotx571 comparetotal 1E+15 1 -> 1 +-- similar with an useful coefficient, one side only +cotx580 comparetotal 0.000000987654321 1E-15 -> 1 +cotx581 comparetotal 0.000000987654321 1E-14 -> 1 +cotx582 comparetotal 0.000000987654321 1E-13 -> 1 +cotx583 comparetotal 0.000000987654321 1E-12 -> 1 +cotx584 comparetotal 0.000000987654321 1E-11 -> 1 +cotx585 comparetotal 0.000000987654321 1E-10 -> 1 +cotx586 comparetotal 0.000000987654321 1E-9 -> 1 +cotx587 comparetotal 0.000000987654321 1E-8 -> 1 +cotx588 comparetotal 0.000000987654321 1E-7 -> 1 +cotx589 comparetotal 0.000000987654321 1E-6 -> -1 +cotx590 comparetotal 0.000000987654321 1E-5 -> -1 +cotx591 comparetotal 0.000000987654321 1E-4 -> -1 +cotx592 comparetotal 0.000000987654321 1E-3 -> -1 +cotx593 comparetotal 0.000000987654321 1E-2 -> -1 +cotx594 comparetotal 0.000000987654321 1E-1 -> -1 +cotx595 comparetotal 0.000000987654321 1E-0 -> -1 +cotx596 comparetotal 0.000000987654321 1E+1 -> -1 +cotx597 comparetotal 0.000000987654321 1E+2 -> -1 +cotx598 comparetotal 0.000000987654321 1E+3 -> -1 +cotx599 comparetotal 0.000000987654321 1E+4 -> -1 + +-- check some unit-y traps +precision: 20 +cotx600 comparetotal 12 12.2345 -> -1 +cotx601 comparetotal 12.0 12.2345 -> -1 +cotx602 comparetotal 12.00 12.2345 -> -1 +cotx603 comparetotal 12.000 12.2345 -> -1 +cotx604 comparetotal 12.0000 12.2345 -> -1 +cotx605 comparetotal 12.00000 12.2345 -> -1 +cotx606 comparetotal 12.000000 12.2345 -> -1 +cotx607 comparetotal 12.0000000 12.2345 -> -1 +cotx608 comparetotal 12.00000000 12.2345 -> -1 +cotx609 comparetotal 12.000000000 12.2345 -> -1 +cotx610 comparetotal 12.1234 12 -> 1 +cotx611 comparetotal 12.1234 12.0 -> 1 +cotx612 comparetotal 12.1234 12.00 -> 1 +cotx613 comparetotal 12.1234 12.000 -> 1 +cotx614 comparetotal 12.1234 12.0000 -> 1 +cotx615 comparetotal 12.1234 12.00000 -> 1 +cotx616 comparetotal 12.1234 12.000000 -> 1 +cotx617 comparetotal 12.1234 12.0000000 -> 1 +cotx618 comparetotal 12.1234 12.00000000 -> 1 +cotx619 comparetotal 12.1234 12.000000000 -> 1 +cotx620 comparetotal -12 -12.2345 -> 1 +cotx621 comparetotal -12.0 -12.2345 -> 1 +cotx622 comparetotal -12.00 -12.2345 -> 1 +cotx623 comparetotal -12.000 -12.2345 -> 1 +cotx624 comparetotal -12.0000 -12.2345 -> 1 +cotx625 comparetotal -12.00000 -12.2345 -> 1 +cotx626 comparetotal -12.000000 -12.2345 -> 1 +cotx627 comparetotal -12.0000000 -12.2345 -> 1 +cotx628 comparetotal -12.00000000 -12.2345 -> 1 +cotx629 comparetotal -12.000000000 -12.2345 -> 1 +cotx630 comparetotal -12.1234 -12 -> -1 +cotx631 comparetotal -12.1234 -12.0 -> -1 +cotx632 comparetotal -12.1234 -12.00 -> -1 +cotx633 comparetotal -12.1234 -12.000 -> -1 +cotx634 comparetotal -12.1234 -12.0000 -> -1 +cotx635 comparetotal -12.1234 -12.00000 -> -1 +cotx636 comparetotal -12.1234 -12.000000 -> -1 +cotx637 comparetotal -12.1234 -12.0000000 -> -1 +cotx638 comparetotal -12.1234 -12.00000000 -> -1 +cotx639 comparetotal -12.1234 -12.000000000 -> -1 +precision: 9 + +-- extended zeros +cotx640 comparetotal 0 0 -> 0 +cotx641 comparetotal 0 -0 -> 1 +cotx642 comparetotal 0 -0.0 -> 1 +cotx643 comparetotal 0 0.0 -> 1 +cotx644 comparetotal -0 0 -> -1 +cotx645 comparetotal -0 -0 -> 0 +cotx646 comparetotal -0 -0.0 -> -1 +cotx647 comparetotal -0 0.0 -> -1 +cotx648 comparetotal 0.0 0 -> -1 +cotx649 comparetotal 0.0 -0 -> 1 +cotx650 comparetotal 0.0 -0.0 -> 1 +cotx651 comparetotal 0.0 0.0 -> 0 +cotx652 comparetotal -0.0 0 -> -1 +cotx653 comparetotal -0.0 -0 -> 1 +cotx654 comparetotal -0.0 -0.0 -> 0 +cotx655 comparetotal -0.0 0.0 -> -1 + +cotx656 comparetotal -0E1 0.0 -> -1 +cotx657 comparetotal -0E2 0.0 -> -1 +cotx658 comparetotal 0E1 0.0 -> 1 +cotx659 comparetotal 0E2 0.0 -> 1 +cotx660 comparetotal -0E1 0 -> -1 +cotx661 comparetotal -0E2 0 -> -1 +cotx662 comparetotal 0E1 0 -> 1 +cotx663 comparetotal 0E2 0 -> 1 +cotx664 comparetotal -0E1 -0E1 -> 0 +cotx665 comparetotal -0E2 -0E1 -> -1 +cotx666 comparetotal 0E1 -0E1 -> 1 +cotx667 comparetotal 0E2 -0E1 -> 1 +cotx668 comparetotal -0E1 -0E2 -> 1 +cotx669 comparetotal -0E2 -0E2 -> 0 +cotx670 comparetotal 0E1 -0E2 -> 1 +cotx671 comparetotal 0E2 -0E2 -> 1 +cotx672 comparetotal -0E1 0E1 -> -1 +cotx673 comparetotal -0E2 0E1 -> -1 +cotx674 comparetotal 0E1 0E1 -> 0 +cotx675 comparetotal 0E2 0E1 -> 1 +cotx676 comparetotal -0E1 0E2 -> -1 +cotx677 comparetotal -0E2 0E2 -> -1 +cotx678 comparetotal 0E1 0E2 -> -1 +cotx679 comparetotal 0E2 0E2 -> 0 + +-- trailing zeros; unit-y +precision: 20 +cotx680 comparetotal 12 12 -> 0 +cotx681 comparetotal 12 12.0 -> 1 +cotx682 comparetotal 12 12.00 -> 1 +cotx683 comparetotal 12 12.000 -> 1 +cotx684 comparetotal 12 12.0000 -> 1 +cotx685 comparetotal 12 12.00000 -> 1 +cotx686 comparetotal 12 12.000000 -> 1 +cotx687 comparetotal 12 12.0000000 -> 1 +cotx688 comparetotal 12 12.00000000 -> 1 +cotx689 comparetotal 12 12.000000000 -> 1 +cotx690 comparetotal 12 12 -> 0 +cotx691 comparetotal 12.0 12 -> -1 +cotx692 comparetotal 12.00 12 -> -1 +cotx693 comparetotal 12.000 12 -> -1 +cotx694 comparetotal 12.0000 12 -> -1 +cotx695 comparetotal 12.00000 12 -> -1 +cotx696 comparetotal 12.000000 12 -> -1 +cotx697 comparetotal 12.0000000 12 -> -1 +cotx698 comparetotal 12.00000000 12 -> -1 +cotx699 comparetotal 12.000000000 12 -> -1 + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +cotx701 comparetotal 12345678000 1 -> 1 +cotx702 comparetotal 1 12345678000 -> -1 +cotx703 comparetotal 1234567800 1 -> 1 +cotx704 comparetotal 1 1234567800 -> -1 +cotx705 comparetotal 1234567890 1 -> 1 +cotx706 comparetotal 1 1234567890 -> -1 +cotx707 comparetotal 1234567891 1 -> 1 +cotx708 comparetotal 1 1234567891 -> -1 +cotx709 comparetotal 12345678901 1 -> 1 +cotx710 comparetotal 1 12345678901 -> -1 +cotx711 comparetotal 1234567896 1 -> 1 +cotx712 comparetotal 1 1234567896 -> -1 +cotx713 comparetotal -1234567891 1 -> -1 +cotx714 comparetotal 1 -1234567891 -> 1 +cotx715 comparetotal -12345678901 1 -> -1 +cotx716 comparetotal 1 -12345678901 -> 1 +cotx717 comparetotal -1234567896 1 -> -1 +cotx718 comparetotal 1 -1234567896 -> 1 + +precision: 15 +-- same with plenty of precision +cotx721 comparetotal 12345678000 1 -> 1 +cotx722 comparetotal 1 12345678000 -> -1 +cotx723 comparetotal 1234567800 1 -> 1 +cotx724 comparetotal 1 1234567800 -> -1 +cotx725 comparetotal 1234567890 1 -> 1 +cotx726 comparetotal 1 1234567890 -> -1 +cotx727 comparetotal 1234567891 1 -> 1 +cotx728 comparetotal 1 1234567891 -> -1 +cotx729 comparetotal 12345678901 1 -> 1 +cotx730 comparetotal 1 12345678901 -> -1 +cotx731 comparetotal 1234567896 1 -> 1 +cotx732 comparetotal 1 1234567896 -> -1 + +-- residue cases +precision: 5 +cotx740 comparetotal 1 0.9999999 -> 1 +cotx741 comparetotal 1 0.999999 -> 1 +cotx742 comparetotal 1 0.99999 -> 1 +cotx743 comparetotal 1 1.0000 -> 1 +cotx744 comparetotal 1 1.00001 -> -1 +cotx745 comparetotal 1 1.000001 -> -1 +cotx746 comparetotal 1 1.0000001 -> -1 +cotx750 comparetotal 0.9999999 1 -> -1 +cotx751 comparetotal 0.999999 1 -> -1 +cotx752 comparetotal 0.99999 1 -> -1 +cotx753 comparetotal 1.0000 1 -> -1 +cotx754 comparetotal 1.00001 1 -> 1 +cotx755 comparetotal 1.000001 1 -> 1 +cotx756 comparetotal 1.0000001 1 -> 1 + +-- a selection of longies +cotx760 comparetotal -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> -1 +cotx761 comparetotal -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0 +cotx762 comparetotal -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> -1 +cotx763 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +-- precisions above or below the difference should have no effect +precision: 11 +cotx764 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 10 +cotx765 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 9 +cotx766 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 8 +cotx767 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 7 +cotx768 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 6 +cotx769 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 5 +cotx770 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 4 +cotx771 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 3 +cotx772 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 2 +cotx773 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 +precision: 1 +cotx774 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1 + +-- Specials +precision: 9 +cotx780 comparetotal Inf -Inf -> 1 +cotx781 comparetotal Inf -1000 -> 1 +cotx782 comparetotal Inf -1 -> 1 +cotx783 comparetotal Inf -0 -> 1 +cotx784 comparetotal Inf 0 -> 1 +cotx785 comparetotal Inf 1 -> 1 +cotx786 comparetotal Inf 1000 -> 1 +cotx787 comparetotal Inf Inf -> 0 +cotx788 comparetotal -1000 Inf -> -1 +cotx789 comparetotal -Inf Inf -> -1 +cotx790 comparetotal -1 Inf -> -1 +cotx791 comparetotal -0 Inf -> -1 +cotx792 comparetotal 0 Inf -> -1 +cotx793 comparetotal 1 Inf -> -1 +cotx794 comparetotal 1000 Inf -> -1 +cotx795 comparetotal Inf Inf -> 0 + +cotx800 comparetotal -Inf -Inf -> 0 +cotx801 comparetotal -Inf -1000 -> -1 +cotx802 comparetotal -Inf -1 -> -1 +cotx803 comparetotal -Inf -0 -> -1 +cotx804 comparetotal -Inf 0 -> -1 +cotx805 comparetotal -Inf 1 -> -1 +cotx806 comparetotal -Inf 1000 -> -1 +cotx807 comparetotal -Inf Inf -> -1 +cotx808 comparetotal -Inf -Inf -> 0 +cotx809 comparetotal -1000 -Inf -> 1 +cotx810 comparetotal -1 -Inf -> 1 +cotx811 comparetotal -0 -Inf -> 1 +cotx812 comparetotal 0 -Inf -> 1 +cotx813 comparetotal 1 -Inf -> 1 +cotx814 comparetotal 1000 -Inf -> 1 +cotx815 comparetotal Inf -Inf -> 1 + +cotx821 comparetotal NaN -Inf -> 1 +cotx822 comparetotal NaN -1000 -> 1 +cotx823 comparetotal NaN -1 -> 1 +cotx824 comparetotal NaN -0 -> 1 +cotx825 comparetotal NaN 0 -> 1 +cotx826 comparetotal NaN 1 -> 1 +cotx827 comparetotal NaN 1000 -> 1 +cotx828 comparetotal NaN Inf -> 1 +cotx829 comparetotal NaN NaN -> 0 +cotx830 comparetotal -Inf NaN -> -1 +cotx831 comparetotal -1000 NaN -> -1 +cotx832 comparetotal -1 NaN -> -1 +cotx833 comparetotal -0 NaN -> -1 +cotx834 comparetotal 0 NaN -> -1 +cotx835 comparetotal 1 NaN -> -1 +cotx836 comparetotal 1000 NaN -> -1 +cotx837 comparetotal Inf NaN -> -1 +cotx838 comparetotal -NaN -NaN -> 0 +cotx839 comparetotal +NaN -NaN -> 1 +cotx840 comparetotal -NaN +NaN -> -1 + +cotx841 comparetotal sNaN -sNaN -> 1 +cotx842 comparetotal sNaN -NaN -> 1 +cotx843 comparetotal sNaN -Inf -> 1 +cotx844 comparetotal sNaN -1000 -> 1 +cotx845 comparetotal sNaN -1 -> 1 +cotx846 comparetotal sNaN -0 -> 1 +cotx847 comparetotal sNaN 0 -> 1 +cotx848 comparetotal sNaN 1 -> 1 +cotx849 comparetotal sNaN 1000 -> 1 +cotx850 comparetotal sNaN NaN -> -1 +cotx851 comparetotal sNaN sNaN -> 0 + +cotx852 comparetotal -sNaN sNaN -> -1 +cotx853 comparetotal -NaN sNaN -> -1 +cotx854 comparetotal -Inf sNaN -> -1 +cotx855 comparetotal -1000 sNaN -> -1 +cotx856 comparetotal -1 sNaN -> -1 +cotx857 comparetotal -0 sNaN -> -1 +cotx858 comparetotal 0 sNaN -> -1 +cotx859 comparetotal 1 sNaN -> -1 +cotx860 comparetotal 1000 sNaN -> -1 +cotx861 comparetotal Inf sNaN -> -1 +cotx862 comparetotal NaN sNaN -> 1 +cotx863 comparetotal sNaN sNaN -> 0 + +cotx871 comparetotal -sNaN -sNaN -> 0 +cotx872 comparetotal -sNaN -NaN -> 1 +cotx873 comparetotal -sNaN -Inf -> -1 +cotx874 comparetotal -sNaN -1000 -> -1 +cotx875 comparetotal -sNaN -1 -> -1 +cotx876 comparetotal -sNaN -0 -> -1 +cotx877 comparetotal -sNaN 0 -> -1 +cotx878 comparetotal -sNaN 1 -> -1 +cotx879 comparetotal -sNaN 1000 -> -1 +cotx880 comparetotal -sNaN NaN -> -1 +cotx881 comparetotal -sNaN sNaN -> -1 + +cotx882 comparetotal -sNaN -sNaN -> 0 +cotx883 comparetotal -NaN -sNaN -> -1 +cotx884 comparetotal -Inf -sNaN -> 1 +cotx885 comparetotal -1000 -sNaN -> 1 +cotx886 comparetotal -1 -sNaN -> 1 +cotx887 comparetotal -0 -sNaN -> 1 +cotx888 comparetotal 0 -sNaN -> 1 +cotx889 comparetotal 1 -sNaN -> 1 +cotx890 comparetotal 1000 -sNaN -> 1 +cotx891 comparetotal Inf -sNaN -> 1 +cotx892 comparetotal NaN -sNaN -> 1 +cotx893 comparetotal sNaN -sNaN -> 1 + +-- NaNs with payload +cotx960 comparetotal NaN9 -Inf -> 1 +cotx961 comparetotal NaN8 999 -> 1 +cotx962 comparetotal NaN77 Inf -> 1 +cotx963 comparetotal -NaN67 NaN5 -> -1 +cotx964 comparetotal -Inf -NaN4 -> 1 +cotx965 comparetotal -999 -NaN33 -> 1 +cotx966 comparetotal Inf NaN2 -> -1 + +cotx970 comparetotal -NaN41 -NaN42 -> 1 +cotx971 comparetotal +NaN41 -NaN42 -> 1 +cotx972 comparetotal -NaN41 +NaN42 -> -1 +cotx973 comparetotal +NaN41 +NaN42 -> -1 +cotx974 comparetotal -NaN42 -NaN01 -> -1 +cotx975 comparetotal +NaN42 -NaN01 -> 1 +cotx976 comparetotal -NaN42 +NaN01 -> -1 +cotx977 comparetotal +NaN42 +NaN01 -> 1 + +cotx980 comparetotal -sNaN771 -sNaN772 -> 1 +cotx981 comparetotal +sNaN771 -sNaN772 -> 1 +cotx982 comparetotal -sNaN771 +sNaN772 -> -1 +cotx983 comparetotal +sNaN771 +sNaN772 -> -1 +cotx984 comparetotal -sNaN772 -sNaN771 -> -1 +cotx985 comparetotal +sNaN772 -sNaN771 -> 1 +cotx986 comparetotal -sNaN772 +sNaN771 -> -1 +cotx987 comparetotal +sNaN772 +sNaN771 -> 1 + +cotx991 comparetotal -sNaN99 -Inf -> -1 +cotx992 comparetotal sNaN98 -11 -> 1 +cotx993 comparetotal sNaN97 NaN -> -1 +cotx994 comparetotal sNaN16 sNaN94 -> -1 +cotx995 comparetotal NaN85 sNaN83 -> 1 +cotx996 comparetotal -Inf sNaN92 -> -1 +cotx997 comparetotal 088 sNaN81 -> -1 +cotx998 comparetotal Inf sNaN90 -> -1 +cotx999 comparetotal NaN -sNaN89 -> 1 + +-- overflow and underflow tests .. subnormal results now allowed +maxExponent: 999999999 +minexponent: -999999999 +cotx1080 comparetotal +1.23456789012345E-0 9E+999999999 -> -1 +cotx1081 comparetotal 9E+999999999 +1.23456789012345E-0 -> 1 +cotx1082 comparetotal +0.100 9E-999999999 -> 1 +cotx1083 comparetotal 9E-999999999 +0.100 -> -1 +cotx1085 comparetotal -1.23456789012345E-0 9E+999999999 -> -1 +cotx1086 comparetotal 9E+999999999 -1.23456789012345E-0 -> 1 +cotx1087 comparetotal -0.100 9E-999999999 -> -1 +cotx1088 comparetotal 9E-999999999 -0.100 -> 1 + +cotx1089 comparetotal 1e-599999999 1e-400000001 -> -1 +cotx1090 comparetotal 1e-599999999 1e-400000000 -> -1 +cotx1091 comparetotal 1e-600000000 1e-400000000 -> -1 +cotx1092 comparetotal 9e-999999998 0.01 -> -1 +cotx1093 comparetotal 9e-999999998 0.1 -> -1 +cotx1094 comparetotal 0.01 9e-999999998 -> 1 +cotx1095 comparetotal 1e599999999 1e400000001 -> 1 +cotx1096 comparetotal 1e599999999 1e400000000 -> 1 +cotx1097 comparetotal 1e600000000 1e400000000 -> 1 +cotx1098 comparetotal 9e999999998 100 -> 1 +cotx1099 comparetotal 9e999999998 10 -> 1 +cotx1100 comparetotal 100 9e999999998 -> -1 +-- signs +cotx1101 comparetotal 1e+777777777 1e+411111111 -> 1 +cotx1102 comparetotal 1e+777777777 -1e+411111111 -> 1 +cotx1103 comparetotal -1e+777777777 1e+411111111 -> -1 +cotx1104 comparetotal -1e+777777777 -1e+411111111 -> -1 +cotx1105 comparetotal 1e-777777777 1e-411111111 -> -1 +cotx1106 comparetotal 1e-777777777 -1e-411111111 -> 1 +cotx1107 comparetotal -1e-777777777 1e-411111111 -> -1 +cotx1108 comparetotal -1e-777777777 -1e-411111111 -> 1 + +-- Null tests +cotx9990 comparetotal 10 # -> NaN Invalid_operation +cotx9991 comparetotal # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal-c/new_dt/decimal128.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/decimal128.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,536 @@ +------------------------------------------------------------------------ +-- decimal128.decTest -- decimal sixteen-byte format testcases -- +-- Copyright (c) IBM Corporation, 2000, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- This set of tests is for the sixteen-byte concrete representation. +-- Its characteristics are: +-- +-- 1 bit sign +-- 5 bits combination field +-- 12 bits exponent continuation +-- 110 bits coefficient continuation +-- +-- Total exponent length 14 bits +-- Total coefficient length 114 bits (34 digits) +-- +-- Elimit = 12287 (maximum encoded exponent) +-- Emax = 6144 (largest exponent value) +-- Emin = -6143 (smallest exponent value) +-- bias = 6176 (subtracted from encoded exponent) = -Etiny + +extended: 1 +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 + +-- General testcases +-- (mostly derived from the Strawman 4 document and examples) +decg001 apply #A20780000000000000000000000003D0 -> -7.50 +decg002 apply -7.50 -> #A20780000000000000000000000003D0 + +-- Normality +decf010 apply 1234567890123456789012345678901234 -> #2608134b9c1e28e56f3c127177823534 +decf011 apply 1234567890123456789012345678901234.0 -> #2608134b9c1e28e56f3c127177823534 Rounded +decf012 apply 1234567890123456789012345678901234.1 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf013 apply 1234567890123456789012345678901234.9 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf014 apply -1234567890123456789012345678901234 -> #a608134b9c1e28e56f3c127177823534 +decf015 apply -1234567890123456789012345678901234.0 -> #a608134b9c1e28e56f3c127177823534 Rounded +decf016 apply -1234567890123456789012345678901234.1 -> #a608134b9c1e28e56f3c127177823534 Rounded Inexact +decf017 apply -1234567890123456789012345678901234.9 -> #a608134b9c1e28e56f3c127177823535 Rounded Inexact + + +-- Nmax and similar +decf022 apply 9.999999999999999999999999999999999E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff +decf023 apply #77ffcff3fcff3fcff3fcff3fcff3fcff -> 9.999999999999999999999999999999999E+6144 +decf024 apply 1.234567890123456789012345678901234E+6144 -> #47ffd34b9c1e28e56f3c127177823534 +decf025 apply #47ffd34b9c1e28e56f3c127177823534 -> 1.234567890123456789012345678901234E+6144 +-- fold-downs (more below) +decf030 apply 1.23E+6144 -> #47ffd300000000000000000000000000 Clamped +decf031 apply #47ffd300000000000000000000000000 -> 1.230000000000000000000000000000000E+6144 +decf032 apply 1E+6144 -> #47ffc000000000000000000000000000 Clamped +decf033 apply #47ffc000000000000000000000000000 -> 1.000000000000000000000000000000000E+6144 + +-- overflows +maxExponent: 9999 -- set high so conversion causes the overflow +minExponent: -9999 +decf040 apply 10E+6144 -> #78000000000000000000000000000000 Overflow Rounded Inexact +decf041 apply 1.000000000000000E+6145 -> #78000000000000000000000000000000 Overflow Rounded Inexact +maxExponent: 6144 +minExponent: -6143 + +decf051 apply 12345 -> #220800000000000000000000000049c5 +decf052 apply #220800000000000000000000000049c5 -> 12345 +decf053 apply 1234 -> #22080000000000000000000000000534 +decf054 apply #22080000000000000000000000000534 -> 1234 +decf055 apply 123 -> #220800000000000000000000000000a3 +decf056 apply #220800000000000000000000000000a3 -> 123 +decf057 apply 12 -> #22080000000000000000000000000012 +decf058 apply #22080000000000000000000000000012 -> 12 +decf059 apply 1 -> #22080000000000000000000000000001 +decf060 apply #22080000000000000000000000000001 -> 1 +decf061 apply 1.23 -> #220780000000000000000000000000a3 +decf062 apply #220780000000000000000000000000a3 -> 1.23 +decf063 apply 123.45 -> #220780000000000000000000000049c5 +decf064 apply #220780000000000000000000000049c5 -> 123.45 + +-- Nmin and below +decf071 apply 1E-6143 -> #00084000000000000000000000000001 +decf072 apply #00084000000000000000000000000001 -> 1E-6143 +decf073 apply 1.000000000000000000000000000000000E-6143 -> #04000000000000000000000000000000 +decf074 apply #04000000000000000000000000000000 -> 1.000000000000000000000000000000000E-6143 +decf075 apply 1.000000000000000000000000000000001E-6143 -> #04000000000000000000000000000001 +decf076 apply #04000000000000000000000000000001 -> 1.000000000000000000000000000000001E-6143 + +decf077 apply 0.100000000000000000000000000000000E-6143 -> #00000800000000000000000000000000 Subnormal +decf078 apply #00000800000000000000000000000000 -> 1.00000000000000000000000000000000E-6144 Subnormal +decf079 apply 0.000000000000000000000000000000010E-6143 -> #00000000000000000000000000000010 Subnormal +decf080 apply #00000000000000000000000000000010 -> 1.0E-6175 Subnormal +decf081 apply 0.00000000000000000000000000000001E-6143 -> #00004000000000000000000000000001 Subnormal +decf082 apply #00004000000000000000000000000001 -> 1E-6175 Subnormal +decf083 apply 0.000000000000000000000000000000001E-6143 -> #00000000000000000000000000000001 Subnormal +decf084 apply #00000000000000000000000000000001 -> 1E-6176 Subnormal + +-- underflows +decf090 apply 1e-6176 -> #00000000000000000000000000000001 Subnormal +decf091 apply 1.9e-6176 -> #00000000000000000000000000000002 Subnormal Underflow Inexact Rounded +decf092 apply 1.1e-6176 -> #00000000000000000000000000000001 Subnormal Underflow Inexact Rounded +decf093 apply 1.00000000001e-6176 -> #00000000000000000000000000000001 Subnormal Underflow Inexact Rounded +decf094 apply 1.00000000000001e-6176 -> #00000000000000000000000000000001 Subnormal Underflow Inexact Rounded +decf095 apply 1.000000000000001e-6176 -> #00000000000000000000000000000001 Subnormal Underflow Inexact Rounded +decf096 apply 0.1e-6176 -> #00000000000000000000000000000000 Subnormal Underflow Inexact Rounded Clamped +decf097 apply 0.00000000001e-6176 -> #00000000000000000000000000000000 Subnormal Underflow Inexact Rounded Clamped +decf098 apply 0.00000000000001e-6176 -> #00000000000000000000000000000000 Subnormal Underflow Inexact Rounded Clamped +decf099 apply 0.000000000000001e-6176 -> #00000000000000000000000000000000 Subnormal Underflow Inexact Rounded Clamped +decf100 apply 999999999999999999999999999999999e-6176 -> #00000ff3fcff3fcff3fcff3fcff3fcff Subnormal + +-- same again, negatives +-- Nmax and similar +decf122 apply -9.999999999999999999999999999999999E+6144 -> #f7ffcff3fcff3fcff3fcff3fcff3fcff +decf123 apply #f7ffcff3fcff3fcff3fcff3fcff3fcff -> -9.999999999999999999999999999999999E+6144 +decf124 apply -1.234567890123456789012345678901234E+6144 -> #c7ffd34b9c1e28e56f3c127177823534 +decf125 apply #c7ffd34b9c1e28e56f3c127177823534 -> -1.234567890123456789012345678901234E+6144 +-- fold-downs (more below) +decf130 apply -1.23E+6144 -> #c7ffd300000000000000000000000000 Clamped +decf131 apply #c7ffd300000000000000000000000000 -> -1.230000000000000000000000000000000E+6144 +decf132 apply -1E+6144 -> #c7ffc000000000000000000000000000 Clamped +decf133 apply #c7ffc000000000000000000000000000 -> -1.000000000000000000000000000000000E+6144 + +-- overflows +maxExponent: 9999 -- set high so conversion causes the overflow +minExponent: -9999 +decf140 apply -10E+6144 -> #f8000000000000000000000000000000 Overflow Rounded Inexact +decf141 apply -1.000000000000000E+6145 -> #f8000000000000000000000000000000 Overflow Rounded Inexact +maxExponent: 6144 +minExponent: -6143 + +decf151 apply -12345 -> #a20800000000000000000000000049c5 +decf152 apply #a20800000000000000000000000049c5 -> -12345 +decf153 apply -1234 -> #a2080000000000000000000000000534 +decf154 apply #a2080000000000000000000000000534 -> -1234 +decf155 apply -123 -> #a20800000000000000000000000000a3 +decf156 apply #a20800000000000000000000000000a3 -> -123 +decf157 apply -12 -> #a2080000000000000000000000000012 +decf158 apply #a2080000000000000000000000000012 -> -12 +decf159 apply -1 -> #a2080000000000000000000000000001 +decf160 apply #a2080000000000000000000000000001 -> -1 +decf161 apply -1.23 -> #a20780000000000000000000000000a3 +decf162 apply #a20780000000000000000000000000a3 -> -1.23 +decf163 apply -123.45 -> #a20780000000000000000000000049c5 +decf164 apply #a20780000000000000000000000049c5 -> -123.45 + +-- Nmin and below +decf171 apply -1E-6143 -> #80084000000000000000000000000001 +decf172 apply #80084000000000000000000000000001 -> -1E-6143 +decf173 apply -1.000000000000000000000000000000000E-6143 -> #84000000000000000000000000000000 +decf174 apply #84000000000000000000000000000000 -> -1.000000000000000000000000000000000E-6143 +decf175 apply -1.000000000000000000000000000000001E-6143 -> #84000000000000000000000000000001 +decf176 apply #84000000000000000000000000000001 -> -1.000000000000000000000000000000001E-6143 + +decf177 apply -0.100000000000000000000000000000000E-6143 -> #80000800000000000000000000000000 Subnormal +decf178 apply #80000800000000000000000000000000 -> -1.00000000000000000000000000000000E-6144 Subnormal +decf179 apply -0.000000000000000000000000000000010E-6143 -> #80000000000000000000000000000010 Subnormal +decf180 apply #80000000000000000000000000000010 -> -1.0E-6175 Subnormal +decf181 apply -0.00000000000000000000000000000001E-6143 -> #80004000000000000000000000000001 Subnormal +decf182 apply #80004000000000000000000000000001 -> -1E-6175 Subnormal +decf183 apply -0.000000000000000000000000000000001E-6143 -> #80000000000000000000000000000001 Subnormal +decf184 apply #80000000000000000000000000000001 -> -1E-6176 Subnormal + +-- underflows +decf190 apply -1e-6176 -> #80000000000000000000000000000001 Subnormal +decf191 apply -1.9e-6176 -> #80000000000000000000000000000002 Subnormal Underflow Inexact Rounded +decf192 apply -1.1e-6176 -> #80000000000000000000000000000001 Subnormal Underflow Inexact Rounded +decf193 apply -1.00000000001e-6176 -> #80000000000000000000000000000001 Subnormal Underflow Inexact Rounded +decf194 apply -1.00000000000001e-6176 -> #80000000000000000000000000000001 Subnormal Underflow Inexact Rounded +decf195 apply -1.000000000000001e-6176 -> #80000000000000000000000000000001 Subnormal Underflow Inexact Rounded +decf196 apply -0.1e-6176 -> #80000000000000000000000000000000 Subnormal Underflow Inexact Rounded Clamped +decf197 apply -0.00000000001e-6176 -> #80000000000000000000000000000000 Subnormal Underflow Inexact Rounded Clamped +decf198 apply -0.00000000000001e-6176 -> #80000000000000000000000000000000 Subnormal Underflow Inexact Rounded Clamped +decf199 apply -0.000000000000001e-6176 -> #80000000000000000000000000000000 Subnormal Underflow Inexact Rounded Clamped +decf200 apply -999999999999999999999999999999999e-6176 -> #80000ff3fcff3fcff3fcff3fcff3fcff Subnormal + +-- zeros +decf400 apply 0E-8000 -> #00000000000000000000000000000000 Clamped +decf401 apply 0E-6177 -> #00000000000000000000000000000000 Clamped +decf402 apply 0E-6176 -> #00000000000000000000000000000000 +decf403 apply #00000000000000000000000000000000 -> 0E-6176 +decf404 apply 0.000000000000000000000000000000000E-6143 -> #00000000000000000000000000000000 +decf405 apply #00000000000000000000000000000000 -> 0E-6176 +decf406 apply 0E-2 -> #22078000000000000000000000000000 +decf407 apply #22078000000000000000000000000000 -> 0.00 +decf408 apply 0 -> #22080000000000000000000000000000 +decf409 apply #22080000000000000000000000000000 -> 0 +decf410 apply 0E+3 -> #2208c000000000000000000000000000 +decf411 apply #2208c000000000000000000000000000 -> 0E+3 +decf412 apply 0E+6111 -> #43ffc000000000000000000000000000 +decf413 apply #43ffc000000000000000000000000000 -> 0E+6111 +-- clamped zeros... +decf414 apply 0E+6112 -> #43ffc000000000000000000000000000 Clamped +decf415 apply #43ffc000000000000000000000000000 -> 0E+6111 +decf416 apply 0E+6144 -> #43ffc000000000000000000000000000 Clamped +decf417 apply #43ffc000000000000000000000000000 -> 0E+6111 +decf418 apply 0E+8000 -> #43ffc000000000000000000000000000 Clamped +decf419 apply #43ffc000000000000000000000000000 -> 0E+6111 + +-- negative zeros +decf420 apply -0E-8000 -> #80000000000000000000000000000000 Clamped +decf421 apply -0E-6177 -> #80000000000000000000000000000000 Clamped +decf422 apply -0E-6176 -> #80000000000000000000000000000000 +decf423 apply #80000000000000000000000000000000 -> -0E-6176 +decf424 apply -0.000000000000000000000000000000000E-6143 -> #80000000000000000000000000000000 +decf425 apply #80000000000000000000000000000000 -> -0E-6176 +decf426 apply -0E-2 -> #a2078000000000000000000000000000 +decf427 apply #a2078000000000000000000000000000 -> -0.00 +decf428 apply -0 -> #a2080000000000000000000000000000 +decf429 apply #a2080000000000000000000000000000 -> -0 +decf430 apply -0E+3 -> #a208c000000000000000000000000000 +decf431 apply #a208c000000000000000000000000000 -> -0E+3 +decf432 apply -0E+6111 -> #c3ffc000000000000000000000000000 +decf433 apply #c3ffc000000000000000000000000000 -> -0E+6111 +-- clamped zeros... +decf434 apply -0E+6112 -> #c3ffc000000000000000000000000000 Clamped +decf435 apply #c3ffc000000000000000000000000000 -> -0E+6111 +decf436 apply -0E+6144 -> #c3ffc000000000000000000000000000 Clamped +decf437 apply #c3ffc000000000000000000000000000 -> -0E+6111 +decf438 apply -0E+8000 -> #c3ffc000000000000000000000000000 Clamped +decf439 apply #c3ffc000000000000000000000000000 -> -0E+6111 + +-- Specials +decf500 apply Infinity -> #78000000000000000000000000000000 +decf501 apply #78787878787878787878787878787878 -> #78000000000000000000000000000000 +decf502 apply #78000000000000000000000000000000 -> Infinity +decf503 apply #79797979797979797979797979797979 -> #78000000000000000000000000000000 +decf504 apply #79000000000000000000000000000000 -> Infinity +decf505 apply #7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #78000000000000000000000000000000 +decf506 apply #7a000000000000000000000000000000 -> Infinity +decf507 apply #7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #78000000000000000000000000000000 +decf508 apply #7b000000000000000000000000000000 -> Infinity + +decf509 apply NaN -> #7c000000000000000000000000000000 +decf510 apply #7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #7c003c7c7c7c7c7c7c7c7c7c7c7c7c7c +decf511 apply #7c000000000000000000000000000000 -> NaN +decf512 apply #7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #7c003d7d7d7d7d7d7d7d7d7d7d7d7d7d +decf513 apply #7d000000000000000000000000000000 -> NaN +decf514 apply #7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #7e003e7e7c7e7e7e7e7c7e7e7e7e7c7e +decf515 apply #7e000000000000000000000000000000 -> sNaN +decf516 apply #7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #7e003f7f7c7f7f7f7f7c7f7f7f7f7c7f +decf517 apply #7f000000000000000000000000000000 -> sNaN +decf518 apply #7fffffffffffffffffffffffffffffff -> sNaN999999999999999999999999999999999 +decf519 apply #7fffffffffffffffffffffffffffffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff + +decf520 apply -Infinity -> #f8000000000000000000000000000000 +decf521 apply #f8787878787878787878787878787878 -> #f8000000000000000000000000000000 +decf522 apply #f8000000000000000000000000000000 -> -Infinity +decf523 apply #f9797979797979797979797979797979 -> #f8000000000000000000000000000000 +decf524 apply #f9000000000000000000000000000000 -> -Infinity +decf525 apply #fa7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #f8000000000000000000000000000000 +decf526 apply #fa000000000000000000000000000000 -> -Infinity +decf527 apply #fb7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #f8000000000000000000000000000000 +decf528 apply #fb000000000000000000000000000000 -> -Infinity + +decf529 apply -NaN -> #fc000000000000000000000000000000 +decf530 apply #fc7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #fc003c7c7c7c7c7c7c7c7c7c7c7c7c7c +decf531 apply #fc000000000000000000000000000000 -> -NaN +decf532 apply #fd7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #fc003d7d7d7d7d7d7d7d7d7d7d7d7d7d +decf533 apply #fd000000000000000000000000000000 -> -NaN +decf534 apply #fe7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #fe003e7e7c7e7e7e7e7c7e7e7e7e7c7e +decf535 apply #fe000000000000000000000000000000 -> -sNaN +decf536 apply #ff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #fe003f7f7c7f7f7f7f7c7f7f7f7f7c7f +decf537 apply #ff000000000000000000000000000000 -> -sNaN +decf538 apply #ffffffffffffffffffffffffffffffff -> -sNaN999999999999999999999999999999999 +decf539 apply #ffffffffffffffffffffffffffffffff -> #fe000ff3fcff3fcff3fcff3fcff3fcff + +decf540 apply NaN -> #7c000000000000000000000000000000 +decf541 apply NaN0 -> #7c000000000000000000000000000000 +decf542 apply NaN1 -> #7c000000000000000000000000000001 +decf543 apply NaN12 -> #7c000000000000000000000000000012 +decf544 apply NaN79 -> #7c000000000000000000000000000079 +decf545 apply NaN12345 -> #7c0000000000000000000000000049c5 +decf546 apply NaN123456 -> #7c000000000000000000000000028e56 +decf547 apply NaN799799 -> #7c0000000000000000000000000f7fdf +decf548 apply NaN799799799799799799799799799799799 -> #7c003dff7fdff7fdff7fdff7fdff7fdf +decf549 apply NaN999999999999999999999999999999999 -> #7c000ff3fcff3fcff3fcff3fcff3fcff +decf550 apply NaN1234567890123456789012345678901234 -> #7c000000000000000000000000000000 -- too many digits + +-- fold-down full sequence +decf600 apply 1E+6145 -> #78000000000000000000000000000000 Overflow Inexact Rounded +decf601 apply 1E+6144 -> #47ffc000000000000000000000000000 Clamped +decf602 apply #47ffc000000000000000000000000000 -> 1.000000000000000000000000000000000E+6144 +decf603 apply 1E+6143 -> #43ffc800000000000000000000000000 Clamped +decf604 apply #43ffc800000000000000000000000000 -> 1.00000000000000000000000000000000E+6143 +decf605 apply 1E+6142 -> #43ffc100000000000000000000000000 Clamped +decf606 apply #43ffc100000000000000000000000000 -> 1.0000000000000000000000000000000E+6142 +decf607 apply 1E+6141 -> #43ffc010000000000000000000000000 Clamped +decf608 apply #43ffc010000000000000000000000000 -> 1.000000000000000000000000000000E+6141 +decf609 apply 1E+6140 -> #43ffc002000000000000000000000000 Clamped +decf610 apply #43ffc002000000000000000000000000 -> 1.00000000000000000000000000000E+6140 +decf611 apply 1E+6139 -> #43ffc000400000000000000000000000 Clamped +decf612 apply #43ffc000400000000000000000000000 -> 1.0000000000000000000000000000E+6139 +decf613 apply 1E+6138 -> #43ffc000040000000000000000000000 Clamped +decf614 apply #43ffc000040000000000000000000000 -> 1.000000000000000000000000000E+6138 +decf615 apply 1E+6137 -> #43ffc000008000000000000000000000 Clamped +decf616 apply #43ffc000008000000000000000000000 -> 1.00000000000000000000000000E+6137 +decf617 apply 1E+6136 -> #43ffc000001000000000000000000000 Clamped +decf618 apply #43ffc000001000000000000000000000 -> 1.0000000000000000000000000E+6136 +decf619 apply 1E+6135 -> #43ffc000000100000000000000000000 Clamped +decf620 apply #43ffc000000100000000000000000000 -> 1.000000000000000000000000E+6135 +decf621 apply 1E+6134 -> #43ffc000000020000000000000000000 Clamped +decf622 apply #43ffc000000020000000000000000000 -> 1.00000000000000000000000E+6134 +decf623 apply 1E+6133 -> #43ffc000000004000000000000000000 Clamped +decf624 apply #43ffc000000004000000000000000000 -> 1.0000000000000000000000E+6133 +decf625 apply 1E+6132 -> #43ffc000000000400000000000000000 Clamped +decf626 apply #43ffc000000000400000000000000000 -> 1.000000000000000000000E+6132 +decf627 apply 1E+6131 -> #43ffc000000000080000000000000000 Clamped +decf628 apply #43ffc000000000080000000000000000 -> 1.00000000000000000000E+6131 +decf629 apply 1E+6130 -> #43ffc000000000010000000000000000 Clamped +decf630 apply #43ffc000000000010000000000000000 -> 1.0000000000000000000E+6130 +decf631 apply 1E+6129 -> #43ffc000000000001000000000000000 Clamped +decf632 apply #43ffc000000000001000000000000000 -> 1.000000000000000000E+6129 +decf633 apply 1E+6128 -> #43ffc000000000000200000000000000 Clamped +decf634 apply #43ffc000000000000200000000000000 -> 1.00000000000000000E+6128 +decf635 apply 1E+6127 -> #43ffc000000000000040000000000000 Clamped +decf636 apply #43ffc000000000000040000000000000 -> 1.0000000000000000E+6127 +decf637 apply 1E+6126 -> #43ffc000000000000004000000000000 Clamped +decf638 apply #43ffc000000000000004000000000000 -> 1.000000000000000E+6126 +decf639 apply 1E+6125 -> #43ffc000000000000000800000000000 Clamped +decf640 apply #43ffc000000000000000800000000000 -> 1.00000000000000E+6125 +decf641 apply 1E+6124 -> #43ffc000000000000000100000000000 Clamped +decf642 apply #43ffc000000000000000100000000000 -> 1.0000000000000E+6124 +decf643 apply 1E+6123 -> #43ffc000000000000000010000000000 Clamped +decf644 apply #43ffc000000000000000010000000000 -> 1.000000000000E+6123 +decf645 apply 1E+6122 -> #43ffc000000000000000002000000000 Clamped +decf646 apply #43ffc000000000000000002000000000 -> 1.00000000000E+6122 +decf647 apply 1E+6121 -> #43ffc000000000000000000400000000 Clamped +decf648 apply #43ffc000000000000000000400000000 -> 1.0000000000E+6121 +decf649 apply 1E+6120 -> #43ffc000000000000000000040000000 Clamped +decf650 apply #43ffc000000000000000000040000000 -> 1.000000000E+6120 +decf651 apply 1E+6119 -> #43ffc000000000000000000008000000 Clamped +decf652 apply #43ffc000000000000000000008000000 -> 1.00000000E+6119 +decf653 apply 1E+6118 -> #43ffc000000000000000000001000000 Clamped +decf654 apply #43ffc000000000000000000001000000 -> 1.0000000E+6118 +decf655 apply 1E+6117 -> #43ffc000000000000000000000100000 Clamped +decf656 apply #43ffc000000000000000000000100000 -> 1.000000E+6117 +decf657 apply 1E+6116 -> #43ffc000000000000000000000020000 Clamped +decf658 apply #43ffc000000000000000000000020000 -> 1.00000E+6116 +decf659 apply 1E+6115 -> #43ffc000000000000000000000004000 Clamped +decf660 apply #43ffc000000000000000000000004000 -> 1.0000E+6115 +decf661 apply 1E+6114 -> #43ffc000000000000000000000000400 Clamped +decf662 apply #43ffc000000000000000000000000400 -> 1.000E+6114 +decf663 apply 1E+6113 -> #43ffc000000000000000000000000080 Clamped +decf664 apply #43ffc000000000000000000000000080 -> 1.00E+6113 +decf665 apply 1E+6112 -> #43ffc000000000000000000000000010 Clamped +decf666 apply #43ffc000000000000000000000000010 -> 1.0E+6112 +decf667 apply 1E+6111 -> #43ffc000000000000000000000000001 +decf668 apply #43ffc000000000000000000000000001 -> 1E+6111 +decf669 apply 1E+6110 -> #43ff8000000000000000000000000001 +decf670 apply #43ff8000000000000000000000000001 -> 1E+6110 + +-- Selected DPD codes +decf700 apply #22080000000000000000000000000000 -> 0 +decf701 apply #22080000000000000000000000000009 -> 9 +decf702 apply #22080000000000000000000000000010 -> 10 +decf703 apply #22080000000000000000000000000019 -> 19 +decf704 apply #22080000000000000000000000000020 -> 20 +decf705 apply #22080000000000000000000000000029 -> 29 +decf706 apply #22080000000000000000000000000030 -> 30 +decf707 apply #22080000000000000000000000000039 -> 39 +decf708 apply #22080000000000000000000000000040 -> 40 +decf709 apply #22080000000000000000000000000049 -> 49 +decf710 apply #22080000000000000000000000000050 -> 50 +decf711 apply #22080000000000000000000000000059 -> 59 +decf712 apply #22080000000000000000000000000060 -> 60 +decf713 apply #22080000000000000000000000000069 -> 69 +decf714 apply #22080000000000000000000000000070 -> 70 +decf715 apply #22080000000000000000000000000071 -> 71 +decf716 apply #22080000000000000000000000000072 -> 72 +decf717 apply #22080000000000000000000000000073 -> 73 +decf718 apply #22080000000000000000000000000074 -> 74 +decf719 apply #22080000000000000000000000000075 -> 75 +decf720 apply #22080000000000000000000000000076 -> 76 +decf721 apply #22080000000000000000000000000077 -> 77 +decf722 apply #22080000000000000000000000000078 -> 78 +decf723 apply #22080000000000000000000000000079 -> 79 + +decf730 apply #2208000000000000000000000000029e -> 994 +decf731 apply #2208000000000000000000000000029f -> 995 +decf732 apply #220800000000000000000000000002a0 -> 520 +decf733 apply #220800000000000000000000000002a1 -> 521 + +-- DPD: one of each of the huffman groups +decf740 apply #220800000000000000000000000003f7 -> 777 +decf741 apply #220800000000000000000000000003f8 -> 778 +decf742 apply #220800000000000000000000000003eb -> 787 +decf743 apply #2208000000000000000000000000037d -> 877 +decf744 apply #2208000000000000000000000000039f -> 997 +decf745 apply #220800000000000000000000000003bf -> 979 +decf746 apply #220800000000000000000000000003df -> 799 +decf747 apply #2208000000000000000000000000006e -> 888 + + +-- DPD all-highs cases (includes the 24 redundant codes) +decf750 apply #2208000000000000000000000000006e -> 888 +decf751 apply #2208000000000000000000000000016e -> 888 +decf752 apply #2208000000000000000000000000026e -> 888 +decf753 apply #2208000000000000000000000000036e -> 888 +decf754 apply #2208000000000000000000000000006f -> 889 +decf755 apply #2208000000000000000000000000016f -> 889 +decf756 apply #2208000000000000000000000000026f -> 889 +decf757 apply #2208000000000000000000000000036f -> 889 + +decf760 apply #2208000000000000000000000000007e -> 898 +decf761 apply #2208000000000000000000000000017e -> 898 +decf762 apply #2208000000000000000000000000027e -> 898 +decf763 apply #2208000000000000000000000000037e -> 898 +decf764 apply #2208000000000000000000000000007f -> 899 +decf765 apply #2208000000000000000000000000017f -> 899 +decf766 apply #2208000000000000000000000000027f -> 899 +decf767 apply #2208000000000000000000000000037f -> 899 + +decf770 apply #220800000000000000000000000000ee -> 988 +decf771 apply #220800000000000000000000000001ee -> 988 +decf772 apply #220800000000000000000000000002ee -> 988 +decf773 apply #220800000000000000000000000003ee -> 988 +decf774 apply #220800000000000000000000000000ef -> 989 +decf775 apply #220800000000000000000000000001ef -> 989 +decf776 apply #220800000000000000000000000002ef -> 989 +decf777 apply #220800000000000000000000000003ef -> 989 + +decf780 apply #220800000000000000000000000000fe -> 998 +decf781 apply #220800000000000000000000000001fe -> 998 +decf782 apply #220800000000000000000000000002fe -> 998 +decf783 apply #220800000000000000000000000003fe -> 998 +decf784 apply #220800000000000000000000000000ff -> 999 +decf785 apply #220800000000000000000000000001ff -> 999 +decf786 apply #220800000000000000000000000002ff -> 999 +decf787 apply #220800000000000000000000000003ff -> 999 + +-- Miscellaneous (testers' queries, etc.) + +decf790 apply #2208000000000000000000000000c000 -> 30000 +decf791 apply #22080000000000000000000000007800 -> 890000 +decf792 apply 30000 -> #2208000000000000000000000000c000 +decf793 apply 890000 -> #22080000000000000000000000007800 + +-- Rounding modes (negatives in decimal64) + +rounding: floor +decf800 apply 1234567890123456789012345678901234.00 -> #2608134b9c1e28e56f3c127177823534 Rounded +decf801 apply 1234567890123456789012345678901234.01 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf802 apply 1234567890123456789012345678901234.3 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf803 apply 1234567890123456789012345678901234.49 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf804 apply 1234567890123456789012345678901233.50 -> #2608134b9c1e28e56f3c127177823533 Rounded Inexact +decf805 apply 1234567890123456789012345678901234.50 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf806 apply 1234567890123456789012345678901234.51 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf807 apply 1234567890123456789012345678901234.66 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf808 apply 1234567890123456789012345678901234.90 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf809 apply 1234567890123456789012345678901234.99 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact + +rounding: ceiling +decf810 apply 1234567890123456789012345678901234.00 -> #2608134b9c1e28e56f3c127177823534 Rounded +decf811 apply 1234567890123456789012345678901234.01 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf812 apply 1234567890123456789012345678901234.3 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf813 apply 1234567890123456789012345678901234.49 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf814 apply 1234567890123456789012345678901233.50 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf815 apply 1234567890123456789012345678901234.50 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf816 apply 1234567890123456789012345678901234.51 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf817 apply 1234567890123456789012345678901234.66 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf818 apply 1234567890123456789012345678901234.90 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf819 apply 1234567890123456789012345678901234.99 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact + +rounding: up +decf820 apply 1234567890123456789012345678901234.00 -> #2608134b9c1e28e56f3c127177823534 Rounded +decf821 apply 1234567890123456789012345678901234.01 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf822 apply 1234567890123456789012345678901234.3 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf823 apply 1234567890123456789012345678901234.49 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf824 apply 1234567890123456789012345678901233.50 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf825 apply 1234567890123456789012345678901234.50 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf826 apply 1234567890123456789012345678901234.51 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf827 apply 1234567890123456789012345678901234.66 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf828 apply 1234567890123456789012345678901234.90 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf829 apply 1234567890123456789012345678901234.99 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact + +rounding: down +decf830 apply 1234567890123456789012345678901234.00 -> #2608134b9c1e28e56f3c127177823534 Rounded +decf831 apply 1234567890123456789012345678901234.01 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf832 apply 1234567890123456789012345678901234.3 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf833 apply 1234567890123456789012345678901234.49 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf834 apply 1234567890123456789012345678901233.50 -> #2608134b9c1e28e56f3c127177823533 Rounded Inexact +decf835 apply 1234567890123456789012345678901234.50 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf836 apply 1234567890123456789012345678901234.51 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf837 apply 1234567890123456789012345678901234.66 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf838 apply 1234567890123456789012345678901234.90 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf839 apply 1234567890123456789012345678901234.99 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact + +rounding: half_up +decf840 apply 1234567890123456789012345678901234.00 -> #2608134b9c1e28e56f3c127177823534 Rounded +decf841 apply 1234567890123456789012345678901234.01 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf842 apply 1234567890123456789012345678901234.3 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf843 apply 1234567890123456789012345678901234.49 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf844 apply 1234567890123456789012345678901233.50 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf845 apply 1234567890123456789012345678901234.50 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf846 apply 1234567890123456789012345678901234.51 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf847 apply 1234567890123456789012345678901234.66 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf848 apply 1234567890123456789012345678901234.90 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf849 apply 1234567890123456789012345678901234.99 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact + +rounding: half_even +decf850 apply 1234567890123456789012345678901234.00 -> #2608134b9c1e28e56f3c127177823534 Rounded +decf851 apply 1234567890123456789012345678901234.01 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf852 apply 1234567890123456789012345678901234.3 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf853 apply 1234567890123456789012345678901234.49 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf854 apply 1234567890123456789012345678901233.50 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf855 apply 1234567890123456789012345678901234.50 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf856 apply 1234567890123456789012345678901234.51 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf857 apply 1234567890123456789012345678901234.66 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf858 apply 1234567890123456789012345678901234.90 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf859 apply 1234567890123456789012345678901234.99 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact + +rounding: half_down +decf860 apply 1234567890123456789012345678901234.00 -> #2608134b9c1e28e56f3c127177823534 Rounded +decf861 apply 1234567890123456789012345678901234.01 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf862 apply 1234567890123456789012345678901234.3 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf863 apply 1234567890123456789012345678901234.49 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf864 apply 1234567890123456789012345678901233.50 -> #2608134b9c1e28e56f3c127177823533 Rounded Inexact +decf865 apply 1234567890123456789012345678901234.50 -> #2608134b9c1e28e56f3c127177823534 Rounded Inexact +decf866 apply 1234567890123456789012345678901234.51 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf867 apply 1234567890123456789012345678901234.66 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf868 apply 1234567890123456789012345678901234.90 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact +decf869 apply 1234567890123456789012345678901234.99 -> #2608134b9c1e28e56f3c127177823535 Rounded Inexact + Added: sandbox/trunk/decimal-c/new_dt/decimal32.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/decimal32.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,472 @@ +------------------------------------------------------------------------ +-- decimal32.decTest -- decimal four-byte format testcases -- +-- Copyright (c) IBM Corporation, 2000, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- This set of tests is for the four-byte concrete representation. +-- Its characteristics are: +-- +-- 1 bit sign +-- 5 bits combination field +-- 6 bits exponent continuation +-- 20 bits coefficient continuation +-- +-- Total exponent length 8 bits +-- Total coefficient length 24 bits (7 digits) +-- +-- Elimit = 191 (maximum encoded exponent) +-- Emax = 96 (largest exponent value) +-- Emin = -95 (smallest exponent value) +-- bias = 101 (subtracted from encoded exponent) = -Etiny + +extended: 1 +precision: 7 +rounding: half_up +maxExponent: 96 +minExponent: -95 + +-- General testcases +-- (mostly derived from the Strawman 4 document and examples) +decd001 apply #A23003D0 -> -7.50 +decd002 apply -7.50 -> #A23003D0 + +-- Normality +decd010 apply 1234567 -> #2654d2e7 +decd011 apply 1234567.0 -> #2654d2e7 Rounded +decd013 apply 1234567.1 -> #2654d2e7 Rounded Inexact +decd014 apply 1234567.9 -> #2654d2e8 Rounded Inexact +decd015 apply -1234567 -> #a654d2e7 +decd016 apply -1234567.0 -> #a654d2e7 Rounded +decd017 apply -1234567.1 -> #a654d2e7 Rounded Inexact +decd018 apply -1234567.9 -> #a654d2e8 Rounded Inexact + + +-- Nmax and similar +decd022 apply 9.999999E+96 -> #77f3fcff +decd023 apply #77f3fcff -> 9.999999E+96 +decd024 apply 1.234567E+96 -> #47f4d2e7 +decd025 apply #47f4d2e7 -> 1.234567E+96 +-- fold-downs (more below) +decd030 apply 1.23E+96 -> #47f4c000 Clamped +decd031 apply #47f4c000 -> 1.230000E+96 +decd032 apply 1E+96 -> #47f00000 Clamped +decd033 apply #47f00000 -> 1.000000E+96 + +-- overflows +maxExponent: 999 -- set high so conversion causes the overflow +minExponent: -999 +decd040 apply 10E+96 -> #78000000 Overflow Rounded Inexact +decd041 apply 1.000000E+97 -> #78000000 Overflow Rounded Inexact +maxExponent: 96 +minExponent: -95 + +decd051 apply 12345 -> #225049c5 +decd052 apply #225049c5 -> 12345 +decd053 apply 1234 -> #22500534 +decd054 apply #22500534 -> 1234 +decd055 apply 123 -> #225000a3 +decd056 apply #225000a3 -> 123 +decd057 apply 12 -> #22500012 +decd058 apply #22500012 -> 12 +decd059 apply 1 -> #22500001 +decd060 apply #22500001 -> 1 +decd061 apply 1.23 -> #223000a3 +decd062 apply #223000a3 -> 1.23 +decd063 apply 123.45 -> #223049c5 +decd064 apply #223049c5 -> 123.45 + +-- Nmin and below +decd071 apply 1E-95 -> #00600001 +decd072 apply #00600001 -> 1E-95 +decd073 apply 1.000000E-95 -> #04000000 +decd074 apply #04000000 -> 1.000000E-95 +decd075 apply 1.000001E-95 -> #04000001 +decd076 apply #04000001 -> 1.000001E-95 + +decd077 apply 0.100000E-95 -> #00020000 Subnormal +decd07x apply 1.00000E-96 -> 1.00000E-96 Subnormal +decd078 apply #00020000 -> 1.00000E-96 Subnormal +decd079 apply 0.000010E-95 -> #00000010 Subnormal +decd080 apply #00000010 -> 1.0E-100 Subnormal +decd081 apply 0.000001E-95 -> #00000001 Subnormal +decd082 apply #00000001 -> 1E-101 Subnormal +decd083 apply 1e-101 -> #00000001 Subnormal +decd084 apply #00000001 -> 1E-101 Subnormal +decd08x apply 1e-101 -> 1E-101 Subnormal + +-- underflows +decd090 apply 1e-101 -> #00000001 Subnormal +decd091 apply 1.9e-101 -> #00000002 Subnormal Underflow Inexact Rounded +decd092 apply 1.1e-101 -> #00000001 Subnormal Underflow Inexact Rounded +decd093 apply 1.001e-101 -> #00000001 Subnormal Underflow Inexact Rounded +decd094 apply 1.000001e-101 -> #00000001 Subnormal Underflow Inexact Rounded +decd095 apply 1.0000001e-101 -> #00000001 Subnormal Underflow Inexact Rounded +decd096 apply 0.1e-101 -> #00000000 Subnormal Underflow Inexact Rounded Clamped +decd097 apply 0.001e-101 -> #00000000 Subnormal Underflow Inexact Rounded Clamped +decd098 apply 0.000001e-101 -> #00000000 Subnormal Underflow Inexact Rounded Clamped +decd099 apply 0.0000001e-101 -> #00000000 Subnormal Underflow Inexact Rounded Clamped + +-- same again, negatives -- + +-- Nmax and similar +decd122 apply -9.999999E+96 -> #f7f3fcff +decd123 apply #f7f3fcff -> -9.999999E+96 +decd124 apply -1.234567E+96 -> #c7f4d2e7 +decd125 apply #c7f4d2e7 -> -1.234567E+96 +-- fold-downs (more below) +decd130 apply -1.23E+96 -> #c7f4c000 Clamped +decd131 apply #c7f4c000 -> -1.230000E+96 +decd132 apply -1E+96 -> #c7f00000 Clamped +decd133 apply #c7f00000 -> -1.000000E+96 + +-- overflows +maxExponent: 999 -- set high so conversion causes the overflow +minExponent: -999 +decd140 apply -10E+96 -> #f8000000 Overflow Rounded Inexact +decd141 apply -1.000000E+97 -> #f8000000 Overflow Rounded Inexact +maxExponent: 96 +minExponent: -95 + +decd151 apply -12345 -> #a25049c5 +decd152 apply #a25049c5 -> -12345 +decd153 apply -1234 -> #a2500534 +decd154 apply #a2500534 -> -1234 +decd155 apply -123 -> #a25000a3 +decd156 apply #a25000a3 -> -123 +decd157 apply -12 -> #a2500012 +decd158 apply #a2500012 -> -12 +decd159 apply -1 -> #a2500001 +decd160 apply #a2500001 -> -1 +decd161 apply -1.23 -> #a23000a3 +decd162 apply #a23000a3 -> -1.23 +decd163 apply -123.45 -> #a23049c5 +decd164 apply #a23049c5 -> -123.45 + +-- Nmin and below +decd171 apply -1E-95 -> #80600001 +decd172 apply #80600001 -> -1E-95 +decd173 apply -1.000000E-95 -> #84000000 +decd174 apply #84000000 -> -1.000000E-95 +decd175 apply -1.000001E-95 -> #84000001 +decd176 apply #84000001 -> -1.000001E-95 + +decd177 apply -0.100000E-95 -> #80020000 Subnormal +decd178 apply #80020000 -> -1.00000E-96 Subnormal +decd179 apply -0.000010E-95 -> #80000010 Subnormal +decd180 apply #80000010 -> -1.0E-100 Subnormal +decd181 apply -0.000001E-95 -> #80000001 Subnormal +decd182 apply #80000001 -> -1E-101 Subnormal +decd183 apply -1e-101 -> #80000001 Subnormal +decd184 apply #80000001 -> -1E-101 Subnormal + +-- underflows +decd190 apply -1e-101 -> #80000001 Subnormal +decd191 apply -1.9e-101 -> #80000002 Subnormal Underflow Inexact Rounded +decd192 apply -1.1e-101 -> #80000001 Subnormal Underflow Inexact Rounded +decd193 apply -1.001e-101 -> #80000001 Subnormal Underflow Inexact Rounded +decd194 apply -1.000001e-101 -> #80000001 Subnormal Underflow Inexact Rounded +decd195 apply -1.0000001e-101 -> #80000001 Subnormal Underflow Inexact Rounded +decd196 apply -0.1e-101 -> #80000000 Subnormal Underflow Inexact Rounded Clamped +decd197 apply -0.001e-101 -> #80000000 Subnormal Underflow Inexact Rounded Clamped +decd198 apply -0.000001e-101 -> #80000000 Subnormal Underflow Inexact Rounded Clamped +decd199 apply -0.0000001e-101 -> #80000000 Subnormal Underflow Inexact Rounded Clamped + +-- zeros +decd400 apply 0E-400 -> #00000000 Clamped +decd401 apply 0E-101 -> #00000000 +decd402 apply #00000000 -> 0E-101 +decd403 apply 0.000000E-95 -> #00000000 +decd404 apply #00000000 -> 0E-101 +decd405 apply 0E-2 -> #22300000 +decd406 apply #22300000 -> 0.00 +decd407 apply 0 -> #22500000 +decd408 apply #22500000 -> 0 +decd409 apply 0E+3 -> #22800000 +decd410 apply #22800000 -> 0E+3 +decd411 apply 0E+90 -> #43f00000 +decd412 apply #43f00000 -> 0E+90 +-- clamped zeros... +decd413 apply 0E+91 -> #43f00000 Clamped +decd414 apply #43f00000 -> 0E+90 +decd415 apply 0E+96 -> #43f00000 Clamped +decd416 apply #43f00000 -> 0E+90 +decd417 apply 0E+400 -> #43f00000 Clamped +decd418 apply #43f00000 -> 0E+90 + +-- negative zeros +decd420 apply -0E-400 -> #80000000 Clamped +decd421 apply -0E-101 -> #80000000 +decd422 apply #80000000 -> -0E-101 +decd423 apply -0.000000E-95 -> #80000000 +decd424 apply #80000000 -> -0E-101 +decd425 apply -0E-2 -> #a2300000 +decd426 apply #a2300000 -> -0.00 +decd427 apply -0 -> #a2500000 +decd428 apply #a2500000 -> -0 +decd429 apply -0E+3 -> #a2800000 +decd430 apply #a2800000 -> -0E+3 +decd431 apply -0E+90 -> #c3f00000 +decd432 apply #c3f00000 -> -0E+90 +-- clamped zeros... +decd433 apply -0E+91 -> #c3f00000 Clamped +decd434 apply #c3f00000 -> -0E+90 +decd435 apply -0E+96 -> #c3f00000 Clamped +decd436 apply #c3f00000 -> -0E+90 +decd437 apply -0E+400 -> #c3f00000 Clamped +decd438 apply #c3f00000 -> -0E+90 + +-- Specials +decd500 apply Infinity -> #78000000 +decd501 apply #78787878 -> #78000000 +decd502 apply #78000000 -> Infinity +decd503 apply #79797979 -> #78000000 +decd504 apply #79000000 -> Infinity +decd505 apply #7a7a7a7a -> #78000000 +decd506 apply #7a000000 -> Infinity +decd507 apply #7b7b7b7b -> #78000000 +decd508 apply #7b000000 -> Infinity +decd509 apply #7c7c7c7c -> #7c0c7c7c + +decd510 apply NaN -> #7c000000 +decd511 apply #7c000000 -> NaN +decd512 apply #7d7d7d7d -> #7c0d7d7d +decd513 apply #7d000000 -> NaN +decd514 apply #7e7e7e7e -> #7e0e7c7e +decd515 apply #7e000000 -> sNaN +decd516 apply #7f7f7f7f -> #7e0f7c7f +decd517 apply #7f000000 -> sNaN +decd518 apply #7fffffff -> sNaN999999 +decd519 apply #7fffffff -> #7e03fcff + +decd520 apply -Infinity -> #f8000000 +decd521 apply #f8787878 -> #f8000000 +decd522 apply #f8000000 -> -Infinity +decd523 apply #f9797979 -> #f8000000 +decd524 apply #f9000000 -> -Infinity +decd525 apply #fa7a7a7a -> #f8000000 +decd526 apply #fa000000 -> -Infinity +decd527 apply #fb7b7b7b -> #f8000000 +decd528 apply #fb000000 -> -Infinity + +decd529 apply -NaN -> #fc000000 +decd530 apply #fc7c7c7c -> #fc0c7c7c +decd531 apply #fc000000 -> -NaN +decd532 apply #fd7d7d7d -> #fc0d7d7d +decd533 apply #fd000000 -> -NaN +decd534 apply #fe7e7e7e -> #fe0e7c7e +decd535 apply #fe000000 -> -sNaN +decd536 apply #ff7f7f7f -> #fe0f7c7f +decd537 apply #ff000000 -> -sNaN +decd538 apply #ffffffff -> -sNaN999999 +decd539 apply #ffffffff -> #fe03fcff + +-- diagnostic NaNs +decd540 apply NaN -> #7c000000 +decd541 apply NaN0 -> #7c000000 +decd542 apply NaN1 -> #7c000001 +decd543 apply NaN12 -> #7c000012 +decd544 apply NaN79 -> #7c000079 +decd545 apply NaN12345 -> #7c0049c5 +decd546 apply NaN123456 -> #7c028e56 +decd547 apply NaN799799 -> #7c0f7fdf +decd548 apply NaN999999 -> #7c03fcff +decd549 apply NaN1234567 -> #7c000000 -- too many digits + + +-- fold-down full sequence +decd601 apply 1E+96 -> #47f00000 Clamped +decd602 apply #47f00000 -> 1.000000E+96 +decd603 apply 1E+95 -> #43f20000 Clamped +decd604 apply #43f20000 -> 1.00000E+95 +decd605 apply 1E+94 -> #43f04000 Clamped +decd606 apply #43f04000 -> 1.0000E+94 +decd607 apply 1E+93 -> #43f00400 Clamped +decd608 apply #43f00400 -> 1.000E+93 +decd609 apply 1E+92 -> #43f00080 Clamped +decd610 apply #43f00080 -> 1.00E+92 +decd611 apply 1E+91 -> #43f00010 Clamped +decd612 apply #43f00010 -> 1.0E+91 +decd613 apply 1E+90 -> #43f00001 +decd614 apply #43f00001 -> 1E+90 + + +-- Selected DPD codes +decd700 apply #22500000 -> 0 +decd701 apply #22500009 -> 9 +decd702 apply #22500010 -> 10 +decd703 apply #22500019 -> 19 +decd704 apply #22500020 -> 20 +decd705 apply #22500029 -> 29 +decd706 apply #22500030 -> 30 +decd707 apply #22500039 -> 39 +decd708 apply #22500040 -> 40 +decd709 apply #22500049 -> 49 +decd710 apply #22500050 -> 50 +decd711 apply #22500059 -> 59 +decd712 apply #22500060 -> 60 +decd713 apply #22500069 -> 69 +decd714 apply #22500070 -> 70 +decd715 apply #22500071 -> 71 +decd716 apply #22500072 -> 72 +decd717 apply #22500073 -> 73 +decd718 apply #22500074 -> 74 +decd719 apply #22500075 -> 75 +decd720 apply #22500076 -> 76 +decd721 apply #22500077 -> 77 +decd722 apply #22500078 -> 78 +decd723 apply #22500079 -> 79 + +decd730 apply #2250029e -> 994 +decd731 apply #2250029f -> 995 +decd732 apply #225002a0 -> 520 +decd733 apply #225002a1 -> 521 + +-- DPD: one of each of the huffman groups +decd740 apply #225003f7 -> 777 +decd741 apply #225003f8 -> 778 +decd742 apply #225003eb -> 787 +decd743 apply #2250037d -> 877 +decd744 apply #2250039f -> 997 +decd745 apply #225003bf -> 979 +decd746 apply #225003df -> 799 +decd747 apply #2250006e -> 888 + + +-- DPD all-highs cases (includes the 24 redundant codes) +decd750 apply #2250006e -> 888 +decd751 apply #2250016e -> 888 +decd752 apply #2250026e -> 888 +decd753 apply #2250036e -> 888 +decd754 apply #2250006f -> 889 +decd755 apply #2250016f -> 889 +decd756 apply #2250026f -> 889 +decd757 apply #2250036f -> 889 + +decd760 apply #2250007e -> 898 +decd761 apply #2250017e -> 898 +decd762 apply #2250027e -> 898 +decd763 apply #2250037e -> 898 +decd764 apply #2250007f -> 899 +decd765 apply #2250017f -> 899 +decd766 apply #2250027f -> 899 +decd767 apply #2250037f -> 899 + +decd770 apply #225000ee -> 988 +decd771 apply #225001ee -> 988 +decd772 apply #225002ee -> 988 +decd773 apply #225003ee -> 988 +decd774 apply #225000ef -> 989 +decd775 apply #225001ef -> 989 +decd776 apply #225002ef -> 989 +decd777 apply #225003ef -> 989 + +decd780 apply #225000fe -> 998 +decd781 apply #225001fe -> 998 +decd782 apply #225002fe -> 998 +decd783 apply #225003fe -> 998 +decd784 apply #225000ff -> 999 +decd785 apply #225001ff -> 999 +decd786 apply #225002ff -> 999 +decd787 apply #225003ff -> 999 + +-- Rounding modes (negatives in decimal64) + +rounding: floor +decd800 apply 1234567.0 -> #2654d2e7 Rounded +decd801 apply 1234567.01 -> #2654d2e7 Rounded Inexact +decd802 apply 1234567.30 -> #2654d2e7 Rounded Inexact +decd803 apply 1234567.49 -> #2654d2e7 Rounded Inexact +decd804 apply 1234566.50 -> #2654d2e6 Rounded Inexact +decd805 apply 1234567.50 -> #2654d2e7 Rounded Inexact +decd806 apply 1234567.51 -> #2654d2e7 Rounded Inexact +decd807 apply 1234567.75 -> #2654d2e7 Rounded Inexact +decd808 apply 1234567.89 -> #2654d2e7 Rounded Inexact +decd809 apply 1234567.99 -> #2654d2e7 Rounded Inexact + +rounding: ceiling +decd810 apply 1234567.0 -> #2654d2e7 Rounded +decd811 apply 1234567.01 -> #2654d2e8 Rounded Inexact +decd812 apply 1234567.30 -> #2654d2e8 Rounded Inexact +decd813 apply 1234567.49 -> #2654d2e8 Rounded Inexact +decd814 apply 1234566.50 -> #2654d2e7 Rounded Inexact +decd815 apply 1234567.50 -> #2654d2e8 Rounded Inexact +decd816 apply 1234567.51 -> #2654d2e8 Rounded Inexact +decd817 apply 1234567.75 -> #2654d2e8 Rounded Inexact +decd818 apply 1234567.89 -> #2654d2e8 Rounded Inexact +decd819 apply 1234567.99 -> #2654d2e8 Rounded Inexact + +rounding: up +decd820 apply 1234567.0 -> #2654d2e7 Rounded +decd821 apply 1234567.01 -> #2654d2e8 Rounded Inexact +decd822 apply 1234567.30 -> #2654d2e8 Rounded Inexact +decd823 apply 1234567.49 -> #2654d2e8 Rounded Inexact +decd824 apply 1234566.50 -> #2654d2e7 Rounded Inexact +decd825 apply 1234567.50 -> #2654d2e8 Rounded Inexact +decd826 apply 1234567.51 -> #2654d2e8 Rounded Inexact +decd827 apply 1234567.75 -> #2654d2e8 Rounded Inexact +decd828 apply 1234567.89 -> #2654d2e8 Rounded Inexact +decd829 apply 1234567.99 -> #2654d2e8 Rounded Inexact + +rounding: down +decd830 apply 1234567.0 -> #2654d2e7 Rounded +decd831 apply 1234567.01 -> #2654d2e7 Rounded Inexact +decd832 apply 1234567.30 -> #2654d2e7 Rounded Inexact +decd833 apply 1234567.49 -> #2654d2e7 Rounded Inexact +decd834 apply 1234566.50 -> #2654d2e6 Rounded Inexact +decd835 apply 1234567.50 -> #2654d2e7 Rounded Inexact +decd836 apply 1234567.51 -> #2654d2e7 Rounded Inexact +decd837 apply 1234567.75 -> #2654d2e7 Rounded Inexact +decd838 apply 1234567.89 -> #2654d2e7 Rounded Inexact +decd839 apply 1234567.99 -> #2654d2e7 Rounded Inexact + +rounding: half_up +decd840 apply 1234567.0 -> #2654d2e7 Rounded +decd841 apply 1234567.01 -> #2654d2e7 Rounded Inexact +decd842 apply 1234567.30 -> #2654d2e7 Rounded Inexact +decd843 apply 1234567.49 -> #2654d2e7 Rounded Inexact +decd844 apply 1234566.50 -> #2654d2e7 Rounded Inexact +decd845 apply 1234567.50 -> #2654d2e8 Rounded Inexact +decd846 apply 1234567.51 -> #2654d2e8 Rounded Inexact +decd847 apply 1234567.75 -> #2654d2e8 Rounded Inexact +decd848 apply 1234567.89 -> #2654d2e8 Rounded Inexact +decd849 apply 1234567.99 -> #2654d2e8 Rounded Inexact + +rounding: half_even +decd850 apply 1234567.0 -> #2654d2e7 Rounded +decd851 apply 1234567.01 -> #2654d2e7 Rounded Inexact +decd852 apply 1234567.30 -> #2654d2e7 Rounded Inexact +decd853 apply 1234567.49 -> #2654d2e7 Rounded Inexact +decd854 apply 1234566.50 -> #2654d2e6 Rounded Inexact +decd855 apply 1234567.50 -> #2654d2e8 Rounded Inexact +decd856 apply 1234567.51 -> #2654d2e8 Rounded Inexact +decd857 apply 1234567.75 -> #2654d2e8 Rounded Inexact +decd858 apply 1234567.89 -> #2654d2e8 Rounded Inexact +decd859 apply 1234567.99 -> #2654d2e8 Rounded Inexact + +rounding: half_down +decd860 apply 1234567.0 -> #2654d2e7 Rounded +decd861 apply 1234567.01 -> #2654d2e7 Rounded Inexact +decd862 apply 1234567.30 -> #2654d2e7 Rounded Inexact +decd863 apply 1234567.49 -> #2654d2e7 Rounded Inexact +decd864 apply 1234566.50 -> #2654d2e6 Rounded Inexact +decd865 apply 1234567.50 -> #2654d2e7 Rounded Inexact +decd866 apply 1234567.51 -> #2654d2e8 Rounded Inexact +decd867 apply 1234567.75 -> #2654d2e8 Rounded Inexact +decd868 apply 1234567.89 -> #2654d2e8 Rounded Inexact +decd869 apply 1234567.99 -> #2654d2e8 Rounded Inexact Added: sandbox/trunk/decimal-c/new_dt/decimal64.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/decimal64.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,616 @@ +------------------------------------------------------------------------ +-- decimal64.decTest -- decimal eight-byte format testcases -- +-- Copyright (c) IBM Corporation, 2000, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- This set of tests is for the eight-byte concrete representation. +-- Its characteristics are: +-- +-- 1 bit sign +-- 5 bits combination field +-- 8 bits exponent continuation +-- 50 bits coefficient continuation +-- +-- Total exponent length 10 bits +-- Total coefficient length 54 bits (16 digits) +-- +-- Elimit = 767 (maximum encoded exponent) +-- Emax = 384 (largest exponent value) +-- Emin = -383 (smallest exponent value) +-- bias = 398 (subtracted from encoded exponent) = -Etiny + +extended: 1 +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +-- General testcases +-- (mostly derived from the Strawman 4 document and examples) +dece001 apply #A2300000000003D0 -> -7.50 +dece002 apply -7.50 -> #A2300000000003D0 + +-- Normality +dece010 apply 1234567890123456 -> #263934b9c1e28e56 +dece011 apply 1234567890123456.0 -> #263934b9c1e28e56 Rounded +dece012 apply 1234567890123456.1 -> #263934b9c1e28e56 Rounded Inexact +dece013 apply 1234567890123456.9 -> #263934b9c1e28e57 Rounded Inexact +dece014 apply -1234567890123456 -> #a63934b9c1e28e56 +dece015 apply -1234567890123456.0 -> #a63934b9c1e28e56 Rounded +dece016 apply -1234567890123456.1 -> #a63934b9c1e28e56 Rounded Inexact +dece017 apply -1234567890123456.9 -> #a63934b9c1e28e57 Rounded Inexact + +-- Nmax and similar +dece021 apply 9999999999999999E+369 -> #77fcff3fcff3fcff +dece022 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff +dece023 apply #77fcff3fcff3fcff -> 9.999999999999999E+384 +dece024 apply 1.234567890123456E+384 -> #47fd34b9c1e28e56 +dece025 apply #47fd34b9c1e28e56 -> 1.234567890123456E+384 + +-- fold-downs (more below) +dece030 apply 1.23E+384 -> #47fd300000000000 Clamped +dece031 apply #47fd300000000000 -> 1.230000000000000E+384 +dece032 apply 1E+384 -> #47fc000000000000 Clamped +dece033 apply #47fc000000000000 -> 1.000000000000000E+384 + +-- overflows +maxExponent: 999 -- set high so conversion causes the overflow +minExponent: -999 +dece040 apply 10E+384 -> #7800000000000000 Overflow Rounded Inexact +dece041 apply 1.000000000000000E+385 -> #7800000000000000 Overflow Rounded Inexact +dece042 apply 9999999999999999E+370 -> #7800000000000000 Overflow Rounded Inexact +maxExponent: 384 +minExponent: -383 + +dece051 apply 12345 -> #22380000000049c5 +dece052 apply #22380000000049c5 -> 12345 +dece053 apply 1234 -> #2238000000000534 +dece054 apply #2238000000000534 -> 1234 +dece055 apply 123 -> #22380000000000a3 +dece056 apply #22380000000000a3 -> 123 +dece057 apply 12 -> #2238000000000012 +dece058 apply #2238000000000012 -> 12 +dece059 apply 1 -> #2238000000000001 +dece060 apply #2238000000000001 -> 1 +dece061 apply 1.23 -> #22300000000000a3 +dece062 apply #22300000000000a3 -> 1.23 +dece063 apply 123.45 -> #22300000000049c5 +dece064 apply #22300000000049c5 -> 123.45 + +-- Nmin and below +dece071 apply 1E-383 -> #003c000000000001 +dece072 apply #003c000000000001 -> 1E-383 +dece073 apply 1.000000000000000E-383 -> #0400000000000000 +dece074 apply #0400000000000000 -> 1.000000000000000E-383 +dece075 apply 1.000000000000001E-383 -> #0400000000000001 +dece076 apply #0400000000000001 -> 1.000000000000001E-383 + +dece077 apply 0.100000000000000E-383 -> #0000800000000000 Subnormal +dece078 apply #0000800000000000 -> 1.00000000000000E-384 Subnormal +dece079 apply 0.000000000000010E-383 -> #0000000000000010 Subnormal +dece080 apply #0000000000000010 -> 1.0E-397 Subnormal +dece081 apply 0.00000000000001E-383 -> #0004000000000001 Subnormal +dece082 apply #0004000000000001 -> 1E-397 Subnormal +dece083 apply 0.000000000000001E-383 -> #0000000000000001 Subnormal +dece084 apply #0000000000000001 -> 1E-398 Subnormal +-- next is smallest all-nines +dece085 apply 9999999999999999E-398 -> #6400ff3fcff3fcff +dece086 apply #6400ff3fcff3fcff -> 9.999999999999999E-383 + +-- underflows +dece090 apply 1e-398 -> #0000000000000001 Subnormal +dece091 apply 1.9e-398 -> #0000000000000002 Subnormal Underflow Inexact Rounded +dece092 apply 1.1e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded +dece093 apply 1.00000000001e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded +dece094 apply 1.00000000000001e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded +dece095 apply 1.000000000000001e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded +dece096 apply 0.1e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped +dece097 apply 0.00000000001e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped +dece098 apply 0.00000000000001e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped +dece099 apply 0.000000000000001e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped + +-- Same again, negatives +-- Nmax and similar +dece122 apply -9.999999999999999E+384 -> #f7fcff3fcff3fcff +dece123 apply #f7fcff3fcff3fcff -> -9.999999999999999E+384 +dece124 apply -1.234567890123456E+384 -> #c7fd34b9c1e28e56 +dece125 apply #c7fd34b9c1e28e56 -> -1.234567890123456E+384 +-- fold-downs (more below) +dece130 apply -1.23E+384 -> #c7fd300000000000 Clamped +dece131 apply #c7fd300000000000 -> -1.230000000000000E+384 +dece132 apply -1E+384 -> #c7fc000000000000 Clamped +dece133 apply #c7fc000000000000 -> -1.000000000000000E+384 + +-- overflows +maxExponent: 999 -- set high so conversion causes the overflow +minExponent: -999 +dece140 apply -10E+384 -> #f800000000000000 Overflow Rounded Inexact +dece141 apply -1.000000000000000E+385 -> #f800000000000000 Overflow Rounded Inexact +maxExponent: 384 +minExponent: -383 + +dece151 apply -12345 -> #a2380000000049c5 +dece152 apply #a2380000000049c5 -> -12345 +dece153 apply -1234 -> #a238000000000534 +dece154 apply #a238000000000534 -> -1234 +dece155 apply -123 -> #a2380000000000a3 +dece156 apply #a2380000000000a3 -> -123 +dece157 apply -12 -> #a238000000000012 +dece158 apply #a238000000000012 -> -12 +dece159 apply -1 -> #a238000000000001 +dece160 apply #a238000000000001 -> -1 +dece161 apply -1.23 -> #a2300000000000a3 +dece162 apply #a2300000000000a3 -> -1.23 +dece163 apply -123.45 -> #a2300000000049c5 +dece164 apply #a2300000000049c5 -> -123.45 + +-- Nmin and below +dece171 apply -1E-383 -> #803c000000000001 +dece172 apply #803c000000000001 -> -1E-383 +dece173 apply -1.000000000000000E-383 -> #8400000000000000 +dece174 apply #8400000000000000 -> -1.000000000000000E-383 +dece175 apply -1.000000000000001E-383 -> #8400000000000001 +dece176 apply #8400000000000001 -> -1.000000000000001E-383 + +dece177 apply -0.100000000000000E-383 -> #8000800000000000 Subnormal +dece178 apply #8000800000000000 -> -1.00000000000000E-384 Subnormal +dece179 apply -0.000000000000010E-383 -> #8000000000000010 Subnormal +dece180 apply #8000000000000010 -> -1.0E-397 Subnormal +dece181 apply -0.00000000000001E-383 -> #8004000000000001 Subnormal +dece182 apply #8004000000000001 -> -1E-397 Subnormal +dece183 apply -0.000000000000001E-383 -> #8000000000000001 Subnormal +dece184 apply #8000000000000001 -> -1E-398 Subnormal +-- next is smallest all-nines +dece185 apply -9999999999999999E-398 -> #e400ff3fcff3fcff +dece186 apply #e400ff3fcff3fcff -> -9.999999999999999E-383 + +-- underflows +dece189 apply -1e-398 -> #8000000000000001 Subnormal +dece190 apply -1.0e-398 -> #8000000000000001 Subnormal Rounded +dece191 apply -1.9e-398 -> #8000000000000002 Subnormal Underflow Inexact Rounded +dece192 apply -1.1e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded +dece193 apply -1.00000000001e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded +dece194 apply -1.00000000000001e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded +dece195 apply -1.000000000000001e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded +dece196 apply -0.1e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped +dece197 apply -0.00000000001e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped +dece198 apply -0.00000000000001e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped +dece199 apply -0.000000000000001e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped + +-- zeros +dece401 apply 0E-500 -> #0000000000000000 Clamped +dece402 apply 0E-400 -> #0000000000000000 Clamped +dece403 apply 0E-398 -> #0000000000000000 +dece404 apply #0000000000000000 -> 0E-398 +dece405 apply 0.000000000000000E-383 -> #0000000000000000 +dece406 apply #0000000000000000 -> 0E-398 +dece407 apply 0E-2 -> #2230000000000000 +dece408 apply #2230000000000000 -> 0.00 +dece409 apply 0 -> #2238000000000000 +dece410 apply #2238000000000000 -> 0 +dece411 apply 0E+3 -> #2244000000000000 +dece412 apply #2244000000000000 -> 0E+3 +dece413 apply 0E+369 -> #43fc000000000000 +dece414 apply #43fc000000000000 -> 0E+369 +-- clamped zeros... +dece415 apply 0E+370 -> #43fc000000000000 Clamped +dece416 apply #43fc000000000000 -> 0E+369 +dece417 apply 0E+384 -> #43fc000000000000 Clamped +dece418 apply #43fc000000000000 -> 0E+369 +dece419 apply 0E+400 -> #43fc000000000000 Clamped +dece420 apply #43fc000000000000 -> 0E+369 +dece421 apply 0E+500 -> #43fc000000000000 Clamped +dece422 apply #43fc000000000000 -> 0E+369 + +-- negative zeros +dece431 apply -0E-400 -> #8000000000000000 Clamped +dece432 apply -0E-400 -> #8000000000000000 Clamped +dece433 apply -0E-398 -> #8000000000000000 +dece434 apply #8000000000000000 -> -0E-398 +dece435 apply -0.000000000000000E-383 -> #8000000000000000 +dece436 apply #8000000000000000 -> -0E-398 +dece437 apply -0E-2 -> #a230000000000000 +dece438 apply #a230000000000000 -> -0.00 +dece439 apply -0 -> #a238000000000000 +dece440 apply #a238000000000000 -> -0 +dece441 apply -0E+3 -> #a244000000000000 +dece442 apply #a244000000000000 -> -0E+3 +dece443 apply -0E+369 -> #c3fc000000000000 +dece444 apply #c3fc000000000000 -> -0E+369 +-- clamped zeros... +dece445 apply -0E+370 -> #c3fc000000000000 Clamped +dece446 apply #c3fc000000000000 -> -0E+369 +dece447 apply -0E+384 -> #c3fc000000000000 Clamped +dece448 apply #c3fc000000000000 -> -0E+369 +dece449 apply -0E+400 -> #c3fc000000000000 Clamped +dece450 apply #c3fc000000000000 -> -0E+369 +dece451 apply -0E+500 -> #c3fc000000000000 Clamped +dece452 apply #c3fc000000000000 -> -0E+369 + +-- Specials +dece500 apply Infinity -> #7800000000000000 +dece501 apply #7878787878787878 -> #7800000000000000 +dece502 apply #7800000000000000 -> Infinity +dece503 apply #7979797979797979 -> #7800000000000000 +dece504 apply #7900000000000000 -> Infinity +dece505 apply #7a7a7a7a7a7a7a7a -> #7800000000000000 +dece506 apply #7a00000000000000 -> Infinity +dece507 apply #7b7b7b7b7b7b7b7b -> #7800000000000000 +dece508 apply #7b00000000000000 -> Infinity + +dece509 apply NaN -> #7c00000000000000 +dece510 apply #7c7c7c7c7c7c7c7c -> #7c007c7c7c7c7c7c +dece511 apply #7c00000000000000 -> NaN +dece512 apply #7d7d7d7d7d7d7d7d -> #7c017d7d7d7d7d7d +dece513 apply #7d00000000000000 -> NaN +dece514 apply #7e7e7e7e7e7e7e7e -> #7e007e7e7e7e7c7e +dece515 apply #7e00000000000000 -> sNaN +dece516 apply #7f7f7f7f7f7f7f7f -> #7e007f7f7f7f7c7f +dece517 apply #7f00000000000000 -> sNaN +dece518 apply #7fffffffffffffff -> sNaN999999999999999 +dece519 apply #7fffffffffffffff -> #7e00ff3fcff3fcff + +dece520 apply -Infinity -> #f800000000000000 +dece521 apply #f878787878787878 -> #f800000000000000 +dece522 apply #f800000000000000 -> -Infinity +dece523 apply #f979797979797979 -> #f800000000000000 +dece524 apply #f900000000000000 -> -Infinity +dece525 apply #fa7a7a7a7a7a7a7a -> #f800000000000000 +dece526 apply #fa00000000000000 -> -Infinity +dece527 apply #fb7b7b7b7b7b7b7b -> #f800000000000000 +dece528 apply #fb00000000000000 -> -Infinity + +dece529 apply -NaN -> #fc00000000000000 +dece530 apply #fc7c7c7c7c7c7c7c -> #fc007c7c7c7c7c7c +dece531 apply #fc00000000000000 -> -NaN +dece532 apply #fd7d7d7d7d7d7d7d -> #fc017d7d7d7d7d7d +dece533 apply #fd00000000000000 -> -NaN +dece534 apply #fe7e7e7e7e7e7e7e -> #fe007e7e7e7e7c7e +dece535 apply #fe00000000000000 -> -sNaN +dece536 apply #ff7f7f7f7f7f7f7f -> #fe007f7f7f7f7c7f +dece537 apply #ff00000000000000 -> -sNaN +dece538 apply #ffffffffffffffff -> -sNaN999999999999999 +dece539 apply #ffffffffffffffff -> #fe00ff3fcff3fcff + +-- diagnostic NaNs +dece540 apply NaN -> #7c00000000000000 +dece541 apply NaN0 -> #7c00000000000000 +dece542 apply NaN1 -> #7c00000000000001 +dece543 apply NaN12 -> #7c00000000000012 +dece544 apply NaN79 -> #7c00000000000079 +dece545 apply NaN12345 -> #7c000000000049c5 +dece546 apply NaN123456 -> #7c00000000028e56 +dece547 apply NaN799799 -> #7c000000000f7fdf +dece548 apply NaN799799799799799 -> #7c03dff7fdff7fdf +dece549 apply NaN999999999999999 -> #7c00ff3fcff3fcff +dece550 apply NaN1234567890123456 -> #7c00000000000000 -- too many digits + +-- fold-down full sequence +dece601 apply 1E+384 -> #47fc000000000000 Clamped +dece602 apply #47fc000000000000 -> 1.000000000000000E+384 +dece603 apply 1E+383 -> #43fc800000000000 Clamped +dece604 apply #43fc800000000000 -> 1.00000000000000E+383 +dece605 apply 1E+382 -> #43fc100000000000 Clamped +dece606 apply #43fc100000000000 -> 1.0000000000000E+382 +dece607 apply 1E+381 -> #43fc010000000000 Clamped +dece608 apply #43fc010000000000 -> 1.000000000000E+381 +dece609 apply 1E+380 -> #43fc002000000000 Clamped +dece610 apply #43fc002000000000 -> 1.00000000000E+380 +dece611 apply 1E+379 -> #43fc000400000000 Clamped +dece612 apply #43fc000400000000 -> 1.0000000000E+379 +dece613 apply 1E+378 -> #43fc000040000000 Clamped +dece614 apply #43fc000040000000 -> 1.000000000E+378 +dece615 apply 1E+377 -> #43fc000008000000 Clamped +dece616 apply #43fc000008000000 -> 1.00000000E+377 +dece617 apply 1E+376 -> #43fc000001000000 Clamped +dece618 apply #43fc000001000000 -> 1.0000000E+376 +dece619 apply 1E+375 -> #43fc000000100000 Clamped +dece620 apply #43fc000000100000 -> 1.000000E+375 +dece621 apply 1E+374 -> #43fc000000020000 Clamped +dece622 apply #43fc000000020000 -> 1.00000E+374 +dece623 apply 1E+373 -> #43fc000000004000 Clamped +dece624 apply #43fc000000004000 -> 1.0000E+373 +dece625 apply 1E+372 -> #43fc000000000400 Clamped +dece626 apply #43fc000000000400 -> 1.000E+372 +dece627 apply 1E+371 -> #43fc000000000080 Clamped +dece628 apply #43fc000000000080 -> 1.00E+371 +dece629 apply 1E+370 -> #43fc000000000010 Clamped +dece630 apply #43fc000000000010 -> 1.0E+370 +dece631 apply 1E+369 -> #43fc000000000001 +dece632 apply #43fc000000000001 -> 1E+369 +dece633 apply 1E+368 -> #43f8000000000001 +dece634 apply #43f8000000000001 -> 1E+368 +-- same with 9s +dece641 apply 9E+384 -> #77fc000000000000 Clamped +dece642 apply #77fc000000000000 -> 9.000000000000000E+384 +dece643 apply 9E+383 -> #43fc8c0000000000 Clamped +dece644 apply #43fc8c0000000000 -> 9.00000000000000E+383 +dece645 apply 9E+382 -> #43fc1a0000000000 Clamped +dece646 apply #43fc1a0000000000 -> 9.0000000000000E+382 +dece647 apply 9E+381 -> #43fc090000000000 Clamped +dece648 apply #43fc090000000000 -> 9.000000000000E+381 +dece649 apply 9E+380 -> #43fc002300000000 Clamped +dece650 apply #43fc002300000000 -> 9.00000000000E+380 +dece651 apply 9E+379 -> #43fc000680000000 Clamped +dece652 apply #43fc000680000000 -> 9.0000000000E+379 +dece653 apply 9E+378 -> #43fc000240000000 Clamped +dece654 apply #43fc000240000000 -> 9.000000000E+378 +dece655 apply 9E+377 -> #43fc000008c00000 Clamped +dece656 apply #43fc000008c00000 -> 9.00000000E+377 +dece657 apply 9E+376 -> #43fc000001a00000 Clamped +dece658 apply #43fc000001a00000 -> 9.0000000E+376 +dece659 apply 9E+375 -> #43fc000000900000 Clamped +dece660 apply #43fc000000900000 -> 9.000000E+375 +dece661 apply 9E+374 -> #43fc000000023000 Clamped +dece662 apply #43fc000000023000 -> 9.00000E+374 +dece663 apply 9E+373 -> #43fc000000006800 Clamped +dece664 apply #43fc000000006800 -> 9.0000E+373 +dece665 apply 9E+372 -> #43fc000000002400 Clamped +dece666 apply #43fc000000002400 -> 9.000E+372 +dece667 apply 9E+371 -> #43fc00000000008c Clamped +dece668 apply #43fc00000000008c -> 9.00E+371 +dece669 apply 9E+370 -> #43fc00000000001a Clamped +dece670 apply #43fc00000000001a -> 9.0E+370 +dece671 apply 9E+369 -> #43fc000000000009 +dece672 apply #43fc000000000009 -> 9E+369 +dece673 apply 9E+368 -> #43f8000000000009 +dece674 apply #43f8000000000009 -> 9E+368 + + +-- Selected DPD codes +dece700 apply #2238000000000000 -> 0 +dece701 apply #2238000000000009 -> 9 +dece702 apply #2238000000000010 -> 10 +dece703 apply #2238000000000019 -> 19 +dece704 apply #2238000000000020 -> 20 +dece705 apply #2238000000000029 -> 29 +dece706 apply #2238000000000030 -> 30 +dece707 apply #2238000000000039 -> 39 +dece708 apply #2238000000000040 -> 40 +dece709 apply #2238000000000049 -> 49 +dece710 apply #2238000000000050 -> 50 +dece711 apply #2238000000000059 -> 59 +dece712 apply #2238000000000060 -> 60 +dece713 apply #2238000000000069 -> 69 +dece714 apply #2238000000000070 -> 70 +dece715 apply #2238000000000071 -> 71 +dece716 apply #2238000000000072 -> 72 +dece717 apply #2238000000000073 -> 73 +dece718 apply #2238000000000074 -> 74 +dece719 apply #2238000000000075 -> 75 +dece720 apply #2238000000000076 -> 76 +dece721 apply #2238000000000077 -> 77 +dece722 apply #2238000000000078 -> 78 +dece723 apply #2238000000000079 -> 79 + +dece725 apply #223800000000029e -> 994 +dece726 apply #223800000000029f -> 995 +dece727 apply #22380000000002a0 -> 520 +dece728 apply #22380000000002a1 -> 521 +-- from telco test data +dece730 apply #2238000000000188 -> 308 +dece731 apply #22380000000001a3 -> 323 +dece732 apply #223800000000002a -> 82 +dece733 apply #22380000000001a9 -> 329 +dece734 apply #2238000000000081 -> 101 +dece735 apply #22380000000002a2 -> 522 + +-- DPD: one of each of the huffman groups +dece740 apply #22380000000003f7 -> 777 +dece741 apply #22380000000003f8 -> 778 +dece742 apply #22380000000003eb -> 787 +dece743 apply #223800000000037d -> 877 +dece744 apply #223800000000039f -> 997 +dece745 apply #22380000000003bf -> 979 +dece746 apply #22380000000003df -> 799 +dece747 apply #223800000000006e -> 888 + + +-- DPD all-highs cases (includes the 24 redundant codes) +dece750 apply #223800000000006e -> 888 +dece751 apply #223800000000016e -> 888 +dece752 apply #223800000000026e -> 888 +dece753 apply #223800000000036e -> 888 +dece754 apply #223800000000006f -> 889 +dece755 apply #223800000000016f -> 889 +dece756 apply #223800000000026f -> 889 +dece757 apply #223800000000036f -> 889 + +dece760 apply #223800000000007e -> 898 +dece761 apply #223800000000017e -> 898 +dece762 apply #223800000000027e -> 898 +dece763 apply #223800000000037e -> 898 +dece764 apply #223800000000007f -> 899 +dece765 apply #223800000000017f -> 899 +dece766 apply #223800000000027f -> 899 +dece767 apply #223800000000037f -> 899 + +dece770 apply #22380000000000ee -> 988 +dece771 apply #22380000000001ee -> 988 +dece772 apply #22380000000002ee -> 988 +dece773 apply #22380000000003ee -> 988 +dece774 apply #22380000000000ef -> 989 +dece775 apply #22380000000001ef -> 989 +dece776 apply #22380000000002ef -> 989 +dece777 apply #22380000000003ef -> 989 + +dece780 apply #22380000000000fe -> 998 +dece781 apply #22380000000001fe -> 998 +dece782 apply #22380000000002fe -> 998 +dece783 apply #22380000000003fe -> 998 +dece784 apply #22380000000000ff -> 999 +dece785 apply #22380000000001ff -> 999 +dece786 apply #22380000000002ff -> 999 +dece787 apply #22380000000003ff -> 999 + +-- Rounding modes +rounding: floor +dece800 apply 1234567890123456.0 -> #263934b9c1e28e56 Rounded +dece801 apply 1234567890123456.01 -> #263934b9c1e28e56 Rounded Inexact +dece802 apply 1234567890123456.1 -> #263934b9c1e28e56 Rounded Inexact +dece803 apply 1234567890123456.30 -> #263934b9c1e28e56 Rounded Inexact +dece804 apply 1234567890123456.49 -> #263934b9c1e28e56 Rounded Inexact +dece805 apply 1234567890123456.50 -> #263934b9c1e28e56 Rounded Inexact +dece806 apply 1234567890123455.50 -> #263934b9c1e28e55 Rounded Inexact +dece807 apply 1234567890123456.51 -> #263934b9c1e28e56 Rounded Inexact +dece808 apply 1234567890123456.70 -> #263934b9c1e28e56 Rounded Inexact +dece809 apply 1234567890123456.9 -> #263934b9c1e28e56 Rounded Inexact +dece810 apply 1234567890123456.99 -> #263934b9c1e28e56 Rounded Inexact +dece811 apply -1234567890123456.01 -> #a63934b9c1e28e57 Rounded Inexact +dece812 apply -1234567890123456.1 -> #a63934b9c1e28e57 Rounded Inexact +dece813 apply -1234567890123456.30 -> #a63934b9c1e28e57 Rounded Inexact +dece814 apply -1234567890123456.49 -> #a63934b9c1e28e57 Rounded Inexact +dece815 apply -1234567890123456.50 -> #a63934b9c1e28e57 Rounded Inexact +dece816 apply -1234567890123455.50 -> #a63934b9c1e28e56 Rounded Inexact +dece817 apply -1234567890123456.51 -> #a63934b9c1e28e57 Rounded Inexact +dece818 apply -1234567890123456.70 -> #a63934b9c1e28e57 Rounded Inexact +dece819 apply -1234567890123456.9 -> #a63934b9c1e28e57 Rounded Inexact + +rounding: ceiling +dece820 apply 1234567890123456.0 -> #263934b9c1e28e56 Rounded +dece821 apply 1234567890123456.01 -> #263934b9c1e28e57 Rounded Inexact +dece822 apply 1234567890123456.1 -> #263934b9c1e28e57 Rounded Inexact +dece823 apply 1234567890123456.30 -> #263934b9c1e28e57 Rounded Inexact +dece824 apply 1234567890123456.49 -> #263934b9c1e28e57 Rounded Inexact +dece825 apply 1234567890123456.50 -> #263934b9c1e28e57 Rounded Inexact +dece826 apply 1234567890123455.50 -> #263934b9c1e28e56 Rounded Inexact +dece827 apply 1234567890123456.51 -> #263934b9c1e28e57 Rounded Inexact +dece828 apply 1234567890123456.70 -> #263934b9c1e28e57 Rounded Inexact +dece829 apply 1234567890123456.9 -> #263934b9c1e28e57 Rounded Inexact +dece830 apply 1234567890123456.99 -> #263934b9c1e28e57 Rounded Inexact +dece831 apply -1234567890123456.01 -> #a63934b9c1e28e56 Rounded Inexact +dece832 apply -1234567890123456.1 -> #a63934b9c1e28e56 Rounded Inexact +dece833 apply -1234567890123456.30 -> #a63934b9c1e28e56 Rounded Inexact +dece834 apply -1234567890123456.49 -> #a63934b9c1e28e56 Rounded Inexact +dece835 apply -1234567890123456.50 -> #a63934b9c1e28e56 Rounded Inexact +dece836 apply -1234567890123455.50 -> #a63934b9c1e28e55 Rounded Inexact +dece837 apply -1234567890123456.51 -> #a63934b9c1e28e56 Rounded Inexact +dece838 apply -1234567890123456.70 -> #a63934b9c1e28e56 Rounded Inexact +dece839 apply -1234567890123456.9 -> #a63934b9c1e28e56 Rounded Inexact + +rounding: up +dece840 apply 1234567890123456.0 -> #263934b9c1e28e56 Rounded +dece841 apply 1234567890123456.01 -> #263934b9c1e28e57 Rounded Inexact +dece842 apply 1234567890123456.1 -> #263934b9c1e28e57 Rounded Inexact +dece843 apply 1234567890123456.30 -> #263934b9c1e28e57 Rounded Inexact +dece844 apply 1234567890123456.49 -> #263934b9c1e28e57 Rounded Inexact +dece845 apply 1234567890123456.50 -> #263934b9c1e28e57 Rounded Inexact +dece846 apply 1234567890123455.50 -> #263934b9c1e28e56 Rounded Inexact +dece847 apply 1234567890123456.51 -> #263934b9c1e28e57 Rounded Inexact +dece848 apply 1234567890123456.70 -> #263934b9c1e28e57 Rounded Inexact +dece849 apply 1234567890123456.99 -> #263934b9c1e28e57 Rounded Inexact +dece850 apply -1234567890123456.00 -> #a63934b9c1e28e56 Rounded +dece851 apply -1234567890123456.01 -> #a63934b9c1e28e57 Rounded Inexact +dece852 apply -1234567890123456.1 -> #a63934b9c1e28e57 Rounded Inexact +dece853 apply -1234567890123456.30 -> #a63934b9c1e28e57 Rounded Inexact +dece854 apply -1234567890123456.49 -> #a63934b9c1e28e57 Rounded Inexact +dece855 apply -1234567890123456.50 -> #a63934b9c1e28e57 Rounded Inexact +dece856 apply -1234567890123455.50 -> #a63934b9c1e28e56 Rounded Inexact +dece857 apply -1234567890123456.51 -> #a63934b9c1e28e57 Rounded Inexact +dece858 apply -1234567890123456.70 -> #a63934b9c1e28e57 Rounded Inexact +dece859 apply -1234567890123456.9 -> #a63934b9c1e28e57 Rounded Inexact + +rounding: down +dece860 apply 1234567890123456.0 -> #263934b9c1e28e56 Rounded +dece861 apply 1234567890123456.01 -> #263934b9c1e28e56 Rounded Inexact +dece862 apply 1234567890123456.1 -> #263934b9c1e28e56 Rounded Inexact +dece863 apply 1234567890123456.30 -> #263934b9c1e28e56 Rounded Inexact +dece864 apply 1234567890123456.49 -> #263934b9c1e28e56 Rounded Inexact +dece865 apply 1234567890123456.50 -> #263934b9c1e28e56 Rounded Inexact +dece866 apply 1234567890123455.50 -> #263934b9c1e28e55 Rounded Inexact +dece867 apply 1234567890123456.51 -> #263934b9c1e28e56 Rounded Inexact +dece868 apply 1234567890123456.70 -> #263934b9c1e28e56 Rounded Inexact +dece869 apply 1234567890123456.9 -> #263934b9c1e28e56 Rounded Inexact +dece870 apply 1234567890123456.99 -> #263934b9c1e28e56 Rounded Inexact +dece871 apply -1234567890123456.01 -> #a63934b9c1e28e56 Rounded Inexact +dece872 apply -1234567890123456.1 -> #a63934b9c1e28e56 Rounded Inexact +dece873 apply -1234567890123456.30 -> #a63934b9c1e28e56 Rounded Inexact +dece874 apply -1234567890123456.49 -> #a63934b9c1e28e56 Rounded Inexact +dece875 apply -1234567890123456.50 -> #a63934b9c1e28e56 Rounded Inexact +dece876 apply -1234567890123455.50 -> #a63934b9c1e28e55 Rounded Inexact +dece877 apply -1234567890123456.51 -> #a63934b9c1e28e56 Rounded Inexact +dece878 apply -1234567890123456.70 -> #a63934b9c1e28e56 Rounded Inexact +dece879 apply -1234567890123456.9 -> #a63934b9c1e28e56 Rounded Inexact + +rounding: half_up +dece880 apply 1234567890123456.0 -> #263934b9c1e28e56 Rounded +dece881 apply 1234567890123456.01 -> #263934b9c1e28e56 Rounded Inexact +dece882 apply 1234567890123456.1 -> #263934b9c1e28e56 Rounded Inexact +dece883 apply 1234567890123456.30 -> #263934b9c1e28e56 Rounded Inexact +dece884 apply 1234567890123456.49 -> #263934b9c1e28e56 Rounded Inexact +dece885 apply 1234567890123456.50 -> #263934b9c1e28e57 Rounded Inexact +dece886 apply 1234567890123455.50 -> #263934b9c1e28e56 Rounded Inexact +dece887 apply 1234567890123456.51 -> #263934b9c1e28e57 Rounded Inexact +dece888 apply 1234567890123456.70 -> #263934b9c1e28e57 Rounded Inexact +dece889 apply 1234567890123456.9 -> #263934b9c1e28e57 Rounded Inexact +dece890 apply -1234567890123456.00 -> #a63934b9c1e28e56 Rounded +dece891 apply -1234567890123456.01 -> #a63934b9c1e28e56 Rounded Inexact +dece892 apply -1234567890123456.1 -> #a63934b9c1e28e56 Rounded Inexact +dece893 apply -1234567890123456.30 -> #a63934b9c1e28e56 Rounded Inexact +dece894 apply -1234567890123456.49 -> #a63934b9c1e28e56 Rounded Inexact +dece895 apply -1234567890123456.50 -> #a63934b9c1e28e57 Rounded Inexact +dece896 apply -1234567890123455.50 -> #a63934b9c1e28e56 Rounded Inexact +dece897 apply -1234567890123456.51 -> #a63934b9c1e28e57 Rounded Inexact +dece898 apply -1234567890123456.70 -> #a63934b9c1e28e57 Rounded Inexact +dece899 apply -1234567890123456.9 -> #a63934b9c1e28e57 Rounded Inexact + +rounding: half_even +dece900 apply 1234567890123456.0 -> #263934b9c1e28e56 Rounded +dece901 apply 1234567890123456.01 -> #263934b9c1e28e56 Rounded Inexact +dece902 apply 1234567890123456.1 -> #263934b9c1e28e56 Rounded Inexact +dece903 apply 1234567890123456.30 -> #263934b9c1e28e56 Rounded Inexact +dece904 apply 1234567890123456.49 -> #263934b9c1e28e56 Rounded Inexact +dece905 apply 1234567890123456.50 -> #263934b9c1e28e56 Rounded Inexact +dece906 apply 1234567890123455.50 -> #263934b9c1e28e56 Rounded Inexact +dece907 apply 1234567890123456.51 -> #263934b9c1e28e57 Rounded Inexact +dece908 apply 1234567890123456.70 -> #263934b9c1e28e57 Rounded Inexact +dece909 apply 1234567890123456.9 -> #263934b9c1e28e57 Rounded Inexact +dece910 apply 1234567890123456.99 -> #263934b9c1e28e57 Rounded Inexact +dece911 apply -1234567890123456.01 -> #a63934b9c1e28e56 Rounded Inexact +dece912 apply -1234567890123456.1 -> #a63934b9c1e28e56 Rounded Inexact +dece913 apply -1234567890123456.30 -> #a63934b9c1e28e56 Rounded Inexact +dece914 apply -1234567890123456.49 -> #a63934b9c1e28e56 Rounded Inexact +dece915 apply -1234567890123456.50 -> #a63934b9c1e28e56 Rounded Inexact +dece916 apply -1234567890123455.50 -> #a63934b9c1e28e56 Rounded Inexact +dece917 apply -1234567890123456.51 -> #a63934b9c1e28e57 Rounded Inexact +dece918 apply -1234567890123456.70 -> #a63934b9c1e28e57 Rounded Inexact +dece919 apply -1234567890123456.9 -> #a63934b9c1e28e57 Rounded Inexact + +rounding: half_down +dece920 apply 1234567890123456.0 -> #263934b9c1e28e56 Rounded +dece921 apply 1234567890123456.01 -> #263934b9c1e28e56 Rounded Inexact +dece922 apply 1234567890123456.1 -> #263934b9c1e28e56 Rounded Inexact +dece923 apply 1234567890123456.30 -> #263934b9c1e28e56 Rounded Inexact +dece924 apply 1234567890123456.49 -> #263934b9c1e28e56 Rounded Inexact +dece925 apply 1234567890123456.50 -> #263934b9c1e28e56 Rounded Inexact +dece926 apply 1234567890123455.50 -> #263934b9c1e28e55 Rounded Inexact +dece927 apply 1234567890123456.51 -> #263934b9c1e28e57 Rounded Inexact +dece928 apply 1234567890123456.70 -> #263934b9c1e28e57 Rounded Inexact +dece929 apply 1234567890123456.98 -> #263934b9c1e28e57 Rounded Inexact +dece930 apply 1234567890123456.999 -> #263934b9c1e28e57 Rounded Inexact +dece931 apply -1234567890123456.001 -> #a63934b9c1e28e56 Rounded Inexact +dece932 apply -1234567890123456.1 -> #a63934b9c1e28e56 Rounded Inexact +dece933 apply -1234567890123456.30 -> #a63934b9c1e28e56 Rounded Inexact +dece934 apply -1234567890123456.49 -> #a63934b9c1e28e56 Rounded Inexact +dece935 apply -1234567890123456.50 -> #a63934b9c1e28e56 Rounded Inexact +dece936 apply -1234567890123455.50 -> #a63934b9c1e28e55 Rounded Inexact +dece937 apply -1234567890123456.51 -> #a63934b9c1e28e57 Rounded Inexact +dece938 apply -1234567890123456.70 -> #a63934b9c1e28e57 Rounded Inexact +dece939 apply -1234567890123456.9 -> #a63934b9c1e28e57 Rounded Inexact + Added: sandbox/trunk/decimal-c/new_dt/divide.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/divide.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,845 @@ +------------------------------------------------------------------------ +-- divide.decTest -- decimal division -- +-- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- sanity checks +divx001 divide 1 1 -> 1 +divx002 divide 2 1 -> 2 +divx003 divide 1 2 -> 0.5 +divx004 divide 2 2 -> 1 +divx005 divide 0 1 -> 0 +divx006 divide 0 2 -> 0 +divx007 divide 1 3 -> 0.333333333 Inexact Rounded +divx008 divide 2 3 -> 0.666666667 Inexact Rounded +divx009 divide 3 3 -> 1 + +divx010 divide 2.4 1 -> 2.4 +divx011 divide 2.4 -1 -> -2.4 +divx012 divide -2.4 1 -> -2.4 +divx013 divide -2.4 -1 -> 2.4 +divx014 divide 2.40 1 -> 2.40 +divx015 divide 2.400 1 -> 2.400 +divx016 divide 2.4 2 -> 1.2 +divx017 divide 2.400 2 -> 1.200 +divx018 divide 2. 2 -> 1 +divx019 divide 20 20 -> 1 + +divx020 divide 187 187 -> 1 +divx021 divide 5 2 -> 2.5 +divx022 divide 50 20 -> 2.5 +divx023 divide 500 200 -> 2.5 +divx024 divide 50.0 20.0 -> 2.5 +divx025 divide 5.00 2.00 -> 2.5 +divx026 divide 5 2.0 -> 2.5 +divx027 divide 5 2.000 -> 2.5 +divx028 divide 5 0.20 -> 25 +divx029 divide 5 0.200 -> 25 +divx030 divide 10 1 -> 10 +divx031 divide 100 1 -> 100 +divx032 divide 1000 1 -> 1000 +divx033 divide 1000 100 -> 10 + +divx035 divide 1 2 -> 0.5 +divx036 divide 1 4 -> 0.25 +divx037 divide 1 8 -> 0.125 +divx038 divide 1 16 -> 0.0625 +divx039 divide 1 32 -> 0.03125 +divx040 divide 1 64 -> 0.015625 +divx041 divide 1 -2 -> -0.5 +divx042 divide 1 -4 -> -0.25 +divx043 divide 1 -8 -> -0.125 +divx044 divide 1 -16 -> -0.0625 +divx045 divide 1 -32 -> -0.03125 +divx046 divide 1 -64 -> -0.015625 +divx047 divide -1 2 -> -0.5 +divx048 divide -1 4 -> -0.25 +divx049 divide -1 8 -> -0.125 +divx050 divide -1 16 -> -0.0625 +divx051 divide -1 32 -> -0.03125 +divx052 divide -1 64 -> -0.015625 +divx053 divide -1 -2 -> 0.5 +divx054 divide -1 -4 -> 0.25 +divx055 divide -1 -8 -> 0.125 +divx056 divide -1 -16 -> 0.0625 +divx057 divide -1 -32 -> 0.03125 +divx058 divide -1 -64 -> 0.015625 + +divx070 divide 999999999 1 -> 999999999 +divx071 divide 999999999.4 1 -> 999999999 Inexact Rounded +divx072 divide 999999999.5 1 -> 1.00000000E+9 Inexact Rounded +divx073 divide 999999999.9 1 -> 1.00000000E+9 Inexact Rounded +divx074 divide 999999999.999 1 -> 1.00000000E+9 Inexact Rounded +precision: 6 +divx080 divide 999999999 1 -> 1.00000E+9 Inexact Rounded +divx081 divide 99999999 1 -> 1.00000E+8 Inexact Rounded +divx082 divide 9999999 1 -> 1.00000E+7 Inexact Rounded +divx083 divide 999999 1 -> 999999 +divx084 divide 99999 1 -> 99999 +divx085 divide 9999 1 -> 9999 +divx086 divide 999 1 -> 999 +divx087 divide 99 1 -> 99 +divx088 divide 9 1 -> 9 + +precision: 9 +divx090 divide 0. 1 -> 0 +divx091 divide .0 1 -> 0.0 +divx092 divide 0.00 1 -> 0.00 +divx093 divide 0.00E+9 1 -> 0E+7 +divx094 divide 0.0000E-50 1 -> 0E-54 + +divx095 divide 1 1E-8 -> 1E+8 +divx096 divide 1 1E-9 -> 1E+9 +divx097 divide 1 1E-10 -> 1E+10 +divx098 divide 1 1E-11 -> 1E+11 +divx099 divide 1 1E-12 -> 1E+12 + +divx100 divide 1 1 -> 1 +divx101 divide 1 2 -> 0.5 +divx102 divide 1 3 -> 0.333333333 Inexact Rounded +divx103 divide 1 4 -> 0.25 +divx104 divide 1 5 -> 0.2 +divx105 divide 1 6 -> 0.166666667 Inexact Rounded +divx106 divide 1 7 -> 0.142857143 Inexact Rounded +divx107 divide 1 8 -> 0.125 +divx108 divide 1 9 -> 0.111111111 Inexact Rounded +divx109 divide 1 10 -> 0.1 +divx110 divide 1 1 -> 1 +divx111 divide 2 1 -> 2 +divx112 divide 3 1 -> 3 +divx113 divide 4 1 -> 4 +divx114 divide 5 1 -> 5 +divx115 divide 6 1 -> 6 +divx116 divide 7 1 -> 7 +divx117 divide 8 1 -> 8 +divx118 divide 9 1 -> 9 +divx119 divide 10 1 -> 10 + +divx120 divide 3E+1 0.001 -> 3E+4 +divx121 divide 2.200 2 -> 1.100 + +divx130 divide 12345 4.999 -> 2469.49390 Inexact Rounded +divx131 divide 12345 4.99 -> 2473.94790 Inexact Rounded +divx132 divide 12345 4.9 -> 2519.38776 Inexact Rounded +divx133 divide 12345 5 -> 2469 +divx134 divide 12345 5.1 -> 2420.58824 Inexact Rounded +divx135 divide 12345 5.01 -> 2464.07186 Inexact Rounded +divx136 divide 12345 5.001 -> 2468.50630 Inexact Rounded + +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 + +-- test possibly imprecise results +divx220 divide 391 597 -> 0.654941374 Inexact Rounded +divx221 divide 391 -597 -> -0.654941374 Inexact Rounded +divx222 divide -391 597 -> -0.654941374 Inexact Rounded +divx223 divide -391 -597 -> 0.654941374 Inexact Rounded + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +divx270 divide 1 1e999999999 -> 1E-999999999 +divx271 divide 1 0.9e999999999 -> 1.11111111E-999999999 Inexact Rounded +divx272 divide 1 0.99e999999999 -> 1.01010101E-999999999 Inexact Rounded +divx273 divide 1 0.999999999e999999999 -> 1.00000000E-999999999 Inexact Rounded +divx274 divide 9e999999999 1 -> 9E+999999999 +divx275 divide 9.9e999999999 1 -> 9.9E+999999999 +divx276 divide 9.99e999999999 1 -> 9.99E+999999999 +divx277 divide 9.99999999e999999999 1 -> 9.99999999E+999999999 + +divx280 divide 0.1 9e-999999999 -> 1.11111111E+999999997 Inexact Rounded +divx281 divide 0.1 99e-999999999 -> 1.01010101E+999999996 Inexact Rounded +divx282 divide 0.1 999e-999999999 -> 1.00100100E+999999995 Inexact Rounded + +divx283 divide 0.1 9e-999999998 -> 1.11111111E+999999996 Inexact Rounded +divx284 divide 0.1 99e-999999998 -> 1.01010101E+999999995 Inexact Rounded +divx285 divide 0.1 999e-999999998 -> 1.00100100E+999999994 Inexact Rounded +divx286 divide 0.1 999e-999999997 -> 1.00100100E+999999993 Inexact Rounded +divx287 divide 0.1 9999e-999999997 -> 1.00010001E+999999992 Inexact Rounded +divx288 divide 0.1 99999e-999999997 -> 1.00001000E+999999991 Inexact Rounded + +-- Divide into 0 tests + +divx301 divide 0 7 -> 0 +divx302 divide 0 7E-5 -> 0E+5 +divx303 divide 0 7E-1 -> 0E+1 +divx304 divide 0 7E+1 -> 0.0 +divx305 divide 0 7E+5 -> 0.00000 +divx306 divide 0 7E+6 -> 0.000000 +divx307 divide 0 7E+7 -> 0E-7 +divx308 divide 0 70E-5 -> 0E+5 +divx309 divide 0 70E-1 -> 0E+1 +divx310 divide 0 70E+0 -> 0 +divx311 divide 0 70E+1 -> 0.0 +divx312 divide 0 70E+5 -> 0.00000 +divx313 divide 0 70E+6 -> 0.000000 +divx314 divide 0 70E+7 -> 0E-7 +divx315 divide 0 700E-5 -> 0E+5 +divx316 divide 0 700E-1 -> 0E+1 +divx317 divide 0 700E+0 -> 0 +divx318 divide 0 700E+1 -> 0.0 +divx319 divide 0 700E+5 -> 0.00000 +divx320 divide 0 700E+6 -> 0.000000 +divx321 divide 0 700E+7 -> 0E-7 +divx322 divide 0 700E+77 -> 0E-77 + +divx331 divide 0E-3 7E-5 -> 0E+2 +divx332 divide 0E-3 7E-1 -> 0.00 +divx333 divide 0E-3 7E+1 -> 0.0000 +divx334 divide 0E-3 7E+5 -> 0E-8 +divx335 divide 0E-1 7E-5 -> 0E+4 +divx336 divide 0E-1 7E-1 -> 0 +divx337 divide 0E-1 7E+1 -> 0.00 +divx338 divide 0E-1 7E+5 -> 0.000000 +divx339 divide 0E+1 7E-5 -> 0E+6 +divx340 divide 0E+1 7E-1 -> 0E+2 +divx341 divide 0E+1 7E+1 -> 0 +divx342 divide 0E+1 7E+5 -> 0.0000 +divx343 divide 0E+3 7E-5 -> 0E+8 +divx344 divide 0E+3 7E-1 -> 0E+4 +divx345 divide 0E+3 7E+1 -> 0E+2 +divx346 divide 0E+3 7E+5 -> 0.00 + +maxexponent: 92 +minexponent: -92 +precision: 7 +divx351 divide 0E-92 7E-1 -> 0E-91 +divx352 divide 0E-92 7E+1 -> 0E-93 +divx353 divide 0E-92 7E+5 -> 0E-97 +divx354 divide 0E-92 7E+6 -> 0E-98 +divx355 divide 0E-92 7E+7 -> 0E-98 Clamped +divx356 divide 0E-92 777E-1 -> 0E-91 +divx357 divide 0E-92 777E+1 -> 0E-93 +divx358 divide 0E-92 777E+3 -> 0E-95 +divx359 divide 0E-92 777E+4 -> 0E-96 +divx360 divide 0E-92 777E+5 -> 0E-97 +divx361 divide 0E-92 777E+6 -> 0E-98 +divx362 divide 0E-92 777E+7 -> 0E-98 Clamped +divx363 divide 0E-92 7E+92 -> 0E-98 Clamped + +divx371 divide 0E-92 700E-1 -> 0E-91 +divx372 divide 0E-92 700E+1 -> 0E-93 +divx373 divide 0E-92 700E+3 -> 0E-95 +divx374 divide 0E-92 700E+4 -> 0E-96 +divx375 divide 0E-92 700E+5 -> 0E-97 +divx376 divide 0E-92 700E+6 -> 0E-98 +divx377 divide 0E-92 700E+7 -> 0E-98 Clamped + +divx381 divide 0E+92 7E+1 -> 0E+91 +divx382 divide 0E+92 7E+0 -> 0E+92 +divx383 divide 0E+92 7E-1 -> 0E+92 Clamped +divx384 divide 0E+90 777E+1 -> 0E+89 +divx385 divide 0E+90 777E-1 -> 0E+91 +divx386 divide 0E+90 777E-2 -> 0E+92 +divx387 divide 0E+90 777E-3 -> 0E+92 Clamped +divx388 divide 0E+90 777E-4 -> 0E+92 Clamped + +divx391 divide 0E+90 700E+1 -> 0E+89 +divx392 divide 0E+90 700E-1 -> 0E+91 +divx393 divide 0E+90 700E-2 -> 0E+92 +divx394 divide 0E+90 700E-3 -> 0E+92 Clamped +divx395 divide 0E+90 700E-4 -> 0E+92 Clamped + +-- input rounding checks +maxexponent: 999 +minexponent: -999 +precision: 9 +divx401 divide 12345678000 1 -> 1.23456780E+10 Rounded +divx402 divide 1 12345678000 -> 8.10000066E-11 Inexact Rounded +divx403 divide 1234567800 1 -> 1.23456780E+9 Rounded +divx404 divide 1 1234567800 -> 8.10000066E-10 Inexact Rounded +divx405 divide 1234567890 1 -> 1.23456789E+9 Rounded +divx406 divide 1 1234567890 -> 8.10000007E-10 Inexact Rounded +divx407 divide 1234567891 1 -> 1.23456789E+9 Inexact Rounded +divx408 divide 1 1234567891 -> 8.10000007E-10 Inexact Rounded +divx409 divide 12345678901 1 -> 1.23456789E+10 Inexact Rounded +divx410 divide 1 12345678901 -> 8.10000007E-11 Inexact Rounded +divx411 divide 1234567896 1 -> 1.23456790E+9 Inexact Rounded +divx412 divide 1 1234567896 -> 8.10000003E-10 Inexact Rounded +divx413 divide 1 1234567897 -> 8.10000003E-10 Inexact Rounded +divx414 divide 1 1234567898 -> 8.10000002E-10 Inexact Rounded +divx415 divide 1 1234567899 -> 8.10000001E-10 Inexact Rounded +divx416 divide 1 1234567900 -> 8.10000001E-10 Inexact Rounded +divx417 divide 1 1234567901 -> 8.10000000E-10 Inexact Rounded +divx418 divide 1 1234567902 -> 8.09999999E-10 Inexact Rounded +-- some longies +divx421 divide 1234567896.000000000000 1 -> 1.23456790E+9 Inexact Rounded +divx422 divide 1 1234567896.000000000000 -> 8.10000003E-10 Inexact Rounded +divx423 divide 1234567896.000000000001 1 -> 1.23456790E+9 Inexact Rounded +divx424 divide 1 1234567896.000000000001 -> 8.10000003E-10 Inexact Rounded +divx425 divide 1234567896.000000000000000000000000000000000000000009 1 -> 1.23456790E+9 Inexact Rounded +divx426 divide 1 1234567896.000000000000000000000000000000000000000009 -> 8.10000003E-10 Inexact Rounded +divx427 divide 1234567897.900010000000000000000000000000000000000009 1 -> 1.23456790E+9 Inexact Rounded +divx428 divide 1 1234567897.900010000000000000000000000000000000000009 -> 8.10000002E-10 Inexact Rounded + +precision: 15 +-- still checking... +divx441 divide 12345678000 1 -> 12345678000 +divx442 divide 1 12345678000 -> 8.10000066420005E-11 Inexact Rounded +divx443 divide 1234567800 1 -> 1234567800 +divx444 divide 1 1234567800 -> 8.10000066420005E-10 Inexact Rounded +divx445 divide 1234567890 1 -> 1234567890 +divx446 divide 1 1234567890 -> 8.10000007371000E-10 Inexact Rounded +divx447 divide 1234567891 1 -> 1234567891 +divx448 divide 1 1234567891 -> 8.10000006714900E-10 Inexact Rounded +divx449 divide 12345678901 1 -> 12345678901 +divx450 divide 1 12345678901 -> 8.10000007305390E-11 Inexact Rounded +divx451 divide 1234567896 1 -> 1234567896 +divx452 divide 1 1234567896 -> 8.10000003434400E-10 Inexact Rounded + +-- high-lows +divx453 divide 1e+1 1 -> 1E+1 +divx454 divide 1e+1 1.0 -> 1E+1 +divx455 divide 1e+1 1.00 -> 1E+1 +divx456 divide 1e+2 2 -> 5E+1 +divx457 divide 1e+2 2.0 -> 5E+1 +divx458 divide 1e+2 2.00 -> 5E+1 + +-- some from IEEE discussions +divx460 divide 3e0 2e0 -> 1.5 +divx461 divide 30e-1 2e0 -> 1.5 +divx462 divide 300e-2 2e0 -> 1.50 +divx464 divide 3000e-3 2e0 -> 1.500 +divx465 divide 3e0 20e-1 -> 1.5 +divx466 divide 30e-1 20e-1 -> 1.5 +divx467 divide 300e-2 20e-1 -> 1.5 +divx468 divide 3000e-3 20e-1 -> 1.50 +divx469 divide 3e0 200e-2 -> 1.5 +divx470 divide 30e-1 200e-2 -> 1.5 +divx471 divide 300e-2 200e-2 -> 1.5 +divx472 divide 3000e-3 200e-2 -> 1.5 +divx473 divide 3e0 2000e-3 -> 1.5 +divx474 divide 30e-1 2000e-3 -> 1.5 +divx475 divide 300e-2 2000e-3 -> 1.5 +divx476 divide 3000e-3 2000e-3 -> 1.5 + +-- some reciprocals +divx480 divide 1 1.0E+33 -> 1E-33 +divx481 divide 1 10E+33 -> 1E-34 +divx482 divide 1 1.0E-33 -> 1E+33 +divx483 divide 1 10E-33 -> 1E+32 + +-- RMS discussion table +maxexponent: 96 +minexponent: -95 +precision: 7 + +divx484 divide 0e5 1e3 -> 0E+2 +divx485 divide 0e5 2e3 -> 0E+2 +divx486 divide 0e5 10e2 -> 0E+3 +divx487 divide 0e5 20e2 -> 0E+3 +divx488 divide 0e5 100e1 -> 0E+4 +divx489 divide 0e5 200e1 -> 0E+4 + +divx491 divide 1e5 1e3 -> 1E+2 +divx492 divide 1e5 2e3 -> 5E+1 +divx493 divide 1e5 10e2 -> 1E+2 +divx494 divide 1e5 20e2 -> 5E+1 +divx495 divide 1e5 100e1 -> 1E+2 +divx496 divide 1e5 200e1 -> 5E+1 + +-- tryzeros cases +precision: 7 +rounding: half_up +maxExponent: 92 +minexponent: -92 +divx497 divide 0E+86 1000E-13 -> 0E+92 Clamped +divx498 divide 0E-98 1000E+13 -> 0E-98 Clamped + +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +-- focus on trailing zeros issues +precision: 9 +divx500 divide 1 9.9 -> 0.101010101 Inexact Rounded +precision: 8 +divx501 divide 1 9.9 -> 0.10101010 Inexact Rounded +precision: 7 +divx502 divide 1 9.9 -> 0.1010101 Inexact Rounded +precision: 6 +divx503 divide 1 9.9 -> 0.101010 Inexact Rounded +precision: 9 + +divx511 divide 1 2 -> 0.5 +divx512 divide 1.0 2 -> 0.5 +divx513 divide 1.00 2 -> 0.50 +divx514 divide 1.000 2 -> 0.500 +divx515 divide 1.0000 2 -> 0.5000 +divx516 divide 1.00000 2 -> 0.50000 +divx517 divide 1.000000 2 -> 0.500000 +divx518 divide 1.0000000 2 -> 0.5000000 +divx519 divide 1.00 2.00 -> 0.5 + +divx521 divide 2 1 -> 2 +divx522 divide 2 1.0 -> 2 +divx523 divide 2 1.00 -> 2 +divx524 divide 2 1.000 -> 2 +divx525 divide 2 1.0000 -> 2 +divx526 divide 2 1.00000 -> 2 +divx527 divide 2 1.000000 -> 2 +divx528 divide 2 1.0000000 -> 2 +divx529 divide 2.00 1.00 -> 2 + +divx530 divide 2.40 2 -> 1.20 +divx531 divide 2.40 4 -> 0.60 +divx532 divide 2.40 10 -> 0.24 +divx533 divide 2.40 2.0 -> 1.2 +divx534 divide 2.40 4.0 -> 0.6 +divx535 divide 2.40 10.0 -> 0.24 +divx536 divide 2.40 2.00 -> 1.2 +divx537 divide 2.40 4.00 -> 0.6 +divx538 divide 2.40 10.00 -> 0.24 +divx539 divide 0.9 0.1 -> 9 +divx540 divide 0.9 0.01 -> 9E+1 +divx541 divide 0.9 0.001 -> 9E+2 +divx542 divide 5 2 -> 2.5 +divx543 divide 5 2.0 -> 2.5 +divx544 divide 5 2.00 -> 2.5 +divx545 divide 5 20 -> 0.25 +divx546 divide 5 20.0 -> 0.25 +divx547 divide 2.400 2 -> 1.200 +divx548 divide 2.400 2.0 -> 1.20 +divx549 divide 2.400 2.400 -> 1 + +divx550 divide 240 1 -> 240 +divx551 divide 240 10 -> 24 +divx552 divide 240 100 -> 2.4 +divx553 divide 240 1000 -> 0.24 +divx554 divide 2400 1 -> 2400 +divx555 divide 2400 10 -> 240 +divx556 divide 2400 100 -> 24 +divx557 divide 2400 1000 -> 2.4 + +-- +ve exponent +precision: 5 +divx570 divide 2.4E+6 2 -> 1.2E+6 +divx571 divide 2.40E+6 2 -> 1.20E+6 +divx572 divide 2.400E+6 2 -> 1.200E+6 +divx573 divide 2.4000E+6 2 -> 1.2000E+6 +divx574 divide 24E+5 2 -> 1.2E+6 +divx575 divide 240E+4 2 -> 1.20E+6 +divx576 divide 2400E+3 2 -> 1.200E+6 +divx577 divide 24000E+2 2 -> 1.2000E+6 +precision: 6 +divx580 divide 2.4E+6 2 -> 1.2E+6 +divx581 divide 2.40E+6 2 -> 1.20E+6 +divx582 divide 2.400E+6 2 -> 1.200E+6 +divx583 divide 2.4000E+6 2 -> 1.2000E+6 +divx584 divide 24E+5 2 -> 1.2E+6 +divx585 divide 240E+4 2 -> 1.20E+6 +divx586 divide 2400E+3 2 -> 1.200E+6 +divx587 divide 24000E+2 2 -> 1.2000E+6 +precision: 7 +divx590 divide 2.4E+6 2 -> 1.2E+6 +divx591 divide 2.40E+6 2 -> 1.20E+6 +divx592 divide 2.400E+6 2 -> 1.200E+6 +divx593 divide 2.4000E+6 2 -> 1.2000E+6 +divx594 divide 24E+5 2 -> 1.2E+6 +divx595 divide 240E+4 2 -> 1.20E+6 +divx596 divide 2400E+3 2 -> 1.200E+6 +divx597 divide 24000E+2 2 -> 1.2000E+6 +precision: 9 +divx600 divide 2.4E+9 2 -> 1.2E+9 +divx601 divide 2.40E+9 2 -> 1.20E+9 +divx602 divide 2.400E+9 2 -> 1.200E+9 +divx603 divide 2.4000E+9 2 -> 1.2000E+9 +divx604 divide 24E+8 2 -> 1.2E+9 +divx605 divide 240E+7 2 -> 1.20E+9 +divx606 divide 2400E+6 2 -> 1.200E+9 +divx607 divide 24000E+5 2 -> 1.2000E+9 + +-- long operand triangle +precision: 33 +divx610 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8131097703792 Inexact Rounded +precision: 32 +divx611 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.813109770379 Inexact Rounded +precision: 31 +divx612 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81310977038 Inexact Rounded +precision: 30 +divx613 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8131097704 Inexact Rounded +precision: 29 +divx614 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.813109770 Inexact Rounded +precision: 28 +divx615 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81310977 Inexact Rounded +precision: 27 +divx616 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8131098 Inexact Rounded +precision: 26 +divx617 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.813110 Inexact Rounded +precision: 25 +divx618 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81311 Inexact Rounded +precision: 24 +divx619 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8131 Inexact Rounded +precision: 23 +divx620 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.813 Inexact Rounded +precision: 22 +divx621 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81 Inexact Rounded +precision: 21 +divx622 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.8 Inexact Rounded +precision: 20 +divx623 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817798 Inexact Rounded +precision: 19 +divx624 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101140888379681780E+19 Inexact Rounded +precision: 18 +divx625 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114088837968178E+19 Inexact Rounded +precision: 17 +divx626 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011408883796818E+19 Inexact Rounded +precision: 16 +divx627 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101140888379682E+19 Inexact Rounded +precision: 15 +divx628 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114088837968E+19 Inexact Rounded +precision: 14 +divx629 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011408883797E+19 Inexact Rounded +precision: 13 +divx630 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101140888380E+19 Inexact Rounded +precision: 12 +divx631 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114088838E+19 Inexact Rounded +precision: 11 +divx632 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011408884E+19 Inexact Rounded +precision: 10 +divx633 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101140888E+19 Inexact Rounded +precision: 9 +divx634 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114089E+19 Inexact Rounded +precision: 8 +divx635 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011409E+19 Inexact Rounded +precision: 7 +divx636 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101141E+19 Inexact Rounded +precision: 6 +divx637 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10114E+19 Inexact Rounded +precision: 5 +divx638 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1011E+19 Inexact Rounded +precision: 4 +divx639 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.101E+19 Inexact Rounded +precision: 3 +divx640 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.10E+19 Inexact Rounded +precision: 2 +divx641 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4.1E+19 Inexact Rounded +precision: 1 +divx642 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -4E+19 Inexact Rounded + +-- more zeros, etc. +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +divx731 divide 5.00 1E-3 -> 5.00E+3 +divx732 divide 00.00 0.000 -> NaN Division_undefined +divx733 divide 00.00 0E-3 -> NaN Division_undefined +divx734 divide 0 -0 -> NaN Division_undefined +divx735 divide -0 0 -> NaN Division_undefined +divx736 divide -0 -0 -> NaN Division_undefined + +divx741 divide 0 -1 -> -0 +divx742 divide -0 -1 -> 0 +divx743 divide 0 1 -> 0 +divx744 divide -0 1 -> -0 +divx745 divide -1 0 -> -Infinity Division_by_zero +divx746 divide -1 -0 -> Infinity Division_by_zero +divx747 divide 1 0 -> Infinity Division_by_zero +divx748 divide 1 -0 -> -Infinity Division_by_zero + +divx751 divide 0.0 -1 -> -0.0 +divx752 divide -0.0 -1 -> 0.0 +divx753 divide 0.0 1 -> 0.0 +divx754 divide -0.0 1 -> -0.0 +divx755 divide -1.0 0 -> -Infinity Division_by_zero +divx756 divide -1.0 -0 -> Infinity Division_by_zero +divx757 divide 1.0 0 -> Infinity Division_by_zero +divx758 divide 1.0 -0 -> -Infinity Division_by_zero + +divx761 divide 0 -1.0 -> -0E+1 +divx762 divide -0 -1.0 -> 0E+1 +divx763 divide 0 1.0 -> 0E+1 +divx764 divide -0 1.0 -> -0E+1 +divx765 divide -1 0.0 -> -Infinity Division_by_zero +divx766 divide -1 -0.0 -> Infinity Division_by_zero +divx767 divide 1 0.0 -> Infinity Division_by_zero +divx768 divide 1 -0.0 -> -Infinity Division_by_zero + +divx771 divide 0.0 -1.0 -> -0 +divx772 divide -0.0 -1.0 -> 0 +divx773 divide 0.0 1.0 -> 0 +divx774 divide -0.0 1.0 -> -0 +divx775 divide -1.0 0.0 -> -Infinity Division_by_zero +divx776 divide -1.0 -0.0 -> Infinity Division_by_zero +divx777 divide 1.0 0.0 -> Infinity Division_by_zero +divx778 divide 1.0 -0.0 -> -Infinity Division_by_zero + +-- Specials +divx780 divide Inf -Inf -> NaN Invalid_operation +divx781 divide Inf -1000 -> -Infinity +divx782 divide Inf -1 -> -Infinity +divx783 divide Inf -0 -> -Infinity +divx784 divide Inf 0 -> Infinity +divx785 divide Inf 1 -> Infinity +divx786 divide Inf 1000 -> Infinity +divx787 divide Inf Inf -> NaN Invalid_operation +divx788 divide -1000 Inf -> -0E-398 Clamped +divx789 divide -Inf Inf -> NaN Invalid_operation +divx790 divide -1 Inf -> -0E-398 Clamped +divx791 divide -0 Inf -> -0E-398 Clamped +divx792 divide 0 Inf -> 0E-398 Clamped +divx793 divide 1 Inf -> 0E-398 Clamped +divx794 divide 1000 Inf -> 0E-398 Clamped +divx795 divide Inf Inf -> NaN Invalid_operation + +divx800 divide -Inf -Inf -> NaN Invalid_operation +divx801 divide -Inf -1000 -> Infinity +divx802 divide -Inf -1 -> Infinity +divx803 divide -Inf -0 -> Infinity +divx804 divide -Inf 0 -> -Infinity +divx805 divide -Inf 1 -> -Infinity +divx806 divide -Inf 1000 -> -Infinity +divx807 divide -Inf Inf -> NaN Invalid_operation +divx808 divide -1000 Inf -> -0E-398 Clamped +divx809 divide -Inf -Inf -> NaN Invalid_operation +divx810 divide -1 -Inf -> 0E-398 Clamped +divx811 divide -0 -Inf -> 0E-398 Clamped +divx812 divide 0 -Inf -> -0E-398 Clamped +divx813 divide 1 -Inf -> -0E-398 Clamped +divx814 divide 1000 -Inf -> -0E-398 Clamped +divx815 divide Inf -Inf -> NaN Invalid_operation + +divx821 divide NaN -Inf -> NaN +divx822 divide NaN -1000 -> NaN +divx823 divide NaN -1 -> NaN +divx824 divide NaN -0 -> NaN +divx825 divide NaN 0 -> NaN +divx826 divide NaN 1 -> NaN +divx827 divide NaN 1000 -> NaN +divx828 divide NaN Inf -> NaN +divx829 divide NaN NaN -> NaN +divx830 divide -Inf NaN -> NaN +divx831 divide -1000 NaN -> NaN +divx832 divide -1 NaN -> NaN +divx833 divide -0 NaN -> NaN +divx834 divide 0 NaN -> NaN +divx835 divide 1 NaN -> NaN +divx836 divide 1000 NaN -> NaN +divx837 divide Inf NaN -> NaN + +divx841 divide sNaN -Inf -> NaN Invalid_operation +divx842 divide sNaN -1000 -> NaN Invalid_operation +divx843 divide sNaN -1 -> NaN Invalid_operation +divx844 divide sNaN -0 -> NaN Invalid_operation +divx845 divide sNaN 0 -> NaN Invalid_operation +divx846 divide sNaN 1 -> NaN Invalid_operation +divx847 divide sNaN 1000 -> NaN Invalid_operation +divx848 divide sNaN NaN -> NaN Invalid_operation +divx849 divide sNaN sNaN -> NaN Invalid_operation +divx850 divide NaN sNaN -> NaN Invalid_operation +divx851 divide -Inf sNaN -> NaN Invalid_operation +divx852 divide -1000 sNaN -> NaN Invalid_operation +divx853 divide -1 sNaN -> NaN Invalid_operation +divx854 divide -0 sNaN -> NaN Invalid_operation +divx855 divide 0 sNaN -> NaN Invalid_operation +divx856 divide 1 sNaN -> NaN Invalid_operation +divx857 divide 1000 sNaN -> NaN Invalid_operation +divx858 divide Inf sNaN -> NaN Invalid_operation +divx859 divide NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +divx861 divide NaN9 -Inf -> NaN9 +divx862 divide NaN8 1000 -> NaN8 +divx863 divide NaN7 Inf -> NaN7 +divx864 divide NaN6 NaN5 -> NaN6 +divx865 divide -Inf NaN4 -> NaN4 +divx866 divide -1000 NaN3 -> NaN3 +divx867 divide Inf NaN2 -> NaN2 + +divx871 divide sNaN99 -Inf -> NaN99 Invalid_operation +divx872 divide sNaN98 -1 -> NaN98 Invalid_operation +divx873 divide sNaN97 NaN -> NaN97 Invalid_operation +divx874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation +divx875 divide NaN95 sNaN93 -> NaN93 Invalid_operation +divx876 divide -Inf sNaN92 -> NaN92 Invalid_operation +divx877 divide 0 sNaN91 -> NaN91 Invalid_operation +divx878 divide Inf sNaN90 -> NaN90 Invalid_operation +divx879 divide NaN sNaN89 -> NaN89 Invalid_operation + +divx881 divide -NaN9 -Inf -> -NaN9 +divx882 divide -NaN8 1000 -> -NaN8 +divx883 divide -NaN7 Inf -> -NaN7 +divx884 divide -NaN6 -NaN5 -> -NaN6 +divx885 divide -Inf -NaN4 -> -NaN4 +divx886 divide -1000 -NaN3 -> -NaN3 +divx887 divide Inf -NaN2 -> -NaN2 + +divx891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation +divx892 divide -sNaN98 -1 -> -NaN98 Invalid_operation +divx893 divide -sNaN97 NaN -> -NaN97 Invalid_operation +divx894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation +divx895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation +divx896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation +divx897 divide 0 -sNaN91 -> -NaN91 Invalid_operation +divx898 divide Inf -sNaN90 -> -NaN90 Invalid_operation +divx899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation + +maxexponent: 999999999 +minexponent: -999999999 + +-- Various flavours of divide by 0 +divx901 divide 0 0 -> NaN Division_undefined +divx902 divide 0.0E5 0 -> NaN Division_undefined +divx903 divide 0.000 0 -> NaN Division_undefined +divx904 divide 0.0001 0 -> Infinity Division_by_zero +divx905 divide 0.01 0 -> Infinity Division_by_zero +divx906 divide 0.1 0 -> Infinity Division_by_zero +divx907 divide 1 0 -> Infinity Division_by_zero +divx908 divide 1 0.0 -> Infinity Division_by_zero +divx909 divide 10 0.0 -> Infinity Division_by_zero +divx910 divide 1E+100 0.0 -> Infinity Division_by_zero +divx911 divide 1E+1000 0 -> Infinity Division_by_zero + +divx921 divide -0.0001 0 -> -Infinity Division_by_zero +divx922 divide -0.01 0 -> -Infinity Division_by_zero +divx923 divide -0.1 0 -> -Infinity Division_by_zero +divx924 divide -1 0 -> -Infinity Division_by_zero +divx925 divide -1 0.0 -> -Infinity Division_by_zero +divx926 divide -10 0.0 -> -Infinity Division_by_zero +divx927 divide -1E+100 0.0 -> -Infinity Division_by_zero +divx928 divide -1E+1000 0 -> -Infinity Division_by_zero + +divx931 divide 0.0001 -0 -> -Infinity Division_by_zero +divx932 divide 0.01 -0 -> -Infinity Division_by_zero +divx933 divide 0.1 -0 -> -Infinity Division_by_zero +divx934 divide 1 -0 -> -Infinity Division_by_zero +divx935 divide 1 -0.0 -> -Infinity Division_by_zero +divx936 divide 10 -0.0 -> -Infinity Division_by_zero +divx937 divide 1E+100 -0.0 -> -Infinity Division_by_zero +divx938 divide 1E+1000 -0 -> -Infinity Division_by_zero + +divx941 divide -0.0001 -0 -> Infinity Division_by_zero +divx942 divide -0.01 -0 -> Infinity Division_by_zero +divx943 divide -0.1 -0 -> Infinity Division_by_zero +divx944 divide -1 -0 -> Infinity Division_by_zero +divx945 divide -1 -0.0 -> Infinity Division_by_zero +divx946 divide -10 -0.0 -> Infinity Division_by_zero +divx947 divide -1E+100 -0.0 -> Infinity Division_by_zero +divx948 divide -1E+1000 -0 -> Infinity Division_by_zero + +-- overflow and underflow tests +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +divx951 divide 9E+999999999 +0.23456789012345E-0 -> Infinity Inexact Overflow Rounded +divx952 divide +0.100 9E+999999999 -> 1.111111E-1000000001 Inexact Rounded Underflow Subnormal +divx953 divide 9E-999999999 +9.100 -> 9.8901099E-1000000000 Inexact Rounded Underflow Subnormal +divx954 divide -1.23456789 9E+999999999 -> -1.3717421E-1000000000 Subnormal +divx955 divide -1.23456789012345E-0 9E+999999999 -> -1.3717421E-1000000000 Underflow Subnormal Rounded Inexact +divx956 divide -1.23456789012345E-0 7E+999999999 -> -1.7636684E-1000000000 Inexact Rounded Underflow Subnormal +divx957 divide 9E+999999999 -0.83456789012345E-0 -> -Infinity Inexact Overflow Rounded +divx958 divide -0.100 9E+999999999 -> -1.111111E-1000000001 Subnormal Inexact Rounded Underflow +divx959 divide 9E-999999999 -9.100 -> -9.8901099E-1000000000 Inexact Rounded Underflow Subnormal + +-- overflow and underflow (additional edge tests in multiply.decTest) +-- 'subnormal' results now possible (all hard underflow or overflow in +-- base arithemtic) +divx960 divide 1e-600000000 1e+400000001 -> 1E-1000000001 Subnormal +divx961 divide 1e-600000000 1e+400000002 -> 1E-1000000002 Subnormal +divx962 divide 1e-600000000 1e+400000003 -> 1E-1000000003 Subnormal +divx963 divide 1e-600000000 1e+400000004 -> 1E-1000000004 Subnormal +divx964 divide 1e-600000000 1e+400000005 -> 1E-1000000005 Subnormal +divx965 divide 1e-600000000 1e+400000006 -> 1E-1000000006 Subnormal +divx966 divide 1e-600000000 1e+400000007 -> 1E-1000000007 Subnormal +divx967 divide 1e-600000000 1e+400000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +divx968 divide 1e-600000000 1e+400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +divx969 divide 1e-600000000 1e+400000010 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +-- [no equivalent of 'subnormal' for overflow] +divx970 divide 1e+600000000 1e-400000001 -> Infinity Overflow Inexact Rounded +divx971 divide 1e+600000000 1e-400000002 -> Infinity Overflow Inexact Rounded +divx972 divide 1e+600000000 1e-400000003 -> Infinity Overflow Inexact Rounded +divx973 divide 1e+600000000 1e-400000004 -> Infinity Overflow Inexact Rounded +divx974 divide 1e+600000000 1e-400000005 -> Infinity Overflow Inexact Rounded +divx975 divide 1e+600000000 1e-400000006 -> Infinity Overflow Inexact Rounded +divx976 divide 1e+600000000 1e-400000007 -> Infinity Overflow Inexact Rounded +divx977 divide 1e+600000000 1e-400000008 -> Infinity Overflow Inexact Rounded +divx978 divide 1e+600000000 1e-400000009 -> Infinity Overflow Inexact Rounded +divx979 divide 1e+600000000 1e-400000010 -> Infinity Overflow Inexact Rounded + +-- Sign after overflow and underflow +divx980 divide 1e-600000000 1e+400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +divx981 divide 1e-600000000 -1e+400000009 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +divx982 divide -1e-600000000 1e+400000009 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +divx983 divide -1e-600000000 -1e+400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +divx984 divide 1e+600000000 1e-400000009 -> Infinity Overflow Inexact Rounded +divx985 divide 1e+600000000 -1e-400000009 -> -Infinity Overflow Inexact Rounded +divx986 divide -1e+600000000 1e-400000009 -> -Infinity Overflow Inexact Rounded +divx987 divide -1e+600000000 -1e-400000009 -> Infinity Overflow Inexact Rounded + +-- Long operand overflow may be a different path +precision: 3 +divx990 divide 1000 9.999E-999999999 -> Infinity Inexact Overflow Rounded +divx991 divide 1000 -9.999E-999999999 -> -Infinity Inexact Overflow Rounded +divx992 divide 9.999E+999999999 0.01 -> Infinity Inexact Overflow Rounded +divx993 divide -9.999E+999999999 0.01 -> -Infinity Inexact Overflow Rounded + +-- check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +divx1001 divide 1.52444E-80 1 -> 1.524E-80 Inexact Rounded Subnormal Underflow +divx1002 divide 1.52445E-80 1 -> 1.524E-80 Inexact Rounded Subnormal Underflow +divx1003 divide 1.52446E-80 1 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +-- a rounding problem in one implementation +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +-- Unbounded answer to 40 digits: +-- 1.465811965811965811965811965811965811966E+7000 +divx1010 divide 343E6000 234E-1000 -> Infinity Overflow Inexact Rounded + +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 + +-- Examples from SQL proposal (Krishna Kulkarni) +precision: 7 +divx1021 divide 1E0 1E0 -> 1 +divx1022 divide 1E0 2E0 -> 0.5 +divx1023 divide 1E0 3E0 -> 0.3333333 Inexact Rounded +divx1024 divide 100E-2 1000E-3 -> 1 +divx1025 divide 24E-1 2E0 -> 1.2 +divx1026 divide 2400E-3 2E0 -> 1.200 +divx1027 divide 5E0 2E0 -> 2.5 +divx1028 divide 5E0 20E-1 -> 2.5 +divx1029 divide 5E0 2000E-3 -> 2.5 +divx1030 divide 5E0 2E-1 -> 25 +divx1031 divide 5E0 20E-2 -> 25 +divx1032 divide 480E-2 3E0 -> 1.60 +divx1033 divide 47E-1 2E0 -> 2.35 + + + +-- Null tests +divx9998 divide 10 # -> NaN Invalid_operation +divx9999 divide # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal-c/new_dt/divideint.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/divideint.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,486 @@ +------------------------------------------------------------------------ +-- divideint.decTest -- decimal integer division -- +-- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +dvix001 divideint 1 1 -> 1 +dvix002 divideint 2 1 -> 2 +dvix003 divideint 1 2 -> 0 +dvix004 divideint 2 2 -> 1 +dvix005 divideint 0 1 -> 0 +dvix006 divideint 0 2 -> 0 +dvix007 divideint 1 3 -> 0 +dvix008 divideint 2 3 -> 0 +dvix009 divideint 3 3 -> 1 + +dvix010 divideint 2.4 1 -> 2 +dvix011 divideint 2.4 -1 -> -2 +dvix012 divideint -2.4 1 -> -2 +dvix013 divideint -2.4 -1 -> 2 +dvix014 divideint 2.40 1 -> 2 +dvix015 divideint 2.400 1 -> 2 +dvix016 divideint 2.4 2 -> 1 +dvix017 divideint 2.400 2 -> 1 +dvix018 divideint 2. 2 -> 1 +dvix019 divideint 20 20 -> 1 + +dvix020 divideint 187 187 -> 1 +dvix021 divideint 5 2 -> 2 +dvix022 divideint 5 2.0 -> 2 +dvix023 divideint 5 2.000 -> 2 +dvix024 divideint 5 0.200 -> 25 +dvix025 divideint 5 0.200 -> 25 + +dvix030 divideint 1 2 -> 0 +dvix031 divideint 1 4 -> 0 +dvix032 divideint 1 8 -> 0 +dvix033 divideint 1 16 -> 0 +dvix034 divideint 1 32 -> 0 +dvix035 divideint 1 64 -> 0 +dvix040 divideint 1 -2 -> -0 +dvix041 divideint 1 -4 -> -0 +dvix042 divideint 1 -8 -> -0 +dvix043 divideint 1 -16 -> -0 +dvix044 divideint 1 -32 -> -0 +dvix045 divideint 1 -64 -> -0 +dvix050 divideint -1 2 -> -0 +dvix051 divideint -1 4 -> -0 +dvix052 divideint -1 8 -> -0 +dvix053 divideint -1 16 -> -0 +dvix054 divideint -1 32 -> -0 +dvix055 divideint -1 64 -> -0 +dvix060 divideint -1 -2 -> 0 +dvix061 divideint -1 -4 -> 0 +dvix062 divideint -1 -8 -> 0 +dvix063 divideint -1 -16 -> 0 +dvix064 divideint -1 -32 -> 0 +dvix065 divideint -1 -64 -> 0 + +-- similar with powers of ten +dvix160 divideint 1 1 -> 1 +dvix161 divideint 1 10 -> 0 +dvix162 divideint 1 100 -> 0 +dvix163 divideint 1 1000 -> 0 +dvix164 divideint 1 10000 -> 0 +dvix165 divideint 1 100000 -> 0 +dvix166 divideint 1 1000000 -> 0 +dvix167 divideint 1 10000000 -> 0 +dvix168 divideint 1 100000000 -> 0 +dvix170 divideint 1 -1 -> -1 +dvix171 divideint 1 -10 -> -0 +dvix172 divideint 1 -100 -> -0 +dvix173 divideint 1 -1000 -> -0 +dvix174 divideint 1 -10000 -> -0 +dvix175 divideint 1 -100000 -> -0 +dvix176 divideint 1 -1000000 -> -0 +dvix177 divideint 1 -10000000 -> -0 +dvix178 divideint 1 -100000000 -> -0 +dvix180 divideint -1 1 -> -1 +dvix181 divideint -1 10 -> -0 +dvix182 divideint -1 100 -> -0 +dvix183 divideint -1 1000 -> -0 +dvix184 divideint -1 10000 -> -0 +dvix185 divideint -1 100000 -> -0 +dvix186 divideint -1 1000000 -> -0 +dvix187 divideint -1 10000000 -> -0 +dvix188 divideint -1 100000000 -> -0 +dvix190 divideint -1 -1 -> 1 +dvix191 divideint -1 -10 -> 0 +dvix192 divideint -1 -100 -> 0 +dvix193 divideint -1 -1000 -> 0 +dvix194 divideint -1 -10000 -> 0 +dvix195 divideint -1 -100000 -> 0 +dvix196 divideint -1 -1000000 -> 0 +dvix197 divideint -1 -10000000 -> 0 +dvix198 divideint -1 -100000000 -> 0 + +-- some long operand cases here +dvix070 divideint 999999999 1 -> 999999999 +dvix071 divideint 999999999.4 1 -> 999999999 +dvix072 divideint 999999999.5 1 -> 999999999 +dvix073 divideint 999999999.9 1 -> 999999999 +dvix074 divideint 999999999.999 1 -> 999999999 +precision: 6 +dvix080 divideint 999999999 1 -> NaN Division_impossible +dvix081 divideint 99999999 1 -> NaN Division_impossible +dvix082 divideint 9999999 1 -> NaN Division_impossible +dvix083 divideint 999999 1 -> 999999 +dvix084 divideint 99999 1 -> 99999 +dvix085 divideint 9999 1 -> 9999 +dvix086 divideint 999 1 -> 999 +dvix087 divideint 99 1 -> 99 +dvix088 divideint 9 1 -> 9 + +precision: 9 +dvix090 divideint 0. 1 -> 0 +dvix091 divideint .0 1 -> 0 +dvix092 divideint 0.00 1 -> 0 +dvix093 divideint 0.00E+9 1 -> 0 +dvix094 divideint 0.0000E-50 1 -> 0 + +dvix100 divideint 1 1 -> 1 +dvix101 divideint 1 2 -> 0 +dvix102 divideint 1 3 -> 0 +dvix103 divideint 1 4 -> 0 +dvix104 divideint 1 5 -> 0 +dvix105 divideint 1 6 -> 0 +dvix106 divideint 1 7 -> 0 +dvix107 divideint 1 8 -> 0 +dvix108 divideint 1 9 -> 0 +dvix109 divideint 1 10 -> 0 +dvix110 divideint 1 1 -> 1 +dvix111 divideint 2 1 -> 2 +dvix112 divideint 3 1 -> 3 +dvix113 divideint 4 1 -> 4 +dvix114 divideint 5 1 -> 5 +dvix115 divideint 6 1 -> 6 +dvix116 divideint 7 1 -> 7 +dvix117 divideint 8 1 -> 8 +dvix118 divideint 9 1 -> 9 +dvix119 divideint 10 1 -> 10 + +-- from DiagBigDecimal +dvix131 divideint 101.3 1 -> 101 +dvix132 divideint 101.0 1 -> 101 +dvix133 divideint 101.3 3 -> 33 +dvix134 divideint 101.0 3 -> 33 +dvix135 divideint 2.4 1 -> 2 +dvix136 divideint 2.400 1 -> 2 +dvix137 divideint 18 18 -> 1 +dvix138 divideint 1120 1000 -> 1 +dvix139 divideint 2.4 2 -> 1 +dvix140 divideint 2.400 2 -> 1 +dvix141 divideint 0.5 2.000 -> 0 +dvix142 divideint 8.005 7 -> 1 +dvix143 divideint 5 2 -> 2 +dvix144 divideint 0 2 -> 0 +dvix145 divideint 0.00 2 -> 0 + +-- Others +dvix150 divideint 12345 4.999 -> 2469 +dvix151 divideint 12345 4.99 -> 2473 +dvix152 divideint 12345 4.9 -> 2519 +dvix153 divideint 12345 5 -> 2469 +dvix154 divideint 12345 5.1 -> 2420 +dvix155 divideint 12345 5.01 -> 2464 +dvix156 divideint 12345 5.001 -> 2468 +dvix157 divideint 101 7.6 -> 13 + +-- Various flavours of divideint by 0 +maxexponent: 999999999 +minexponent: -999999999 +dvix201 divideint 0 0 -> NaN Division_undefined +dvix202 divideint 0.0E5 0 -> NaN Division_undefined +dvix203 divideint 0.000 0 -> NaN Division_undefined +dvix204 divideint 0.0001 0 -> Infinity Division_by_zero +dvix205 divideint 0.01 0 -> Infinity Division_by_zero +dvix206 divideint 0.1 0 -> Infinity Division_by_zero +dvix207 divideint 1 0 -> Infinity Division_by_zero +dvix208 divideint 1 0.0 -> Infinity Division_by_zero +dvix209 divideint 10 0.0 -> Infinity Division_by_zero +dvix210 divideint 1E+100 0.0 -> Infinity Division_by_zero +dvix211 divideint 1E+1000 0 -> Infinity Division_by_zero +dvix214 divideint -0.0001 0 -> -Infinity Division_by_zero +dvix215 divideint -0.01 0 -> -Infinity Division_by_zero +dvix216 divideint -0.1 0 -> -Infinity Division_by_zero +dvix217 divideint -1 0 -> -Infinity Division_by_zero +dvix218 divideint -1 0.0 -> -Infinity Division_by_zero +dvix219 divideint -10 0.0 -> -Infinity Division_by_zero +dvix220 divideint -1E+100 0.0 -> -Infinity Division_by_zero +dvix221 divideint -1E+1000 0 -> -Infinity Division_by_zero + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +dvix270 divideint 1 1e999999999 -> 0 +dvix271 divideint 1 0.9e999999999 -> 0 +dvix272 divideint 1 0.99e999999999 -> 0 +dvix273 divideint 1 0.999999999e999999999 -> 0 +dvix274 divideint 9e999999999 1 -> NaN Division_impossible +dvix275 divideint 9.9e999999999 1 -> NaN Division_impossible +dvix276 divideint 9.99e999999999 1 -> NaN Division_impossible +dvix277 divideint 9.99999999e999999999 1 -> NaN Division_impossible + +dvix280 divideint 0.1 9e-999999999 -> NaN Division_impossible +dvix281 divideint 0.1 99e-999999999 -> NaN Division_impossible +dvix282 divideint 0.1 999e-999999999 -> NaN Division_impossible + +dvix283 divideint 0.1 9e-999999998 -> NaN Division_impossible +dvix284 divideint 0.1 99e-999999998 -> NaN Division_impossible +dvix285 divideint 0.1 999e-999999998 -> NaN Division_impossible +dvix286 divideint 0.1 999e-999999997 -> NaN Division_impossible +dvix287 divideint 0.1 9999e-999999997 -> NaN Division_impossible +dvix288 divideint 0.1 99999e-999999997 -> NaN Division_impossible + +-- GD edge cases: lhs smaller than rhs but more digits +dvix301 divideint 0.9 2 -> 0 +dvix302 divideint 0.9 2.0 -> 0 +dvix303 divideint 0.9 2.1 -> 0 +dvix304 divideint 0.9 2.00 -> 0 +dvix305 divideint 0.9 2.01 -> 0 +dvix306 divideint 0.12 1 -> 0 +dvix307 divideint 0.12 1.0 -> 0 +dvix308 divideint 0.12 1.00 -> 0 +dvix309 divideint 0.12 1.0 -> 0 +dvix310 divideint 0.12 1.00 -> 0 +dvix311 divideint 0.12 2 -> 0 +dvix312 divideint 0.12 2.0 -> 0 +dvix313 divideint 0.12 2.1 -> 0 +dvix314 divideint 0.12 2.00 -> 0 +dvix315 divideint 0.12 2.01 -> 0 + +-- overflow and underflow tests [from divide] +maxexponent: 999999999 +minexponent: -999999999 +dvix330 divideint +1.23456789012345E-0 9E+999999999 -> 0 +dvix331 divideint 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible +dvix332 divideint +0.100 9E+999999999 -> 0 +dvix333 divideint 9E-999999999 +9.100 -> 0 +dvix335 divideint -1.23456789012345E-0 9E+999999999 -> -0 +dvix336 divideint 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible +dvix337 divideint -0.100 9E+999999999 -> -0 +dvix338 divideint 9E-999999999 -9.100 -> -0 + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +dvix401 divideint 12345678000 100 -> 123456780 +dvix402 divideint 1 12345678000 -> 0 +dvix403 divideint 1234567800 10 -> 123456780 +dvix404 divideint 1 1234567800 -> 0 +dvix405 divideint 1234567890 10 -> 123456789 +dvix406 divideint 1 1234567890 -> 0 +dvix407 divideint 1234567891 10 -> 123456789 +dvix408 divideint 1 1234567891 -> 0 +dvix409 divideint 12345678901 100 -> 123456789 +dvix410 divideint 1 12345678901 -> 0 +dvix411 divideint 1234567896 10 -> 123456789 +dvix412 divideint 1 1234567896 -> 0 +dvix413 divideint 12345678948 100 -> 123456789 +dvix414 divideint 12345678949 100 -> 123456789 +dvix415 divideint 12345678950 100 -> 123456789 +dvix416 divideint 12345678951 100 -> 123456789 +dvix417 divideint 12345678999 100 -> 123456789 + +precision: 15 +dvix441 divideint 12345678000 1 -> 12345678000 +dvix442 divideint 1 12345678000 -> 0 +dvix443 divideint 1234567800 1 -> 1234567800 +dvix444 divideint 1 1234567800 -> 0 +dvix445 divideint 1234567890 1 -> 1234567890 +dvix446 divideint 1 1234567890 -> 0 +dvix447 divideint 1234567891 1 -> 1234567891 +dvix448 divideint 1 1234567891 -> 0 +dvix449 divideint 12345678901 1 -> 12345678901 +dvix450 divideint 1 12345678901 -> 0 +dvix451 divideint 1234567896 1 -> 1234567896 +dvix452 divideint 1 1234567896 -> 0 + +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +-- more zeros, etc. +dvix531 divideint 5.00 1E-3 -> 5000 +dvix532 divideint 00.00 0.000 -> NaN Division_undefined +dvix533 divideint 00.00 0E-3 -> NaN Division_undefined +dvix534 divideint 0 -0 -> NaN Division_undefined +dvix535 divideint -0 0 -> NaN Division_undefined +dvix536 divideint -0 -0 -> NaN Division_undefined + +dvix541 divideint 0 -1 -> -0 +dvix542 divideint -0 -1 -> 0 +dvix543 divideint 0 1 -> 0 +dvix544 divideint -0 1 -> -0 +dvix545 divideint -1 0 -> -Infinity Division_by_zero +dvix546 divideint -1 -0 -> Infinity Division_by_zero +dvix547 divideint 1 0 -> Infinity Division_by_zero +dvix548 divideint 1 -0 -> -Infinity Division_by_zero + +dvix551 divideint 0.0 -1 -> -0 +dvix552 divideint -0.0 -1 -> 0 +dvix553 divideint 0.0 1 -> 0 +dvix554 divideint -0.0 1 -> -0 +dvix555 divideint -1.0 0 -> -Infinity Division_by_zero +dvix556 divideint -1.0 -0 -> Infinity Division_by_zero +dvix557 divideint 1.0 0 -> Infinity Division_by_zero +dvix558 divideint 1.0 -0 -> -Infinity Division_by_zero + +dvix561 divideint 0 -1.0 -> -0 +dvix562 divideint -0 -1.0 -> 0 +dvix563 divideint 0 1.0 -> 0 +dvix564 divideint -0 1.0 -> -0 +dvix565 divideint -1 0.0 -> -Infinity Division_by_zero +dvix566 divideint -1 -0.0 -> Infinity Division_by_zero +dvix567 divideint 1 0.0 -> Infinity Division_by_zero +dvix568 divideint 1 -0.0 -> -Infinity Division_by_zero + +dvix571 divideint 0.0 -1.0 -> -0 +dvix572 divideint -0.0 -1.0 -> 0 +dvix573 divideint 0.0 1.0 -> 0 +dvix574 divideint -0.0 1.0 -> -0 +dvix575 divideint -1.0 0.0 -> -Infinity Division_by_zero +dvix576 divideint -1.0 -0.0 -> Infinity Division_by_zero +dvix577 divideint 1.0 0.0 -> Infinity Division_by_zero +dvix578 divideint 1.0 -0.0 -> -Infinity Division_by_zero + +-- Specials +dvix580 divideint Inf -Inf -> NaN Invalid_operation +dvix581 divideint Inf -1000 -> -Infinity +dvix582 divideint Inf -1 -> -Infinity +dvix583 divideint Inf -0 -> -Infinity +dvix584 divideint Inf 0 -> Infinity +dvix585 divideint Inf 1 -> Infinity +dvix586 divideint Inf 1000 -> Infinity +dvix587 divideint Inf Inf -> NaN Invalid_operation +dvix588 divideint -1000 Inf -> -0 +dvix589 divideint -Inf Inf -> NaN Invalid_operation +dvix590 divideint -1 Inf -> -0 +dvix591 divideint -0 Inf -> -0 +dvix592 divideint 0 Inf -> 0 +dvix593 divideint 1 Inf -> 0 +dvix594 divideint 1000 Inf -> 0 +dvix595 divideint Inf Inf -> NaN Invalid_operation + +dvix600 divideint -Inf -Inf -> NaN Invalid_operation +dvix601 divideint -Inf -1000 -> Infinity +dvix602 divideint -Inf -1 -> Infinity +dvix603 divideint -Inf -0 -> Infinity +dvix604 divideint -Inf 0 -> -Infinity +dvix605 divideint -Inf 1 -> -Infinity +dvix606 divideint -Inf 1000 -> -Infinity +dvix607 divideint -Inf Inf -> NaN Invalid_operation +dvix608 divideint -1000 Inf -> -0 +dvix609 divideint -Inf -Inf -> NaN Invalid_operation +dvix610 divideint -1 -Inf -> 0 +dvix611 divideint -0 -Inf -> 0 +dvix612 divideint 0 -Inf -> -0 +dvix613 divideint 1 -Inf -> -0 +dvix614 divideint 1000 -Inf -> -0 +dvix615 divideint Inf -Inf -> NaN Invalid_operation + +dvix621 divideint NaN -Inf -> NaN +dvix622 divideint NaN -1000 -> NaN +dvix623 divideint NaN -1 -> NaN +dvix624 divideint NaN -0 -> NaN +dvix625 divideint NaN 0 -> NaN +dvix626 divideint NaN 1 -> NaN +dvix627 divideint NaN 1000 -> NaN +dvix628 divideint NaN Inf -> NaN +dvix629 divideint NaN NaN -> NaN +dvix630 divideint -Inf NaN -> NaN +dvix631 divideint -1000 NaN -> NaN +dvix632 divideint -1 NaN -> NaN +dvix633 divideint -0 NaN -> NaN +dvix634 divideint 0 NaN -> NaN +dvix635 divideint 1 NaN -> NaN +dvix636 divideint 1000 NaN -> NaN +dvix637 divideint Inf NaN -> NaN + +dvix641 divideint sNaN -Inf -> NaN Invalid_operation +dvix642 divideint sNaN -1000 -> NaN Invalid_operation +dvix643 divideint sNaN -1 -> NaN Invalid_operation +dvix644 divideint sNaN -0 -> NaN Invalid_operation +dvix645 divideint sNaN 0 -> NaN Invalid_operation +dvix646 divideint sNaN 1 -> NaN Invalid_operation +dvix647 divideint sNaN 1000 -> NaN Invalid_operation +dvix648 divideint sNaN NaN -> NaN Invalid_operation +dvix649 divideint sNaN sNaN -> NaN Invalid_operation +dvix650 divideint NaN sNaN -> NaN Invalid_operation +dvix651 divideint -Inf sNaN -> NaN Invalid_operation +dvix652 divideint -1000 sNaN -> NaN Invalid_operation +dvix653 divideint -1 sNaN -> NaN Invalid_operation +dvix654 divideint -0 sNaN -> NaN Invalid_operation +dvix655 divideint 0 sNaN -> NaN Invalid_operation +dvix656 divideint 1 sNaN -> NaN Invalid_operation +dvix657 divideint 1000 sNaN -> NaN Invalid_operation +dvix658 divideint Inf sNaN -> NaN Invalid_operation +dvix659 divideint NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +dvix661 divideint NaN9 -Inf -> NaN9 +dvix662 divideint NaN8 1000 -> NaN8 +dvix663 divideint NaN7 Inf -> NaN7 +dvix664 divideint -NaN6 NaN5 -> -NaN6 +dvix665 divideint -Inf NaN4 -> NaN4 +dvix666 divideint -1000 NaN3 -> NaN3 +dvix667 divideint Inf -NaN2 -> -NaN2 + +dvix671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation +dvix672 divideint sNaN98 -1 -> NaN98 Invalid_operation +dvix673 divideint sNaN97 NaN -> NaN97 Invalid_operation +dvix674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation +dvix675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation +dvix676 divideint -Inf sNaN92 -> NaN92 Invalid_operation +dvix677 divideint 0 sNaN91 -> NaN91 Invalid_operation +dvix678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation +dvix679 divideint NaN sNaN89 -> NaN89 Invalid_operation + +-- some long operand cases again +precision: 8 +dvix710 divideint 100000001 1 -> NaN Division_impossible +dvix711 divideint 100000000.4 1 -> NaN Division_impossible +dvix712 divideint 100000000.5 1 -> NaN Division_impossible +dvix713 divideint 100000000.9 1 -> NaN Division_impossible +dvix714 divideint 100000000.999 1 -> NaN Division_impossible +precision: 6 +dvix720 divideint 100000000 1 -> NaN Division_impossible +dvix721 divideint 10000000 1 -> NaN Division_impossible +dvix722 divideint 1000000 1 -> NaN Division_impossible +dvix723 divideint 100000 1 -> 100000 +dvix724 divideint 10000 1 -> 10000 +dvix725 divideint 1000 1 -> 1000 +dvix726 divideint 100 1 -> 100 +dvix727 divideint 10 1 -> 10 +dvix728 divideint 1 1 -> 1 +dvix729 divideint 1 10 -> 0 + +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +dvix732 divideint 1 0.99e999999999 -> 0 +dvix733 divideint 1 0.999999999e999999999 -> 0 +dvix734 divideint 9e999999999 1 -> NaN Division_impossible +dvix735 divideint 9.9e999999999 1 -> NaN Division_impossible +dvix736 divideint 9.99e999999999 1 -> NaN Division_impossible +dvix737 divideint 9.99999999e999999999 1 -> NaN Division_impossible + +dvix740 divideint 0.1 9e-999999999 -> NaN Division_impossible +dvix741 divideint 0.1 99e-999999999 -> NaN Division_impossible +dvix742 divideint 0.1 999e-999999999 -> NaN Division_impossible + +dvix743 divideint 0.1 9e-999999998 -> NaN Division_impossible +dvix744 divideint 0.1 99e-999999998 -> NaN Division_impossible +dvix745 divideint 0.1 999e-999999998 -> NaN Division_impossible +dvix746 divideint 0.1 999e-999999997 -> NaN Division_impossible +dvix747 divideint 0.1 9999e-999999997 -> NaN Division_impossible +dvix748 divideint 0.1 99999e-999999997 -> NaN Division_impossible + + +-- Null tests +dvix900 divideint 10 # -> NaN Invalid_operation +dvix901 divideint # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal-c/new_dt/exp.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/exp.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,670 @@ +------------------------------------------------------------------------ +-- exp.decTest -- decimal natural exponentiation -- +-- Copyright (c) IBM Corporation, 2005. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- Tests of the exponential funtion. Currently all testcases here +-- show results which are correctly rounded (within <= 0.5 ulp). + +extended: 1 +precision: 9 +rounding: half_even +maxExponent: 384 +minexponent: -383 + +-- basics (examples in specificiation, etc.) +expx001 exp -Infinity -> 0 +expx002 exp -10 -> 0.0000453999298 Inexact Rounded +expx003 exp -1 -> 0.367879441 Inexact Rounded +expx004 exp 0 -> 1 +expx005 exp -0 -> 1 +expx006 exp 1 -> 2.71828183 Inexact Rounded +expx007 exp 0.693147181 -> 2.00000000 Inexact Rounded +expx008 exp 10 -> 22026.4658 Inexact Rounded +expx009 exp +Infinity -> Infinity + +-- tiny edge cases +precision: 7 +expx011 exp 0.1 -> 1.105171 Inexact Rounded +expx012 exp 0.01 -> 1.010050 Inexact Rounded +expx013 exp 0.001 -> 1.001001 Inexact Rounded +expx014 exp 0.0001 -> 1.000100 Inexact Rounded +expx015 exp 0.00001 -> 1.000010 Inexact Rounded +expx016 exp 0.000001 -> 1.000001 Inexact Rounded +expx017 exp 0.0000001 -> 1.000000 Inexact Rounded +expx018 exp 0.0000003 -> 1.000000 Inexact Rounded +expx019 exp 0.0000004 -> 1.000000 Inexact Rounded +expx020 exp 0.0000005 -> 1.000001 Inexact Rounded +expx021 exp 0.0000008 -> 1.000001 Inexact Rounded +expx022 exp 0.0000009 -> 1.000001 Inexact Rounded +expx023 exp 0.0000010 -> 1.000001 Inexact Rounded +expx024 exp 0.0000011 -> 1.000001 Inexact Rounded +expx025 exp 0.00000009 -> 1.000000 Inexact Rounded +expx026 exp 0.00000005 -> 1.000000 Inexact Rounded +expx027 exp 0.00000004 -> 1.000000 Inexact Rounded +expx028 exp 0.00000001 -> 1.000000 Inexact Rounded + +-- and some more zeros +expx030 exp 0.00000000 -> 1 +expx031 exp 0E+100 -> 1 +expx032 exp 0E-100 -> 1 +expx033 exp -0.00000000 -> 1 +expx034 exp -0E+100 -> 1 +expx035 exp -0E-100 -> 1 + +-- basic e=0, e=1, e=2, e=4, e>=8 cases +precision: 7 +expx041 exp 1 -> 2.718282 Inexact Rounded +expx042 exp -1 -> 0.3678794 Inexact Rounded +expx043 exp 10 -> 22026.47 Inexact Rounded +expx044 exp -10 -> 0.00004539993 Inexact Rounded +expx045 exp 100 -> 2.688117E+43 Inexact Rounded +expx046 exp -100 -> 3.720076E-44 Inexact Rounded +expx047 exp 1000 -> Infinity Overflow Inexact Rounded +expx048 exp -1000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx049 exp 100000000 -> Infinity Overflow Inexact Rounded +expx050 exp -100000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal + +-- miscellanea +-- similar to 'VF bug' test, at 17, but with last digit corrected for decimal +precision: 16 +expx055 exp -5.42410311287441459172E+2 -> 2.717658486884572E-236 Inexact Rounded +-- result from NetRexx/Java prototype -> 2.7176584868845721117677929628617246054459644711108E-236 +-- result from Rexx (series) version -> 2.717658486884572111767792962861724605446E-236 +precision: 17 +expx056 exp -5.42410311287441459172E+2 -> 2.7176584868845721E-236 Inexact Rounded +precision: 18 +expx057 exp -5.42410311287441459172E+2 -> 2.71765848688457211E-236 Inexact Rounded +precision: 19 +expx058 exp -5.42410311287441459172E+2 -> 2.717658486884572112E-236 Inexact Rounded +precision: 20 +expx059 exp -5.42410311287441459172E+2 -> 2.7176584868845721118E-236 Inexact Rounded + +-- rounding in areas of ..500.., ..499.., ..100.., ..999.. sequences +precision: 50 +expx101 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded +precision: 31 +expx102 exp -9E-8 -> 0.9999999100000040499998785000027 Inexact Rounded +precision: 30 +expx103 exp -9E-8 -> 0.999999910000004049999878500003 Inexact Rounded +precision: 29 +expx104 exp -9E-8 -> 0.99999991000000404999987850000 Inexact Rounded +precision: 28 +expx105 exp -9E-8 -> 0.9999999100000040499998785000 Inexact Rounded +precision: 27 +expx106 exp -9E-8 -> 0.999999910000004049999878500 Inexact Rounded +precision: 26 +expx107 exp -9E-8 -> 0.99999991000000404999987850 Inexact Rounded +precision: 25 +expx108 exp -9E-8 -> 0.9999999100000040499998785 Inexact Rounded +precision: 24 +expx109 exp -9E-8 -> 0.999999910000004049999879 Inexact Rounded +precision: 23 +expx110 exp -9E-8 -> 0.99999991000000404999988 Inexact Rounded +precision: 22 +expx111 exp -9E-8 -> 0.9999999100000040499999 Inexact Rounded +precision: 21 +expx112 exp -9E-8 -> 0.999999910000004050000 Inexact Rounded +precision: 20 +expx113 exp -9E-8 -> 0.99999991000000405000 Inexact Rounded +precision: 19 +expx114 exp -9E-8 -> 0.9999999100000040500 Inexact Rounded +precision: 18 +expx115 exp -9E-8 -> 0.999999910000004050 Inexact Rounded +precision: 17 +expx116 exp -9E-8 -> 0.99999991000000405 Inexact Rounded +precision: 16 +expx117 exp -9E-8 -> 0.9999999100000040 Inexact Rounded +precision: 15 +expx118 exp -9E-8 -> 0.999999910000004 Inexact Rounded +precision: 14 +expx119 exp -9E-8 -> 0.99999991000000 Inexact Rounded +precision: 13 +expx120 exp -9E-8 -> 0.9999999100000 Inexact Rounded +precision: 12 +expx121 exp -9E-8 -> 0.999999910000 Inexact Rounded +precision: 11 +expx122 exp -9E-8 -> 0.99999991000 Inexact Rounded +precision: 10 +expx123 exp -9E-8 -> 0.9999999100 Inexact Rounded +precision: 9 +expx124 exp -9E-8 -> 0.999999910 Inexact Rounded +precision: 8 +expx125 exp -9E-8 -> 0.99999991 Inexact Rounded +precision: 7 +expx126 exp -9E-8 -> 0.9999999 Inexact Rounded +precision: 6 +expx127 exp -9E-8 -> 1.00000 Inexact Rounded +precision: 5 +expx128 exp -9E-8 -> 1.0000 Inexact Rounded +precision: 4 +expx129 exp -9E-8 -> 1.000 Inexact Rounded +precision: 3 +expx130 exp -9E-8 -> 1.00 Inexact Rounded +precision: 2 +expx131 exp -9E-8 -> 1.0 Inexact Rounded +precision: 1 +expx132 exp -9E-8 -> 1 Inexact Rounded + + +-- sanity checks, with iteration counts [normalized so 0<=|x|<1] +precision: 50 + +expx210 exp 0 -> 1 +-- iterations: 2 +expx211 exp -1E-40 -> 0.99999999999999999999999999999999999999990000000000 Inexact Rounded +-- iterations: 8 +expx212 exp -9E-7 -> 0.99999910000040499987850002733749507925073811240510 Inexact Rounded +-- iterations: 6 +expx213 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded +-- iterations: 15 +expx214 exp -0.003 -> 0.99700449550337297601206623409756091074177480489845 Inexact Rounded +-- iterations: 14 +expx215 exp -0.001 -> 0.99900049983337499166805535716765597470235590236008 Inexact Rounded +-- iterations: 26 +expx216 exp -0.1 -> 0.90483741803595957316424905944643662119470536098040 Inexact Rounded +-- iterations: 39 +expx217 exp -0.7 -> 0.49658530379140951470480009339752896170766716571182 Inexact Rounded +-- iterations: 41 +expx218 exp -0.9 -> 0.40656965974059911188345423964562598783370337617038 Inexact Rounded +-- iterations: 43 +expx219 exp -0.99 -> 0.37157669102204569053152411990820138691802885490501 Inexact Rounded +-- iterations: 26 +expx220 exp -1 -> 0.36787944117144232159552377016146086744581113103177 Inexact Rounded +-- iterations: 26 +expx221 exp -1.01 -> 0.36421897957152331975704629563734548959589139192482 Inexact Rounded +-- iterations: 27 +expx222 exp -1.1 -> 0.33287108369807955328884690643131552161247952156921 Inexact Rounded +-- iterations: 28 +expx223 exp -1.5 -> 0.22313016014842982893328047076401252134217162936108 Inexact Rounded +-- iterations: 30 +expx224 exp -2 -> 0.13533528323661269189399949497248440340763154590958 Inexact Rounded +-- iterations: 36 +expx225 exp -5 -> 0.0067379469990854670966360484231484242488495850273551 Inexact Rounded +-- iterations: 26 +expx226 exp -10 -> 0.000045399929762484851535591515560550610237918088866565 Inexact Rounded +-- iterations: 28 +expx227 exp -14 -> 8.3152871910356788406398514256526229460765836498457E-7 Inexact Rounded +-- iterations: 29 +expx228 exp -15 -> 3.0590232050182578837147949770228963937082078081856E-7 Inexact Rounded +-- iterations: 30 +expx233 exp 0 -> 1 +-- iterations: 2 +expx234 exp 1E-40 -> 1.0000000000000000000000000000000000000001000000000 Inexact Rounded +-- iterations: 7 +expx235 exp 9E-7 -> 1.0000009000004050001215000273375049207507381125949 Inexact Rounded +-- iterations: 6 +expx236 exp 9E-8 -> 1.0000000900000040500001215000027337500492075007381 Inexact Rounded +-- iterations: 15 +expx237 exp 0.003 -> 1.0030045045033770260129340913489002053318727195619 Inexact Rounded +-- iterations: 13 +expx238 exp 0.001 -> 1.0010005001667083416680557539930583115630762005807 Inexact Rounded +-- iterations: 25 +expx239 exp 0.1 -> 1.1051709180756476248117078264902466682245471947375 Inexact Rounded +-- iterations: 38 +expx240 exp 0.7 -> 2.0137527074704765216245493885830652700175423941459 Inexact Rounded +-- iterations: 41 +expx241 exp 0.9 -> 2.4596031111569496638001265636024706954217723064401 Inexact Rounded +-- iterations: 42 +expx242 exp 0.99 -> 2.6912344723492622890998794040710139721802931841030 Inexact Rounded +-- iterations: 26 +expx243 exp 1 -> 2.7182818284590452353602874713526624977572470937000 Inexact Rounded +-- iterations: 26 +expx244 exp 1.01 -> 2.7456010150169164939897763166603876240737508195960 Inexact Rounded +-- iterations: 26 +expx245 exp 1.1 -> 3.0041660239464331120584079535886723932826810260163 Inexact Rounded +-- iterations: 28 +expx246 exp 1.5 -> 4.4816890703380648226020554601192758190057498683697 Inexact Rounded +-- iterations: 29 +expx247 exp 2 -> 7.3890560989306502272304274605750078131803155705518 Inexact Rounded +-- iterations: 36 +expx248 exp 5 -> 148.41315910257660342111558004055227962348766759388 Inexact Rounded +-- iterations: 26 +expx249 exp 10 -> 22026.465794806716516957900645284244366353512618557 Inexact Rounded +-- iterations: 28 +expx250 exp 14 -> 1202604.2841647767777492367707678594494124865433761 Inexact Rounded +-- iterations: 28 +expx251 exp 15 -> 3269017.3724721106393018550460917213155057385438200 Inexact Rounded +-- iterations: 29 + +-- a biggie [result verified 3 ways] +precision: 250 +expx260 exp 1 -> 2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003059921817413596629043572900334295260595630738132328627943490763233829880753195251019011573834187930702154089149934884167509244761460668 Inexact Rounded + +-- extreme range boundaries +precision: 16 +maxExponent: 999999 +minExponent: -999999 +-- Ntiny boundary +expx290 exp -2302618.022332529 -> 0E-1000014 Underflow Subnormal Inexact Rounded Clamped +expx291 exp -2302618.022332528 -> 1E-1000014 Underflow Subnormal Inexact Rounded +-- Nmax/10 and Nmax boundary +expx292 exp 2302582.790408952 -> 9.999999993100277E+999998 Inexact Rounded +expx293 exp 2302582.790408953 -> 1.000000000310028E+999999 Inexact Rounded +expx294 exp 2302585.092993946 -> 9.999999003159870E+999999 Inexact Rounded +expx295 exp 2302585.092994036 -> 9.999999903159821E+999999 Inexact Rounded +expx296 exp 2302585.092994045 -> 9.999999993159820E+999999 Inexact Rounded +expx297 exp 2302585.092994046 -> Infinity Overflow Inexact Rounded + +-- 0<-x<<1 effects +precision: 30 +expx320 exp -4.9999999999999E-8 -> 0.999999950000001250000979166617 Inexact Rounded +expx321 exp -5.0000000000000E-8 -> 0.999999950000001249999979166667 Inexact Rounded +expx322 exp -5.0000000000001E-8 -> 0.999999950000001249998979166717 Inexact Rounded +precision: 20 +expx323 exp -4.9999999999999E-8 -> 0.99999995000000125000 Inexact Rounded +expx324 exp -5.0000000000000E-8 -> 0.99999995000000125000 Inexact Rounded +expx325 exp -5.0000000000001E-8 -> 0.99999995000000125000 Inexact Rounded +precision: 14 +expx326 exp -4.9999999999999E-8 -> 0.99999995000000 Inexact Rounded +expx327 exp -5.0000000000000E-8 -> 0.99999995000000 Inexact Rounded +expx328 exp -5.0000000000001E-8 -> 0.99999995000000 Inexact Rounded +-- overprecise and 0<-x<<1 +precision: 8 +expx330 exp -4.9999999999999E-8 -> 0.99999995 Inexact Rounded +expx331 exp -5.0000000000000E-8 -> 0.99999995 Inexact Rounded +expx332 exp -5.0000000000001E-8 -> 0.99999995 Inexact Rounded +precision: 7 +expx333 exp -4.9999999999999E-8 -> 1.000000 Inexact Rounded +expx334 exp -5.0000000000000E-8 -> 1.000000 Inexact Rounded +expx335 exp -5.0000000000001E-8 -> 1.000000 Inexact Rounded +precision: 3 +expx336 exp -4.9999999999999E-8 -> 1.00 Inexact Rounded +expx337 exp -5.0000000000000E-8 -> 1.00 Inexact Rounded +expx338 exp -5.0000000000001E-8 -> 1.00 Inexact Rounded + +-- 0 1.00000005000000124999902083328 Inexact Rounded +expx341 exp 5.0000000000000E-8 -> 1.00000005000000125000002083333 Inexact Rounded +expx342 exp 5.0000000000001E-8 -> 1.00000005000000125000102083338 Inexact Rounded +precision: 20 +expx343 exp 4.9999999999999E-8 -> 1.0000000500000012500 Inexact Rounded +expx344 exp 5.0000000000000E-8 -> 1.0000000500000012500 Inexact Rounded +expx345 exp 5.0000000000001E-8 -> 1.0000000500000012500 Inexact Rounded +precision: 14 +expx346 exp 4.9999999999999E-8 -> 1.0000000500000 Inexact Rounded +expx347 exp 5.0000000000000E-8 -> 1.0000000500000 Inexact Rounded +expx348 exp 5.0000000000001E-8 -> 1.0000000500000 Inexact Rounded +-- overprecise and 0 1.0000001 Inexact Rounded +expx351 exp 5.0000000000000E-8 -> 1.0000001 Inexact Rounded +expx352 exp 5.0000000000001E-8 -> 1.0000001 Inexact Rounded +precision: 7 +expx353 exp 4.9999999999999E-8 -> 1.000000 Inexact Rounded +expx354 exp 5.0000000000000E-8 -> 1.000000 Inexact Rounded +expx355 exp 5.0000000000001E-8 -> 1.000000 Inexact Rounded +precision: 3 +expx356 exp 4.9999999999999E-8 -> 1.00 Inexact Rounded +expx357 exp 5.0000000000000E-8 -> 1.00 Inexact Rounded +expx358 exp 5.0000000000001E-8 -> 1.00 Inexact Rounded + +-- cases near 1 -- 1 2345678901234567890 +precision: 20 +expx401 exp 0.99999999999996 -> 2.7182818284589365041 Inexact Rounded +expx402 exp 0.99999999999997 -> 2.7182818284589636869 Inexact Rounded +expx403 exp 0.99999999999998 -> 2.7182818284589908697 Inexact Rounded +expx404 exp 0.99999999999999 -> 2.7182818284590180525 Inexact Rounded +expx405 exp 1.0000000000000 -> 2.7182818284590452354 Inexact Rounded +expx406 exp 1.0000000000001 -> 2.7182818284593170635 Inexact Rounded +expx407 exp 1.0000000000002 -> 2.7182818284595888917 Inexact Rounded +precision: 14 +expx411 exp 0.99999999999996 -> 2.7182818284589 Inexact Rounded +expx412 exp 0.99999999999997 -> 2.7182818284590 Inexact Rounded +expx413 exp 0.99999999999998 -> 2.7182818284590 Inexact Rounded +expx414 exp 0.99999999999999 -> 2.7182818284590 Inexact Rounded +expx415 exp 1.0000000000000 -> 2.7182818284590 Inexact Rounded +expx416 exp 1.0000000000001 -> 2.7182818284593 Inexact Rounded +expx417 exp 1.0000000000002 -> 2.7182818284596 Inexact Rounded +-- overprecise... +precision: 7 +expx421 exp 0.99999999999996 -> 2.718282 Inexact Rounded +expx422 exp 0.99999999999997 -> 2.718282 Inexact Rounded +expx423 exp 0.99999999999998 -> 2.718282 Inexact Rounded +expx424 exp 0.99999999999999 -> 2.718282 Inexact Rounded +expx425 exp 1.0000000000001 -> 2.718282 Inexact Rounded +expx426 exp 1.0000000000002 -> 2.718282 Inexact Rounded +expx427 exp 1.0000000000003 -> 2.718282 Inexact Rounded +precision: 2 +expx431 exp 0.99999999999996 -> 2.7 Inexact Rounded +expx432 exp 0.99999999999997 -> 2.7 Inexact Rounded +expx433 exp 0.99999999999998 -> 2.7 Inexact Rounded +expx434 exp 0.99999999999999 -> 2.7 Inexact Rounded +expx435 exp 1.0000000000001 -> 2.7 Inexact Rounded +expx436 exp 1.0000000000002 -> 2.7 Inexact Rounded +expx437 exp 1.0000000000003 -> 2.7 Inexact Rounded + +-- basics at low precisions +precision: 3 +expx501 exp -Infinity -> 0 +expx502 exp -10 -> 0.0000454 Inexact Rounded +expx503 exp -1 -> 0.368 Inexact Rounded +expx504 exp 0 -> 1 +expx505 exp -0 -> 1 +expx506 exp 1 -> 2.72 Inexact Rounded +expx507 exp 0.693147181 -> 2.00 Inexact Rounded +expx508 exp 10 -> 2.20E+4 Inexact Rounded +expx509 exp +Infinity -> Infinity +precision: 2 +expx511 exp -Infinity -> 0 +expx512 exp -10 -> 0.000045 Inexact Rounded +expx513 exp -1 -> 0.37 Inexact Rounded +expx514 exp 0 -> 1 +expx515 exp -0 -> 1 +expx516 exp 1 -> 2.7 Inexact Rounded +expx517 exp 0.693147181 -> 2.0 Inexact Rounded +expx518 exp 10 -> 2.2E+4 Inexact Rounded +expx519 exp +Infinity -> Infinity +precision: 1 +expx521 exp -Infinity -> 0 +expx522 exp -10 -> 0.00005 Inexact Rounded +expx523 exp -1 -> 0.4 Inexact Rounded +expx524 exp 0 -> 1 +expx525 exp -0 -> 1 +expx526 exp 1 -> 3 Inexact Rounded +expx527 exp 0.693147181 -> 2 Inexact Rounded +expx528 exp 10 -> 2E+4 Inexact Rounded +expx529 exp +Infinity -> Infinity + +-- overflows, including some overprecise borderlines +precision: 7 +maxExponent: 384 +minExponent: -383 +expx701 exp 1000000000 -> Infinity Overflow Inexact Rounded +expx702 exp 100000000 -> Infinity Overflow Inexact Rounded +expx703 exp 10000000 -> Infinity Overflow Inexact Rounded +expx704 exp 1000000 -> Infinity Overflow Inexact Rounded +expx705 exp 100000 -> Infinity Overflow Inexact Rounded +expx706 exp 10000 -> Infinity Overflow Inexact Rounded +expx707 exp 1000 -> Infinity Overflow Inexact Rounded +expx708 exp 886.4952608 -> Infinity Overflow Inexact Rounded +expx709 exp 886.4952607 -> 9.999999E+384 Inexact Rounded +expx710 exp 886.49527 -> Infinity Overflow Inexact Rounded +expx711 exp 886.49526 -> 9.999992E+384 Inexact Rounded +precision: 16 +expx721 exp 886.4952608027075883 -> Infinity Overflow Inexact Rounded +expx722 exp 886.4952608027075882 -> 9.999999999999999E+384 Inexact Rounded +expx723 exp 886.49526080270759 -> Infinity Overflow Inexact Rounded +expx724 exp 886.49526080270758 -> 9.999999999999917E+384 Inexact Rounded +expx725 exp 886.4952608027076 -> Infinity Overflow Inexact Rounded +expx726 exp 886.4952608027075 -> 9.999999999999117E+384 Inexact Rounded +-- and by special request ... +precision: 15 +expx731 exp 886.495260802708 -> Infinity Overflow Inexact Rounded +expx732 exp 886.495260802707 -> 9.99999999999412E+384 Inexact Rounded +expx733 exp 886.495260802706 -> 9.99999999998412E+384 Inexact Rounded +maxExponent: 999 +minExponent: -999 +expx735 exp 2302.58509299405 -> Infinity Overflow Inexact Rounded +expx736 exp 2302.58509299404 -> 9.99999999994316E+999 Inexact Rounded +expx737 exp 2302.58509299403 -> 9.99999999984316E+999 Inexact Rounded + +-- subnormals and underflows, including underflow-to-zero edge point +precision: 7 +maxExponent: 384 +minExponent: -383 +expx751 exp -1000000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx752 exp -100000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx753 exp -10000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx754 exp -1000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx755 exp -100000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx756 exp -10000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx757 exp -1000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal +expx758 exp -881.89009 -> 1.000001E-383 Inexact Rounded +expx759 exp -881.8901 -> 9.99991E-384 Inexact Rounded Underflow Subnormal +expx760 exp -885 -> 4.4605E-385 Inexact Rounded Underflow Subnormal +expx761 exp -888 -> 2.221E-386 Inexact Rounded Underflow Subnormal +expx762 exp -890 -> 3.01E-387 Inexact Rounded Underflow Subnormal +expx763 exp -892.9 -> 1.7E-388 Inexact Rounded Underflow Subnormal +expx764 exp -893 -> 1.5E-388 Inexact Rounded Underflow Subnormal +expx765 exp -893.5 -> 9E-389 Inexact Rounded Underflow Subnormal +expx766 exp -895.7056 -> 1E-389 Inexact Rounded Underflow Subnormal +expx769 exp -895.8 -> 1E-389 Inexact Rounded Underflow Subnormal +expx770 exp -895.73 -> 1E-389 Inexact Rounded Underflow Subnormal +expx771 exp -896.3987 -> 1E-389 Inexact Rounded Underflow Subnormal +expx772 exp -896.3988 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped +expx773 exp -898.0081 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped +expx774 exp -898.0082 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped + +-- special values +maxexponent: 999 +minexponent: -999 +expx820 exp Inf -> Infinity +expx821 exp -Inf -> 0 +expx822 exp NaN -> NaN +expx823 exp sNaN -> NaN Invalid_operation +-- propagating NaNs +expx824 exp sNaN123 -> NaN123 Invalid_operation +expx825 exp -sNaN321 -> -NaN321 Invalid_operation +expx826 exp NaN456 -> NaN456 +expx827 exp -NaN654 -> -NaN654 +expx828 exp NaN1 -> NaN1 + +-- Invalid operations due to restrictions +-- [next two probably skipped by most test harnesses] +precision: 100000000 +expx901 exp -Infinity -> NaN Invalid_context +precision: 99999999 +expx902 exp -Infinity -> NaN Invalid_context + +precision: 9 +maxExponent: 1000000 +minExponent: -999999 +expx903 exp -Infinity -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999999 +expx904 exp -Infinity -> 0 +maxExponent: 999999 +minExponent: -1000000 +expx905 exp -Infinity -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999998 +expx906 exp -Infinity -> 0 + +-- +maxExponent: 384 +minExponent: -383 +precision: 16 +rounding: half_even + +-- Null test +expx900 exp # -> NaN Invalid_operation + + +-- Randoms P=50, within 0-999 +Precision: 50 +maxExponent: 384 +minExponent: -383 +expx1501 exp 656.35397950590285612266095596539934213943872885728 -> 1.1243757610640319783611178528839652672062820040314E+285 Inexact Rounded +expx1502 exp 0.93620571093652800225038550600780322831236082781471 -> 2.5502865130986176689199711857825771311178046842009 Inexact Rounded +expx1503 exp 0.00000000000000008340785856601514714183373874105791 -> 1.0000000000000000834078585660151506202691740252512 Inexact Rounded +expx1504 exp 0.00009174057262887789625745574686545163168788456203 -> 1.0000917447809239005146722341251524081006051473273 Inexact Rounded +expx1505 exp 33.909116897973797735657751591014926629051117541243 -> 532773181025002.03543618901306726495870476617232229 Inexact Rounded +expx1506 exp 0.00000740470413004406592124575295278456936809587311 -> 1.0000074047315449333590066395670306135567889210814 Inexact Rounded +expx1507 exp 0.00000000000124854922222108802453746922483071445492 -> 1.0000000000012485492222218674621176239911424968263 Inexact Rounded +expx1508 exp 4.1793280674155659794286951159430651258356014391382 -> 65.321946520147199404199787811336860087975118278185 Inexact Rounded +expx1509 exp 485.43595745460655893746179890255529919221550201686 -> 6.6398403920459617255950476953129377459845366585463E+210 Inexact Rounded +expx1510 exp 0.00000000003547259806590856032527875157830328156597 -> 1.0000000000354725980665377129320589406715000685515 Inexact Rounded +expx1511 exp 0.00000000000000759621497339104047930616478635042678 -> 1.0000000000000075962149733910693305471257715463887 Inexact Rounded +expx1512 exp 9.7959168821760339304571595474480640286072720233796 -> 17960.261146042955179164303653412650751681436352437 Inexact Rounded +expx1513 exp 0.00000000566642006258290526783901451194943164535581 -> 1.0000000056664200786370634609832438815665249347650 Inexact Rounded +expx1514 exp 741.29888791134298194088827572374718940925820027354 -> 8.7501694006317332808128946666402622432064923198731E+321 Inexact Rounded +expx1515 exp 032.75573003552517668808529099897153710887014947935 -> 168125196578678.17725841108617955904425345631092339 Inexact Rounded +expx1516 exp 42.333700726429333308594265553422902463737399437644 -> 2428245675864172475.4681119493045657797309369672012 Inexact Rounded +expx1517 exp 0.00000000000000559682616876491888197609158802835798 -> 1.0000000000000055968261687649345442076732739577049 Inexact Rounded +expx1518 exp 0.00000000000080703688668280193584758300973549486312 -> 1.0000000000008070368866831275901158164321867914342 Inexact Rounded +expx1519 exp 640.72396012796509482382712891709072570653606838251 -> 1.8318094990683394229304133068983914236995326891045E+278 Inexact Rounded +expx1520 exp 0.00000000000000509458922167631071416948112219512224 -> 1.0000000000000050945892216763236915891499324358556 Inexact Rounded +expx1521 exp 6.7670394314315206378625221583973414660727960241395 -> 868.73613012822031367806248697092884415119568271315 Inexact Rounded +expx1522 exp 04.823217407412963506638267226891024138054783122548 -> 124.36457929588837129731821077586705505565904205366 Inexact Rounded +expx1523 exp 193.51307878701196403991208482520115359690106143615 -> 1.1006830872854715677390914655452261550768957576034E+84 Inexact Rounded +expx1524 exp 5.7307749038303650539200345901210497015617393970463 -> 308.20800743106843083522721523715645950574866495196 Inexact Rounded +expx1525 exp 0.00000000000095217825199797965200541169123743500267 -> 1.0000000000009521782519984329737172007991390381273 Inexact Rounded +expx1526 exp 0.00027131440949183370966393682617930153495028919140 -> 1.0002713512185751022906058160480606598754913607364 Inexact Rounded +expx1527 exp 0.00000000064503059114680682343002315662069272707123 -> 1.0000000006450305913548390552323517403613135496633 Inexact Rounded +expx1528 exp 0.00000000000000095616643506527288866235238548440593 -> 1.0000000000000009561664350652733457894781582009094 Inexact Rounded +expx1529 exp 0.00000000000000086449942811678650244459550252743433 -> 1.0000000000000008644994281167868761242261096529986 Inexact Rounded +expx1530 exp 0.06223488355635359965683053157729204988381887621850 -> 1.0642122813392406657789688931838919323826250630831 Inexact Rounded +expx1531 exp 0.00000400710807804429435502657131912308680674057053 -> 1.0000040071161065125925620890019319832127863559260 Inexact Rounded +expx1532 exp 85.522796894744576211573232055494551429297878413017 -> 13870073686404228452757799770251085177.853337368935 Inexact Rounded +expx1533 exp 9.1496720811363678696938036379756663548353399954363 -> 9411.3537122832743386783597629161763057370034495157 Inexact Rounded +expx1534 exp 8.2215705240788294472944382056330516738577785177942 -> 3720.3406813383076953899654701615084425598377758189 Inexact Rounded +expx1535 exp 0.00000000015772064569640613142823203726821076239561 -> 1.0000000001577206457088440324683315788358926129830 Inexact Rounded +expx1536 exp 0.58179346473959531432624153576883440625538017532480 -> 1.7892445018275360163797022372655837188423194863605 Inexact Rounded +expx1537 exp 33.555726197149525061455517784870570470833498096559 -> 374168069896324.62578073148993526626307095854407952 Inexact Rounded +expx1538 exp 9.7898079803906215094140010009583375537259810398659 -> 17850.878119912208888217100998019986634620368538426 Inexact Rounded +expx1539 exp 89.157697327174521542502447953032536541038636966347 -> 525649152320166503771224149330448089550.67293829227 Inexact Rounded +expx1540 exp 25.022947600123328912029051897171319573322888514885 -> 73676343442.952517824345431437683153304645851960524 Inexact Rounded + +-- Randoms P=34, within 0-999 +Precision: 34 +maxExponent: 6144 +minExponent: -6143 +expx1201 exp 309.5948855821510212996700645087188 -> 2.853319692901387521201738015050724E+134 Inexact Rounded +expx1202 exp 9.936543068706211420422803962680164 -> 20672.15839203171877476511093276022 Inexact Rounded +expx1203 exp 6.307870323881505684429839491707908 -> 548.8747777054637296137277391754665 Inexact Rounded +expx1204 exp 0.0003543281389438420535201308282503 -> 1.000354390920573746164733350843155 Inexact Rounded +expx1205 exp 0.0000037087453363918375598394920229 -> 1.000003708752213796324841920189323 Inexact Rounded +expx1206 exp 0.0020432312687512438040222444116585 -> 1.002045320088164826013561630975308 Inexact Rounded +expx1207 exp 6.856313340032177672550343216129586 -> 949.8587981604144147983589660524396 Inexact Rounded +expx1208 exp 0.0000000000402094928333815643326418 -> 1.000000000040209492834189965989612 Inexact Rounded +expx1209 exp 0.0049610784722412117632647003545839 -> 1.004973404997901987039589029277833 Inexact Rounded +expx1210 exp 0.0000891471883724066909746786702686 -> 1.000089151162101085412780088266699 Inexact Rounded +expx1211 exp 08.59979170376061890684723211112566 -> 5430.528314920905714615339273738097 Inexact Rounded +expx1212 exp 9.473117039341003854872778112752590 -> 13005.36234331224953460055897913917 Inexact Rounded +expx1213 exp 0.0999060724692207648429969999310118 -> 1.105067116975190602296052700726802 Inexact Rounded +expx1214 exp 0.0000000927804533555877884082269247 -> 1.000000092780457659694183954740772 Inexact Rounded +expx1215 exp 0.0376578583872889916298772818265677 -> 1.038375900489771946477857818447556 Inexact Rounded +expx1216 exp 261.6896411697539524911536116712307 -> 4.470613562127465095241600174941460E+113 Inexact Rounded +expx1217 exp 0.0709997423269162980875824213889626 -> 1.073580949235407949417814485533172 Inexact Rounded +expx1218 exp 0.0000000444605583295169895235658731 -> 1.000000044460559317887627657593900 Inexact Rounded +expx1219 exp 0.0000021224072854777512281369815185 -> 1.000002122409537785687390631070906 Inexact Rounded +expx1220 exp 547.5174462574156885473558485475052 -> 6.078629247383807942612114579728672E+237 Inexact Rounded +expx1221 exp 0.0000009067598041615192002339844670 -> 1.000000906760215268314680115374387 Inexact Rounded +expx1222 exp 0.0316476500308065365803455533244603 -> 1.032153761880187977658387961769034 Inexact Rounded +expx1223 exp 84.46160530377645101833996706384473 -> 4.799644995897968383503269871697856E+36 Inexact Rounded +expx1224 exp 0.0000000000520599740290848018904145 -> 1.000000000052059974030439922338393 Inexact Rounded +expx1225 exp 0.0000006748530640093620665651726708 -> 1.000000674853291722742292331812997 Inexact Rounded +expx1226 exp 0.0000000116853119761042020507916169 -> 1.000000011685312044377460306165203 Inexact Rounded +expx1227 exp 0.0022593818094258636727616886693280 -> 1.002261936135876893707094845543461 Inexact Rounded +expx1228 exp 0.0029398857673478912249856509667517 -> 1.002944211469495086813087651287012 Inexact Rounded +expx1229 exp 0.7511480029928802775376270557636963 -> 2.119431734510320169806976569366789 Inexact Rounded +expx1230 exp 174.9431952176750671150886423048447 -> 9.481222305374955011464619468044051E+75 Inexact Rounded +expx1231 exp 0.0000810612451694136129199895164424 -> 1.000081064530720924186615149646920 Inexact Rounded +expx1232 exp 51.06888989702669288180946272499035 -> 15098613888619165073959.89896018749 Inexact Rounded +expx1233 exp 0.0000000005992887599437093651494510 -> 1.000000000599288760123282874082758 Inexact Rounded +expx1234 exp 714.8549046761054856311108828903972 -> 2.867744544891081117381595080480784E+310 Inexact Rounded +expx1235 exp 0.0000000004468247802990643645607110 -> 1.000000000446824780398890556720233 Inexact Rounded +expx1236 exp 831.5818151589890366323551672043709 -> 1.417077409182624969435938062261655E+361 Inexact Rounded +expx1237 exp 0.0000000006868323825179605747108044 -> 1.000000000686832382753829935602454 Inexact Rounded +expx1238 exp 0.0000001306740266408976840228440255 -> 1.000000130674035178748675187648098 Inexact Rounded +expx1239 exp 0.3182210609022267704811502412335163 -> 1.374680115667798185758927247894859 Inexact Rounded +expx1240 exp 0.0147741234179104437440264644295501 -> 1.014883800239950682628277534839222 Inexact Rounded + +-- Randoms P=16, within 0-99 +Precision: 16 +maxExponent: 384 +minExponent: -383 +expx1101 exp 8.473011527013724 -> 4783.900643969246 Inexact Rounded +expx1102 exp 0.0000055753022764 -> 1.000005575317818 Inexact Rounded +expx1103 exp 0.0000323474114482 -> 1.000032347934631 Inexact Rounded +expx1104 exp 64.54374138544166 -> 1.073966476173531E+28 Inexact Rounded +expx1105 exp 90.47203246416569 -> 1.956610887250643E+39 Inexact Rounded +expx1106 exp 9.299931532342757 -> 10937.27033325227 Inexact Rounded +expx1107 exp 8.759678437852203 -> 6372.062234495381 Inexact Rounded +expx1108 exp 0.0000931755127172 -> 1.000093179853690 Inexact Rounded +expx1109 exp 0.0000028101158373 -> 1.000002810119786 Inexact Rounded +expx1110 exp 0.0000008008130919 -> 1.000000800813413 Inexact Rounded +expx1111 exp 8.339771722299049 -> 4187.133803081878 Inexact Rounded +expx1112 exp 0.0026140497995474 -> 1.002617469406750 Inexact Rounded +expx1113 exp 0.7478033356261771 -> 2.112354781975418 Inexact Rounded +expx1114 exp 51.77663761827966 -> 3.064135801120365E+22 Inexact Rounded +expx1115 exp 0.1524989783061012 -> 1.164741272084955 Inexact Rounded +expx1116 exp 0.0066298798669219 -> 1.006651906170791 Inexact Rounded +expx1117 exp 9.955141865534960 -> 21060.23334287038 Inexact Rounded +expx1118 exp 92.34503059198483 -> 1.273318993481226E+40 Inexact Rounded +expx1119 exp 0.0000709388677346 -> 1.000070941383956 Inexact Rounded +expx1120 exp 79.12883036433204 -> 2.318538899389243E+34 Inexact Rounded +expx1121 exp 0.0000090881548873 -> 1.000009088196185 Inexact Rounded +expx1122 exp 0.0424828809603411 -> 1.043398194245720 Inexact Rounded +expx1123 exp 0.8009035891427416 -> 2.227552811933310 Inexact Rounded +expx1124 exp 8.825786167283102 -> 6807.540455289995 Inexact Rounded +expx1125 exp 1.535457249746275 -> 4.643448260146849 Inexact Rounded +expx1126 exp 69.02254254355800 -> 9.464754500670653E+29 Inexact Rounded +expx1127 exp 0.0007050554368713 -> 1.000705304046880 Inexact Rounded +expx1128 exp 0.0000081206549504 -> 1.000008120687923 Inexact Rounded +expx1129 exp 0.621774854641137 -> 1.862230298554903 Inexact Rounded +expx1130 exp 3.847629031404354 -> 46.88177613568203 Inexact Rounded +expx1131 exp 24.81250184697732 -> 59694268456.19966 Inexact Rounded +expx1132 exp 5.107546500516044 -> 165.2643809755670 Inexact Rounded +expx1133 exp 79.17810943951986 -> 2.435656372541360E+34 Inexact Rounded +expx1134 exp 0.0051394695667015 -> 1.005152699295301 Inexact Rounded +expx1135 exp 57.44504488501725 -> 8.872908566929688E+24 Inexact Rounded +expx1136 exp 0.0000508388968036 -> 1.000050840189122 Inexact Rounded +expx1137 exp 69.71309932148997 -> 1.888053740693541E+30 Inexact Rounded +expx1138 exp 0.0064183412981502 -> 1.006438982988835 Inexact Rounded +expx1139 exp 9.346991220814677 -> 11464.27802035082 Inexact Rounded +expx1140 exp 33.09087139999152 -> 235062229168763.5 Inexact Rounded + +-- Randoms P=7, within 0-9 +Precision: 7 +maxExponent: 96 +minExponent: -95 +expx1001 exp 2.395441 -> 10.97304 Inexact Rounded +expx1002 exp 0.6406779 -> 1.897767 Inexact Rounded +expx1003 exp 0.5618218 -> 1.753865 Inexact Rounded +expx1004 exp 3.055120 -> 21.22373 Inexact Rounded +expx1005 exp 1.536792 -> 4.649650 Inexact Rounded +expx1006 exp 0.0801591 -> 1.083459 Inexact Rounded +expx1007 exp 0.0966875 -> 1.101516 Inexact Rounded +expx1008 exp 0.0646761 -> 1.066813 Inexact Rounded +expx1009 exp 0.0095670 -> 1.009613 Inexact Rounded +expx1010 exp 2.956859 -> 19.23745 Inexact Rounded +expx1011 exp 7.504679 -> 1816.522 Inexact Rounded +expx1012 exp 0.0045259 -> 1.004536 Inexact Rounded +expx1013 exp 3.810071 -> 45.15364 Inexact Rounded +expx1014 exp 1.502390 -> 4.492413 Inexact Rounded +expx1015 exp 0.0321523 -> 1.032675 Inexact Rounded +expx1016 exp 0.0057214 -> 1.005738 Inexact Rounded +expx1017 exp 9.811445 -> 18241.33 Inexact Rounded +expx1018 exp 3.245249 -> 25.66810 Inexact Rounded +expx1019 exp 0.3189742 -> 1.375716 Inexact Rounded +expx1020 exp 0.8621610 -> 2.368273 Inexact Rounded +expx1021 exp 0.0122511 -> 1.012326 Inexact Rounded +expx1022 exp 2.202088 -> 9.043877 Inexact Rounded +expx1023 exp 8.778203 -> 6491.202 Inexact Rounded +expx1024 exp 0.1896279 -> 1.208800 Inexact Rounded +expx1025 exp 0.4510947 -> 1.570030 Inexact Rounded +expx1026 exp 0.276413 -> 1.318392 Inexact Rounded +expx1027 exp 4.490067 -> 89.12742 Inexact Rounded +expx1028 exp 0.0439786 -> 1.044960 Inexact Rounded +expx1029 exp 0.8168245 -> 2.263301 Inexact Rounded +expx1030 exp 0.0391658 -> 1.039943 Inexact Rounded +expx1031 exp 9.261816 -> 10528.24 Inexact Rounded +expx1032 exp 9.611186 -> 14930.87 Inexact Rounded +expx1033 exp 9.118125 -> 9119.087 Inexact Rounded +expx1034 exp 9.469083 -> 12953.00 Inexact Rounded +expx1035 exp 0.0499983 -> 1.051269 Inexact Rounded +expx1036 exp 0.0050746 -> 1.005087 Inexact Rounded +expx1037 exp 0.0014696 -> 1.001471 Inexact Rounded +expx1038 exp 9.138494 -> 9306.739 Inexact Rounded +expx1039 exp 0.0065436 -> 1.006565 Inexact Rounded +expx1040 exp 0.7284803 -> 2.071930 Inexact Rounded + Added: sandbox/trunk/decimal-c/new_dt/inexact.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/inexact.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,215 @@ +------------------------------------------------------------------------ +-- inexact.decTest -- decimal inexact and rounded edge cases -- +-- Copyright (c) IBM Corporation, 1981, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +inx001 add 1 1 -> 2 +inx002 add 123456789 0 -> 123456789 +inx003 add 123456789 0.0 -> 123456789 Rounded +inx004 add 123456789 0.00 -> 123456789 Rounded +inx005 add 123456789 1 -> 123456790 +inx006 add 123456789 0.1 -> 123456789 Inexact Rounded +inx007 add 123456789 0.01 -> 123456789 Inexact Rounded +inx008 add 123456789 0.001 -> 123456789 Inexact Rounded +inx009 add 123456789 0.000001 -> 123456789 Inexact Rounded +inx010 add 123456789 0.000000001 -> 123456789 Inexact Rounded +inx011 add 123456789 0.000000000001 -> 123456789 Inexact Rounded + +inx012 add 123456789 0.9 -> 123456790 Inexact Rounded +inx013 add 123456789 0.09 -> 123456789 Inexact Rounded +inx014 add 123456789 0.009 -> 123456789 Inexact Rounded +inx015 add 123456789 0.000009 -> 123456789 Inexact Rounded +inx016 add 123456789 0.000000009 -> 123456789 Inexact Rounded +inx017 add 123456789 0.000000000009 -> 123456789 Inexact Rounded + +inx021 add 1 -1 -> 0 +inx022 add 123456789 -0 -> 123456789 +inx023 add 123456789 -0.0 -> 123456789 Rounded +inx024 add 123456789 -0.00 -> 123456789 Rounded +inx025 add 123456789 -1 -> 123456788 +inx026 add 123456789 -0.1 -> 123456789 Inexact Rounded +inx027 add 123456789 -0.01 -> 123456789 Inexact Rounded +inx028 add 123456789 -0.001 -> 123456789 Inexact Rounded +inx029 add 123456789 -0.000001 -> 123456789 Inexact Rounded +inx030 add 123456789 -0.000000001 -> 123456789 Inexact Rounded +inx031 add 123456789 -0.000000000001 -> 123456789 Inexact Rounded +inx032 add 123456789 -0.9 -> 123456788 Inexact Rounded +inx033 add 123456789 -0.09 -> 123456789 Inexact Rounded +inx034 add 123456789 -0.009 -> 123456789 Inexact Rounded +inx035 add 123456789 -0.000009 -> 123456789 Inexact Rounded +inx036 add 123456789 -0.000000009 -> 123456789 Inexact Rounded +inx037 add 123456789 -0.000000000009 -> 123456789 Inexact Rounded + +inx042 add 0 123456789 -> 123456789 +inx043 add 0.0 123456789 -> 123456789 Rounded +inx044 add 0.00 123456789 -> 123456789 Rounded +inx045 add 1 123456789 -> 123456790 +inx046 add 0.1 123456789 -> 123456789 Inexact Rounded +inx047 add 0.01 123456789 -> 123456789 Inexact Rounded +inx048 add 0.001 123456789 -> 123456789 Inexact Rounded +inx049 add 0.000001 123456789 -> 123456789 Inexact Rounded +inx050 add 0.000000001 123456789 -> 123456789 Inexact Rounded +inx051 add 0.000000000001 123456789 -> 123456789 Inexact Rounded +inx052 add 0.9 123456789 -> 123456790 Inexact Rounded +inx053 add 0.09 123456789 -> 123456789 Inexact Rounded +inx054 add 0.009 123456789 -> 123456789 Inexact Rounded +inx055 add 0.000009 123456789 -> 123456789 Inexact Rounded +inx056 add 0.000000009 123456789 -> 123456789 Inexact Rounded +inx057 add 0.000000000009 123456789 -> 123456789 Inexact Rounded + +inx062 add -0 123456789 -> 123456789 +inx063 add -0.0 123456789 -> 123456789 Rounded +inx064 add -0.00 123456789 -> 123456789 Rounded +inx065 add -1 123456789 -> 123456788 +inx066 add -0.1 123456789 -> 123456789 Inexact Rounded +inx067 add -0.01 123456789 -> 123456789 Inexact Rounded +inx068 add -0.001 123456789 -> 123456789 Inexact Rounded +inx069 add -0.000001 123456789 -> 123456789 Inexact Rounded +inx070 add -0.000000001 123456789 -> 123456789 Inexact Rounded +inx071 add -0.000000000001 123456789 -> 123456789 Inexact Rounded +inx072 add -0.9 123456789 -> 123456788 Inexact Rounded +inx073 add -0.09 123456789 -> 123456789 Inexact Rounded +inx074 add -0.009 123456789 -> 123456789 Inexact Rounded +inx075 add -0.000009 123456789 -> 123456789 Inexact Rounded +inx076 add -0.000000009 123456789 -> 123456789 Inexact Rounded +inx077 add -0.000000000009 123456789 -> 123456789 Inexact Rounded + +-- some boundaries +inx081 add 999999999 0 -> 999999999 +inx082 add 0.999999999 0.000000000 -> 0.999999999 +inx083 add 999999999 1 -> 1.00000000E+9 Rounded +inx084 add 0.999999999 0.000000001 -> 1.00000000 Rounded +inx085 add 999999999 2 -> 1.00000000E+9 Inexact Rounded +inx086 add 0.999999999 0.000000002 -> 1.00000000 Inexact Rounded +inx087 add 999999999 3 -> 1.00000000E+9 Inexact Rounded +inx089 add 0.999999999 0.000000003 -> 1.00000000 Inexact Rounded + +-- minus, plus, and subtract all assumed to work like add. + +-- multiply +precision: 8 +inx101 multiply 1000 1000 -> 1000000 +inx102 multiply 9000 9000 -> 81000000 +inx103 multiply 9999 9999 -> 99980001 +inx104 multiply 1000 10000 -> 10000000 +inx105 multiply 10000 10000 -> 1.0000000E+8 Rounded +inx106 multiply 10001 10000 -> 1.0001000E+8 Rounded +inx107 multiply 10001 10001 -> 1.0002000E+8 Inexact Rounded +inx108 multiply 10101 10001 -> 1.0102010E+8 Inexact Rounded +inx109 multiply 10001 10101 -> 1.0102010E+8 Inexact Rounded + +-- divide +precision: 4 +inx201 divide 1000 1000 -> 1 +inx202 divide 1000 1 -> 1000 +inx203 divide 1000 2 -> 500 +inx204 divide 1000 3 -> 333.3 Inexact Rounded +inx205 divide 1000 4 -> 250 +inx206 divide 1000 5 -> 200 +inx207 divide 1000 6 -> 166.7 Inexact Rounded +inx208 divide 1000 7 -> 142.9 Inexact Rounded +inx209 divide 1000 8 -> 125 +inx210 divide 1000 9 -> 111.1 Inexact Rounded +inx211 divide 1000 10 -> 100 + +inx220 divide 1 1 -> 1 +inx221 divide 1 2 -> 0.5 +inx222 divide 1 4 -> 0.25 +inx223 divide 1 8 -> 0.125 +inx224 divide 1 16 -> 0.0625 +inx225 divide 1 32 -> 0.03125 +inx226 divide 1 64 -> 0.01563 Inexact Rounded +inx227 divide 1 128 -> 0.007813 Inexact Rounded + +precision: 5 +inx230 divide 1 1 -> 1 +inx231 divide 1 2 -> 0.5 +inx232 divide 1 4 -> 0.25 +inx233 divide 1 8 -> 0.125 +inx234 divide 1 16 -> 0.0625 +inx235 divide 1 32 -> 0.03125 +inx236 divide 1 64 -> 0.015625 +inx237 divide 1 128 -> 0.0078125 + +precision: 3 +inx240 divide 1 1 -> 1 +inx241 divide 1 2 -> 0.5 +inx242 divide 1 4 -> 0.25 +inx243 divide 1 8 -> 0.125 +inx244 divide 1 16 -> 0.0625 +inx245 divide 1 32 -> 0.0313 Inexact Rounded +inx246 divide 1 64 -> 0.0156 Inexact Rounded +inx247 divide 1 128 -> 0.00781 Inexact Rounded + +precision: 2 +inx250 divide 1 1 -> 1 +inx251 divide 1 2 -> 0.5 +inx252 divide 1 4 -> 0.25 +inx253 divide 1 8 -> 0.13 Inexact Rounded +inx254 divide 1 16 -> 0.063 Inexact Rounded +inx255 divide 1 32 -> 0.031 Inexact Rounded +inx256 divide 1 64 -> 0.016 Inexact Rounded +inx257 divide 1 128 -> 0.0078 Inexact Rounded + +precision: 1 +inx260 divide 1 1 -> 1 +inx261 divide 1 2 -> 0.5 +inx262 divide 1 4 -> 0.3 Inexact Rounded +inx263 divide 1 8 -> 0.1 Inexact Rounded +inx264 divide 1 16 -> 0.06 Inexact Rounded +inx265 divide 1 32 -> 0.03 Inexact Rounded +inx266 divide 1 64 -> 0.02 Inexact Rounded +inx267 divide 1 128 -> 0.008 Inexact Rounded + + +-- power +precision: 4 +inx301 power 0.5 2 -> 0.25 +inx302 power 0.5 4 -> 0.0625 +inx303 power 0.5 8 -> 0.003906 Inexact Rounded +inx304 power 0.5 16 -> 0.00001526 Inexact Rounded +inx305 power 0.5 32 -> 2.328E-10 Inexact Rounded + +-- compare, divideInteger, and remainder are always exact + +-- rescale +precision: 4 +inx401 rescale 0 0 -> 0 +inx402 rescale 1 0 -> 1 +inx403 rescale 0.1 +2 -> 0E+2 Inexact Rounded +inx404 rescale 0.1 +1 -> 0E+1 Inexact Rounded +inx405 rescale 0.1 0 -> 0 Inexact Rounded +inx406 rescale 0.1 -1 -> 0.1 +inx407 rescale 0.1 -2 -> 0.10 + +-- long operands cause rounding too +precision: 9 +inx801 plus 123456789 -> 123456789 +inx802 plus 1234567890 -> 1.23456789E+9 Rounded +inx803 plus 1234567891 -> 1.23456789E+9 Inexact Rounded +inx804 plus 1234567892 -> 1.23456789E+9 Inexact Rounded +inx805 plus 1234567899 -> 1.23456790E+9 Inexact Rounded +inx806 plus 1234567900 -> 1.23456790E+9 Rounded + Added: sandbox/trunk/decimal-c/new_dt/ln.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/ln.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,612 @@ +------------------------------------------------------------------------ +-- ln.decTest -- decimal natural logarithm -- +-- Copyright (c) IBM Corporation, 2005. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +extended: 1 +precision: 16 +rounding: half_even +maxExponent: 384 +minexponent: -383 + +-- basics (examples in specification) +precision: 9 +lnxs001 ln 0 -> -Infinity +lnxs002 ln 1.000 -> 0 +lnxs003 ln 2.71828183 -> 1.00000000 Inexact Rounded +lnxs004 ln 10 -> 2.30258509 Inexact Rounded +lnxs005 ln +Infinity -> Infinity + + +-- basics +precision: 16 +lnx0001 ln 0 -> -Infinity +lnx0002 ln 1E-9 -> -20.72326583694641 Inexact Rounded +lnx0003 ln 0.0007 -> -7.264430222920869 Inexact Rounded +lnx0004 ln 0.1 -> -2.302585092994046 Inexact Rounded +lnx0005 ln 0.7 -> -0.3566749439387324 Inexact Rounded +lnx0006 ln 1 -> 0 +lnx0007 ln 1.000 -> 0 +lnx0008 ln 1.5 -> 0.4054651081081644 Inexact Rounded +lnx0009 ln 2 -> 0.6931471805599453 Inexact Rounded +lnx0010 ln 2.718281828459045 -> 0.9999999999999999 Inexact Rounded +lnx0011 ln 2.718281828459046 -> 1.000000000000000 Inexact Rounded +lnx0012 ln 2.718281828459047 -> 1.000000000000001 Inexact Rounded +lnx0013 ln 10 -> 2.302585092994046 Inexact Rounded +lnx0014 ln 10.5 -> 2.351375257163478 Inexact Rounded +lnx0015 ln 9999 -> 9.210240366975849 Inexact Rounded +lnx0016 ln 1E6 -> 13.81551055796427 Inexact Rounded +lnx0017 ln 1E+9 -> 20.72326583694641 Inexact Rounded +lnx0018 ln +Infinity -> Infinity + +-- notable cases +-- negatives +lnx0021 ln -1E-9 -> NaN Invalid_operation +lnx0022 ln -0.0007 -> NaN Invalid_operation +lnx0023 ln -0.1 -> NaN Invalid_operation +lnx0024 ln -0.7 -> NaN Invalid_operation +lnx0025 ln -1 -> NaN Invalid_operation +lnx0026 ln -1.5 -> NaN Invalid_operation +lnx0027 ln -2 -> NaN Invalid_operation +lnx0029 ln -10.5 -> NaN Invalid_operation +lnx0028 ln -9999 -> NaN Invalid_operation +lnx0030 ln -2.718281828459045 -> NaN Invalid_operation +lnx0031 ln -2.718281828459046 -> NaN Invalid_operation +lnx0032 ln -0 -> -Infinity +lnx0033 ln -0E+17 -> -Infinity +lnx0034 ln -0E-17 -> -Infinity +-- other zeros +lnx0041 ln 0 -> -Infinity +lnx0042 ln 0E+17 -> -Infinity +lnx0043 ln 0E-17 -> -Infinity +-- infinities +lnx0045 ln -Infinity -> NaN Invalid_operation +lnx0046 ln +Infinity -> Infinity +-- ones +lnx0050 ln 1 -> 0 +lnx0051 ln 1.0 -> 0 +lnx0052 ln 1.000000000000000 -> 0 +lnx0053 ln 1.000000000000000000 -> 0 + +-- lower precision basics +Precision: 7 +lnx0101 ln 0 -> -Infinity +lnx0102 ln 1E-9 -> -20.72327 Inexact Rounded +lnx0103 ln 0.0007 -> -7.264430 Inexact Rounded +lnx0104 ln 0.1 -> -2.302585 Inexact Rounded +lnx0105 ln 0.7 -> -0.3566749 Inexact Rounded +lnx0106 ln 1 -> 0 +lnx0107 ln 1.5 -> 0.4054651 Inexact Rounded +lnx0108 ln 2 -> 0.6931472 Inexact Rounded +lnx0109 ln 2.718281828459045 -> 1.000000 Inexact Rounded +lnx0110 ln 2.718281828459046 -> 1.000000 Inexact Rounded +lnx0111 ln 2.718281828459047 -> 1.000000 Inexact Rounded +lnx0112 ln 10 -> 2.302585 Inexact Rounded +lnx0113 ln 10.5 -> 2.351375 Inexact Rounded +lnx0114 ln 9999 -> 9.210240 Inexact Rounded +lnx0115 ln 1E6 -> 13.81551 Inexact Rounded +lnx0116 ln 1E+9 -> 20.72327 Inexact Rounded +lnx0117 ln +Infinity -> Infinity +Precision: 2 +lnx0121 ln 0 -> -Infinity +lnx0122 ln 1E-9 -> -21 Inexact Rounded +lnx0123 ln 0.0007 -> -7.3 Inexact Rounded +lnx0124 ln 0.1 -> -2.3 Inexact Rounded +lnx0125 ln 0.7 -> -0.36 Inexact Rounded +lnx0126 ln 1 -> 0 +lnx0127 ln 1.5 -> 0.41 Inexact Rounded +lnx0128 ln 2 -> 0.69 Inexact Rounded +lnx0129 ln 2.718281828459045 -> 1.0 Inexact Rounded +lnx0130 ln 2.718281828459046 -> 1.0 Inexact Rounded +lnx0131 ln 2.718281828459047 -> 1.0 Inexact Rounded +lnx0132 ln 10 -> 2.3 Inexact Rounded +lnx0133 ln 10.5 -> 2.4 Inexact Rounded +lnx0134 ln 9999 -> 9.2 Inexact Rounded +lnx0135 ln 1E6 -> 14 Inexact Rounded +lnx0136 ln 1E+9 -> 21 Inexact Rounded +lnx0137 ln +Infinity -> Infinity +Precision: 1 +lnx0141 ln 0 -> -Infinity +lnx0142 ln 1E-9 -> -2E+1 Inexact Rounded +lnx0143 ln 0.0007 -> -7 Inexact Rounded +lnx0144 ln 0.1 -> -2 Inexact Rounded +lnx0145 ln 0.7 -> -0.4 Inexact Rounded +lnx0146 ln 1 -> 0 +lnx0147 ln 1.5 -> 0.4 Inexact Rounded +lnx0148 ln 2 -> 0.7 Inexact Rounded +lnx0149 ln 2.718281828459045 -> 1 Inexact Rounded +lnx0150 ln 2.718281828459046 -> 1 Inexact Rounded +lnx0151 ln 2.718281828459047 -> 1 Inexact Rounded +lnx0152 ln 10 -> 2 Inexact Rounded +lnx0153 ln 10.5 -> 2 Inexact Rounded +lnx0154 ln 9999 -> 9 Inexact Rounded +lnx0155 ln 1E6 -> 1E+1 Inexact Rounded +lnx0156 ln 1E+9 -> 2E+1 Inexact Rounded +lnx0157 ln +Infinity -> Infinity + +-- group low-precision ln(1)s: +precision: 1 +lnx0161 ln 1 -> 0 +precision: 2 +lnx0162 ln 1 -> 0 +precision: 3 +lnx0163 ln 1 -> 0 +precision: 4 +lnx0164 ln 1 -> 0 +precision: 5 +lnx0165 ln 1 -> 0 +precision: 6 +lnx0166 ln 1 -> 0 +precision: 7 +lnx0167 ln 1 -> 0 +precision: 8 +lnx0168 ln 1 -> 0 + +-- edge-test ln(2) and ln(10) in case of lookasides +precision: 45 +lnx201 ln 2 -> 0.693147180559945309417232121458176568075500134 Inexact Rounded +lnx202 ln 10 -> 2.30258509299404568401799145468436420760110149 Inexact Rounded +precision: 44 +lnx203 ln 2 -> 0.69314718055994530941723212145817656807550013 Inexact Rounded +lnx204 ln 10 -> 2.3025850929940456840179914546843642076011015 Inexact Rounded +precision: 43 +lnx205 ln 2 -> 0.6931471805599453094172321214581765680755001 Inexact Rounded +lnx206 ln 10 -> 2.302585092994045684017991454684364207601101 Inexact Rounded +precision: 42 +lnx207 ln 2 -> 0.693147180559945309417232121458176568075500 Inexact Rounded +lnx208 ln 10 -> 2.30258509299404568401799145468436420760110 Inexact Rounded +precision: 41 +lnx209 ln 2 -> 0.69314718055994530941723212145817656807550 Inexact Rounded +lnx210 ln 10 -> 2.3025850929940456840179914546843642076011 Inexact Rounded +precision: 40 +lnx211 ln 2 -> 0.6931471805599453094172321214581765680755 Inexact Rounded +lnx212 ln 10 -> 2.302585092994045684017991454684364207601 Inexact Rounded +precision: 39 +lnx213 ln 2 -> 0.693147180559945309417232121458176568076 Inexact Rounded +lnx214 ln 10 -> 2.30258509299404568401799145468436420760 Inexact Rounded +precision: 38 +lnx215 ln 2 -> 0.69314718055994530941723212145817656808 Inexact Rounded +lnx216 ln 10 -> 2.3025850929940456840179914546843642076 Inexact Rounded +precision: 37 +lnx217 ln 2 -> 0.6931471805599453094172321214581765681 Inexact Rounded +lnx218 ln 10 -> 2.302585092994045684017991454684364208 Inexact Rounded +precision: 36 +lnx219 ln 2 -> 0.693147180559945309417232121458176568 Inexact Rounded +lnx220 ln 10 -> 2.30258509299404568401799145468436421 Inexact Rounded +precision: 35 +lnx221 ln 2 -> 0.69314718055994530941723212145817657 Inexact Rounded +lnx222 ln 10 -> 2.3025850929940456840179914546843642 Inexact Rounded +precision: 34 +lnx223 ln 2 -> 0.6931471805599453094172321214581766 Inexact Rounded +lnx224 ln 10 -> 2.302585092994045684017991454684364 Inexact Rounded +precision: 33 +lnx225 ln 2 -> 0.693147180559945309417232121458177 Inexact Rounded +lnx226 ln 10 -> 2.30258509299404568401799145468436 Inexact Rounded +precision: 32 +lnx227 ln 2 -> 0.69314718055994530941723212145818 Inexact Rounded +lnx228 ln 10 -> 2.3025850929940456840179914546844 Inexact Rounded +precision: 31 +lnx229 ln 2 -> 0.6931471805599453094172321214582 Inexact Rounded +lnx230 ln 10 -> 2.302585092994045684017991454684 Inexact Rounded +precision: 30 +lnx231 ln 2 -> 0.693147180559945309417232121458 Inexact Rounded +lnx232 ln 10 -> 2.30258509299404568401799145468 Inexact Rounded + +-- extreme input range values +maxExponent: 384 +minExponent: -383 +Precision: 16 + +lnx0901 ln 1e-400 -> -921.0340371976183 Inexact Rounded +lnx0902 ln 1e+400 -> 921.0340371976183 Inexact Rounded +lnx0903 ln 1e-999999 -> -2302582.790408953 Inexact Rounded +lnx0904 ln 1e+999999 -> 2302582.790408953 Inexact Rounded +lnx0905 ln 1e-1000013 -> -2302615.026600255 Inexact Rounded +lnx0906 ln 2e-1000013 -> -2302614.333453074 Inexact Rounded + +lnx0910 ln 9.999999e+999999 -> 2302585.092993946 Inexact Rounded +lnx0911 ln 9.9999999e+999999 -> 2302585.092994036 Inexact Rounded +lnx0912 ln 9.99999999e+999999 -> 2302585.092994045 Inexact Rounded +lnx0913 ln 9.999999999e+999999 -> 2302585.092994046 Inexact Rounded +lnx0914 ln 9.999999999999e+999999 -> 2302585.092994046 Inexact Rounded +lnx0915 ln 9.999999999999999e+999999 -> 2302585.092994046 Inexact Rounded +lnx0916 ln 9.999999999999999999999999e+999999 -> 2302585.092994046 Inexact Rounded + +-- randoms +-- P=50, within 0-999 +Precision: 50 +maxExponent: 384 +minExponent: -383 +lnx1501 ln 0.00098800906574486388604608477869812518857023768951 -> -6.9198186844033787995945147836955586009548513043689 Inexact Rounded +lnx1502 ln 158.15866624664623070184595045304145949900714987827 -> 5.0635987458895647454907806507503825602758392287684 Inexact Rounded +lnx1503 ln 0.00565661412059571925040285814021799775249288309321 -> -5.1749297776760632102047540300491550931651318975237 Inexact Rounded +lnx1504 ln 0.00000006914232532620489602008402091666547903180607 -> -16.487098770877825308138976818688771638172333034347 Inexact Rounded +lnx1505 ln 0.00025380374621297657504661540749355251231770070723 -> -8.2789492423005003205242162741569033124260321954589 Inexact Rounded +lnx1506 ln 83.033654063877426261108592599182418953442677554806 -> 4.4192459962647137976949249810815698465031609843669 Inexact Rounded +lnx1507 ln 0.00000000416863228092481651627734668440663678118729 -> -19.295677845122141772791294599714950175284915666430 Inexact Rounded +lnx1508 ln 0.00000140847873187820570181214271960511080523457669 -> -13.473000349581967189668305314384952251556809480339 Inexact Rounded +lnx1509 ln 66.176106555181527101630351127583944689752069132522 -> 4.1923194696232505883666171116966137694013431504252 Inexact Rounded +lnx1510 ln 0.00000000000009899043487403590900111602024562297908 -> -29.943753166877840985821508112917991506656545174163 Inexact Rounded +lnx1511 ln 0.00000000000324618296721747097510453388683912733569 -> -26.453541281444586819009546418577507163362590139422 Inexact Rounded +lnx1512 ln 72.646968818463546449499147579023555008392860423385 -> 4.2856116660689646882852128853423566276718230426479 Inexact Rounded +lnx1513 ln 0.00000000000000066755483124635612574263153825990523 -> -34.942910142802769319262875080398852491588707172483 Inexact Rounded +lnx1514 ln 61.002910447202398204114909451851111424657671911002 -> 4.1109215752843377323363182051446177066434038096529 Inexact Rounded +lnx1515 ln 917.06917611331980999227893584010544542312239174774 -> 6.8211829068303114128752453661946446979787826282907 Inexact Rounded +lnx1516 ln 0.00000000170823794883673083358549749078972003965194 -> -20.187803436976150477297246666771626827057191023004 Inexact Rounded +lnx1517 ln 0.53731767845358224445809761315159249898566542910649 -> -0.62116577939968409211736413628236285160048357000961 Inexact Rounded +lnx1518 ln 0.00000000000000008965291392882804161299758708033373 -> -36.950585970980857376081265073276303670820056916206 Inexact Rounded +lnx1519 ln 0.00000000006990244916026429904498278982530170295668 -> -23.383920429244457578373523508427783144589480420753 Inexact Rounded +lnx1520 ln 4.0312542977070300070506064666536478373801988540614 -> 1.3940775676592451945795752796421391871302024763305 Inexact Rounded +lnx1521 ln 271.84991311551875601432518819562391699324632396423 -> 5.6052501239873862517916679747146539808077431873478 Inexact Rounded +lnx1522 ln 7.4118671629373864667229445746862314443895404818689 -> 2.0030823863706344628239147639318289961917060121141 Inexact Rounded +lnx1523 ln 0.00000000000002026311452625364905357321664186034258 -> -31.529974180054438792043856877314043794320951134754 Inexact Rounded +lnx1524 ln 0.00000000000009563398651261756952398250624737809347 -> -29.978248130576972953141284136962670021368834792579 Inexact Rounded +lnx1525 ln 0.00000000009556772669409858653026558223465197808991 -> -23.071185939748285541228206161472956661196956741186 Inexact Rounded +lnx1526 ln 6.8441648298027301292342057248737326152250794026761 -> 1.9233964395801946597272589473417948024361005082908 Inexact Rounded +lnx1527 ln 0.00000000000073059699884439979394945822035704264577 -> -27.944914388353724718836101828677771967128509603158 Inexact Rounded +lnx1528 ln 0.00000000000000002610078280419082263138064745416787 -> -38.184566367516207885573773320135965798717120735115 Inexact Rounded +lnx1529 ln 0.00000000000000000150259517166294243088546806083283 -> -41.039337946266676108538170837580051699618334928421 Inexact Rounded +lnx1530 ln 0.00000000000000087919160541714580707181969708502091 -> -34.667528818827671507514319744047440696187358676848 Inexact Rounded +lnx1531 ln 0.00000000000395726725120787763271849577708068584598 -> -26.255467416961357741818735787226671938678424748431 Inexact Rounded +lnx1532 ln 0.00000000002014334901669366218018377213150715938355 -> -24.628146955635359035289123027319969201693737159108 Inexact Rounded +lnx1533 ln 0.00000008097927101101093117753938766241442896030637 -> -16.329072628469715178637178365710373398203190937454 Inexact Rounded +lnx1534 ln 0.00000000000017115834162632864392039668116243984176 -> -29.396187292434898225453626794459285157263177528034 Inexact Rounded +lnx1535 ln 0.39168317593866334087305459933723864294857086105035 -> -0.93730199062757240485836637306785037368746737693029 Inexact Rounded +lnx1536 ln 79.335036798971515026519630103325369729637514127617 -> 4.3736798570287828823772149735170431010616961976965 Inexact Rounded +lnx1537 ln 0.00000000000000056004952129926137413602116591493625 -> -35.118506463181870020730685884333000241039028127213 Inexact Rounded +lnx1538 ln 0.00000006006035907843890918832481099660639553666078 -> -16.627915795747112566532705974853114454405010472043 Inexact Rounded +lnx1539 ln 0.00000000085242024937414906371333826574632450587590 -> -20.882941460268101080186482230657774997273494107221 Inexact Rounded +lnx1540 ln 0.00000000000043671099499262350316173246550771951561 -> -28.459504757285639221776305968469058854558726593945 Inexact Rounded + +-- P=34, within 0-999 +Precision: 34 +lnx1201 ln 0.0086732880815927182997566810334394 -> -4.747507311920844752486938187973721 Inexact Rounded +lnx1202 ln 0.0007104103693460260609792222569854 -> -7.249667769903503023005549250347695 Inexact Rounded +lnx1203 ln 786.8398945385105190697541493392742 -> 6.668024790031836340471824147010546 Inexact Rounded +lnx1204 ln 0.7723073620282687656895190171967399 -> -0.2583726708506850868786816238217326 Inexact Rounded +lnx1205 ln 0.0061057951517197631287183938412200 -> -5.098516933918797347064454103742635 Inexact Rounded +lnx1206 ln 0.6181379708184393730103917562498745 -> -0.4810435926903365087463387760350021 Inexact Rounded +lnx1207 ln 09.13888261229039989110753389096760 -> 2.212538125507975574509563027696021 Inexact Rounded +lnx1208 ln 802.0105417063143696497292158147174 -> 6.687121752052341737234832203350214 Inexact Rounded +lnx1209 ln 778.7749710387773713523028497333058 -> 6.657722135126935472086625031413031 Inexact Rounded +lnx1210 ln 0.0024457295895346502513567679390616 -> -6.013411799940245345321348290398517 Inexact Rounded +lnx1211 ln 0.0000511296947872828310338864217860 -> -9.881145118237281798081573131711636 Inexact Rounded +lnx1212 ln 0.0000246803508602554924938685155658 -> -10.60950314264825661825360971430218 Inexact Rounded +lnx1213 ln 9.027898199253511668242977766616082 -> 2.200319582778899029786017830557293 Inexact Rounded +lnx1214 ln 0.0991812396542505631850692800904188 -> -2.310806398964672258823043180400384 Inexact Rounded +lnx1215 ln 0.0000000000070238810143028811223924 -> -25.68170519961636647174714538290075 Inexact Rounded +lnx1216 ln 2.630101665342826494730394729313167 -> 0.9670225014664367465128243039749559 Inexact Rounded +lnx1217 ln 0.0056878928594359587691526063254683 -> -5.169415422904037819736637399445096 Inexact Rounded +lnx1218 ln 567.3436047121057843908106573095590 -> 6.340965124964258486463444360787970 Inexact Rounded +lnx1219 ln 1.199291248124655996614605745649725 -> 0.1817307557425911805765087755675657 Inexact Rounded +lnx1220 ln 25.02050448582031098696267479135557 -> 3.219695668137659139544178905459317 Inexact Rounded +lnx1221 ln 0.0000000000009939597023558756961300 -> -27.63707972996537636504396558259058 Inexact Rounded +lnx1222 ln 0.0000007988551670159429716506430403 -> -14.04008617542597230988198612376415 Inexact Rounded +lnx1223 ln 4.681515800176129184873770605589795 -> 1.543621946415383338972124445445748 Inexact Rounded +lnx1224 ln 15.95126669161103011206658749345781 -> 2.769538242479483539275986395443539 Inexact Rounded +lnx1225 ln 0.0301626783922211213675457279076066 -> -3.501149933677283341023932281826341 Inexact Rounded +lnx1226 ln 000.0040544064881821770528475185674 -> -5.507950967557021671647165889608324 Inexact Rounded +lnx1227 ln 29.01617095935593792095913785100360 -> 3.367853293862745651888450004473297 Inexact Rounded +lnx1228 ln 78.01836167344736733024804243195323 -> 4.356944205055768575987781375003992 Inexact Rounded +lnx1229 ln 0.0000000096545319316965321158634893 -> -18.45583840160965814462095477365013 Inexact Rounded +lnx1230 ln 97.95475237720579752770587185074428 -> 4.584505661612812742208619358214729 Inexact Rounded +lnx1231 ln 528.0609262050423246402564228432371 -> 6.269211667589138113396583894315956 Inexact Rounded +lnx1232 ln 0.0000002250064349732969696660452972 -> -15.30713683526963996712167701738724 Inexact Rounded +lnx1233 ln 47.97063637767998658567199049725754 -> 3.870589081585660692195989854842372 Inexact Rounded +lnx1234 ln 0.0005394311344541432318853513414361 -> -7.524995428393925934087126702974121 Inexact Rounded +lnx1235 ln 0.0000000090973385649567471674972633 -> -18.51528393158931783447035004125791 Inexact Rounded +lnx1236 ln 0.0000000000238776490227576197317977 -> -24.45807828188389561331158879207262 Inexact Rounded +lnx1237 ln 0.0000236587000231921532145326218758 -> -10.65177964499823314952429277979034 Inexact Rounded +lnx1238 ln 499.1277448846130709827154556125942 -> 6.212862064761427967461188083514774 Inexact Rounded +lnx1239 ln 0.0000003960192300284787663712417647 -> -14.74180306619298548093697608293284 Inexact Rounded +lnx1240 ln 41.08268350829477451667228892495136 -> 3.715586706887278039173584859218960 Inexact Rounded + +-- P=16, within 0-99 +Precision: 16 +lnx1101 ln 7.964875261033948 -> 2.075041282352241 Inexact Rounded +lnx1102 ln 13.54527396845394 -> 2.606037701870263 Inexact Rounded +lnx1103 ln 0.0008026554341331 -> -7.127585034321814 Inexact Rounded +lnx1104 ln 0.0000030582233261 -> -12.69767642300625 Inexact Rounded +lnx1105 ln 0.0004477497509672 -> -7.711276073210766 Inexact Rounded +lnx1106 ln 7.616268622474371 -> 2.030286567675148 Inexact Rounded +lnx1107 ln 51.58329925806381 -> 3.943197962309569 Inexact Rounded +lnx1108 ln 0.0018197497951263 -> -6.309056262549345 Inexact Rounded +lnx1109 ln 2.956282457072984 -> 1.083932552334575 Inexact Rounded +lnx1110 ln 0.3843325579189906 -> -0.9562470649400558 Inexact Rounded +lnx1111 ln 0.0074466329265663 -> -4.899993304919237 Inexact Rounded +lnx1112 ln 0.0003372478532993 -> -7.994692428206378 Inexact Rounded +lnx1113 ln 0.0084792263167809 -> -4.770136069569271 Inexact Rounded +lnx1114 ln 5.926756998151102 -> 1.779477182834305 Inexact Rounded +lnx1115 ln 9.025699152180897 -> 2.200075969604119 Inexact Rounded +lnx1116 ln 1.910124643533526 -> 0.6471684983238183 Inexact Rounded +lnx1117 ln 0.8158922711411020 -> -0.2034729533939387 Inexact Rounded +lnx1118 ln 0.0067080016475322 -> -5.004454189414139 Inexact Rounded +lnx1119 ln 0.0047583242092716 -> -5.347859729601094 Inexact Rounded +lnx1120 ln 0.0386647411641339 -> -3.252827175263113 Inexact Rounded +lnx1121 ln 0.0050226427841761 -> -5.293799032774131 Inexact Rounded +lnx1122 ln 6.927937541637261 -> 1.935562155866906 Inexact Rounded +lnx1123 ln 0.0000095745343513 -> -11.55640365579814 Inexact Rounded +lnx1124 ln 1.602465492956538 -> 0.4715433763243936 Inexact Rounded +lnx1125 ln 38.98415625087535 -> 3.663155313610213 Inexact Rounded +lnx1126 ln 5.343182042276734 -> 1.675821363568112 Inexact Rounded +lnx1127 ln 55.89763703245816 -> 4.023522107934110 Inexact Rounded +lnx1128 ln 0.7445257810280847 -> -0.2950077988101030 Inexact Rounded +lnx1129 ln 1.631407314946094 -> 0.4894430257201248 Inexact Rounded +lnx1130 ln 0.0005462451932602 -> -7.512442611116852 Inexact Rounded +lnx1131 ln 0.0000864173269362 -> -9.356322359017317 Inexact Rounded +lnx1132 ln 5.227161719132849 -> 1.653868438439637 Inexact Rounded +lnx1133 ln 60.57078466941998 -> 4.103812675662452 Inexact Rounded +lnx1134 ln 0.0992864325333160 -> -2.309746348350318 Inexact Rounded +lnx1135 ln 09.48564268447325 -> 2.249779359074983 Inexact Rounded +lnx1136 ln 0.0036106089355634 -> -5.623878840650787 Inexact Rounded +lnx1137 ln 1.805176865587172 -> 0.5906585734593707 Inexact Rounded +lnx1138 ln 62.59363259642255 -> 4.136663557220559 Inexact Rounded +lnx1139 ln 4.373828261137201 -> 1.475638657912000 Inexact Rounded +lnx1140 ln 0.994483524148738 -> -0.005531747794938690 Inexact Rounded + +-- P=7, within 0-9 +Precision: 7 +lnx1001 ln 0.0912025 -> -2.394673 Inexact Rounded +lnx1002 ln 0.9728626 -> -0.02751242 Inexact Rounded +lnx1003 ln 0.3886032 -> -0.9451965 Inexact Rounded +lnx1004 ln 8.798639 -> 2.174597 Inexact Rounded +lnx1005 ln 2.459121 -> 0.8998040 Inexact Rounded +lnx1006 ln 2.013193 -> 0.6997220 Inexact Rounded +lnx1007 ln 9.064857 -> 2.204405 Inexact Rounded +lnx1008 ln 5.796417 -> 1.757240 Inexact Rounded +lnx1009 ln 0.1143471 -> -2.168517 Inexact Rounded +lnx1010 ln 0.5341542 -> -0.6270707 Inexact Rounded +lnx1011 ln 6.693781 -> 1.901179 Inexact Rounded +lnx1012 ln 0.0081779 -> -4.806320 Inexact Rounded +lnx1013 ln 8.313616 -> 2.117895 Inexact Rounded +lnx1014 ln 3.486925 -> 1.249020 Inexact Rounded +lnx1015 ln 0.1801401 -> -1.714020 Inexact Rounded +lnx1016 ln 0.5227148 -> -0.6487193 Inexact Rounded +lnx1017 ln 7.818111 -> 2.056443 Inexact Rounded +lnx1018 ln 0.0870671 -> -2.441076 Inexact Rounded +lnx1019 ln 8.153966 -> 2.098504 Inexact Rounded +lnx1020 ln 2.040975 -> 0.7134276 Inexact Rounded +lnx1021 ln 1.481642 -> 0.3931509 Inexact Rounded +lnx1022 ln 0.2610123 -> -1.343188 Inexact Rounded +lnx1023 ln 0.466723 -> -0.7620193 Inexact Rounded +lnx1024 ln 0.0518756 -> -2.958907 Inexact Rounded +lnx1025 ln 2.056410 -> 0.7209617 Inexact Rounded +lnx1026 ln 0.181522 -> -1.706378 Inexact Rounded +lnx1027 ln 0.515551 -> -0.6625190 Inexact Rounded +lnx1028 ln 8.425089 -> 2.131214 Inexact Rounded +lnx1029 ln 2.077091 -> 0.7309684 Inexact Rounded +lnx1030 ln 6.212705 -> 1.826596 Inexact Rounded +lnx1031 ln 5.729343 -> 1.745601 Inexact Rounded +lnx1032 ln 4.831251 -> 1.575105 Inexact Rounded +lnx1033 ln 2.029760 -> 0.7079176 Inexact Rounded +lnx1034 ln 8.615060 -> 2.153512 Inexact Rounded +lnx1035 ln 0.0611511 -> -2.794407 Inexact Rounded +lnx1036 ln 5.195269 -> 1.647748 Inexact Rounded +lnx1037 ln 9.617686 -> 2.263604 Inexact Rounded +lnx1038 ln 0.0049382 -> -5.310754 Inexact Rounded +lnx1039 ln 2.786840 -> 1.024908 Inexact Rounded +lnx1040 ln 0.0091073 -> -4.698679 Inexact Rounded + +-- from here 3-digit tests are based on reverse exp tests +precision: 9 +rounding: half_even +maxExponent: 384 +minexponent: -383 + +lnx001 ln 0 -> -Infinity +lnx002 ln 0.367879441 -> -1.00000000 Inexact Rounded +lnx003 ln 1 -> 0 +lnx005 ln 2.71828183 -> 1.00000000 Inexact Rounded +lnx006 ln 2.00000000 -> 0.693147181 Inexact Rounded +lnx007 ln +Infinity -> Infinity + +-- tiny edge cases +precision: 7 +lnx011 ln 1.105171 -> 0.1000001 Inexact Rounded +lnx012 ln 1.010050 -> 0.009999835 Inexact Rounded +lnx013 ln 1.000010 -> 0.000009999950 Inexact Rounded +lnx014 ln 1.000001 -> 9.999995E-7 Inexact Rounded +lnx015 ln 1.000000 -> 0 + +-- basic e=0, e=1, e=2, e=4, e>=8 cases +precision: 7 +lnx041 ln 2.718282 -> 1.000000 Inexact Rounded +lnx042 ln 0.3678794 -> -1.000000 Inexact Rounded +lnx043 ln 22026.47 -> 10.00000 Inexact Rounded +lnx044 ln 0.00004539993 -> -10.00000 Inexact Rounded +lnx045 ln 2.688117E+43 -> 100.0000 Inexact Rounded +lnx046 ln 3.720076E-44 -> -100.0000 Inexact Rounded +lnx047 ln Infinity -> Infinity +lnx048 ln 0E-389 -> -Infinity + +-- miscellanea +precision: 16 +lnx055 ln 2.717658486884572E-236 -> -542.4103112874415 Inexact Rounded +precision: 17 +lnx056 ln 2.7176584868845721E-236 -> -542.41031128744146 Inexact Rounded +precision: 18 +lnx057 ln 2.71765848688457211E-236 -> -542.410311287441459 Inexact Rounded +precision: 19 +lnx058 ln 2.717658486884572112E-236 -> -542.4103112874414592 Inexact Rounded +precision: 20 +lnx059 ln 2.7176584868845721118E-236 -> -542.41031128744145917 Inexact Rounded + +-- inputs ending in ..500.., ..499.., ..100.., ..999.. sequences +precision: 50 +lnx102 ln 0.9999999100000040499998785000027 -> -9.0000000000000000000000033749953829996446124861750E-8 Inexact Rounded +precision: 30 +lnx103 ln 0.999999910000004049999878500003 -> -8.99999999999999999999997337499E-8 Inexact Rounded +precision: 29 +lnx104 ln 0.99999991000000404999987850000 -> -9.0000000000000000000002733750E-8 Inexact Rounded +precision: 28 +lnx105 ln 0.9999999100000040499998785000 -> -9.000000000000000000000273375E-8 Inexact Rounded +precision: 27 +lnx106 ln 0.999999910000004049999878500 -> -9.00000000000000000000027338E-8 Inexact Rounded +precision: 26 +lnx107 ln 0.99999991000000404999987850 -> -9.0000000000000000000002734E-8 Inexact Rounded +precision: 25 +lnx108 ln 0.9999999100000040499998785 -> -9.000000000000000000000273E-8 Inexact Rounded +precision: 24 +lnx109 ln 0.999999910000004049999879 -> -8.99999999999999995000027E-8 Inexact Rounded +precision: 23 +lnx110 ln 0.99999991000000404999988 -> -8.9999999999999998500003E-8 Inexact Rounded +precision: 22 +lnx111 ln 0.9999999100000040499999 -> -8.999999999999997850000E-8 Inexact Rounded +precision: 21 +lnx112 ln 0.999999910000004050000 -> -8.99999999999998785000E-8 Inexact Rounded +precision: 20 +lnx113 ln 0.99999991000000405000 -> -8.9999999999999878500E-8 Inexact Rounded +precision: 19 +lnx114 ln 0.9999999100000040500 -> -8.999999999999987850E-8 Inexact Rounded +precision: 18 +lnx115 ln 0.999999910000004050 -> -8.99999999999998785E-8 Inexact Rounded +-- next is a > 0.5ulp case +precision: 17 +lnx116 ln 0.99999991000000405 -> -8.9999999999999879E-8 Inexact Rounded +precision: 16 +lnx117 ln 0.9999999100000040 -> -9.000000004999988E-8 Inexact Rounded +precision: 15 +lnx118 ln 0.999999910000004 -> -9.00000000499999E-8 Inexact Rounded +precision: 14 +lnx119 ln 0.99999991000000 -> -9.0000004050000E-8 Inexact Rounded +precision: 13 +lnx120 ln 0.9999999100000 -> -9.000000405000E-8 Inexact Rounded +precision: 12 +lnx121 ln 0.999999910000 -> -9.00000040500E-8 Inexact Rounded +precision: 11 +lnx122 ln 0.99999991000 -> -9.0000004050E-8 Inexact Rounded +precision: 10 +lnx123 ln 0.9999999100 -> -9.000000405E-8 Inexact Rounded +precision: 9 +lnx124 ln 0.999999910 -> -9.00000041E-8 Inexact Rounded +precision: 8 +lnx125 ln 0.99999991 -> -9.0000004E-8 Inexact Rounded +precision: 7 +lnx126 ln 0.9999999 -> -1.000000E-7 Inexact Rounded +precision: 16 +lnx126b ln 0.9999999 -> -1.000000050000003E-7 Inexact Rounded +precision: 6 +lnx127 ln 0.999999 -> -0.00000100000 Inexact Rounded +precision: 5 +lnx128 ln 0.99999 -> -0.000010000 Inexact Rounded +precision: 4 +lnx129 ln 0.9999 -> -0.0001000 Inexact Rounded +precision: 3 +lnx130 ln 0.999 -> -0.00100 Inexact Rounded +precision: 2 +lnx131 ln 0.99 -> -0.010 Inexact Rounded +precision: 1 +lnx132 ln 0.9 -> -0.1 Inexact Rounded + + +-- cases near 1 -- 1 2345678901234567890 +precision: 20 +lnx401 ln 2.7182818284589365041 -> 0.99999999999996000000 Inexact Rounded +lnx402 ln 2.7182818284589636869 -> 0.99999999999997000000 Inexact Rounded +lnx403 ln 2.7182818284589908697 -> 0.99999999999997999999 Inexact Rounded +lnx404 ln 2.7182818284590180525 -> 0.99999999999998999998 Inexact Rounded +lnx405 ln 2.7182818284590452354 -> 1.0000000000000000000 Inexact Rounded +lnx406 ln 2.7182818284593170635 -> 1.0000000000001000000 Inexact Rounded +lnx407 ln 2.7182818284595888917 -> 1.0000000000002000000 Inexact Rounded +precision: 14 +lnx411 ln 2.7182818284589 -> 0.99999999999995 Inexact Rounded +lnx413 ln 2.7182818284590 -> 0.99999999999998 Inexact Rounded +lnx416 ln 2.7182818284591 -> 1.0000000000000 Inexact Rounded +lnx417 ln 2.7182818284592 -> 1.0000000000001 Inexact Rounded + +-- overflows, including some exp overprecise borderlines +precision: 7 +maxExponent: 384 +minExponent: -383 +lnx709 ln 9.999999E+384 -> 886.4953 Inexact Rounded +lnx711 ln 9.999992E+384 -> 886.4953 Inexact Rounded +precision: 16 +lnx722 ln 9.999999999999999E+384 -> 886.4952608027076 Inexact Rounded +lnx724 ln 9.999999999999917E+384 -> 886.4952608027076 Inexact Rounded +lnx726 ln 9.999999999999117E+384 -> 886.4952608027075 Inexact Rounded +-- and more... +precision: 15 +maxExponent: 999 +minExponent: -999 +lnx731 ln 9.99999999999999E+999 -> 2302.58509299405 Inexact Rounded +lnx732 ln 9.99999999999266E+999 -> 2302.58509299405 Inexact Rounded +lnx733 ln 9.99999999999265E+999 -> 2302.58509299404 Inexact Rounded +lnx734 ln 9.99999999999264E+999 -> 2302.58509299404 Inexact Rounded + +-- subnormals and underflows for exp, including underflow-to-zero edge point +precision: 7 +maxExponent: 384 +minExponent: -383 +lnx751 ln 0E-389 -> -Infinity +lnx758 ln 1.000001E-383 -> -881.8901 Inexact Rounded +lnx759 ln 9.99991E-384 -> -881.8901 Inexact Rounded +lnx760 ln 4.4605E-385 -> -885.0000 Inexact Rounded +lnx761 ln 2.221E-386 -> -887.9999 Inexact Rounded +lnx762 ln 3.01E-387 -> -889.9985 Inexact Rounded +lnx763 ln 1.7E-388 -> -892.8724 Inexact Rounded +lnx764 ln 1.5E-388 -> -892.9976 Inexact Rounded +lnx765 ln 9E-389 -> -893.5084 Inexact Rounded +lnx766 ln 1E-389 -> -895.7056 Inexact Rounded +lnx774 ln 0E-389 -> -Infinity + +-- special values +maxexponent: 999 +minexponent: -999 +lnx820 ln Infinity -> Infinity +lnx821 ln 0 -> -Infinity +lnx822 ln NaN -> NaN +lnx823 ln sNaN -> NaN Invalid_operation +-- propagating NaNs +lnx824 ln sNaN123 -> NaN123 Invalid_operation +lnx825 ln -sNaN321 -> -NaN321 Invalid_operation +lnx826 ln NaN456 -> NaN456 +lnx827 ln -NaN654 -> -NaN654 +lnx828 ln NaN1 -> NaN1 + +-- Invalid operations due to restrictions +-- [next two probably skipped by most test harnesses] +precision: 100000000 +lnx901 ln 1 -> NaN Invalid_context +precision: 99999999 +lnx902 ln 0 -> NaN Invalid_context + +precision: 9 +maxExponent: 1000000 +minExponent: -999999 +lnx903 ln 1 -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999999 +lnx904 ln 0 -> -Infinity +maxExponent: 999999 +minExponent: -1000000 +lnx905 ln 1 -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999998 +lnx906 ln 0 -> -Infinity + +-- +maxExponent: 384 +minExponent: -383 +precision: 16 +rounding: half_even + +-- Null test +lnx900 ln # -> NaN Invalid_operation + + Added: sandbox/trunk/decimal-c/new_dt/log10.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/log10.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,538 @@ +------------------------------------------------------------------------ +-- log10.decTest -- decimal logarithm in base 10 -- +-- Copyright (c) IBM Corporation, 2005. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- This emphasises the testing of notable cases, as they will often +-- have unusual paths (especially the 10**n results). + +extended: 1 +precision: 16 +rounding: half_even +maxExponent: 384 +minexponent: -383 + +-- examples in specification +precision: 9 +logxs000 log10 0 -> -Infinity +logxs001 log10 0.001 -> -3 +logxs002 log10 1 -> 0 +logxs003 log10 2 -> 0.301029996 Inexact Rounded +logxs004 log10 10 -> 1 +logxs005 log10 70 -> 1.84509804 Inexact Rounded +logxs006 log10 +Infinity -> Infinity + + +-- basics (examples in specification, etc.) +precision: 16 +logx0000 log10 0 -> -Infinity +logx0001 log10 7E-1000 -> -999.1549019599857 Inexact Rounded +logx0002 log10 1.1E-9 -> -8.958607314841775 Inexact Rounded +logx0003 log10 0.0007 -> -3.154901959985743 Inexact Rounded +logx0004 log10 0.11 -> -0.9586073148417750 Inexact Rounded +logx0005 log10 0.7 -> -0.1549019599857432 Inexact Rounded +logx0006 log10 1 -> 0 +logx0007 log10 1.5 -> 0.1760912590556812 Inexact Rounded +logx0008 log10 2 -> 0.3010299956639812 Inexact Rounded +logx0009 log10 2.718281828459045 -> 0.4342944819032518 Inexact Rounded +logx0010 log10 2.718281828459046 -> 0.4342944819032519 Inexact Rounded +logx0011 log10 2.718281828459047 -> 0.4342944819032521 Inexact Rounded +logx0012 log10 7 -> 0.8450980400142568 Inexact Rounded +logx0013 log10 10 -> 1 +logx0014 log10 10.5 -> 1.021189299069938 Inexact Rounded +logx0015 log10 11 -> 1.041392685158225 Inexact Rounded +logx0016 log10 70 -> 1.845098040014257 Inexact Rounded +logx0017 log10 9999 -> 3.999956568380192 Inexact Rounded +logx0018 log10 1.21E6 -> 6.082785370316450 Inexact Rounded +logx0019 log10 1.1E+9 -> 9.041392685158225 Inexact Rounded +logx0020 log10 7E+1000 -> 1000.845098040014 Inexact Rounded +logx0021 log10 +Infinity -> Infinity + +-- notable cases +-- negatives +logx0031 log10 -1E-9 -> NaN Invalid_operation +logx0032 log10 -0.0007 -> NaN Invalid_operation +logx0033 log10 -0.1 -> NaN Invalid_operation +logx0034 log10 -0.7 -> NaN Invalid_operation +logx0035 log10 -1 -> NaN Invalid_operation +logx0036 log10 -1.5 -> NaN Invalid_operation +logx0037 log10 -2 -> NaN Invalid_operation +logx0038 log10 -10.5 -> NaN Invalid_operation +logx0039 log10 -10.5 -> NaN Invalid_operation +logx0040 log10 -9999 -> NaN Invalid_operation +logx0041 log10 -10 -> NaN Invalid_operation +logx0042 log10 -0 -> -Infinity +logx0043 log10 -0E+17 -> -Infinity +logx0044 log10 -0E-17 -> -Infinity +-- other zeros +logx0051 log10 0 -> -Infinity +logx0052 log10 0E+17 -> -Infinity +logx0053 log10 0E-17 -> -Infinity +-- infinities +logx0055 log10 -Infinity -> NaN Invalid_operation +logx0056 log10 +Infinity -> Infinity +-- ones +logx0061 log10 1 -> 0 +logx0062 log10 1.0 -> 0 +logx0063 log10 1.000000000000000 -> 0 +logx0064 log10 1.000000000000000000 -> 0 + +-- notable cases -- exact powers of 10 +logx1100 log10 1 -> 0 +logx1101 log10 10 -> 1 +logx1102 log10 100 -> 2 +logx1103 log10 1000 -> 3 +logx1104 log10 10000 -> 4 +logx1105 log10 100000 -> 5 +logx1106 log10 1000000 -> 6 +logx1107 log10 10000000 -> 7 +logx1108 log10 100000000 -> 8 +logx1109 log10 1000000000 -> 9 +logx1110 log10 10000000000 -> 10 +logx1111 log10 100000000000 -> 11 +logx1112 log10 1000000000000 -> 12 +logx1113 log10 0.00000000001 -> -11 +logx1114 log10 0.0000000001 -> -10 +logx1115 log10 0.000000001 -> -9 +logx1116 log10 0.00000001 -> -8 +logx1117 log10 0.0000001 -> -7 +logx1118 log10 0.000001 -> -6 +logx1119 log10 0.00001 -> -5 +logx1120 log10 0.0001 -> -4 +logx1121 log10 0.001 -> -3 +logx1122 log10 0.01 -> -2 +logx1123 log10 0.1 -> -1 +logx1124 log10 1E-99 -> -99 +logx1125 log10 1E-100 -> -100 +logx1126 log10 1E-383 -> -383 + +-- check normally exact cases round properly +precision: 1 +logx1141 log10 10000000000 -> 1E+1 Rounded +logx1142 log10 1000000000000 -> 1E+1 Inexact Rounded +logx1143 log10 1E+100 -> 1E+2 Rounded +logx1144 log10 1E+123 -> 1E+2 Inexact Rounded +logx1145 log10 1E+126 -> 1E+2 Inexact Rounded +logx1146 log10 1E+916 -> 9E+2 Inexact Rounded +logx1147 log10 1E+999 -> 1E+3 Inexact Rounded + +precision: 2 +logx1151 log10 10000000000 -> 10 +logx1152 log10 1000000000000 -> 12 +logx1153 log10 1E+100 -> 1.0E+2 Rounded +logx1154 log10 1E+123 -> 1.2E+2 Inexact Rounded +logx1155 log10 1E+126 -> 1.3E+2 Inexact Rounded +logx1156 log10 1E+916 -> 9.2E+2 Inexact Rounded +logx1157 log10 1E+999 -> 1.0E+3 Inexact Rounded +-- some half-way point rounds, other cases, and negatives +logx1158 log10 1E+125 -> 1.2E+2 Inexact Rounded +logx1159 log10 1E+135 -> 1.4E+2 Inexact Rounded +logx1160 log10 1E+129 -> 1.3E+2 Inexact Rounded +logx1161 log10 1E+131 -> 1.3E+2 Inexact Rounded +logx1162 log10 1E-123 -> -1.2E+2 Inexact Rounded +logx1163 log10 1E-126 -> -1.3E+2 Inexact Rounded +logx1164 log10 1E-916 -> -9.2E+2 Inexact Rounded +logx1165 log10 1E-999 -> -1.0E+3 Inexact Rounded +logx1166 log10 1E-125 -> -1.2E+2 Inexact Rounded +logx1167 log10 1E-135 -> -1.4E+2 Inexact Rounded +logx1168 log10 1E-129 -> -1.3E+2 Inexact Rounded +logx1169 log10 1E-131 -> -1.3E+2 Inexact Rounded + +precision: 3 +logx1171 log10 10000000000 -> 10 +logx1172 log10 1000000000000 -> 12 +logx1173 log10 1E+100 -> 100 +logx1174 log10 1E+123 -> 123 +logx1175 log10 1E+126 -> 126 +logx1176 log10 1E+916 -> 916 +logx1177 log10 1E+999 -> 999 + +-- log10(2) .. tests both ln(2) and ln(10) constants, too +precision: 50 +logx1201 log10 2 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded +logx1202 log10 2.000 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded +logx1203 log10 0.2E1 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded +precision: 49 +logx1204 log10 2 -> 0.3010299956639811952137388947244930267681898814621 Inexact Rounded +precision: 48 +logx1205 log10 2 -> 0.301029995663981195213738894724493026768189881462 Inexact Rounded +precision: 47 +logx1206 log10 2 -> 0.30102999566398119521373889472449302676818988146 Inexact Rounded +precision: 46 +logx1207 log10 2 -> 0.3010299956639811952137388947244930267681898815 Inexact Rounded +precision: 45 +logx1208 log10 2 -> 0.301029995663981195213738894724493026768189881 Inexact Rounded +precision: 44 +logx1209 log10 2 -> 0.30102999566398119521373889472449302676818988 Inexact Rounded +precision: 43 +logx1210 log10 2 -> 0.3010299956639811952137388947244930267681899 Inexact Rounded +precision: 42 +logx1211 log10 2 -> 0.301029995663981195213738894724493026768190 Inexact Rounded +precision: 41 +logx1212 log10 2 -> 0.30102999566398119521373889472449302676819 Inexact Rounded +precision: 40 +logx1213 log10 2 -> 0.3010299956639811952137388947244930267682 Inexact Rounded +precision: 39 +logx1214 log10 2 -> 0.301029995663981195213738894724493026768 Inexact Rounded +precision: 38 +logx1215 log10 2 -> 0.30102999566398119521373889472449302677 Inexact Rounded +precision: 37 +logx1216 log10 2 -> 0.3010299956639811952137388947244930268 Inexact Rounded +precision: 36 +logx1217 log10 2 -> 0.301029995663981195213738894724493027 Inexact Rounded +precision: 35 +logx1218 log10 2 -> 0.30102999566398119521373889472449303 Inexact Rounded +precision: 34 +logx1219 log10 2 -> 0.3010299956639811952137388947244930 Inexact Rounded +precision: 33 +logx1220 log10 2 -> 0.301029995663981195213738894724493 Inexact Rounded +precision: 32 +logx1221 log10 2 -> 0.30102999566398119521373889472449 Inexact Rounded +precision: 31 +logx1222 log10 2 -> 0.3010299956639811952137388947245 Inexact Rounded +precision: 30 +logx1223 log10 2 -> 0.301029995663981195213738894724 Inexact Rounded +precision: 29 +logx1224 log10 2 -> 0.30102999566398119521373889472 Inexact Rounded +precision: 28 +logx1225 log10 2 -> 0.3010299956639811952137388947 Inexact Rounded +precision: 27 +logx1226 log10 2 -> 0.301029995663981195213738895 Inexact Rounded +precision: 26 +logx1227 log10 2 -> 0.30102999566398119521373889 Inexact Rounded +precision: 25 +logx1228 log10 2 -> 0.3010299956639811952137389 Inexact Rounded +precision: 24 +logx1229 log10 2 -> 0.301029995663981195213739 Inexact Rounded +precision: 23 +logx1230 log10 2 -> 0.30102999566398119521374 Inexact Rounded +precision: 22 +logx1231 log10 2 -> 0.3010299956639811952137 Inexact Rounded +precision: 21 +logx1232 log10 2 -> 0.301029995663981195214 Inexact Rounded +precision: 20 +logx1233 log10 2 -> 0.30102999566398119521 Inexact Rounded +precision: 19 +logx1234 log10 2 -> 0.3010299956639811952 Inexact Rounded +precision: 18 +logx1235 log10 2 -> 0.301029995663981195 Inexact Rounded +precision: 17 +logx1236 log10 2 -> 0.30102999566398120 Inexact Rounded +precision: 16 +logx1237 log10 2 -> 0.3010299956639812 Inexact Rounded +precision: 15 +logx1238 log10 2 -> 0.301029995663981 Inexact Rounded +precision: 14 +logx1239 log10 2 -> 0.30102999566398 Inexact Rounded +precision: 13 +logx1240 log10 2 -> 0.3010299956640 Inexact Rounded +precision: 12 +logx1241 log10 2 -> 0.301029995664 Inexact Rounded +precision: 11 +logx1242 log10 2 -> 0.30102999566 Inexact Rounded +precision: 10 +logx1243 log10 2 -> 0.3010299957 Inexact Rounded +precision: 9 +logx1244 log10 2 -> 0.301029996 Inexact Rounded +precision: 8 +logx1245 log10 2 -> 0.30103000 Inexact Rounded +precision: 7 +logx1246 log10 2 -> 0.3010300 Inexact Rounded +precision: 6 +logx1247 log10 2 -> 0.301030 Inexact Rounded +precision: 5 +logx1248 log10 2 -> 0.30103 Inexact Rounded +precision: 4 +logx1249 log10 2 -> 0.3010 Inexact Rounded +precision: 3 +logx1250 log10 2 -> 0.301 Inexact Rounded +precision: 2 +logx1251 log10 2 -> 0.30 Inexact Rounded +precision: 1 +logx1252 log10 2 -> 0.3 Inexact Rounded + +maxExponent: 384 +minExponent: -383 +precision: 16 +rounding: half_even + +-- More close-to-e, etc., tests +precision: 34 +logx1301 log10 2.718281828459045235360287471352661 -> 0.4342944819032518276511289189166048 Inexact Rounded +logx1302 log10 2.718281828459045235360287471352662 -> 0.4342944819032518276511289189166050 Inexact Rounded +logx1303 log10 2.718281828459045235360287471352663 -> 0.4342944819032518276511289189166052 Inexact Rounded +logx1304 log10 0.99999999999999999999999999999999 -> -4.342944819032518276511289189166073E-33 Inexact Rounded +logx1305 log10 0.999999999999999999999999999999999 -> -4.342944819032518276511289189166053E-34 Inexact Rounded +logx1306 log10 0.9999999999999999999999999999999999 -> -4.342944819032518276511289189166051E-35 Inexact Rounded +logx1307 log10 1.000000000000000000000000000000000 -> 0 +logx1308 log10 1.0000000000000000000000000000000001 -> 4.342944819032518276511289189166051E-35 Inexact Rounded +logx1309 log10 1.000000000000000000000000000000001 -> 4.342944819032518276511289189166049E-34 Inexact Rounded +logx1310 log10 1.00000000000000000000000000000001 -> 4.342944819032518276511289189166029E-33 Inexact Rounded +-- lower p +precision: 7 +logx1320 log10 0.999999 -> -4.342947E-7 Inexact Rounded +logx1321 log10 0.9999999 -> -4.342945E-8 Inexact Rounded +logx1322 log10 0.99999999 -> -4.342945E-9 Inexact Rounded +logx1323 log10 0.999999999 -> -4.342945E-10 Inexact Rounded +logx1324 log10 1.00000000 -> 0 +logx1325 log10 1.00000001 -> 4.342945E-9 Inexact Rounded +logx1326 log10 1.0000001 -> 4.342945E-8 Inexact Rounded +logx1327 log10 1.000001 -> 4.342943E-7 Inexact Rounded + +-- near 10^3 +precision: 9 +logx1331 log10 999.9999998 -> 3.00000000 Inexact Rounded +logx1332 log10 999.9999999 -> 3.00000000 Inexact Rounded +logx1333 log10 1000.000000 -> 3 +logx1334 log10 1000.000001 -> 3.00000000 Inexact Rounded +logx1335 log10 1000.000002 -> 3.00000000 Inexact Rounded +precision: 16 +logx1341 log10 999.9999998 -> 2.999999999913141 Inexact Rounded +logx1342 log10 999.9999999 -> 2.999999999956571 Inexact Rounded +logx1343 log10 1000.000000 -> 3 +logx1344 log10 1000.000001 -> 3.000000000434294 Inexact Rounded +logx1345 log10 1000.000002 -> 3.000000000868589 Inexact Rounded + +-- suggestions from Ilan Nehama +logx1400 log10 10E-3 -> -2 +logx1401 log10 10E-2 -> -1 +logx1402 log10 100E-2 -> 0 +logx1403 log10 1000E-2 -> 1 +logx1404 log10 10000E-2 -> 2 +logx1405 log10 10E-1 -> 0 +logx1406 log10 100E-1 -> 1 +logx1407 log10 1000E-1 -> 2 +logx1408 log10 10000E-1 -> 3 +logx1409 log10 10E0 -> 1 +logx1410 log10 100E0 -> 2 +logx1411 log10 1000E0 -> 3 +logx1412 log10 10000E0 -> 4 +logx1413 log10 10E1 -> 2 +logx1414 log10 100E1 -> 3 +logx1415 log10 1000E1 -> 4 +logx1416 log10 10000E1 -> 5 +logx1417 log10 10E2 -> 3 +logx1418 log10 100E2 -> 4 +logx1419 log10 1000E2 -> 5 +logx1420 log10 10000E2 -> 6 + +-- Randoms +-- P=50, within 0-9999 +Precision: 50 +logx2501 log10 0.00035448001667968141775891246991912655961163345904 -> -3.4504082425411775290864053318247274944685586188505 Inexact Rounded +logx2502 log10 70.636455726424311228255338637935330826995136597644 -> 1.8490288998408492045793070255302335558140975719247 Inexact Rounded +logx2503 log10 0.00000000000000233550362473821889060812804063040169 -> -14.631619454343834858023578299142866557717904223667 Inexact Rounded +logx2504 log10 97.783628621523244679901260358286898958832135433764 -> 1.9902661493224219517897657964362571690592734407330 Inexact Rounded +logx2505 log10 0062.2377135315858392802612812022807838599572017342 -> 1.7940536293085066199287632725026837018486533544141 Inexact Rounded +logx2506 log10 6.3767634652071053619977602804724129652981747879532 -> 0.80460030789825961615100163576080761326857374098644 Inexact Rounded +logx2507 log10 63.297088981313278529306533814195068850532666658798 -> 1.8013837373724427092417170149098614410849353839673 Inexact Rounded +logx2508 log10 0.00000077239693316881797717820110898167721602299187 -> -6.1121594592718550613773886241951966264826760310047 Inexact Rounded +logx2509 log10 0.00000003953580359780185534830572461922527831395002 -> -7.4030094293833847136252547069905477213541787177561 Inexact Rounded +logx2510 log10 754.62905817369989169188998111527272688791544577204 -> 2.8777335243761300047758534304371912099958057545416 Inexact Rounded +logx2511 log10 0.00000048360378410241428936607147056283282849158312 -> -6.3155103095309353457604038397980091650760346334512 Inexact Rounded +logx2512 log10 0.00007509037583645612577196104591672080542932166089 -> -4.1244157219700166314012344705538088030592896111026 Inexact Rounded +logx2513 log10 0.00000000000705475944638915053419839063567898092064 -> -11.151517790256466048553810002525868198178167950377 Inexact Rounded +logx2514 log10 9.6210300460497657917445410947099633479609165120661 -> 0.98322157093260978206633922877716078683518617768411 Inexact Rounded +logx2515 log10 0.00000000050150361386555527496607245976120864985611 -> -9.2997259330798261040411086835563234390934934629340 Inexact Rounded +logx2516 log10 098.24754029731994125797723545333677604490074810751 -> 1.9923216862874337077795278629351060819105679670633 Inexact Rounded +logx2517 log10 7.5091998150046994320441463854301624742491015752980 -> 0.87559366078005924080766469158763499725414024128781 Inexact Rounded +logx2518 log10 0.00000000000079540571273330075193668596942268542425 -> -12.099411294165176028817305108475326325006250936963 Inexact Rounded +logx2519 log10 0.00000042395034799555215782907515074134154915491701 -> -6.3726850039125381134069450802108893075604464135297 Inexact Rounded +logx2520 log10 56.683376304674355481905023145238799909301732694982 -> 1.7534557107853480435703421826077606250636580091754 Inexact Rounded +logx2521 log10 48.734033811444195070807606721517169810438049581227 -> 1.6878323602741065190942654710049433808208291564049 Inexact Rounded +logx2522 log10 0.00074830310930046865009851706989430228561880221063 -> -3.1259224502209974082223667712016445572431791920618 Inexact Rounded +logx2523 log10 36.677348885111593384020836720396262497122708598359 -> 1.5643979364260796086754530282302605477567469395425 Inexact Rounded +logx2524 log10 0.00000000000000004495678560480432858812419145833744 -> -16.347204748239740510014320630363244015916029619561 Inexact Rounded +logx2525 log10 9509.5854013650642799374159131940108748594774307104 -> 3.9781615829916326741100166519726824430945406302661 Inexact Rounded +logx2526 log10 0.07834891268689177014044454793608715276615743819097 -> -1.1059670262197643147805517398621288897669876996348 Inexact Rounded +logx2527 log10 0.00000029584529880706128444454688454999032801904794 -> -6.5289353275814043710076526920566721570375026917206 Inexact Rounded +logx2528 log10 3.0713496544497618098794332787772186176981011904294 -> 0.48732926103896828546424341029492468100431414072994 Inexact Rounded +logx2529 log10 352.66392670788816474407442785460803833927136413943 -> 2.5473610388199562714709836398243933320284077008314 Inexact Rounded +logx2530 log10 0.00304743125181876267210516527361742185617091801650 -> -2.5160660830163981967774124745311497447050056400207 Inexact Rounded +logx2531 log10 0.00000076120535894952136499250364604538117729437183 -> -6.1184981629047051532448413863950776496652483019415 Inexact Rounded +logx2532 log10 769.88795978534353052965286195053735007473187735815 -> 2.8864275277862652709986498581064117950288798222100 Inexact Rounded +logx2533 log10 0.00000000000000041297494808612226304619570016336188 -> -15.384076292745415917510668454361868659468669804710 Inexact Rounded +logx2534 log10 860.88864595714426940247940960258558876903741966974 -> 2.9349469800554277915920278090647283233440859155176 Inexact Rounded +logx2535 log10 5839.0328812994787235900178587371051096898683972444 -> 3.7663409208972392569269125539438874737147906238543 Inexact Rounded +logx2536 log10 0.00000028532710151284840471670497112821201598377841 -> -6.5446569753514027675878879843238065488490618159490 Inexact Rounded +logx2537 log10 0.00000000000000009734490059931638483445631835651581 -> -16.011686794011271135978633880864278692254243106931 Inexact Rounded +logx2538 log10 5.8610949526439529489252302463450302981511714144330 -> 0.76797875722452549281028552067645732490929361952278 Inexact Rounded +logx2539 log10 6.6282432221115923372151148990137179611977576327206 -> 0.82139843639227213211012044000785757267155736071361 Inexact Rounded +logx2540 log10 0.00000000001994071862386846626954819923923344413454 -> -10.700259194632339980266559224447212260115021637626 Inexact Rounded + +-- P=34, within 0-9999 +Precision: 34 +logx2201 log10 1.522513203889714179088327328864183 -> 0.1825610677098896250496651330492109 Inexact Rounded +logx2202 log10 0.171123774769717316154080888930404 -> -0.7666896483548462582461898092764408 Inexact Rounded +logx2203 log10 0.0000000997467236251714283104963838 -> -7.001101360652518274271569010312115 Inexact Rounded +logx2204 log10 0.0008856103624122479769647543468633 -> -3.052757310476070891830490327138190 Inexact Rounded +logx2205 log10 1.938274868738032930709498221236758 -> 0.2874153648259449520201536171714594 Inexact Rounded +logx2206 log10 479.5667847823826713082613445010097 -> 2.680849095850361068709165157286435 Inexact Rounded +logx2207 log10 8856.136599178820202141823157336804 -> 3.947244306584767101480454261950559 Inexact Rounded +logx2208 log10 0.0000911026318801903982642871344858 -> -4.040469076434979398438617464033826 Inexact Rounded +logx2209 log10 0.0000000000017271112650427414732630 -> -11.76267968314038748995178212654921 Inexact Rounded +logx2210 log10 6.962605370078885647639503548229695 -> 0.8427717807200322352686396925992250 Inexact Rounded +logx2211 log10 0.3354804428992793132855923541692781 -> -0.4743327923012159170967636070844834 Inexact Rounded +logx2212 log10 2.079864257474859008252165836663504 -> 0.3180349916198059046812506741388856 Inexact Rounded +logx2213 log10 2805.479529292939499220276986621988 -> 3.448007104139974344565978780624744 Inexact Rounded +logx2214 log10 66.45731133034187374557028537213949 -> 1.822542767005644041661520936223086 Inexact Rounded +logx2215 log10 0.0000001206521261762681738274822835 -> -6.918465020390216969561494755767318 Inexact Rounded +logx2216 log10 0.0000000001884891916264401160472381 -> -9.724713548119065386091933007528633 Inexact Rounded +logx2217 log10 0.0000015467279551726326581314582759 -> -5.810586065070435383755759514608738 Inexact Rounded +logx2218 log10 0.0090776316728068586744633914135952 -> -2.042027442843745884503280954390114 Inexact Rounded +logx2219 log10 0.0000000000024541106528713393740030 -> -11.61010585935635713090119156069479 Inexact Rounded +logx2220 log10 14.12936879385863410081087750645856 -> 1.150122760895466989841057385742662 Inexact Rounded +logx2221 log10 0.0000036912481831392922922647231392 -> -5.432826753789892283556211380824203 Inexact Rounded +logx2222 log10 0.0000000004067477525420424270138734 -> -9.390674838050073122857868012475060 Inexact Rounded +logx2223 log10 7080.122562705399744969319589806194 -> 3.850040775747103318724330047546916 Inexact Rounded +logx2224 log10 261.3491411363679209175524790255725 -> 2.417221077227536319655699517530855 Inexact Rounded +logx2225 log10 003.9945581449915240094728380041494 -> 0.6014687471531988260823066997845691 Inexact Rounded +logx2226 log10 0.0000000000583549164588495206767840 -> -10.23392254834182677023231713519341 Inexact Rounded +logx2227 log10 9567.961832607240278342761088487484 -> 3.980819434211107631569386147016368 Inexact Rounded +logx2228 log10 06.26592979160342972777219828867033 -> 0.7969855243966221408595024012574729 Inexact Rounded +logx2229 log10 0.0000000000589847046598067273287319 -> -10.22926059078206218717755253582907 Inexact Rounded +logx2230 log10 567.9388648235589204769442863724997 -> 2.754301589058313576472380262907638 Inexact Rounded +logx2231 log10 039.7790325480037778918162264883415 -> 1.599654216592019199639285308997886 Inexact Rounded +logx2232 log10 0.0000000005123951921894162149817207 -> -9.290394953898862694847327137242690 Inexact Rounded +logx2233 log10 0.0000000000038500999723636904276723 -> -11.41452799337924056186867324854691 Inexact Rounded +logx2234 log10 0.0006726500658977759825616537935864 -> -3.172210810922768725687671849421792 Inexact Rounded +logx2235 log10 260.2400250475967528429943779126507 -> 2.415374092073799204236801383070064 Inexact Rounded +logx2236 log10 0.0000000006101942339385102585042548 -> -9.214531900562046557191261226632509 Inexact Rounded +logx2237 log10 0.0000000010846867501382746760066557 -> -8.964695664883282406359874242387236 Inexact Rounded +logx2238 log10 60.24078375568814769010333711509928 -> 1.779890613567084253168373266648922 Inexact Rounded +logx2239 log10 0.0012058738711757669337600252986093 -> -2.918698115012605915753728220896010 Inexact Rounded +logx2240 log10 230.9450930197841600611503095185600 -> 2.363508739056822846742942599628966 Inexact Rounded + +-- P=16, within 0-999 +Precision: 16 +logx2101 log10 0.0072067119605184 -> -2.142262835573038 Inexact Rounded +logx2102 log10 503.6828482226624 -> 2.702157162195652 Inexact Rounded +logx2103 log10 64.96074447821815 -> 1.812650993464174 Inexact Rounded +logx2104 log10 48.75408597467246 -> 1.688011018842600 Inexact Rounded +logx2105 log10 0.0329009839269587 -> -1.482791113975280 Inexact Rounded +logx2106 log10 223.5320415060633 -> 2.349339784523410 Inexact Rounded +logx2107 log10 73.12765002292194 -> 1.864081617476268 Inexact Rounded +logx2108 log10 487.3749378358509 -> 2.687863192802252 Inexact Rounded +logx2109 log10 0.0000019671987621 -> -5.706151757557926 Inexact Rounded +logx2110 log10 0.0570680660609784 -> -1.243606844697873 Inexact Rounded +logx2111 log10 33.10311638788998 -> 1.519868880976773 Inexact Rounded +logx2112 log10 0.0687382699187077 -> -1.162801402868185 Inexact Rounded +logx2113 log10 258.9416193626484 -> 2.413201859654145 Inexact Rounded +logx2114 log10 0.0005306100136736 -> -3.275224558269725 Inexact Rounded +logx2115 log10 65.78490393408572 -> 1.818126244825109 Inexact Rounded +logx2116 log10 504.2328842073510 -> 2.702631165346958 Inexact Rounded +logx2117 log10 9.417432755815027 -> 0.9739325278524503 Inexact Rounded +logx2118 log10 006.7054835355498 -> 0.8264301004947640 Inexact Rounded +logx2119 log10 0.0917012272363915 -> -1.037624852133399 Inexact Rounded +logx2120 log10 5.959404385244921 -> 0.7752028561953401 Inexact Rounded +logx2121 log10 0.0001209759148486 -> -3.917301084968903 Inexact Rounded +logx2122 log10 0.0004706112139838 -> -3.327337728428039 Inexact Rounded +logx2123 log10 0.0069700457377046 -> -2.156764372035771 Inexact Rounded +logx2124 log10 0.5155584569852619 -> -0.2877220847805025 Inexact Rounded +logx2125 log10 88.06005885607414 -> 1.944778971389913 Inexact Rounded +logx2126 log10 0.0448240038219866 -> -1.348489353509709 Inexact Rounded +logx2127 log10 3.419622484059565 -> 0.5339781639101145 Inexact Rounded +logx2128 log10 5.171123353858721 -> 0.7135848977142854 Inexact Rounded +logx2129 log10 0.0002133188319807 -> -3.670970802945872 Inexact Rounded +logx2130 log10 46.21086703136966 -> 1.664744117045149 Inexact Rounded +logx2131 log10 0.0000631053714415 -> -4.199933672639880 Inexact Rounded +logx2132 log10 78.66019196870698 -> 1.895755001962469 Inexact Rounded +logx2133 log10 0.0007152278351188 -> -3.145555592082297 Inexact Rounded +logx2134 log10 45.52509819928536 -> 1.658250891256892 Inexact Rounded +logx2135 log10 0.0000703227795740 -> -4.152903971697183 Inexact Rounded +logx2136 log10 26.24438641426669 -> 1.419036423550599 Inexact Rounded +logx2137 log10 0.0000044654829535 -> -5.350131564166817 Inexact Rounded +logx2138 log10 0.7360702733062529 -> -0.1330807211893611 Inexact Rounded +logx2139 log10 8.417059176469655 -> 0.9251603805112778 Inexact Rounded +logx2140 log10 0.0002926570767968 -> -3.533640969664818 Inexact Rounded + +-- P=7, within 0-99 +Precision: 7 +logx2001 log10 57.26089 -> 1.757858 Inexact Rounded +logx2002 log10 0.0575421 -> -1.240014 Inexact Rounded +logx2003 log10 0.5918465 -> -0.2277909 Inexact Rounded +logx2004 log10 0.0068776 -> -2.162563 Inexact Rounded +logx2005 log10 0.0066833 -> -2.175009 Inexact Rounded +logx2006 log10 9.926963 -> 0.9968164 Inexact Rounded +logx2007 log10 0.0041852 -> -2.378284 Inexact Rounded +logx2008 log10 84.15412 -> 1.925075 Inexact Rounded +logx2009 log10 2.466856 -> 0.3921438 Inexact Rounded +logx2010 log10 0.0058047 -> -2.236220 Inexact Rounded +logx2011 log10 9.885154 -> 0.9949834 Inexact Rounded +logx2012 log10 0.6667654 -> -0.1760269 Inexact Rounded +logx2013 log10 34.65736 -> 1.539795 Inexact Rounded +logx2014 log10 0.0026884 -> -2.570506 Inexact Rounded +logx2015 log10 0.0432767 -> -1.363746 Inexact Rounded +logx2016 log10 66.01407 -> 1.819637 Inexact Rounded +logx2017 log10 0.0070572 -> -2.151368 Inexact Rounded +logx2018 log10 0.0731613 -> -1.135719 Inexact Rounded +logx2019 log10 9.838983 -> 0.9929502 Inexact Rounded +logx2020 log10 15.89696 -> 1.201314 Inexact Rounded +logx2021 log10 8.459247 -> 0.9273317 Inexact Rounded +logx2022 log10 0.0010873 -> -2.963651 Inexact Rounded +logx2023 log10 0.6498619 -> -0.1871789 Inexact Rounded +logx2024 log10 0.0847008 -> -1.072112 Inexact Rounded +logx2025 log10 0.0075489 -> -2.122116 Inexact Rounded +logx2026 log10 51.11152 -> 1.708519 Inexact Rounded +logx2027 log10 0.7233866 -> -0.1406295 Inexact Rounded +logx2028 log10 2.254721 -> 0.3530928 Inexact Rounded +logx2029 log10 6.568444 -> 0.8174625 Inexact Rounded +logx2030 log10 83.72639 -> 1.922862 Inexact Rounded +logx2031 log10 6.720585 -> 0.8274071 Inexact Rounded +logx2032 log10 87.90366 -> 1.944007 Inexact Rounded +logx2033 log10 0.0433324 -> -1.363187 Inexact Rounded +logx2034 log10 34.63912 -> 1.539567 Inexact Rounded +logx2035 log10 0.8089059 -> -0.09210200 Inexact Rounded +logx2036 log10 7.793405 -> 0.8917272 Inexact Rounded +logx2037 log10 0.0041757 -> -2.379271 Inexact Rounded +logx2038 log10 7.135417 -> 0.8534194 Inexact Rounded +logx2039 log10 12.49570 -> 1.096761 Inexact Rounded +logx2040 log10 6.356276 -> 0.8032027 Inexact Rounded + +-------- +maxExponent: 384 +minExponent: -383 +precision: 16 +rounding: half_even + +-- Invalid operations due to restrictions +-- [next two probably skipped by most test harnesses] +precision: 100000000 +logx901 log10 1 -> NaN Invalid_context +precision: 99999999 +logx902 log10 0 -> NaN Invalid_context + +precision: 9 +maxExponent: 1000000 +minExponent: -999999 +logx903 log10 1 -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999999 +logx904 log10 0 -> -Infinity +maxExponent: 999999 +minExponent: -1000000 +logx905 log10 1 -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999998 +logx906 log10 0 -> -Infinity + +-- Null test +logx900 log10 # -> NaN Invalid_operation + + Added: sandbox/trunk/decimal-c/new_dt/max.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/max.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,403 @@ +------------------------------------------------------------------------ +-- max.decTest -- decimal maximum -- +-- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- sanity checks +maxx001 max -2 -2 -> -2 +maxx002 max -2 -1 -> -1 +maxx003 max -2 0 -> 0 +maxx004 max -2 1 -> 1 +maxx005 max -2 2 -> 2 +maxx006 max -1 -2 -> -1 +maxx007 max -1 -1 -> -1 +maxx008 max -1 0 -> 0 +maxx009 max -1 1 -> 1 +maxx010 max -1 2 -> 2 +maxx011 max 0 -2 -> 0 +maxx012 max 0 -1 -> 0 +maxx013 max 0 0 -> 0 +maxx014 max 0 1 -> 1 +maxx015 max 0 2 -> 2 +maxx016 max 1 -2 -> 1 +maxx017 max 1 -1 -> 1 +maxx018 max 1 0 -> 1 +maxx019 max 1 1 -> 1 +maxx020 max 1 2 -> 2 +maxx021 max 2 -2 -> 2 +maxx022 max 2 -1 -> 2 +maxx023 max 2 0 -> 2 +maxx025 max 2 1 -> 2 +maxx026 max 2 2 -> 2 + +-- extended zeros +maxx030 max 0 0 -> 0 +maxx031 max 0 -0 -> 0 +maxx032 max 0 -0.0 -> 0 +maxx033 max 0 0.0 -> 0 +maxx034 max -0 0 -> 0 -- note: -0 = 0, but 0 chosen +maxx035 max -0 -0 -> -0 +maxx036 max -0 -0.0 -> -0.0 +maxx037 max -0 0.0 -> 0.0 +maxx038 max 0.0 0 -> 0 +maxx039 max 0.0 -0 -> 0.0 +maxx040 max 0.0 -0.0 -> 0.0 +maxx041 max 0.0 0.0 -> 0.0 +maxx042 max -0.0 0 -> 0 +maxx043 max -0.0 -0 -> -0.0 +maxx044 max -0.0 -0.0 -> -0.0 +maxx045 max -0.0 0.0 -> 0.0 + +maxx050 max -0E1 0E1 -> 0E+1 +maxx051 max -0E2 0E2 -> 0E+2 +maxx052 max -0E2 0E1 -> 0E+1 +maxx053 max -0E1 0E2 -> 0E+2 +maxx054 max 0E1 -0E1 -> 0E+1 +maxx055 max 0E2 -0E2 -> 0E+2 +maxx056 max 0E2 -0E1 -> 0E+2 +maxx057 max 0E1 -0E2 -> 0E+1 + +maxx058 max 0E1 0E1 -> 0E+1 +maxx059 max 0E2 0E2 -> 0E+2 +maxx060 max 0E2 0E1 -> 0E+2 +maxx061 max 0E1 0E2 -> 0E+2 +maxx062 max -0E1 -0E1 -> -0E+1 +maxx063 max -0E2 -0E2 -> -0E+2 +maxx064 max -0E2 -0E1 -> -0E+1 +maxx065 max -0E1 -0E2 -> -0E+1 + +-- Specials +precision: 9 +maxx090 max Inf -Inf -> Infinity +maxx091 max Inf -1000 -> Infinity +maxx092 max Inf -1 -> Infinity +maxx093 max Inf -0 -> Infinity +maxx094 max Inf 0 -> Infinity +maxx095 max Inf 1 -> Infinity +maxx096 max Inf 1000 -> Infinity +maxx097 max Inf Inf -> Infinity +maxx098 max -1000 Inf -> Infinity +maxx099 max -Inf Inf -> Infinity +maxx100 max -1 Inf -> Infinity +maxx101 max -0 Inf -> Infinity +maxx102 max 0 Inf -> Infinity +maxx103 max 1 Inf -> Infinity +maxx104 max 1000 Inf -> Infinity +maxx105 max Inf Inf -> Infinity + +maxx120 max -Inf -Inf -> -Infinity +maxx121 max -Inf -1000 -> -1000 +maxx122 max -Inf -1 -> -1 +maxx123 max -Inf -0 -> -0 +maxx124 max -Inf 0 -> 0 +maxx125 max -Inf 1 -> 1 +maxx126 max -Inf 1000 -> 1000 +maxx127 max -Inf Inf -> Infinity +maxx128 max -Inf -Inf -> -Infinity +maxx129 max -1000 -Inf -> -1000 +maxx130 max -1 -Inf -> -1 +maxx131 max -0 -Inf -> -0 +maxx132 max 0 -Inf -> 0 +maxx133 max 1 -Inf -> 1 +maxx134 max 1000 -Inf -> 1000 +maxx135 max Inf -Inf -> Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +maxx141 max NaN -Inf -> -Infinity +maxx142 max NaN -1000 -> -1000 +maxx143 max NaN -1 -> -1 +maxx144 max NaN -0 -> -0 +maxx145 max NaN 0 -> 0 +maxx146 max NaN 1 -> 1 +maxx147 max NaN 1000 -> 1000 +maxx148 max NaN Inf -> Infinity +maxx149 max NaN NaN -> NaN +maxx150 max -Inf NaN -> -Infinity +maxx151 max -1000 NaN -> -1000 +maxx152 max -1 NaN -> -1 +maxx153 max -0 NaN -> -0 +maxx154 max 0 NaN -> 0 +maxx155 max 1 NaN -> 1 +maxx156 max 1000 NaN -> 1000 +maxx157 max Inf NaN -> Infinity + +maxx161 max sNaN -Inf -> NaN Invalid_operation +maxx162 max sNaN -1000 -> NaN Invalid_operation +maxx163 max sNaN -1 -> NaN Invalid_operation +maxx164 max sNaN -0 -> NaN Invalid_operation +maxx165 max sNaN 0 -> NaN Invalid_operation +maxx166 max sNaN 1 -> NaN Invalid_operation +maxx167 max sNaN 1000 -> NaN Invalid_operation +maxx168 max sNaN NaN -> NaN Invalid_operation +maxx169 max sNaN sNaN -> NaN Invalid_operation +maxx170 max NaN sNaN -> NaN Invalid_operation +maxx171 max -Inf sNaN -> NaN Invalid_operation +maxx172 max -1000 sNaN -> NaN Invalid_operation +maxx173 max -1 sNaN -> NaN Invalid_operation +maxx174 max -0 sNaN -> NaN Invalid_operation +maxx175 max 0 sNaN -> NaN Invalid_operation +maxx176 max 1 sNaN -> NaN Invalid_operation +maxx177 max 1000 sNaN -> NaN Invalid_operation +maxx178 max Inf sNaN -> NaN Invalid_operation +maxx179 max NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +maxx181 max NaN9 -Inf -> -Infinity +maxx182 max NaN8 9 -> 9 +maxx183 max -NaN7 Inf -> Infinity + +maxx184 max -NaN1 NaN11 -> -NaN1 +maxx185 max NaN2 NaN12 -> NaN2 +maxx186 max -NaN13 -NaN7 -> -NaN13 +maxx187 max NaN14 -NaN5 -> NaN14 + +maxx188 max -Inf NaN4 -> -Infinity +maxx189 max -9 -NaN3 -> -9 +maxx190 max Inf NaN2 -> Infinity + +maxx191 max sNaN99 -Inf -> NaN99 Invalid_operation +maxx192 max sNaN98 -1 -> NaN98 Invalid_operation +maxx193 max -sNaN97 NaN -> -NaN97 Invalid_operation +maxx194 max sNaN96 sNaN94 -> NaN96 Invalid_operation +maxx195 max NaN95 sNaN93 -> NaN93 Invalid_operation +maxx196 max -Inf sNaN92 -> NaN92 Invalid_operation +maxx197 max 0 sNaN91 -> NaN91 Invalid_operation +maxx198 max Inf -sNaN90 -> -NaN90 Invalid_operation +maxx199 max NaN sNaN89 -> NaN89 Invalid_operation + +-- rounding checks +maxexponent: 999 +minexponent: -999 +precision: 9 +maxx201 max 12345678000 1 -> 1.23456780E+10 Rounded +maxx202 max 1 12345678000 -> 1.23456780E+10 Rounded +maxx203 max 1234567800 1 -> 1.23456780E+9 Rounded +maxx204 max 1 1234567800 -> 1.23456780E+9 Rounded +maxx205 max 1234567890 1 -> 1.23456789E+9 Rounded +maxx206 max 1 1234567890 -> 1.23456789E+9 Rounded +maxx207 max 1234567891 1 -> 1.23456789E+9 Inexact Rounded +maxx208 max 1 1234567891 -> 1.23456789E+9 Inexact Rounded +maxx209 max 12345678901 1 -> 1.23456789E+10 Inexact Rounded +maxx210 max 1 12345678901 -> 1.23456789E+10 Inexact Rounded +maxx211 max 1234567896 1 -> 1.23456790E+9 Inexact Rounded +maxx212 max 1 1234567896 -> 1.23456790E+9 Inexact Rounded +maxx213 max -1234567891 1 -> 1 +maxx214 max 1 -1234567891 -> 1 +maxx215 max -12345678901 1 -> 1 +maxx216 max 1 -12345678901 -> 1 +maxx217 max -1234567896 1 -> 1 +maxx218 max 1 -1234567896 -> 1 + +precision: 15 +maxx221 max 12345678000 1 -> 12345678000 +maxx222 max 1 12345678000 -> 12345678000 +maxx223 max 1234567800 1 -> 1234567800 +maxx224 max 1 1234567800 -> 1234567800 +maxx225 max 1234567890 1 -> 1234567890 +maxx226 max 1 1234567890 -> 1234567890 +maxx227 max 1234567891 1 -> 1234567891 +maxx228 max 1 1234567891 -> 1234567891 +maxx229 max 12345678901 1 -> 12345678901 +maxx230 max 1 12345678901 -> 12345678901 +maxx231 max 1234567896 1 -> 1234567896 +maxx232 max 1 1234567896 -> 1234567896 +maxx233 max -1234567891 1 -> 1 +maxx234 max 1 -1234567891 -> 1 +maxx235 max -12345678901 1 -> 1 +maxx236 max 1 -12345678901 -> 1 +maxx237 max -1234567896 1 -> 1 +maxx238 max 1 -1234567896 -> 1 + +-- from examples +maxx280 max '3' '2' -> '3' +maxx281 max '-10' '3' -> '3' +maxx282 max '1.0' '1' -> '1' +maxx283 max '1' '1.0' -> '1' +maxx284 max '7' 'NaN' -> '7' + +-- overflow and underflow tests ... +maxExponent: 999999999 +minexponent: -999999999 +maxx330 max +1.23456789012345E-0 9E+999999999 -> 9E+999999999 +maxx331 max 9E+999999999 +1.23456789012345E-0 -> 9E+999999999 +maxx332 max +0.100 9E-999999999 -> 0.100 +maxx333 max 9E-999999999 +0.100 -> 0.100 +maxx335 max -1.23456789012345E-0 9E+999999999 -> 9E+999999999 +maxx336 max 9E+999999999 -1.23456789012345E-0 -> 9E+999999999 +maxx337 max -0.100 9E-999999999 -> 9E-999999999 +maxx338 max 9E-999999999 -0.100 -> 9E-999999999 + +maxx339 max 1e-599999999 1e-400000001 -> 1E-400000001 +maxx340 max 1e-599999999 1e-400000000 -> 1E-400000000 +maxx341 max 1e-600000000 1e-400000000 -> 1E-400000000 +maxx342 max 9e-999999998 0.01 -> 0.01 +maxx343 max 9e-999999998 0.1 -> 0.1 +maxx344 max 0.01 9e-999999998 -> 0.01 +maxx345 max 1e599999999 1e400000001 -> 1E+599999999 +maxx346 max 1e599999999 1e400000000 -> 1E+599999999 +maxx347 max 1e600000000 1e400000000 -> 1E+600000000 +maxx348 max 9e999999998 100 -> 9E+999999998 +maxx349 max 9e999999998 10 -> 9E+999999998 +maxx350 max 100 9e999999998 -> 9E+999999998 +-- signs +maxx351 max 1e+777777777 1e+411111111 -> 1E+777777777 +maxx352 max 1e+777777777 -1e+411111111 -> 1E+777777777 +maxx353 max -1e+777777777 1e+411111111 -> 1E+411111111 +maxx354 max -1e+777777777 -1e+411111111 -> -1E+411111111 +maxx355 max 1e-777777777 1e-411111111 -> 1E-411111111 +maxx356 max 1e-777777777 -1e-411111111 -> 1E-777777777 +maxx357 max -1e-777777777 1e-411111111 -> 1E-411111111 +maxx358 max -1e-777777777 -1e-411111111 -> -1E-777777777 + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +maxx401 max Inf 1.1 -> Infinity +maxx402 max 1.1 1 -> 1.1 +maxx403 max 1 1.0 -> 1 +maxx404 max 1.0 0.1 -> 1.0 +maxx405 max 0.1 0.10 -> 0.1 +maxx406 max 0.10 0.100 -> 0.10 +maxx407 max 0.10 0 -> 0.10 +maxx408 max 0 0.0 -> 0 +maxx409 max 0.0 -0 -> 0.0 +maxx410 max 0.0 -0.0 -> 0.0 +maxx411 max 0.00 -0.0 -> 0.00 +maxx412 max 0.0 -0.00 -> 0.0 +maxx413 max 0 -0.0 -> 0 +maxx414 max 0 -0 -> 0 +maxx415 max -0.0 -0 -> -0.0 +maxx416 max -0 -0.100 -> -0 +maxx417 max -0.100 -0.10 -> -0.100 +maxx418 max -0.10 -0.1 -> -0.10 +maxx419 max -0.1 -1.0 -> -0.1 +maxx420 max -1.0 -1 -> -1.0 +maxx421 max -1 -1.1 -> -1 +maxx423 max -1.1 -Inf -> -1.1 +-- same with operands reversed +maxx431 max 1.1 Inf -> Infinity +maxx432 max 1 1.1 -> 1.1 +maxx433 max 1.0 1 -> 1 +maxx434 max 0.1 1.0 -> 1.0 +maxx435 max 0.10 0.1 -> 0.1 +maxx436 max 0.100 0.10 -> 0.10 +maxx437 max 0 0.10 -> 0.10 +maxx438 max 0.0 0 -> 0 +maxx439 max -0 0.0 -> 0.0 +maxx440 max -0.0 0.0 -> 0.0 +maxx441 max -0.0 0.00 -> 0.00 +maxx442 max -0.00 0.0 -> 0.0 +maxx443 max -0.0 0 -> 0 +maxx444 max -0 0 -> 0 +maxx445 max -0 -0.0 -> -0.0 +maxx446 max -0.100 -0 -> -0 +maxx447 max -0.10 -0.100 -> -0.100 +maxx448 max -0.1 -0.10 -> -0.10 +maxx449 max -1.0 -0.1 -> -0.1 +maxx450 max -1 -1.0 -> -1.0 +maxx451 max -1.1 -1 -> -1 +maxx453 max -Inf -1.1 -> -1.1 +-- largies +maxx460 max 1000 1E+3 -> 1E+3 +maxx461 max 1E+3 1000 -> 1E+3 +maxx462 max 1000 -1E+3 -> 1000 +maxx463 max 1E+3 -1000 -> 1E+3 +maxx464 max -1000 1E+3 -> 1E+3 +maxx465 max -1E+3 1000 -> 1000 +maxx466 max -1000 -1E+3 -> -1000 +maxx467 max -1E+3 -1000 -> -1000 + +-- rounding (results treated as though plus) +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 + +maxx470 max 1 .5 -> 1 +maxx471 max 10 5 -> 10 +maxx472 max 100 50 -> 100 +maxx473 max 1000 500 -> 1.00E+3 Rounded +maxx474 max 10000 5000 -> 1.00E+4 Rounded +maxx475 max 6 .5 -> 6 +maxx476 max 66 5 -> 66 +maxx477 max 666 50 -> 666 +maxx478 max 6666 500 -> 6.67E+3 Rounded Inexact +maxx479 max 66666 5000 -> 6.67E+4 Rounded Inexact +maxx480 max 33333 5000 -> 3.33E+4 Rounded Inexact +maxx481 max .5 1 -> 1 +maxx482 max .5 10 -> 10 +maxx483 max .5 100 -> 100 +maxx484 max .5 1000 -> 1.00E+3 Rounded +maxx485 max .5 10000 -> 1.00E+4 Rounded +maxx486 max .5 6 -> 6 +maxx487 max .5 66 -> 66 +maxx488 max .5 666 -> 666 +maxx489 max .5 6666 -> 6.67E+3 Rounded Inexact +maxx490 max .5 66666 -> 6.67E+4 Rounded Inexact +maxx491 max .5 33333 -> 3.33E+4 Rounded Inexact + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +maxx500 max 9.999E+999999999 0 -> Infinity Inexact Overflow Rounded +maxx501 max -9.999E+999999999 0 -> 0 + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +maxx510 max 1.00E-999 0 -> 1.00E-999 +maxx511 max 0.1E-999 0 -> 1E-1000 Subnormal +maxx512 max 0.10E-999 0 -> 1.0E-1000 Subnormal +maxx513 max 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded +maxx514 max 0.01E-999 0 -> 1E-1001 Subnormal +-- next is rounded to Emin +maxx515 max 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow +maxx516 max 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +maxx517 max 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow +maxx518 max 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +maxx519 max 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +maxx520 max 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +maxx530 max -1.00E-999 0 -> 0 +maxx531 max -0.1E-999 0 -> 0 +maxx532 max -0.10E-999 0 -> 0 +maxx533 max -0.100E-999 0 -> 0 +maxx534 max -0.01E-999 0 -> 0 +maxx535 max -0.999E-999 0 -> 0 +maxx536 max -0.099E-999 0 -> 0 +maxx537 max -0.009E-999 0 -> 0 +maxx538 max -0.001E-999 0 -> 0 +maxx539 max -0.0009E-999 0 -> 0 +maxx540 max -0.0001E-999 0 -> 0 + +-- Null tests +maxx900 max 10 # -> NaN Invalid_operation +maxx901 max # 10 -> NaN Invalid_operation + + + Added: sandbox/trunk/decimal-c/new_dt/min.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/min.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,391 @@ +------------------------------------------------------------------------ +-- min.decTest -- decimal minimum -- +-- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- we assume that base comparison is tested in compare.decTest, so +-- these mainly cover special cases and rounding + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- sanity checks +mnmx001 min -2 -2 -> -2 +mnmx002 min -2 -1 -> -2 +mnmx003 min -2 0 -> -2 +mnmx004 min -2 1 -> -2 +mnmx005 min -2 2 -> -2 +mnmx006 min -1 -2 -> -2 +mnmx007 min -1 -1 -> -1 +mnmx008 min -1 0 -> -1 +mnmx009 min -1 1 -> -1 +mnmx010 min -1 2 -> -1 +mnmx011 min 0 -2 -> -2 +mnmx012 min 0 -1 -> -1 +mnmx013 min 0 0 -> 0 +mnmx014 min 0 1 -> 0 +mnmx015 min 0 2 -> 0 +mnmx016 min 1 -2 -> -2 +mnmx017 min 1 -1 -> -1 +mnmx018 min 1 0 -> 0 +mnmx019 min 1 1 -> 1 +mnmx020 min 1 2 -> 1 +mnmx021 min 2 -2 -> -2 +mnmx022 min 2 -1 -> -1 +mnmx023 min 2 0 -> 0 +mnmx025 min 2 1 -> 1 +mnmx026 min 2 2 -> 2 + +-- extended zeros +mnmx030 min 0 0 -> 0 +mnmx031 min 0 -0 -> -0 +mnmx032 min 0 -0.0 -> -0.0 +mnmx033 min 0 0.0 -> 0.0 +mnmx034 min -0 0 -> -0 +mnmx035 min -0 -0 -> -0 +mnmx036 min -0 -0.0 -> -0 +mnmx037 min -0 0.0 -> -0 +mnmx038 min 0.0 0 -> 0.0 +mnmx039 min 0.0 -0 -> -0 +mnmx040 min 0.0 -0.0 -> -0.0 +mnmx041 min 0.0 0.0 -> 0.0 +mnmx042 min -0.0 0 -> -0.0 +mnmx043 min -0.0 -0 -> -0 +mnmx044 min -0.0 -0.0 -> -0.0 +mnmx045 min -0.0 0.0 -> -0.0 + +mnmx046 min 0E1 -0E1 -> -0E+1 +mnmx047 min -0E1 0E2 -> -0E+1 +mnmx048 min 0E2 0E1 -> 0E+1 +mnmx049 min 0E1 0E2 -> 0E+1 +mnmx050 min -0E3 -0E2 -> -0E+3 +mnmx051 min -0E2 -0E3 -> -0E+3 + +-- Specials +precision: 9 +mnmx090 min Inf -Inf -> -Infinity +mnmx091 min Inf -1000 -> -1000 +mnmx092 min Inf -1 -> -1 +mnmx093 min Inf -0 -> -0 +mnmx094 min Inf 0 -> 0 +mnmx095 min Inf 1 -> 1 +mnmx096 min Inf 1000 -> 1000 +mnmx097 min Inf Inf -> Infinity +mnmx098 min -1000 Inf -> -1000 +mnmx099 min -Inf Inf -> -Infinity +mnmx100 min -1 Inf -> -1 +mnmx101 min -0 Inf -> -0 +mnmx102 min 0 Inf -> 0 +mnmx103 min 1 Inf -> 1 +mnmx104 min 1000 Inf -> 1000 +mnmx105 min Inf Inf -> Infinity + +mnmx120 min -Inf -Inf -> -Infinity +mnmx121 min -Inf -1000 -> -Infinity +mnmx122 min -Inf -1 -> -Infinity +mnmx123 min -Inf -0 -> -Infinity +mnmx124 min -Inf 0 -> -Infinity +mnmx125 min -Inf 1 -> -Infinity +mnmx126 min -Inf 1000 -> -Infinity +mnmx127 min -Inf Inf -> -Infinity +mnmx128 min -Inf -Inf -> -Infinity +mnmx129 min -1000 -Inf -> -Infinity +mnmx130 min -1 -Inf -> -Infinity +mnmx131 min -0 -Inf -> -Infinity +mnmx132 min 0 -Inf -> -Infinity +mnmx133 min 1 -Inf -> -Infinity +mnmx134 min 1000 -Inf -> -Infinity +mnmx135 min Inf -Inf -> -Infinity + +-- 2004.08.02 754r chooses number over NaN in mixed cases +mnmx141 min NaN -Inf -> -Infinity +mnmx142 min NaN -1000 -> -1000 +mnmx143 min NaN -1 -> -1 +mnmx144 min NaN -0 -> -0 +mnmx145 min NaN 0 -> 0 +mnmx146 min NaN 1 -> 1 +mnmx147 min NaN 1000 -> 1000 +mnmx148 min NaN Inf -> Infinity +mnmx149 min NaN NaN -> NaN +mnmx150 min -Inf NaN -> -Infinity +mnmx151 min -1000 NaN -> -1000 +mnmx152 min -1 -NaN -> -1 +mnmx153 min -0 NaN -> -0 +mnmx154 min 0 -NaN -> 0 +mnmx155 min 1 NaN -> 1 +mnmx156 min 1000 NaN -> 1000 +mnmx157 min Inf NaN -> Infinity + +mnmx161 min sNaN -Inf -> NaN Invalid_operation +mnmx162 min sNaN -1000 -> NaN Invalid_operation +mnmx163 min sNaN -1 -> NaN Invalid_operation +mnmx164 min sNaN -0 -> NaN Invalid_operation +mnmx165 min -sNaN 0 -> -NaN Invalid_operation +mnmx166 min -sNaN 1 -> -NaN Invalid_operation +mnmx167 min sNaN 1000 -> NaN Invalid_operation +mnmx168 min sNaN NaN -> NaN Invalid_operation +mnmx169 min sNaN sNaN -> NaN Invalid_operation +mnmx170 min NaN sNaN -> NaN Invalid_operation +mnmx171 min -Inf sNaN -> NaN Invalid_operation +mnmx172 min -1000 sNaN -> NaN Invalid_operation +mnmx173 min -1 sNaN -> NaN Invalid_operation +mnmx174 min -0 sNaN -> NaN Invalid_operation +mnmx175 min 0 sNaN -> NaN Invalid_operation +mnmx176 min 1 sNaN -> NaN Invalid_operation +mnmx177 min 1000 sNaN -> NaN Invalid_operation +mnmx178 min Inf sNaN -> NaN Invalid_operation +mnmx179 min NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +mnmx181 min NaN9 -Inf -> -Infinity +mnmx182 min -NaN8 9990 -> 9990 +mnmx183 min NaN71 Inf -> Infinity + +mnmx184 min NaN1 NaN54 -> NaN1 +mnmx185 min NaN22 -NaN53 -> NaN22 +mnmx186 min -NaN3 NaN6 -> -NaN3 +mnmx187 min -NaN44 NaN7 -> -NaN44 + +mnmx188 min -Inf NaN41 -> -Infinity +mnmx189 min -9999 -NaN33 -> -9999 +mnmx190 min Inf NaN2 -> Infinity + +mnmx191 min sNaN99 -Inf -> NaN99 Invalid_operation +mnmx192 min sNaN98 -11 -> NaN98 Invalid_operation +mnmx193 min -sNaN97 NaN8 -> -NaN97 Invalid_operation +mnmx194 min sNaN69 sNaN94 -> NaN69 Invalid_operation +mnmx195 min NaN95 sNaN93 -> NaN93 Invalid_operation +mnmx196 min -Inf sNaN92 -> NaN92 Invalid_operation +mnmx197 min 088 sNaN91 -> NaN91 Invalid_operation +mnmx198 min Inf -sNaN90 -> -NaN90 Invalid_operation +mnmx199 min NaN sNaN86 -> NaN86 Invalid_operation + +-- rounding checks -- chosen is rounded, or not +maxExponent: 999 +minexponent: -999 +precision: 9 +mnmx201 min -12345678000 1 -> -1.23456780E+10 Rounded +mnmx202 min 1 -12345678000 -> -1.23456780E+10 Rounded +mnmx203 min -1234567800 1 -> -1.23456780E+9 Rounded +mnmx204 min 1 -1234567800 -> -1.23456780E+9 Rounded +mnmx205 min -1234567890 1 -> -1.23456789E+9 Rounded +mnmx206 min 1 -1234567890 -> -1.23456789E+9 Rounded +mnmx207 min -1234567891 1 -> -1.23456789E+9 Inexact Rounded +mnmx208 min 1 -1234567891 -> -1.23456789E+9 Inexact Rounded +mnmx209 min -12345678901 1 -> -1.23456789E+10 Inexact Rounded +mnmx210 min 1 -12345678901 -> -1.23456789E+10 Inexact Rounded +mnmx211 min -1234567896 1 -> -1.23456790E+9 Inexact Rounded +mnmx212 min 1 -1234567896 -> -1.23456790E+9 Inexact Rounded +mnmx213 min 1234567891 1 -> 1 +mnmx214 min 1 1234567891 -> 1 +mnmx215 min 12345678901 1 -> 1 +mnmx216 min 1 12345678901 -> 1 +mnmx217 min 1234567896 1 -> 1 +mnmx218 min 1 1234567896 -> 1 + +precision: 15 +mnmx221 min -12345678000 1 -> -12345678000 +mnmx222 min 1 -12345678000 -> -12345678000 +mnmx223 min -1234567800 1 -> -1234567800 +mnmx224 min 1 -1234567800 -> -1234567800 +mnmx225 min -1234567890 1 -> -1234567890 +mnmx226 min 1 -1234567890 -> -1234567890 +mnmx227 min -1234567891 1 -> -1234567891 +mnmx228 min 1 -1234567891 -> -1234567891 +mnmx229 min -12345678901 1 -> -12345678901 +mnmx230 min 1 -12345678901 -> -12345678901 +mnmx231 min -1234567896 1 -> -1234567896 +mnmx232 min 1 -1234567896 -> -1234567896 +mnmx233 min 1234567891 1 -> 1 +mnmx234 min 1 1234567891 -> 1 +mnmx235 min 12345678901 1 -> 1 +mnmx236 min 1 12345678901 -> 1 +mnmx237 min 1234567896 1 -> 1 +mnmx238 min 1 1234567896 -> 1 + +-- from examples +mnmx280 min '3' '2' -> '2' +mnmx281 min '-10' '3' -> '-10' +mnmx282 min '1.0' '1' -> '1.0' +mnmx283 min '1' '1.0' -> '1.0' +mnmx284 min '7' 'NaN' -> '7' + +-- overflow and underflow tests .. subnormal results [inputs] now allowed +maxExponent: 999999999 +minexponent: -999999999 +mnmx330 min -1.23456789012345E-0 -9E+999999999 -> -9E+999999999 +mnmx331 min -9E+999999999 -1.23456789012345E-0 -> -9E+999999999 +mnmx332 min -0.100 -9E-999999999 -> -0.100 +mnmx333 min -9E-999999999 -0.100 -> -0.100 +mnmx335 min +1.23456789012345E-0 -9E+999999999 -> -9E+999999999 +mnmx336 min -9E+999999999 1.23456789012345E-0 -> -9E+999999999 +mnmx337 min +0.100 -9E-999999999 -> -9E-999999999 +mnmx338 min -9E-999999999 0.100 -> -9E-999999999 + +mnmx339 min -1e-599999999 -1e-400000001 -> -1E-400000001 +mnmx340 min -1e-599999999 -1e-400000000 -> -1E-400000000 +mnmx341 min -1e-600000000 -1e-400000000 -> -1E-400000000 +mnmx342 min -9e-999999998 -0.01 -> -0.01 +mnmx343 min -9e-999999998 -0.1 -> -0.1 +mnmx344 min -0.01 -9e-999999998 -> -0.01 +mnmx345 min -1e599999999 -1e400000001 -> -1E+599999999 +mnmx346 min -1e599999999 -1e400000000 -> -1E+599999999 +mnmx347 min -1e600000000 -1e400000000 -> -1E+600000000 +mnmx348 min -9e999999998 -100 -> -9E+999999998 +mnmx349 min -9e999999998 -10 -> -9E+999999998 +mnmx350 min -100 -9e999999998 -> -9E+999999998 +-- signs +mnmx351 min -1e+777777777 -1e+411111111 -> -1E+777777777 +mnmx352 min -1e+777777777 +1e+411111111 -> -1E+777777777 +mnmx353 min +1e+777777777 -1e+411111111 -> -1E+411111111 +mnmx354 min +1e+777777777 +1e+411111111 -> 1E+411111111 +mnmx355 min -1e-777777777 -1e-411111111 -> -1E-411111111 +mnmx356 min -1e-777777777 +1e-411111111 -> -1E-777777777 +mnmx357 min +1e-777777777 -1e-411111111 -> -1E-411111111 +mnmx358 min +1e-777777777 +1e-411111111 -> 1E-777777777 + +-- expanded list from min/max 754r purple prose +-- [explicit tests for exponent ordering] +mnmx401 min Inf 1.1 -> 1.1 +mnmx402 min 1.1 1 -> 1 +mnmx403 min 1 1.0 -> 1.0 +mnmx404 min 1.0 0.1 -> 0.1 +mnmx405 min 0.1 0.10 -> 0.10 +mnmx406 min 0.10 0.100 -> 0.100 +mnmx407 min 0.10 0 -> 0 +mnmx408 min 0 0.0 -> 0.0 +mnmx409 min 0.0 -0 -> -0 +mnmx410 min 0.0 -0.0 -> -0.0 +mnmx411 min 0.00 -0.0 -> -0.0 +mnmx412 min 0.0 -0.00 -> -0.00 +mnmx413 min 0 -0.0 -> -0.0 +mnmx414 min 0 -0 -> -0 +mnmx415 min -0.0 -0 -> -0 +mnmx416 min -0 -0.100 -> -0.100 +mnmx417 min -0.100 -0.10 -> -0.10 +mnmx418 min -0.10 -0.1 -> -0.1 +mnmx419 min -0.1 -1.0 -> -1.0 +mnmx420 min -1.0 -1 -> -1 +mnmx421 min -1 -1.1 -> -1.1 +mnmx423 min -1.1 -Inf -> -Infinity +-- same with operands reversed +mnmx431 min 1.1 Inf -> 1.1 +mnmx432 min 1 1.1 -> 1 +mnmx433 min 1.0 1 -> 1.0 +mnmx434 min 0.1 1.0 -> 0.1 +mnmx435 min 0.10 0.1 -> 0.10 +mnmx436 min 0.100 0.10 -> 0.100 +mnmx437 min 0 0.10 -> 0 +mnmx438 min 0.0 0 -> 0.0 +mnmx439 min -0 0.0 -> -0 +mnmx440 min -0.0 0.0 -> -0.0 +mnmx441 min -0.0 0.00 -> -0.0 +mnmx442 min -0.00 0.0 -> -0.00 +mnmx443 min -0.0 0 -> -0.0 +mnmx444 min -0 0 -> -0 +mnmx445 min -0 -0.0 -> -0 +mnmx446 min -0.100 -0 -> -0.100 +mnmx447 min -0.10 -0.100 -> -0.10 +mnmx448 min -0.1 -0.10 -> -0.1 +mnmx449 min -1.0 -0.1 -> -1.0 +mnmx450 min -1 -1.0 -> -1 +mnmx451 min -1.1 -1 -> -1.1 +mnmx453 min -Inf -1.1 -> -Infinity +-- largies +mnmx460 min 1000 1E+3 -> 1000 +mnmx461 min 1E+3 1000 -> 1000 +mnmx462 min 1000 -1E+3 -> -1E+3 +mnmx463 min 1E+3 -1000 -> -1000 +mnmx464 min -1000 1E+3 -> -1000 +mnmx465 min -1E+3 1000 -> -1E+3 +mnmx466 min -1000 -1E+3 -> -1E+3 +mnmx467 min -1E+3 -1000 -> -1E+3 + +-- rounding (results treated as though plus) +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 + +mnmx470 min 1 5 -> 1 +mnmx471 min 10 50 -> 10 +mnmx472 min 100 500 -> 100 +mnmx473 min 1000 5000 -> 1.00E+3 Rounded +mnmx474 min 10000 50000 -> 1.00E+4 Rounded +mnmx475 min 6 50 -> 6 +mnmx476 min 66 500 -> 66 +mnmx477 min 666 5000 -> 666 +mnmx478 min 6666 50000 -> 6.67E+3 Rounded Inexact +mnmx479 min 66666 500000 -> 6.67E+4 Rounded Inexact +mnmx480 min 33333 500000 -> 3.33E+4 Rounded Inexact +mnmx481 min 75401 1 -> 1 +mnmx482 min 75402 10 -> 10 +mnmx483 min 75403 100 -> 100 +mnmx484 min 75404 1000 -> 1.00E+3 Rounded +mnmx485 min 75405 10000 -> 1.00E+4 Rounded +mnmx486 min 75406 6 -> 6 +mnmx487 min 75407 66 -> 66 +mnmx488 min 75408 666 -> 666 +mnmx489 min 75409 6666 -> 6.67E+3 Rounded Inexact +mnmx490 min 75410 66666 -> 6.67E+4 Rounded Inexact +mnmx491 min 75411 33333 -> 3.33E+4 Rounded Inexact + + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +mnmx500 min 9.999E+999999999 0 -> 0 +mnmx501 min -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +mnmx510 min 1.00E-999 0 -> 0 +mnmx511 min 0.1E-999 0 -> 0 +mnmx512 min 0.10E-999 0 -> 0 +mnmx513 min 0.100E-999 0 -> 0 +mnmx514 min 0.01E-999 0 -> 0 +mnmx515 min 0.999E-999 0 -> 0 +mnmx516 min 0.099E-999 0 -> 0 +mnmx517 min 0.009E-999 0 -> 0 +mnmx518 min 0.001E-999 0 -> 0 +mnmx519 min 0.0009E-999 0 -> 0 +mnmx520 min 0.0001E-999 0 -> 0 + +mnmx530 min -1.00E-999 0 -> -1.00E-999 +mnmx531 min -0.1E-999 0 -> -1E-1000 Subnormal +mnmx532 min -0.10E-999 0 -> -1.0E-1000 Subnormal +mnmx533 min -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded +mnmx534 min -0.01E-999 0 -> -1E-1001 Subnormal +-- next is rounded to Emin +mnmx535 min -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow +mnmx536 min -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +mnmx537 min -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow +mnmx538 min -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +mnmx539 min -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +mnmx540 min -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped + + +-- Null tests +mnm900 min 10 # -> NaN Invalid_operation +mnm901 min # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal-c/new_dt/minus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/minus.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,182 @@ +------------------------------------------------------------------------ +-- minus.decTest -- decimal negation -- +-- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- This set of tests primarily tests the existence of the operator. +-- Subtraction, rounding, and more overflows are tested elsewhere. + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +minx001 minus '1' -> '-1' +minx002 minus '-1' -> '1' +minx003 minus '1.00' -> '-1.00' +minx004 minus '-1.00' -> '1.00' +minx005 minus '0' -> '0' +minx006 minus '0.00' -> '0.00' +minx007 minus '00.0' -> '0.0' +minx008 minus '00.00' -> '0.00' +minx009 minus '00' -> '0' + +minx010 minus '-2' -> '2' +minx011 minus '2' -> '-2' +minx012 minus '-2.00' -> '2.00' +minx013 minus '2.00' -> '-2.00' +minx014 minus '-0' -> '0' +minx015 minus '-0.00' -> '0.00' +minx016 minus '-00.0' -> '0.0' +minx017 minus '-00.00' -> '0.00' +minx018 minus '-00' -> '0' + +-- "lhs" zeros in plus and minus have exponent = operand +minx020 minus '-0E3' -> '0E+3' +minx021 minus '-0E2' -> '0E+2' +minx022 minus '-0E1' -> '0E+1' +minx023 minus '-0E0' -> '0' +minx024 minus '+0E0' -> '0' +minx025 minus '+0E1' -> '0E+1' +minx026 minus '+0E2' -> '0E+2' +minx027 minus '+0E3' -> '0E+3' + +minx030 minus '-5E3' -> '5E+3' +minx031 minus '-5E8' -> '5E+8' +minx032 minus '-5E13' -> '5E+13' +minx033 minus '-5E18' -> '5E+18' +minx034 minus '+5E3' -> '-5E+3' +minx035 minus '+5E8' -> '-5E+8' +minx036 minus '+5E13' -> '-5E+13' +minx037 minus '+5E18' -> '-5E+18' + +minx050 minus '-2000000' -> '2000000' +minx051 minus '2000000' -> '-2000000' +precision: 7 +minx052 minus '-2000000' -> '2000000' +minx053 minus '2000000' -> '-2000000' +precision: 6 +minx054 minus '-2000000' -> '2.00000E+6' Rounded +minx055 minus '2000000' -> '-2.00000E+6' Rounded +precision: 3 +minx056 minus '-2000000' -> '2.00E+6' Rounded +minx057 minus '2000000' -> '-2.00E+6' Rounded + +-- more fixed, potential LHS swaps/overlays if done by 0 subtract x +precision: 9 +minx060 minus '56267E-10' -> '-0.0000056267' +minx061 minus '56267E-5' -> '-0.56267' +minx062 minus '56267E-2' -> '-562.67' +minx063 minus '56267E-1' -> '-5626.7' +minx065 minus '56267E-0' -> '-56267' +minx066 minus '56267E+0' -> '-56267' +minx067 minus '56267E+1' -> '-5.6267E+5' +minx068 minus '56267E+2' -> '-5.6267E+6' +minx069 minus '56267E+3' -> '-5.6267E+7' +minx070 minus '56267E+4' -> '-5.6267E+8' +minx071 minus '56267E+5' -> '-5.6267E+9' +minx072 minus '56267E+6' -> '-5.6267E+10' +minx080 minus '-56267E-10' -> '0.0000056267' +minx081 minus '-56267E-5' -> '0.56267' +minx082 minus '-56267E-2' -> '562.67' +minx083 minus '-56267E-1' -> '5626.7' +minx085 minus '-56267E-0' -> '56267' +minx086 minus '-56267E+0' -> '56267' +minx087 minus '-56267E+1' -> '5.6267E+5' +minx088 minus '-56267E+2' -> '5.6267E+6' +minx089 minus '-56267E+3' -> '5.6267E+7' +minx090 minus '-56267E+4' -> '5.6267E+8' +minx091 minus '-56267E+5' -> '5.6267E+9' +minx092 minus '-56267E+6' -> '5.6267E+10' + + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +minx100 minus 9.999E+999999999 -> -Infinity Inexact Overflow Rounded +minx101 minus -9.999E+999999999 -> Infinity Inexact Overflow Rounded + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +minx110 minus 1.00E-999 -> -1.00E-999 +minx111 minus 0.1E-999 -> -1E-1000 Subnormal +minx112 minus 0.10E-999 -> -1.0E-1000 Subnormal +minx113 minus 0.100E-999 -> -1.0E-1000 Subnormal Rounded +minx114 minus 0.01E-999 -> -1E-1001 Subnormal +-- next is rounded to Emin +minx115 minus 0.999E-999 -> -1.00E-999 Inexact Rounded Subnormal Underflow +minx116 minus 0.099E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +minx117 minus 0.009E-999 -> -1E-1001 Inexact Rounded Subnormal Underflow +minx118 minus 0.001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +minx119 minus 0.0009E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +minx120 minus 0.0001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped + +minx130 minus -1.00E-999 -> 1.00E-999 +minx131 minus -0.1E-999 -> 1E-1000 Subnormal +minx132 minus -0.10E-999 -> 1.0E-1000 Subnormal +minx133 minus -0.100E-999 -> 1.0E-1000 Subnormal Rounded +minx134 minus -0.01E-999 -> 1E-1001 Subnormal +-- next is rounded to Emin +minx135 minus -0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow +minx136 minus -0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +minx137 minus -0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow +minx138 minus -0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +minx139 minus -0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +minx140 minus -0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +minx301 minus 12345678000 -> -1.23456780E+10 Rounded +minx302 minus 1234567800 -> -1.23456780E+9 Rounded +minx303 minus 1234567890 -> -1.23456789E+9 Rounded +minx304 minus 1234567891 -> -1.23456789E+9 Inexact Rounded +minx305 minus 12345678901 -> -1.23456789E+10 Inexact Rounded +minx306 minus 1234567896 -> -1.23456790E+9 Inexact Rounded + +precision: 15 +-- still checking +minx321 minus 12345678000 -> -12345678000 +minx322 minus 1234567800 -> -1234567800 +minx323 minus 1234567890 -> -1234567890 +minx324 minus 1234567891 -> -1234567891 +minx325 minus 12345678901 -> -12345678901 +minx326 minus 1234567896 -> -1234567896 + +-- specials +minx420 minus 'Inf' -> '-Infinity' +minx421 minus '-Inf' -> 'Infinity' +minx422 minus NaN -> NaN +minx423 minus sNaN -> NaN Invalid_operation +minx424 minus NaN255 -> NaN255 +minx425 minus sNaN256 -> NaN256 Invalid_operation +minx426 minus -NaN -> -NaN +minx427 minus -sNaN -> -NaN Invalid_operation +minx428 minus -NaN255 -> -NaN255 +minx429 minus -sNaN256 -> -NaN256 Invalid_operation + +-- Null tests +minx900 minus # -> NaN Invalid_operation + Added: sandbox/trunk/decimal-c/new_dt/multiply.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/multiply.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,727 @@ +------------------------------------------------------------------------ +-- multiply.decTest -- decimal multiplication -- +-- Copyright (c) IBM Corporation, 1981, 2005. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- sanity checks (as base, above) +mulx000 multiply 2 2 -> 4 +mulx001 multiply 2 3 -> 6 +mulx002 multiply 5 1 -> 5 +mulx003 multiply 5 2 -> 10 +mulx004 multiply 1.20 2 -> 2.40 +mulx005 multiply 1.20 0 -> 0.00 +mulx006 multiply 1.20 -2 -> -2.40 +mulx007 multiply -1.20 2 -> -2.40 +mulx008 multiply -1.20 0 -> -0.00 +mulx009 multiply -1.20 -2 -> 2.40 +mulx010 multiply 5.09 7.1 -> 36.139 +mulx011 multiply 2.5 4 -> 10.0 +mulx012 multiply 2.50 4 -> 10.00 +mulx013 multiply 1.23456789 1.00000000 -> 1.23456789 Rounded +mulx014 multiply 9.999999999 9.999999999 -> 100.000000 Inexact Rounded +mulx015 multiply 2.50 4 -> 10.00 +precision: 6 +mulx016 multiply 2.50 4 -> 10.00 +mulx017 multiply 9.999999999 9.999999999 -> 100.000 Inexact Rounded +mulx018 multiply 9.999999999 -9.999999999 -> -100.000 Inexact Rounded +mulx019 multiply -9.999999999 9.999999999 -> -100.000 Inexact Rounded +mulx020 multiply -9.999999999 -9.999999999 -> 100.000 Inexact Rounded + +-- 1999.12.21: next one is a edge case if intermediate longs are used +precision: 15 +mulx059 multiply 999999999999 9765625 -> 9.76562499999023E+18 Inexact Rounded +precision: 30 +mulx160 multiply 999999999999 9765625 -> 9765624999990234375 +precision: 9 +----- + +-- zeros, etc. +mulx021 multiply 0 0 -> 0 +mulx022 multiply 0 -0 -> -0 +mulx023 multiply -0 0 -> -0 +mulx024 multiply -0 -0 -> 0 +mulx025 multiply -0.0 -0.0 -> 0.00 +mulx026 multiply -0.0 -0.0 -> 0.00 +mulx027 multiply -0.0 -0.0 -> 0.00 +mulx028 multiply -0.0 -0.0 -> 0.00 +mulx030 multiply 5.00 1E-3 -> 0.00500 +mulx031 multiply 00.00 0.000 -> 0.00000 +mulx032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0 +mulx033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0 +mulx034 multiply -5.00 1E-3 -> -0.00500 +mulx035 multiply -00.00 0.000 -> -0.00000 +mulx036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0 +mulx037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0 +mulx038 multiply 5.00 -1E-3 -> -0.00500 +mulx039 multiply 00.00 -0.000 -> -0.00000 +mulx040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0 +mulx041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0 +mulx042 multiply -5.00 -1E-3 -> 0.00500 +mulx043 multiply -00.00 -0.000 -> 0.00000 +mulx044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0 +mulx045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0 + +-- examples from decarith +mulx050 multiply 1.20 3 -> 3.60 +mulx051 multiply 7 3 -> 21 +mulx052 multiply 0.9 0.8 -> 0.72 +mulx053 multiply 0.9 -0 -> -0.0 +mulx054 multiply 654321 654321 -> 4.28135971E+11 Inexact Rounded + +mulx060 multiply 123.45 1e7 -> 1.2345E+9 +mulx061 multiply 123.45 1e8 -> 1.2345E+10 +mulx062 multiply 123.45 1e+9 -> 1.2345E+11 +mulx063 multiply 123.45 1e10 -> 1.2345E+12 +mulx064 multiply 123.45 1e11 -> 1.2345E+13 +mulx065 multiply 123.45 1e12 -> 1.2345E+14 +mulx066 multiply 123.45 1e13 -> 1.2345E+15 + + +-- test some intermediate lengths +precision: 9 +mulx080 multiply 0.1 123456789 -> 12345678.9 +mulx081 multiply 0.1 1234567891 -> 123456789 Inexact Rounded +mulx082 multiply 0.1 12345678912 -> 1.23456789E+9 Inexact Rounded +mulx083 multiply 0.1 12345678912345 -> 1.23456789E+12 Inexact Rounded +mulx084 multiply 0.1 123456789 -> 12345678.9 +precision: 8 +mulx085 multiply 0.1 12345678912 -> 1.2345679E+9 Inexact Rounded +mulx086 multiply 0.1 12345678912345 -> 1.2345679E+12 Inexact Rounded +precision: 7 +mulx087 multiply 0.1 12345678912 -> 1.234568E+9 Inexact Rounded +mulx088 multiply 0.1 12345678912345 -> 1.234568E+12 Inexact Rounded + +precision: 9 +mulx090 multiply 123456789 0.1 -> 12345678.9 +mulx091 multiply 1234567891 0.1 -> 123456789 Inexact Rounded +mulx092 multiply 12345678912 0.1 -> 1.23456789E+9 Inexact Rounded +mulx093 multiply 12345678912345 0.1 -> 1.23456789E+12 Inexact Rounded +mulx094 multiply 123456789 0.1 -> 12345678.9 +precision: 8 +mulx095 multiply 12345678912 0.1 -> 1.2345679E+9 Inexact Rounded +mulx096 multiply 12345678912345 0.1 -> 1.2345679E+12 Inexact Rounded +precision: 7 +mulx097 multiply 12345678912 0.1 -> 1.234568E+9 Inexact Rounded +mulx098 multiply 12345678912345 0.1 -> 1.234568E+12 Inexact Rounded + +-- test some more edge cases and carries +maxexponent: 9999 +minexponent: -9999 +precision: 33 +mulx101 multiply 9 9 -> 81 +mulx102 multiply 9 90 -> 810 +mulx103 multiply 9 900 -> 8100 +mulx104 multiply 9 9000 -> 81000 +mulx105 multiply 9 90000 -> 810000 +mulx106 multiply 9 900000 -> 8100000 +mulx107 multiply 9 9000000 -> 81000000 +mulx108 multiply 9 90000000 -> 810000000 +mulx109 multiply 9 900000000 -> 8100000000 +mulx110 multiply 9 9000000000 -> 81000000000 +mulx111 multiply 9 90000000000 -> 810000000000 +mulx112 multiply 9 900000000000 -> 8100000000000 +mulx113 multiply 9 9000000000000 -> 81000000000000 +mulx114 multiply 9 90000000000000 -> 810000000000000 +mulx115 multiply 9 900000000000000 -> 8100000000000000 +mulx116 multiply 9 9000000000000000 -> 81000000000000000 +mulx117 multiply 9 90000000000000000 -> 810000000000000000 +mulx118 multiply 9 900000000000000000 -> 8100000000000000000 +mulx119 multiply 9 9000000000000000000 -> 81000000000000000000 +mulx120 multiply 9 90000000000000000000 -> 810000000000000000000 +mulx121 multiply 9 900000000000000000000 -> 8100000000000000000000 +mulx122 multiply 9 9000000000000000000000 -> 81000000000000000000000 +mulx123 multiply 9 90000000000000000000000 -> 810000000000000000000000 +-- test some more edge cases without carries +mulx131 multiply 3 3 -> 9 +mulx132 multiply 3 30 -> 90 +mulx133 multiply 3 300 -> 900 +mulx134 multiply 3 3000 -> 9000 +mulx135 multiply 3 30000 -> 90000 +mulx136 multiply 3 300000 -> 900000 +mulx137 multiply 3 3000000 -> 9000000 +mulx138 multiply 3 30000000 -> 90000000 +mulx139 multiply 3 300000000 -> 900000000 +mulx140 multiply 3 3000000000 -> 9000000000 +mulx141 multiply 3 30000000000 -> 90000000000 +mulx142 multiply 3 300000000000 -> 900000000000 +mulx143 multiply 3 3000000000000 -> 9000000000000 +mulx144 multiply 3 30000000000000 -> 90000000000000 +mulx145 multiply 3 300000000000000 -> 900000000000000 +mulx146 multiply 3 3000000000000000 -> 9000000000000000 +mulx147 multiply 3 30000000000000000 -> 90000000000000000 +mulx148 multiply 3 300000000000000000 -> 900000000000000000 +mulx149 multiply 3 3000000000000000000 -> 9000000000000000000 +mulx150 multiply 3 30000000000000000000 -> 90000000000000000000 +mulx151 multiply 3 300000000000000000000 -> 900000000000000000000 +mulx152 multiply 3 3000000000000000000000 -> 9000000000000000000000 +mulx153 multiply 3 30000000000000000000000 -> 90000000000000000000000 + +maxexponent: 999999999 +minexponent: -999999999 +precision: 9 +-- test some cases that are close to exponent overflow/underflow +mulx170 multiply 1 9e999999999 -> 9E+999999999 +mulx171 multiply 1 9.9e999999999 -> 9.9E+999999999 +mulx172 multiply 1 9.99e999999999 -> 9.99E+999999999 +mulx173 multiply 9e999999999 1 -> 9E+999999999 +mulx174 multiply 9.9e999999999 1 -> 9.9E+999999999 +mulx176 multiply 9.99e999999999 1 -> 9.99E+999999999 +mulx177 multiply 1 9.99999999e999999999 -> 9.99999999E+999999999 +mulx178 multiply 9.99999999e999999999 1 -> 9.99999999E+999999999 + +mulx180 multiply 0.1 9e-999999998 -> 9E-999999999 +mulx181 multiply 0.1 99e-999999998 -> 9.9E-999999998 +mulx182 multiply 0.1 999e-999999998 -> 9.99E-999999997 + +mulx183 multiply 0.1 9e-999999998 -> 9E-999999999 +mulx184 multiply 0.1 99e-999999998 -> 9.9E-999999998 +mulx185 multiply 0.1 999e-999999998 -> 9.99E-999999997 +mulx186 multiply 0.1 999e-999999997 -> 9.99E-999999996 +mulx187 multiply 0.1 9999e-999999997 -> 9.999E-999999995 +mulx188 multiply 0.1 99999e-999999997 -> 9.9999E-999999994 + +mulx190 multiply 1 9e-999999998 -> 9E-999999998 +mulx191 multiply 1 99e-999999998 -> 9.9E-999999997 +mulx192 multiply 1 999e-999999998 -> 9.99E-999999996 +mulx193 multiply 9e-999999998 1 -> 9E-999999998 +mulx194 multiply 99e-999999998 1 -> 9.9E-999999997 +mulx195 multiply 999e-999999998 1 -> 9.99E-999999996 + +mulx196 multiply 1e-599999999 1e-400000000 -> 1E-999999999 +mulx197 multiply 1e-600000000 1e-399999999 -> 1E-999999999 +mulx198 multiply 1.2e-599999999 1.2e-400000000 -> 1.44E-999999999 +mulx199 multiply 1.2e-600000000 1.2e-399999999 -> 1.44E-999999999 + +mulx201 multiply 1e599999999 1e400000000 -> 1E+999999999 +mulx202 multiply 1e600000000 1e399999999 -> 1E+999999999 +mulx203 multiply 1.2e599999999 1.2e400000000 -> 1.44E+999999999 +mulx204 multiply 1.2e600000000 1.2e399999999 -> 1.44E+999999999 + +-- long operand triangle +precision: 33 +mulx246 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193369671916511992830 Inexact Rounded +precision: 32 +mulx247 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119336967191651199283 Inexact Rounded +precision: 31 +mulx248 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719165119928 Inexact Rounded +precision: 30 +mulx249 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193369671916511993 Inexact Rounded +precision: 29 +mulx250 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119336967191651199 Inexact Rounded +precision: 28 +mulx251 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719165120 Inexact Rounded +precision: 27 +mulx252 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193369671916512 Inexact Rounded +precision: 26 +mulx253 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119336967191651 Inexact Rounded +precision: 25 +mulx254 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719165 Inexact Rounded +precision: 24 +mulx255 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193369671917 Inexact Rounded +precision: 23 +mulx256 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119336967192 Inexact Rounded +precision: 22 +mulx257 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719 Inexact Rounded +precision: 21 +mulx258 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193369672 Inexact Rounded +precision: 20 +mulx259 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119336967 Inexact Rounded +precision: 19 +mulx260 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933697 Inexact Rounded +precision: 18 +mulx261 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193370 Inexact Rounded +precision: 17 +mulx262 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119337 Inexact Rounded +precision: 16 +mulx263 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011934 Inexact Rounded +precision: 15 +mulx264 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801193 Inexact Rounded +precision: 14 +mulx265 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119 Inexact Rounded +precision: 13 +mulx266 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908012 Inexact Rounded +precision: 12 +mulx267 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.290801 Inexact Rounded +precision: 11 +mulx268 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080 Inexact Rounded +precision: 10 +mulx269 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908 Inexact Rounded +precision: 9 +mulx270 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.291 Inexact Rounded +precision: 8 +mulx271 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29 Inexact Rounded +precision: 7 +mulx272 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.3 Inexact Rounded +precision: 6 +mulx273 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433 Inexact Rounded +precision: 5 +mulx274 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1.4543E+5 Inexact Rounded +precision: 4 +mulx275 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1.454E+5 Inexact Rounded +precision: 3 +mulx276 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1.45E+5 Inexact Rounded +precision: 2 +mulx277 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1.5E+5 Inexact Rounded +precision: 1 +mulx278 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1E+5 Inexact Rounded + +-- test some edge cases with exact rounding +maxexponent: 9999 +minexponent: -9999 +precision: 9 +mulx301 multiply 9 9 -> 81 +mulx302 multiply 9 90 -> 810 +mulx303 multiply 9 900 -> 8100 +mulx304 multiply 9 9000 -> 81000 +mulx305 multiply 9 90000 -> 810000 +mulx306 multiply 9 900000 -> 8100000 +mulx307 multiply 9 9000000 -> 81000000 +mulx308 multiply 9 90000000 -> 810000000 +mulx309 multiply 9 900000000 -> 8.10000000E+9 Rounded +mulx310 multiply 9 9000000000 -> 8.10000000E+10 Rounded +mulx311 multiply 9 90000000000 -> 8.10000000E+11 Rounded +mulx312 multiply 9 900000000000 -> 8.10000000E+12 Rounded +mulx313 multiply 9 9000000000000 -> 8.10000000E+13 Rounded +mulx314 multiply 9 90000000000000 -> 8.10000000E+14 Rounded +mulx315 multiply 9 900000000000000 -> 8.10000000E+15 Rounded +mulx316 multiply 9 9000000000000000 -> 8.10000000E+16 Rounded +mulx317 multiply 9 90000000000000000 -> 8.10000000E+17 Rounded +mulx318 multiply 9 900000000000000000 -> 8.10000000E+18 Rounded +mulx319 multiply 9 9000000000000000000 -> 8.10000000E+19 Rounded +mulx320 multiply 9 90000000000000000000 -> 8.10000000E+20 Rounded +mulx321 multiply 9 900000000000000000000 -> 8.10000000E+21 Rounded +mulx322 multiply 9 9000000000000000000000 -> 8.10000000E+22 Rounded +mulx323 multiply 9 90000000000000000000000 -> 8.10000000E+23 Rounded + +-- fastpath breakers +precision: 29 +mulx330 multiply 1.491824697641270317824852952837224 1.105170918075647624811707826490246514675628614562883537345747603 -> 1.6487212707001281468486507878 Inexact Rounded +precision: 55 +mulx331 multiply 0.8958341352965282506768545828765117803873717284891040428 0.8958341352965282506768545828765117803873717284891040428 -> 0.8025187979624784829842553829934069955890983696752228299 Inexact Rounded + + +-- tryzeros cases +precision: 7 +rounding: half_up +maxExponent: 92 +minexponent: -92 +mulx504 multiply 0E-60 1000E-60 -> 0E-98 Clamped +mulx505 multiply 100E+60 0E+60 -> 0E+92 Clamped + +-- mixed with zeros +maxexponent: 999999999 +minexponent: -999999999 +precision: 9 +mulx541 multiply 0 -1 -> -0 +mulx542 multiply -0 -1 -> 0 +mulx543 multiply 0 1 -> 0 +mulx544 multiply -0 1 -> -0 +mulx545 multiply -1 0 -> -0 +mulx546 multiply -1 -0 -> 0 +mulx547 multiply 1 0 -> 0 +mulx548 multiply 1 -0 -> -0 + +mulx551 multiply 0.0 -1 -> -0.0 +mulx552 multiply -0.0 -1 -> 0.0 +mulx553 multiply 0.0 1 -> 0.0 +mulx554 multiply -0.0 1 -> -0.0 +mulx555 multiply -1.0 0 -> -0.0 +mulx556 multiply -1.0 -0 -> 0.0 +mulx557 multiply 1.0 0 -> 0.0 +mulx558 multiply 1.0 -0 -> -0.0 + +mulx561 multiply 0 -1.0 -> -0.0 +mulx562 multiply -0 -1.0 -> 0.0 +mulx563 multiply 0 1.0 -> 0.0 +mulx564 multiply -0 1.0 -> -0.0 +mulx565 multiply -1 0.0 -> -0.0 +mulx566 multiply -1 -0.0 -> 0.0 +mulx567 multiply 1 0.0 -> 0.0 +mulx568 multiply 1 -0.0 -> -0.0 + +mulx571 multiply 0.0 -1.0 -> -0.00 +mulx572 multiply -0.0 -1.0 -> 0.00 +mulx573 multiply 0.0 1.0 -> 0.00 +mulx574 multiply -0.0 1.0 -> -0.00 +mulx575 multiply -1.0 0.0 -> -0.00 +mulx576 multiply -1.0 -0.0 -> 0.00 +mulx577 multiply 1.0 0.0 -> 0.00 +mulx578 multiply 1.0 -0.0 -> -0.00 + + +-- Specials +mulx580 multiply Inf -Inf -> -Infinity +mulx581 multiply Inf -1000 -> -Infinity +mulx582 multiply Inf -1 -> -Infinity +mulx583 multiply Inf -0 -> NaN Invalid_operation +mulx584 multiply Inf 0 -> NaN Invalid_operation +mulx585 multiply Inf 1 -> Infinity +mulx586 multiply Inf 1000 -> Infinity +mulx587 multiply Inf Inf -> Infinity +mulx588 multiply -1000 Inf -> -Infinity +mulx589 multiply -Inf Inf -> -Infinity +mulx590 multiply -1 Inf -> -Infinity +mulx591 multiply -0 Inf -> NaN Invalid_operation +mulx592 multiply 0 Inf -> NaN Invalid_operation +mulx593 multiply 1 Inf -> Infinity +mulx594 multiply 1000 Inf -> Infinity +mulx595 multiply Inf Inf -> Infinity + +mulx600 multiply -Inf -Inf -> Infinity +mulx601 multiply -Inf -1000 -> Infinity +mulx602 multiply -Inf -1 -> Infinity +mulx603 multiply -Inf -0 -> NaN Invalid_operation +mulx604 multiply -Inf 0 -> NaN Invalid_operation +mulx605 multiply -Inf 1 -> -Infinity +mulx606 multiply -Inf 1000 -> -Infinity +mulx607 multiply -Inf Inf -> -Infinity +mulx608 multiply -1000 Inf -> -Infinity +mulx609 multiply -Inf -Inf -> Infinity +mulx610 multiply -1 -Inf -> Infinity +mulx611 multiply -0 -Inf -> NaN Invalid_operation +mulx612 multiply 0 -Inf -> NaN Invalid_operation +mulx613 multiply 1 -Inf -> -Infinity +mulx614 multiply 1000 -Inf -> -Infinity +mulx615 multiply Inf -Inf -> -Infinity + +mulx621 multiply NaN -Inf -> NaN +mulx622 multiply NaN -1000 -> NaN +mulx623 multiply NaN -1 -> NaN +mulx624 multiply NaN -0 -> NaN +mulx625 multiply NaN 0 -> NaN +mulx626 multiply NaN 1 -> NaN +mulx627 multiply NaN 1000 -> NaN +mulx628 multiply NaN Inf -> NaN +mulx629 multiply NaN NaN -> NaN +mulx630 multiply -Inf NaN -> NaN +mulx631 multiply -1000 NaN -> NaN +mulx632 multiply -1 NaN -> NaN +mulx633 multiply -0 NaN -> NaN +mulx634 multiply 0 NaN -> NaN +mulx635 multiply 1 NaN -> NaN +mulx636 multiply 1000 NaN -> NaN +mulx637 multiply Inf NaN -> NaN + +mulx641 multiply sNaN -Inf -> NaN Invalid_operation +mulx642 multiply sNaN -1000 -> NaN Invalid_operation +mulx643 multiply sNaN -1 -> NaN Invalid_operation +mulx644 multiply sNaN -0 -> NaN Invalid_operation +mulx645 multiply sNaN 0 -> NaN Invalid_operation +mulx646 multiply sNaN 1 -> NaN Invalid_operation +mulx647 multiply sNaN 1000 -> NaN Invalid_operation +mulx648 multiply sNaN NaN -> NaN Invalid_operation +mulx649 multiply sNaN sNaN -> NaN Invalid_operation +mulx650 multiply NaN sNaN -> NaN Invalid_operation +mulx651 multiply -Inf sNaN -> NaN Invalid_operation +mulx652 multiply -1000 sNaN -> NaN Invalid_operation +mulx653 multiply -1 sNaN -> NaN Invalid_operation +mulx654 multiply -0 sNaN -> NaN Invalid_operation +mulx655 multiply 0 sNaN -> NaN Invalid_operation +mulx656 multiply 1 sNaN -> NaN Invalid_operation +mulx657 multiply 1000 sNaN -> NaN Invalid_operation +mulx658 multiply Inf sNaN -> NaN Invalid_operation +mulx659 multiply NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +mulx661 multiply NaN9 -Inf -> NaN9 +mulx662 multiply NaN8 999 -> NaN8 +mulx663 multiply NaN71 Inf -> NaN71 +mulx664 multiply NaN6 NaN5 -> NaN6 +mulx665 multiply -Inf NaN4 -> NaN4 +mulx666 multiply -999 NaN33 -> NaN33 +mulx667 multiply Inf NaN2 -> NaN2 + +mulx671 multiply sNaN99 -Inf -> NaN99 Invalid_operation +mulx672 multiply sNaN98 -11 -> NaN98 Invalid_operation +mulx673 multiply sNaN97 NaN -> NaN97 Invalid_operation +mulx674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation +mulx675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation +mulx676 multiply -Inf sNaN92 -> NaN92 Invalid_operation +mulx677 multiply 088 sNaN91 -> NaN91 Invalid_operation +mulx678 multiply Inf sNaN90 -> NaN90 Invalid_operation +mulx679 multiply NaN sNaN89 -> NaN89 Invalid_operation + +mulx681 multiply -NaN9 -Inf -> -NaN9 +mulx682 multiply -NaN8 999 -> -NaN8 +mulx683 multiply -NaN71 Inf -> -NaN71 +mulx684 multiply -NaN6 -NaN5 -> -NaN6 +mulx685 multiply -Inf -NaN4 -> -NaN4 +mulx686 multiply -999 -NaN33 -> -NaN33 +mulx687 multiply Inf -NaN2 -> -NaN2 + +mulx691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation +mulx692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation +mulx693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation +mulx694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation +mulx695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation +mulx696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation +mulx697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation +mulx698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation +mulx699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation + +mulx701 multiply -NaN -Inf -> -NaN +mulx702 multiply -NaN 999 -> -NaN +mulx703 multiply -NaN Inf -> -NaN +mulx704 multiply -NaN -NaN -> -NaN +mulx705 multiply -Inf -NaN0 -> -NaN +mulx706 multiply -999 -NaN -> -NaN +mulx707 multiply Inf -NaN -> -NaN + +mulx711 multiply -sNaN -Inf -> -NaN Invalid_operation +mulx712 multiply -sNaN -11 -> -NaN Invalid_operation +mulx713 multiply -sNaN00 NaN -> -NaN Invalid_operation +mulx714 multiply -sNaN -sNaN -> -NaN Invalid_operation +mulx715 multiply -NaN -sNaN -> -NaN Invalid_operation +mulx716 multiply -Inf -sNaN -> -NaN Invalid_operation +mulx717 multiply 088 -sNaN -> -NaN Invalid_operation +mulx718 multiply Inf -sNaN -> -NaN Invalid_operation +mulx719 multiply -NaN -sNaN -> -NaN Invalid_operation + +-- overflow and underflow tests .. note subnormal results +maxexponent: 999999999 +minexponent: -999999999 +mulx730 multiply +1.23456789012345E-0 9E+999999999 -> Infinity Inexact Overflow Rounded +mulx731 multiply 9E+999999999 +1.23456789012345E-0 -> Infinity Inexact Overflow Rounded +mulx732 multiply +0.100 9E-999999999 -> 9.00E-1000000000 Subnormal +mulx733 multiply 9E-999999999 +0.100 -> 9.00E-1000000000 Subnormal +mulx735 multiply -1.23456789012345E-0 9E+999999999 -> -Infinity Inexact Overflow Rounded +mulx736 multiply 9E+999999999 -1.23456789012345E-0 -> -Infinity Inexact Overflow Rounded +mulx737 multiply -0.100 9E-999999999 -> -9.00E-1000000000 Subnormal +mulx738 multiply 9E-999999999 -0.100 -> -9.00E-1000000000 Subnormal + +mulx739 multiply 1e-599999999 1e-400000001 -> 1E-1000000000 Subnormal +mulx740 multiply 1e-599999999 1e-400000000 -> 1E-999999999 +mulx741 multiply 1e-600000000 1e-400000000 -> 1E-1000000000 Subnormal +mulx742 multiply 9e-999999998 0.01 -> 9E-1000000000 Subnormal +mulx743 multiply 9e-999999998 0.1 -> 9E-999999999 +mulx744 multiply 0.01 9e-999999998 -> 9E-1000000000 Subnormal +mulx745 multiply 1e599999999 1e400000001 -> Infinity Overflow Inexact Rounded +mulx746 multiply 1e599999999 1e400000000 -> 1E+999999999 +mulx747 multiply 1e600000000 1e400000000 -> Infinity Overflow Inexact Rounded +mulx748 multiply 9e999999998 100 -> Infinity Overflow Inexact Rounded +mulx749 multiply 9e999999998 10 -> 9.0E+999999999 +mulx750 multiply 100 9e999999998 -> Infinity Overflow Inexact Rounded +-- signs +mulx751 multiply 1e+777777777 1e+411111111 -> Infinity Overflow Inexact Rounded +mulx752 multiply 1e+777777777 -1e+411111111 -> -Infinity Overflow Inexact Rounded +mulx753 multiply -1e+777777777 1e+411111111 -> -Infinity Overflow Inexact Rounded +mulx754 multiply -1e+777777777 -1e+411111111 -> Infinity Overflow Inexact Rounded +mulx755 multiply 1e-777777777 1e-411111111 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +mulx756 multiply 1e-777777777 -1e-411111111 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +mulx757 multiply -1e-777777777 1e-411111111 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +mulx758 multiply -1e-777777777 -1e-411111111 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped + +-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic) +precision: 9 +mulx760 multiply 1e-600000000 1e-400000001 -> 1E-1000000001 Subnormal +mulx761 multiply 1e-600000000 1e-400000002 -> 1E-1000000002 Subnormal +mulx762 multiply 1e-600000000 1e-400000003 -> 1E-1000000003 Subnormal +mulx763 multiply 1e-600000000 1e-400000004 -> 1E-1000000004 Subnormal +mulx764 multiply 1e-600000000 1e-400000005 -> 1E-1000000005 Subnormal +mulx765 multiply 1e-600000000 1e-400000006 -> 1E-1000000006 Subnormal +mulx766 multiply 1e-600000000 1e-400000007 -> 1E-1000000007 Subnormal +mulx767 multiply 1e-600000000 1e-400000008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +mulx768 multiply 1e-600000000 1e-400000009 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +mulx769 multiply 1e-600000000 1e-400000010 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +-- [no equivalent of 'subnormal' for overflow] +mulx770 multiply 1e+600000000 1e+400000001 -> Infinity Overflow Inexact Rounded +mulx771 multiply 1e+600000000 1e+400000002 -> Infinity Overflow Inexact Rounded +mulx772 multiply 1e+600000000 1e+400000003 -> Infinity Overflow Inexact Rounded +mulx773 multiply 1e+600000000 1e+400000004 -> Infinity Overflow Inexact Rounded +mulx774 multiply 1e+600000000 1e+400000005 -> Infinity Overflow Inexact Rounded +mulx775 multiply 1e+600000000 1e+400000006 -> Infinity Overflow Inexact Rounded +mulx776 multiply 1e+600000000 1e+400000007 -> Infinity Overflow Inexact Rounded +mulx777 multiply 1e+600000000 1e+400000008 -> Infinity Overflow Inexact Rounded +mulx778 multiply 1e+600000000 1e+400000009 -> Infinity Overflow Inexact Rounded +mulx779 multiply 1e+600000000 1e+400000010 -> Infinity Overflow Inexact Rounded + +-- 'subnormal' test edge condition at higher precisions +precision: 99 +mulx780 multiply 1e-600000000 1e-400000007 -> 1E-1000000007 Subnormal +mulx781 multiply 1e-600000000 1e-400000008 -> 1E-1000000008 Subnormal +mulx782 multiply 1e-600000000 1e-400000097 -> 1E-1000000097 Subnormal +mulx783 multiply 1e-600000000 1e-400000098 -> 0E-1000000097 Underflow Subnormal Inexact Rounded Clamped +precision: 999 +mulx784 multiply 1e-600000000 1e-400000997 -> 1E-1000000997 Subnormal +mulx785 multiply 1e-600000000 1e-400000998 -> 0E-1000000997 Underflow Subnormal Inexact Rounded Clamped + +-- following testcases [through mulx800] not yet run against code +precision: 9999 +mulx786 multiply 1e-600000000 1e-400009997 -> 1E-1000009997 Subnormal +mulx787 multiply 1e-600000000 1e-400009998 -> 0E-1000009997 Underflow Subnormal Inexact Rounded Clamped +precision: 99999 +mulx788 multiply 1e-600000000 1e-400099997 -> 1E-1000099997 Subnormal +mulx789 multiply 1e-600000000 1e-400099998 -> 0E-1000099997 Underflow Subnormal Inexact Rounded Clamped +precision: 999999 +mulx790 multiply 1e-600000000 1e-400999997 -> 1E-1000999997 Subnormal +mulx791 multiply 1e-600000000 1e-400999998 -> 0E-1000999997 Underflow Subnormal Inexact Rounded Clamped +precision: 9999999 +mulx792 multiply 1e-600000000 1e-409999997 -> 1E-1009999997 Subnormal +mulx793 multiply 1e-600000000 1e-409999998 -> 0E-1009999997 Underflow Subnormal Inexact Rounded Clamped +precision: 99999999 +mulx794 multiply 1e-600000000 1e-499999997 -> 1E-1099999997 Subnormal +mulx795 multiply 1e-600000000 1e-499999998 -> 0E-1099999997 Underflow Subnormal Inexact Rounded Clamped +precision: 999999999 +mulx796 multiply 1e-999999999 1e-999999997 -> 1E-1999999996 Subnormal +mulx797 multiply 1e-999999999 1e-999999998 -> 1E-1999999997 Subnormal +mulx798 multiply 1e-999999999 1e-999999999 -> 0E-1999999997 Underflow Subnormal Inexact Rounded Clamped +mulx799 multiply 1e-600000000 1e-400000007 -> 1E-1000000007 Subnormal +mulx800 multiply 1e-600000000 1e-400000008 -> 1E-1000000008 Subnormal + +-- test subnormals rounding +precision: 5 +maxExponent: 999 +minexponent: -999 +rounding: half_even + +mulx801 multiply 1.0000E-999 1 -> 1.0000E-999 +mulx802 multiply 1.000E-999 1e-1 -> 1.000E-1000 Subnormal +mulx803 multiply 1.00E-999 1e-2 -> 1.00E-1001 Subnormal +mulx804 multiply 1.0E-999 1e-3 -> 1.0E-1002 Subnormal +mulx805 multiply 1.0E-999 1e-4 -> 1E-1003 Subnormal Rounded +mulx806 multiply 1.3E-999 1e-4 -> 1E-1003 Underflow Subnormal Inexact Rounded +mulx807 multiply 1.5E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx808 multiply 1.7E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx809 multiply 2.3E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx810 multiply 2.5E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx811 multiply 2.7E-999 1e-4 -> 3E-1003 Underflow Subnormal Inexact Rounded +mulx812 multiply 1.49E-999 1e-4 -> 1E-1003 Underflow Subnormal Inexact Rounded +mulx813 multiply 1.50E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx814 multiply 1.51E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx815 multiply 2.49E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx816 multiply 2.50E-999 1e-4 -> 2E-1003 Underflow Subnormal Inexact Rounded +mulx817 multiply 2.51E-999 1e-4 -> 3E-1003 Underflow Subnormal Inexact Rounded + +mulx818 multiply 1E-999 1e-4 -> 1E-1003 Subnormal +mulx819 multiply 3E-999 1e-5 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx820 multiply 5E-999 1e-5 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx821 multiply 7E-999 1e-5 -> 1E-1003 Underflow Subnormal Inexact Rounded +mulx822 multiply 9E-999 1e-5 -> 1E-1003 Underflow Subnormal Inexact Rounded +mulx823 multiply 9.9E-999 1e-5 -> 1E-1003 Underflow Subnormal Inexact Rounded + +mulx824 multiply 1E-999 -1e-4 -> -1E-1003 Subnormal +mulx825 multiply 3E-999 -1e-5 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx826 multiply -5E-999 1e-5 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx827 multiply 7E-999 -1e-5 -> -1E-1003 Underflow Subnormal Inexact Rounded +mulx828 multiply -9E-999 1e-5 -> -1E-1003 Underflow Subnormal Inexact Rounded +mulx829 multiply 9.9E-999 -1e-5 -> -1E-1003 Underflow Subnormal Inexact Rounded +mulx830 multiply 3.0E-999 -1e-5 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped + +mulx831 multiply 1.0E-501 1e-501 -> 1.0E-1002 Subnormal +mulx832 multiply 2.0E-501 2e-501 -> 4.0E-1002 Subnormal +mulx833 multiply 4.0E-501 4e-501 -> 1.60E-1001 Subnormal +mulx834 multiply 10.0E-501 10e-501 -> 1.000E-1000 Subnormal +mulx835 multiply 30.0E-501 30e-501 -> 9.000E-1000 Subnormal +mulx836 multiply 40.0E-501 40e-501 -> 1.6000E-999 + +-- squares +mulx840 multiply 1E-502 1e-502 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx841 multiply 1E-501 1e-501 -> 1E-1002 Subnormal +mulx842 multiply 2E-501 2e-501 -> 4E-1002 Subnormal +mulx843 multiply 4E-501 4e-501 -> 1.6E-1001 Subnormal +mulx844 multiply 10E-501 10e-501 -> 1.00E-1000 Subnormal +mulx845 multiply 30E-501 30e-501 -> 9.00E-1000 Subnormal +mulx846 multiply 40E-501 40e-501 -> 1.600E-999 + +-- cubes +mulx850 multiply 1E-670 1e-335 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx851 multiply 1E-668 1e-334 -> 1E-1002 Subnormal +mulx852 multiply 4E-668 2e-334 -> 8E-1002 Subnormal +mulx853 multiply 9E-668 3e-334 -> 2.7E-1001 Subnormal +mulx854 multiply 16E-668 4e-334 -> 6.4E-1001 Subnormal +mulx855 multiply 25E-668 5e-334 -> 1.25E-1000 Subnormal +mulx856 multiply 10E-668 100e-334 -> 1.000E-999 + +-- test from 0.099 ** 999 at 15 digits +precision: 19 +mulx860 multiply 6636851557994578716E-520 6636851557994578716E-520 -> 4.40477986028551E-1003 Underflow Subnormal Inexact Rounded + +-- Long operand overflow may be a different path +precision: 3 +maxExponent: 999999999 +minexponent: -999999999 +mulx870 multiply 1 9.999E+999999999 -> Infinity Inexact Overflow Rounded +mulx871 multiply 1 -9.999E+999999999 -> -Infinity Inexact Overflow Rounded +mulx872 multiply 9.999E+999999999 1 -> Infinity Inexact Overflow Rounded +mulx873 multiply -9.999E+999999999 1 -> -Infinity Inexact Overflow Rounded + +-- check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +mulx881 multiply 1.2347E-40 1.2347E-40 -> 1.524E-80 Inexact Rounded Subnormal Underflow +mulx882 multiply 1.234E-40 1.234E-40 -> 1.523E-80 Inexact Rounded Subnormal Underflow +mulx883 multiply 1.23E-40 1.23E-40 -> 1.513E-80 Inexact Rounded Subnormal Underflow +mulx884 multiply 1.2E-40 1.2E-40 -> 1.44E-80 Subnormal +mulx885 multiply 1.2E-40 1.2E-41 -> 1.44E-81 Subnormal +mulx886 multiply 1.2E-40 1.2E-42 -> 1.4E-82 Subnormal Inexact Rounded Underflow +mulx887 multiply 1.2E-40 1.3E-42 -> 1.6E-82 Subnormal Inexact Rounded Underflow +mulx888 multiply 1.3E-40 1.3E-42 -> 1.7E-82 Subnormal Inexact Rounded Underflow +mulx889 multiply 1.3E-40 1.3E-43 -> 2E-83 Subnormal Inexact Rounded Underflow +mulx890 multiply 1.3E-41 1.3E-43 -> 0E-83 Clamped Subnormal Inexact Rounded Underflow + +mulx891 multiply 1.2345E-39 1.234E-40 -> 1.5234E-79 Inexact Rounded +mulx892 multiply 1.23456E-39 1.234E-40 -> 1.5234E-79 Inexact Rounded +mulx893 multiply 1.2345E-40 1.234E-40 -> 1.523E-80 Inexact Rounded Subnormal Underflow +mulx894 multiply 1.23456E-40 1.234E-40 -> 1.523E-80 Inexact Rounded Subnormal Underflow +mulx895 multiply 1.2345E-41 1.234E-40 -> 1.52E-81 Inexact Rounded Subnormal Underflow +mulx896 multiply 1.23456E-41 1.234E-40 -> 1.52E-81 Inexact Rounded Subnormal Underflow + +-- Now explore the case where we get a normal result with Underflow +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 + +mulx900 multiply 0.3000000000E-191 0.3000000000E-191 -> 9.00000000000000E-384 Subnormal Rounded +mulx901 multiply 0.3000000001E-191 0.3000000001E-191 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded +mulx902 multiply 9.999999999999999E-383 0.0999999999999 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded +mulx903 multiply 9.999999999999999E-383 0.09999999999999 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded +mulx904 multiply 9.999999999999999E-383 0.099999999999999 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded +mulx905 multiply 9.999999999999999E-383 0.0999999999999999 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded +-- prove operands are exact +mulx906 multiply 9.999999999999999E-383 1 -> 9.999999999999999E-383 +mulx907 multiply 1 0.09999999999999999 -> 0.09999999999999999 +-- the next rounds to Nmin +mulx908 multiply 9.999999999999999E-383 0.09999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +mulx909 multiply 9.999999999999999E-383 0.099999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +mulx910 multiply 9.999999999999999E-383 0.0999999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded +mulx911 multiply 9.999999999999999E-383 0.09999999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded + + +-- Examples from SQL proposal (Krishna Kulkarni) +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +mulx1001 multiply 130E-2 120E-2 -> 1.5600 +mulx1002 multiply 130E-2 12E-1 -> 1.560 +mulx1003 multiply 130E-2 1E0 -> 1.30 +mulx1004 multiply 1E2 1E4 -> 1E+6 + +-- Null tests +mulx990 multiply 10 # -> NaN Invalid_operation +mulx991 multiply # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal-c/new_dt/normalize.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/normalize.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,228 @@ +------------------------------------------------------------------------ +-- normalize.decTest -- remove trailing zeros -- +-- Copyright (c) IBM Corporation, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +nrmx001 normalize '1' -> '1' +nrmx002 normalize '-1' -> '-1' +nrmx003 normalize '1.00' -> '1' +nrmx004 normalize '-1.00' -> '-1' +nrmx005 normalize '0' -> '0' +nrmx006 normalize '0.00' -> '0' +nrmx007 normalize '00.0' -> '0' +nrmx008 normalize '00.00' -> '0' +nrmx009 normalize '00' -> '0' +nrmx010 normalize '0E+1' -> '0' +nrmx011 normalize '0E+5' -> '0' + +nrmx012 normalize '-2' -> '-2' +nrmx013 normalize '2' -> '2' +nrmx014 normalize '-2.00' -> '-2' +nrmx015 normalize '2.00' -> '2' +nrmx016 normalize '-0' -> '-0' +nrmx017 normalize '-0.00' -> '-0' +nrmx018 normalize '-00.0' -> '-0' +nrmx019 normalize '-00.00' -> '-0' +nrmx020 normalize '-00' -> '-0' +nrmx021 normalize '-0E+5' -> '-0' +nrmx022 normalize '-0E+1' -> '-0' + +nrmx030 normalize '+0.1' -> '0.1' +nrmx031 normalize '-0.1' -> '-0.1' +nrmx032 normalize '+0.01' -> '0.01' +nrmx033 normalize '-0.01' -> '-0.01' +nrmx034 normalize '+0.001' -> '0.001' +nrmx035 normalize '-0.001' -> '-0.001' +nrmx036 normalize '+0.000001' -> '0.000001' +nrmx037 normalize '-0.000001' -> '-0.000001' +nrmx038 normalize '+0.000000000001' -> '1E-12' +nrmx039 normalize '-0.000000000001' -> '-1E-12' + +nrmx041 normalize 1.1 -> 1.1 +nrmx042 normalize 1.10 -> 1.1 +nrmx043 normalize 1.100 -> 1.1 +nrmx044 normalize 1.110 -> 1.11 +nrmx045 normalize -1.1 -> -1.1 +nrmx046 normalize -1.10 -> -1.1 +nrmx047 normalize -1.100 -> -1.1 +nrmx048 normalize -1.110 -> -1.11 +nrmx049 normalize 9.9 -> 9.9 +nrmx050 normalize 9.90 -> 9.9 +nrmx051 normalize 9.900 -> 9.9 +nrmx052 normalize 9.990 -> 9.99 +nrmx053 normalize -9.9 -> -9.9 +nrmx054 normalize -9.90 -> -9.9 +nrmx055 normalize -9.900 -> -9.9 +nrmx056 normalize -9.990 -> -9.99 + +-- some trailing fractional zeros with zeros in units +nrmx060 normalize 10.0 -> 1E+1 +nrmx061 normalize 10.00 -> 1E+1 +nrmx062 normalize 100.0 -> 1E+2 +nrmx063 normalize 100.00 -> 1E+2 +nrmx064 normalize 1.1000E+3 -> 1.1E+3 +nrmx065 normalize 1.10000E+3 -> 1.1E+3 +nrmx066 normalize -10.0 -> -1E+1 +nrmx067 normalize -10.00 -> -1E+1 +nrmx068 normalize -100.0 -> -1E+2 +nrmx069 normalize -100.00 -> -1E+2 +nrmx070 normalize -1.1000E+3 -> -1.1E+3 +nrmx071 normalize -1.10000E+3 -> -1.1E+3 + +-- some insignificant trailing zeros with positive exponent +nrmx080 normalize 10E+1 -> 1E+2 +nrmx081 normalize 100E+1 -> 1E+3 +nrmx082 normalize 1.0E+2 -> 1E+2 +nrmx083 normalize 1.0E+3 -> 1E+3 +nrmx084 normalize 1.1E+3 -> 1.1E+3 +nrmx085 normalize 1.00E+3 -> 1E+3 +nrmx086 normalize 1.10E+3 -> 1.1E+3 +nrmx087 normalize -10E+1 -> -1E+2 +nrmx088 normalize -100E+1 -> -1E+3 +nrmx089 normalize -1.0E+2 -> -1E+2 +nrmx090 normalize -1.0E+3 -> -1E+3 +nrmx091 normalize -1.1E+3 -> -1.1E+3 +nrmx092 normalize -1.00E+3 -> -1E+3 +nrmx093 normalize -1.10E+3 -> -1.1E+3 + +-- some significant trailing zeros, were we to be trimming +nrmx100 normalize 11 -> 11 +nrmx101 normalize 10 -> 1E+1 +nrmx102 normalize 10. -> 1E+1 +nrmx103 normalize 1.1E+1 -> 11 +nrmx104 normalize 1.0E+1 -> 1E+1 +nrmx105 normalize 1.10E+2 -> 1.1E+2 +nrmx106 normalize 1.00E+2 -> 1E+2 +nrmx107 normalize 1.100E+3 -> 1.1E+3 +nrmx108 normalize 1.000E+3 -> 1E+3 +nrmx109 normalize 1.000000E+6 -> 1E+6 +nrmx110 normalize -11 -> -11 +nrmx111 normalize -10 -> -1E+1 +nrmx112 normalize -10. -> -1E+1 +nrmx113 normalize -1.1E+1 -> -11 +nrmx114 normalize -1.0E+1 -> -1E+1 +nrmx115 normalize -1.10E+2 -> -1.1E+2 +nrmx116 normalize -1.00E+2 -> -1E+2 +nrmx117 normalize -1.100E+3 -> -1.1E+3 +nrmx118 normalize -1.000E+3 -> -1E+3 +nrmx119 normalize -1.00000E+5 -> -1E+5 +nrmx120 normalize -1.000000E+6 -> -1E+6 +nrmx121 normalize -10.00000E+6 -> -1E+7 +nrmx122 normalize -100.0000E+6 -> -1E+8 +nrmx123 normalize -1000.000E+6 -> -1E+9 +nrmx124 normalize -10000.00E+6 -> -1E+10 +nrmx125 normalize -100000.0E+6 -> -1E+11 +nrmx126 normalize -1000000.E+6 -> -1E+12 + +-- examples from decArith +nrmx140 normalize '2.1' -> '2.1' +nrmx141 normalize '-2.0' -> '-2' +nrmx142 normalize '1.200' -> '1.2' +nrmx143 normalize '-120' -> '-1.2E+2' +nrmx144 normalize '120.00' -> '1.2E+2' +nrmx145 normalize '0.00' -> '0' + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +nrmx160 normalize 9.999E+999999999 -> Infinity Inexact Overflow Rounded +nrmx161 normalize -9.999E+999999999 -> -Infinity Inexact Overflow Rounded + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +nrmx210 normalize 1.00E-999 -> 1E-999 +nrmx211 normalize 0.1E-999 -> 1E-1000 Subnormal +nrmx212 normalize 0.10E-999 -> 1E-1000 Subnormal +nrmx213 normalize 0.100E-999 -> 1E-1000 Subnormal Rounded +nrmx214 normalize 0.01E-999 -> 1E-1001 Subnormal +-- next is rounded to Emin +nrmx215 normalize 0.999E-999 -> 1E-999 Inexact Rounded Subnormal Underflow +nrmx216 normalize 0.099E-999 -> 1E-1000 Inexact Rounded Subnormal Underflow +nrmx217 normalize 0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow +nrmx218 normalize 0.001E-999 -> 0 Inexact Rounded Subnormal Underflow Clamped +nrmx219 normalize 0.0009E-999 -> 0 Inexact Rounded Subnormal Underflow Clamped +nrmx220 normalize 0.0001E-999 -> 0 Inexact Rounded Subnormal Underflow Clamped + +nrmx230 normalize -1.00E-999 -> -1E-999 +nrmx231 normalize -0.1E-999 -> -1E-1000 Subnormal +nrmx232 normalize -0.10E-999 -> -1E-1000 Subnormal +nrmx233 normalize -0.100E-999 -> -1E-1000 Subnormal Rounded +nrmx234 normalize -0.01E-999 -> -1E-1001 Subnormal +-- next is rounded to Emin +nrmx235 normalize -0.999E-999 -> -1E-999 Inexact Rounded Subnormal Underflow +nrmx236 normalize -0.099E-999 -> -1E-1000 Inexact Rounded Subnormal Underflow +nrmx237 normalize -0.009E-999 -> -1E-1001 Inexact Rounded Subnormal Underflow +nrmx238 normalize -0.001E-999 -> -0 Inexact Rounded Subnormal Underflow Clamped +nrmx239 normalize -0.0009E-999 -> -0 Inexact Rounded Subnormal Underflow Clamped +nrmx240 normalize -0.0001E-999 -> -0 Inexact Rounded Subnormal Underflow Clamped + +-- more reshaping +precision: 9 +nrmx260 normalize '56260E-10' -> '0.000005626' +nrmx261 normalize '56260E-5' -> '0.5626' +nrmx262 normalize '56260E-2' -> '562.6' +nrmx263 normalize '56260E-1' -> '5626' +nrmx265 normalize '56260E-0' -> '5.626E+4' +nrmx266 normalize '56260E+0' -> '5.626E+4' +nrmx267 normalize '56260E+1' -> '5.626E+5' +nrmx268 normalize '56260E+2' -> '5.626E+6' +nrmx269 normalize '56260E+3' -> '5.626E+7' +nrmx270 normalize '56260E+4' -> '5.626E+8' +nrmx271 normalize '56260E+5' -> '5.626E+9' +nrmx272 normalize '56260E+6' -> '5.626E+10' +nrmx280 normalize '-56260E-10' -> '-0.000005626' +nrmx281 normalize '-56260E-5' -> '-0.5626' +nrmx282 normalize '-56260E-2' -> '-562.6' +nrmx283 normalize '-56260E-1' -> '-5626' +nrmx285 normalize '-56260E-0' -> '-5.626E+4' +nrmx286 normalize '-56260E+0' -> '-5.626E+4' +nrmx287 normalize '-56260E+1' -> '-5.626E+5' +nrmx288 normalize '-56260E+2' -> '-5.626E+6' +nrmx289 normalize '-56260E+3' -> '-5.626E+7' +nrmx290 normalize '-56260E+4' -> '-5.626E+8' +nrmx291 normalize '-56260E+5' -> '-5.626E+9' +nrmx292 normalize '-56260E+6' -> '-5.626E+10' + +-- FL test +precision: 40 +nrmx295 normalize 9892345673.0123456780000000000 -> 9892345673.012345678 + +-- specials +nrmx820 normalize 'Inf' -> 'Infinity' +nrmx821 normalize '-Inf' -> '-Infinity' +nrmx822 normalize NaN -> NaN +nrmx823 normalize sNaN -> NaN Invalid_operation +nrmx824 normalize NaN101 -> NaN101 +nrmx825 normalize sNaN010 -> NaN10 Invalid_operation +nrmx827 normalize -NaN -> -NaN +nrmx828 normalize -sNaN -> -NaN Invalid_operation +nrmx829 normalize -NaN101 -> -NaN101 +nrmx830 normalize -sNaN010 -> -NaN10 Invalid_operation + +-- Null test +nrmx900 normalize # -> NaN Invalid_operation Added: sandbox/trunk/decimal-c/new_dt/plus.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/plus.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,195 @@ +------------------------------------------------------------------------ +-- plus.decTest -- decimal monadic addition -- +-- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- This set of tests primarily tests the existence of the operator. +-- Addition and rounding, and most overflows, are tested elsewhere. + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +plux001 plus '1' -> '1' +plux002 plus '-1' -> '-1' +plux003 plus '1.00' -> '1.00' +plux004 plus '-1.00' -> '-1.00' +plux005 plus '0' -> '0' +plux006 plus '0.00' -> '0.00' +plux007 plus '00.0' -> '0.0' +plux008 plus '00.00' -> '0.00' +plux009 plus '00' -> '0' + +plux010 plus '-2' -> '-2' +plux011 plus '2' -> '2' +plux012 plus '-2.00' -> '-2.00' +plux013 plus '2.00' -> '2.00' +plux014 plus '-0' -> '0' +plux015 plus '-0.00' -> '0.00' +plux016 plus '-00.0' -> '0.0' +plux017 plus '-00.00' -> '0.00' +plux018 plus '-00' -> '0' + +plux020 plus '-2000000' -> '-2000000' +plux021 plus '2000000' -> '2000000' +precision: 7 +plux022 plus '-2000000' -> '-2000000' +plux023 plus '2000000' -> '2000000' +precision: 6 +plux024 plus '-2000000' -> '-2.00000E+6' Rounded +plux025 plus '2000000' -> '2.00000E+6' Rounded +precision: 3 +plux026 plus '-2000000' -> '-2.00E+6' Rounded +plux027 plus '2000000' -> '2.00E+6' Rounded + +-- more fixed, potential LHS swaps if done by add 0 +precision: 9 +plux060 plus '56267E-10' -> '0.0000056267' +plux061 plus '56267E-5' -> '0.56267' +plux062 plus '56267E-2' -> '562.67' +plux063 plus '56267E-1' -> '5626.7' +plux065 plus '56267E-0' -> '56267' +plux066 plus '56267E+0' -> '56267' +plux067 plus '56267E+1' -> '5.6267E+5' +plux068 plus '56267E+2' -> '5.6267E+6' +plux069 plus '56267E+3' -> '5.6267E+7' +plux070 plus '56267E+4' -> '5.6267E+8' +plux071 plus '56267E+5' -> '5.6267E+9' +plux072 plus '56267E+6' -> '5.6267E+10' +plux080 plus '-56267E-10' -> '-0.0000056267' +plux081 plus '-56267E-5' -> '-0.56267' +plux082 plus '-56267E-2' -> '-562.67' +plux083 plus '-56267E-1' -> '-5626.7' +plux085 plus '-56267E-0' -> '-56267' +plux086 plus '-56267E+0' -> '-56267' +plux087 plus '-56267E+1' -> '-5.6267E+5' +plux088 plus '-56267E+2' -> '-5.6267E+6' +plux089 plus '-56267E+3' -> '-5.6267E+7' +plux090 plus '-56267E+4' -> '-5.6267E+8' +plux091 plus '-56267E+5' -> '-5.6267E+9' +plux092 plus '-56267E+6' -> '-5.6267E+10' + +-- "lhs" zeros in plus and minus have exponent = operand +plux120 plus '-0E3' -> '0E+3' +plux121 plus '-0E2' -> '0E+2' +plux122 plus '-0E1' -> '0E+1' +plux123 plus '-0E0' -> '0' +plux124 plus '+0E0' -> '0' +plux125 plus '+0E1' -> '0E+1' +plux126 plus '+0E2' -> '0E+2' +plux127 plus '+0E3' -> '0E+3' + +plux130 plus '-5E3' -> '-5E+3' +plux131 plus '-5E8' -> '-5E+8' +plux132 plus '-5E13' -> '-5E+13' +plux133 plus '-5E18' -> '-5E+18' +plux134 plus '+5E3' -> '5E+3' +plux135 plus '+5E8' -> '5E+8' +plux136 plus '+5E13' -> '5E+13' +plux137 plus '+5E18' -> '5E+18' + +-- specials +plux150 plus 'Inf' -> 'Infinity' +plux151 plus '-Inf' -> '-Infinity' +plux152 plus NaN -> NaN +plux153 plus sNaN -> NaN Invalid_operation +plux154 plus NaN77 -> NaN77 +plux155 plus sNaN88 -> NaN88 Invalid_operation +plux156 plus -NaN -> -NaN +plux157 plus -sNaN -> -NaN Invalid_operation +plux158 plus -NaN77 -> -NaN77 +plux159 plus -sNaN88 -> -NaN88 Invalid_operation + +-- overflow tests +maxexponent: 999999999 +minexponent: -999999999 +precision: 3 +plux160 plus 9.999E+999999999 -> Infinity Inexact Overflow Rounded +plux161 plus -9.999E+999999999 -> -Infinity Inexact Overflow Rounded + +-- subnormals and underflow +precision: 3 +maxexponent: 999 +minexponent: -999 +plux210 plus 1.00E-999 -> 1.00E-999 +plux211 plus 0.1E-999 -> 1E-1000 Subnormal +plux212 plus 0.10E-999 -> 1.0E-1000 Subnormal +plux213 plus 0.100E-999 -> 1.0E-1000 Subnormal Rounded +plux214 plus 0.01E-999 -> 1E-1001 Subnormal +-- next is rounded to Emin +plux215 plus 0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow +plux216 plus 0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +plux217 plus 0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow +plux218 plus 0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +plux219 plus 0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +plux220 plus 0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +plux230 plus -1.00E-999 -> -1.00E-999 +plux231 plus -0.1E-999 -> -1E-1000 Subnormal +plux232 plus -0.10E-999 -> -1.0E-1000 Subnormal +plux233 plus -0.100E-999 -> -1.0E-1000 Subnormal Rounded +plux234 plus -0.01E-999 -> -1E-1001 Subnormal +-- next is rounded to Emin +plux235 plus -0.999E-999 -> -1.00E-999 Inexact Rounded Subnormal Underflow +plux236 plus -0.099E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +plux237 plus -0.009E-999 -> -1E-1001 Inexact Rounded Subnormal Underflow +plux238 plus -0.001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +plux239 plus -0.0009E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +plux240 plus -0.0001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped + +-- subnormals clamped to 0-Etiny +precision: 16 +maxExponent: 384 +minExponent: -383 +plux251 plus 7E-398 -> 7E-398 Subnormal +plux252 plus 0E-398 -> 0E-398 +plux253 plus 7E-399 -> 1E-398 Subnormal Underflow Inexact Rounded +plux254 plus 4E-399 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded +plux255 plus 7E-400 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded +plux256 plus 7E-401 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded +plux257 plus 0E-399 -> 0E-398 Clamped +plux258 plus 0E-400 -> 0E-398 Clamped +plux259 plus 0E-401 -> 0E-398 Clamped + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +plux301 plus 12345678000 -> 1.23456780E+10 Rounded +plux302 plus 1234567800 -> 1.23456780E+9 Rounded +plux303 plus 1234567890 -> 1.23456789E+9 Rounded +plux304 plus 1234567891 -> 1.23456789E+9 Inexact Rounded +plux305 plus 12345678901 -> 1.23456789E+10 Inexact Rounded +plux306 plus 1234567896 -> 1.23456790E+9 Inexact Rounded + +-- still checking +precision: 15 +plux321 plus 12345678000 -> 12345678000 +plux322 plus 1234567800 -> 1234567800 +plux323 plus 1234567890 -> 1234567890 +plux324 plus 1234567891 -> 1234567891 +plux325 plus 12345678901 -> 12345678901 +plux326 plus 1234567896 -> 1234567896 +precision: 9 + +-- Null tests +plu900 plus # -> NaN Invalid_operation + Added: sandbox/trunk/decimal-c/new_dt/power.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/power.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,1581 @@ +------------------------------------------------------------------------ +-- power.decTest -- decimal exponentiation [power(x, y)] -- +-- Copyright (c) IBM Corporation, 1981, 2005. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- In addition to the power operator testcases here, see also the file +-- powersqrt.decTest which includes all the tests from +-- squareroot.decTest implemented using power(x, 0.5) + +extended: 1 +precision: 16 +rounding: half_even +maxExponent: 384 +minExponent: -383 + +-- base checks. Note 0**0 is an error. +powx001 power '0' '0' -> NaN Invalid_operation +powx002 power '0' '1' -> '0' +powx003 power '0' '2' -> '0' +powx004 power '1' '0' -> '1' +powx005 power '1' '1' -> '1' +powx006 power '1' '2' -> '1' + +powx010 power '2' '0' -> '1' +powx011 power '2' '1' -> '2' +powx012 power '2' '2' -> '4' +powx013 power '2' '3' -> '8' +powx014 power '2' '4' -> '16' +powx015 power '2' '5' -> '32' +powx016 power '2' '6' -> '64' +powx017 power '2' '7' -> '128' +powx018 power '2' '8' -> '256' +powx019 power '2' '9' -> '512' +powx020 power '2' '10' -> '1024' +powx021 power '2' '11' -> '2048' +powx022 power '2' '12' -> '4096' +powx023 power '2' '15' -> '32768' +powx024 power '2' '16' -> '65536' +powx025 power '2' '31' -> '2147483648 +-- NB 0 not stripped in next +powx026 power '2' '32' -> '4294967296 + +precision: 9 +powx027 power '2' '31' -> '2.14748365E+9' Inexact Rounded +-- NB 0 not stripped in next +powx028 power '2' '32' -> '4.29496730E+9' Inexact Rounded +precision: 10 +powx029 power '2' '31' -> '2147483648' +powx030 power '2' '32' -> '4294967296' +precision: 9 + +powx031 power '3' '2' -> 9 +powx032 power '4' '2' -> 16 +powx033 power '5' '2' -> 25 +powx034 power '6' '2' -> 36 +powx035 power '7' '2' -> 49 +powx036 power '8' '2' -> 64 +powx037 power '9' '2' -> 81 +powx038 power '10' '2' -> 100 +powx039 power '11' '2' -> 121 +powx040 power '12' '2' -> 144 + +powx041 power '3' '3' -> 27 +powx042 power '4' '3' -> 64 +powx043 power '5' '3' -> 125 +powx044 power '6' '3' -> 216 +powx045 power '7' '3' -> 343 +powx047 power '-3' '3' -> -27 +powx048 power '-4' '3' -> -64 +powx049 power '-5' '3' -> -125 +powx050 power '-6' '3' -> -216 +powx051 power '-7' '3' -> -343 + +powx052 power '10' '0' -> 1 +powx053 power '10' '1' -> 10 +powx054 power '10' '2' -> 100 +powx055 power '10' '3' -> 1000 +powx056 power '10' '4' -> 10000 +powx057 power '10' '5' -> 100000 +powx058 power '10' '6' -> 1000000 +powx059 power '10' '7' -> 10000000 +powx060 power '10' '8' -> 100000000 +powx061 power '10' '9' -> 1.00000000E+9 Rounded +powx062 power '10' '22' -> 1.00000000E+22 Rounded +powx063 power '10' '77' -> 1.00000000E+77 Rounded +powx064 power '10' '99' -> 1.00000000E+99 Rounded + +powx070 power '0.3' '0' -> '1' +powx071 power '0.3' '1' -> '0.3' +powx072 power '0.3' '1.00' -> '0.3' +powx073 power '0.3' '2.00' -> '0.09' +powx074 power '0.3' '2.000000000' -> '0.09' +powx075 power '6.0' '1' -> '6.0' -- NB zeros not stripped +powx076 power '6.0' '2' -> '36.00' -- .. +powx077 power '-3' '2' -> '9' -- from NetRexx book +powx078 power '4' '3' -> '64' -- .. (sort of) + +powx080 power 0.1 0 -> 1 +powx081 power 0.1 1 -> 0.1 +powx082 power 0.1 2 -> 0.01 +powx083 power 0.1 3 -> 0.001 +powx084 power 0.1 4 -> 0.0001 +powx085 power 0.1 5 -> 0.00001 +powx086 power 0.1 6 -> 0.000001 +powx087 power 0.1 7 -> 1E-7 +powx088 power 0.1 8 -> 1E-8 +powx089 power 0.1 9 -> 1E-9 + +powx090 power 101 2 -> 10201 +powx091 power 101 3 -> 1030301 +powx092 power 101 4 -> 104060401 +powx093 power 101 5 -> 1.05101005E+10 Inexact Rounded +powx094 power 101 6 -> 1.06152015E+12 Inexact Rounded +powx095 power 101 7 -> 1.07213535E+14 Inexact Rounded + +-- negative powers +powx099 power '1' '-1' -> 1 +powx100 power '3' '-1' -> 0.333333333 Inexact Rounded +powx101 power '2' '-1' -> 0.5 +powx102 power '2' '-2' -> 0.25 +powx103 power '2' '-4' -> 0.0625 +powx104 power '2' '-8' -> 0.00390625 +powx105 power '2' '-16' -> 0.0000152587891 Inexact Rounded +powx106 power '2' '-32' -> 2.32830644E-10 Inexact Rounded +powx108 power '2' '-64' -> 5.42101086E-20 Inexact Rounded +powx110 power '10' '-8' -> 1E-8 +powx111 power '10' '-7' -> 1E-7 +powx112 power '10' '-6' -> 0.000001 +powx113 power '10' '-5' -> 0.00001 +powx114 power '10' '-4' -> 0.0001 +powx115 power '10' '-3' -> 0.001 +powx116 power '10' '-2' -> 0.01 +powx117 power '10' '-1' -> 0.1 +powx121 power '10' '-77' -> '1E-77' +powx122 power '10' '-22' -> '1E-22' + +powx123 power '2' '-1' -> '0.5' +powx124 power '2' '-2' -> '0.25' +powx125 power '2' '-4' -> '0.0625' + +powx126 power '0' '-1' -> Infinity +powx127 power '0' '-2' -> Infinity +powx128 power -0 '-1' -> -Infinity +powx129 power -0 '-2' -> Infinity + +-- "0.5" tests from original Rexx diagnostics [loop unrolled] +powx200 power 0.5 0 -> 1 +powx201 power 0.5 1 -> 0.5 +powx202 power 0.5 2 -> 0.25 +powx203 power 0.5 3 -> 0.125 +powx204 power 0.5 4 -> 0.0625 +powx205 power 0.5 5 -> 0.03125 +powx206 power 0.5 6 -> 0.015625 +powx207 power 0.5 7 -> 0.0078125 +powx208 power 0.5 8 -> 0.00390625 +powx209 power 0.5 9 -> 0.001953125 +powx210 power 0.5 10 -> 0.0009765625 + +powx211 power 1 100000000 -> 1 +powx212 power 1 999999998 -> 1 +powx213 power 1 999999999 -> 1 + + +-- The Vienna case. Checks both setup and 1/acc working precision +-- Modified 1998.12.14 as RHS no longer rounded before use (must fit) +-- Modified 1990.02.04 as LHS is now rounded (instead of truncated to guard) +-- '123456789E+10' -- lhs .. rounded to 1.23E+18 +-- '-1.23000e+2' -- rhs .. [was: -1.23455e+2, rounds to -123] +-- Modified 2002.10.06 -- finally, no input rounding +-- With input rounding, result would be 8.74E-2226 +precision: 3 +maxexponent: 5000 +minexponent: -5000 +powx219 power '123456789E+10' '-1.23000e+2' -> '5.54E-2226' Inexact Rounded + +-- zeros +maxexponent: +96 +minexponent: -95 +precision: 7 +powx223 power 0E-30 3 -> 0 +powx224 power 0E-10 3 -> 0 +powx225 power 0E-1 3 -> 0 +powx226 power 0E+0 3 -> 0 +powx227 power 0 3 -> 0 +powx228 power 0E+1 3 -> 0 +powx229 power 0E+10 3 -> 0 +powx230 power 0E+30 3 -> 0 +powx231 power 3 0E-30 -> 1 +powx232 power 3 0E-10 -> 1 +powx233 power 3 0E-1 -> 1 +powx234 power 3 0E+0 -> 1 +powx235 power 3 0 -> 1 +powx236 power 3 0E+1 -> 1 +powx237 power 3 0E+10 -> 1 +powx238 power 3 0E+30 -> 1 +powx239 power 0E-30 -3 -> Infinity +powx240 power 0E-10 -3 -> Infinity +powx241 power 0E-1 -3 -> Infinity +powx242 power 0E+0 -3 -> Infinity +powx243 power 0 -3 -> Infinity +powx244 power 0E+1 -3 -> Infinity +powx245 power 0E+10 -3 -> Infinity +powx246 power 0E+30 -3 -> Infinity +powx247 power -3 0E-30 -> 1 +powx248 power -3 0E-10 -> 1 +powx249 power -3 0E-1 -> 1 +powx250 power -3 0E+0 -> 1 +powx251 power -3 0 -> 1 +powx252 power -3 0E+1 -> 1 +powx253 power -3 0E+10 -> 1 +powx254 power -3 0E+30 -> 1 + +-- a few lhs negatives +precision: 9 +maxExponent: 999 +minexponent: -999 +powx260 power -10 '0' -> 1 +powx261 power -10 '1' -> -10 +powx262 power -10 '2' -> 100 +powx263 power -10 '3' -> -1000 +powx264 power -10 '4' -> 10000 +powx265 power -10 '5' -> -100000 +powx266 power -10 '6' -> 1000000 +powx267 power -10 '7' -> -10000000 +powx268 power -10 '8' -> 100000000 +powx269 power -10 '9' -> -1.00000000E+9 Rounded +powx270 power -10 '22' -> 1.00000000E+22 Rounded +powx271 power -10 '77' -> -1.00000000E+77 Rounded +powx272 power -10 '99' -> -1.00000000E+99 Rounded + +-- some more edge cases +precision: 15 +maxExponent: 999 +minexponent: -999 +powx391 power 0.1 999 -> 1E-999 +powx392 power 0.099 999 -> 4.360732062E-1004 Underflow Subnormal Inexact Rounded +powx393 power 0.098 999 -> 1.71731E-1008 Underflow Subnormal Inexact Rounded +powx394 power 0.097 999 -> 6E-1013 Underflow Subnormal Inexact Rounded +powx395 power 0.096 999 -> 0E-1013 Underflow Subnormal Inexact Rounded Clamped +powx396 power 0.01 999 -> 0E-1013 Underflow Subnormal Inexact Rounded Clamped +powx397 power 0.02 100000000 -> 0E-1013 Underflow Subnormal Inexact Rounded Clamped + +-- multiply tests are here to aid checking and test for consistent handling +-- of underflow +precision: 5 +maxexponent: 999 +minexponent: -999 + +-- squares +mulx400 multiply 1E-502 1e-502 -> 0E-1003 Subnormal Inexact Underflow Rounded Clamped +mulx401 multiply 1E-501 1e-501 -> 1E-1002 Subnormal +mulx402 multiply 2E-501 2e-501 -> 4E-1002 Subnormal +mulx403 multiply 4E-501 4e-501 -> 1.6E-1001 Subnormal +mulx404 multiply 10E-501 10e-501 -> 1.00E-1000 Subnormal +mulx405 multiply 30E-501 30e-501 -> 9.00E-1000 Subnormal +mulx406 multiply 40E-501 40e-501 -> 1.600E-999 + +powx400 power 1E-502 2 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +powx401 power 1E-501 2 -> 1E-1002 Subnormal +powx402 power 2E-501 2 -> 4E-1002 Subnormal +powx403 power 4E-501 2 -> 1.6E-1001 Subnormal +powx404 power 10E-501 2 -> 1.00E-1000 Subnormal +powx405 power 30E-501 2 -> 9.00E-1000 Subnormal +powx406 power 40E-501 2 -> 1.600E-999 + +-- cubes +mulx410 multiply 1E-670 1e-335 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +mulx411 multiply 1E-668 1e-334 -> 1E-1002 Subnormal +mulx412 multiply 4E-668 2e-334 -> 8E-1002 Subnormal +mulx413 multiply 9E-668 3e-334 -> 2.7E-1001 Subnormal +mulx414 multiply 16E-668 4e-334 -> 6.4E-1001 Subnormal +mulx415 multiply 25E-668 5e-334 -> 1.25E-1000 Subnormal +mulx416 multiply 10E-668 100e-334 -> 1.000E-999 + +powx410 power 1E-335 3 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +powx411 power 1E-334 3 -> 1E-1002 Subnormal +powx412 power 2E-334 3 -> 8E-1002 Subnormal +powx413 power 3E-334 3 -> 2.7E-1001 Subnormal +powx414 power 4E-334 3 -> 6.4E-1001 Subnormal +powx415 power 5E-334 3 -> 1.25E-1000 Subnormal +powx416 power 10E-334 3 -> 1.000E-999 + +-- negative powers, testing subnormals +precision: 5 +maxExponent: 999 +minexponent: -999 +powx421 power 2.5E-501 -2 -> Infinity Overflow Inexact Rounded +powx422 power 2.5E-500 -2 -> 1.6E+999 + +powx423 power 2.5E+499 -2 -> 1.6E-999 +powx424 power 2.5E+500 -2 -> 1.6E-1001 Subnormal +powx425 power 2.5E+501 -2 -> 2E-1003 Underflow Subnormal Inexact Rounded +powx426 power 2.5E+502 -2 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped + +powx427 power 0.25E+499 -2 -> 1.6E-997 +powx428 power 0.25E+500 -2 -> 1.6E-999 +powx429 power 0.25E+501 -2 -> 1.6E-1001 Subnormal +powx430 power 0.25E+502 -2 -> 2E-1003 Underflow Subnormal Inexact Rounded +powx431 power 0.25E+503 -2 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped + +powx432 power 0.04E+499 -2 -> 6.25E-996 +powx433 power 0.04E+500 -2 -> 6.25E-998 +powx434 power 0.04E+501 -2 -> 6.25E-1000 Subnormal +powx435 power 0.04E+502 -2 -> 6.2E-1002 Underflow Subnormal Inexact Rounded +powx436 power 0.04E+503 -2 -> 1E-1003 Underflow Subnormal Inexact Rounded +powx437 power 0.04E+504 -2 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped + +powx441 power 0.04E+334 -3 -> 1.5625E-998 +powx442 power 0.04E+335 -3 -> 1.56E-1001 Underflow Subnormal Inexact Rounded +powx443 power 0.04E+336 -3 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +powx444 power 0.25E+333 -3 -> 6.4E-998 +powx445 power 0.25E+334 -3 -> 6.4E-1001 Subnormal +powx446 power 0.25E+335 -3 -> 1E-1003 Underflow Subnormal Inexact Rounded +powx447 power 0.25E+336 -3 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped +-- check sign for cubes and a few squares +powx448 power -0.04E+334 -3 -> -1.5625E-998 +powx449 power -0.04E+335 -3 -> -1.56E-1001 Underflow Subnormal Inexact Rounded +powx450 power -0.04E+336 -3 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped +powx451 power -0.25E+333 -3 -> -6.4E-998 +powx452 power -0.25E+334 -3 -> -6.4E-1001 Subnormal +powx453 power -0.25E+335 -3 -> -1E-1003 Underflow Subnormal Inexact Rounded +powx454 power -0.25E+336 -3 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped +powx455 power -0.04E+499 -2 -> 6.25E-996 +powx456 power -0.04E+500 -2 -> 6.25E-998 +powx457 power -0.04E+501 -2 -> 6.25E-1000 Subnormal +powx458 power -0.04E+502 -2 -> 6.2E-1002 Underflow Subnormal Inexact Rounded + +-- test -0s +precision: 9 +powx560 power 0 0 -> NaN Invalid_operation +powx561 power 0 -0 -> NaN Invalid_operation +powx562 power -0 0 -> NaN Invalid_operation +powx563 power -0 -0 -> NaN Invalid_operation +powx564 power 1 0 -> 1 +powx565 power 1 -0 -> 1 +powx566 power -1 0 -> 1 +powx567 power -1 -0 -> 1 +powx568 power 0 1 -> 0 +powx569 power 0 -1 -> Infinity +powx570 power -0 1 -> -0 +powx571 power -0 -1 -> -Infinity +powx572 power 0 2 -> 0 +powx573 power 0 -2 -> Infinity +powx574 power -0 2 -> 0 +powx575 power -0 -2 -> Infinity +powx576 power 0 3 -> 0 +powx577 power 0 -3 -> Infinity +powx578 power -0 3 -> -0 +powx579 power -0 -3 -> -Infinity + +-- Specials +powx580 power Inf -Inf -> 0 +powx581 power Inf -1000 -> 0 +powx582 power Inf -1 -> 0 +powx583 power Inf -0.5 -> 0 +powx584 power Inf -0 -> 1 +powx585 power Inf 0 -> 1 +powx586 power Inf 0.5 -> Infinity +powx587 power Inf 1 -> Infinity +powx588 power Inf 1000 -> Infinity +powx589 power Inf Inf -> Infinity +powx590 power -1000 Inf -> NaN Invalid_operation +powx591 power -Inf Inf -> NaN Invalid_operation +powx592 power -1 Inf -> NaN Invalid_operation +powx593 power -0.5 Inf -> NaN Invalid_operation +powx594 power -0 Inf -> 0 +powx595 power 0 Inf -> 0 +powx596 power 0.5 Inf -> 0 +powx597 power 1 Inf -> 1.00000000 Inexact Rounded +powx598 power 1000 Inf -> Infinity +powx599 power Inf Inf -> Infinity + +powx600 power -Inf -Inf -> NaN Invalid_operation +powx601 power -Inf -1000 -> 0 +powx602 power -Inf -1 -> -0 +powx603 power -Inf -0.5 -> NaN Invalid_operation +powx604 power -Inf -0 -> 1 +powx605 power -Inf 0 -> 1 +powx606 power -Inf 0.5 -> NaN Invalid_operation +powx607 power -Inf 1 -> -Infinity +powx608 power -Inf 1000 -> Infinity +powx609 power -Inf Inf -> NaN Invalid_operation +powx610 power -1000 Inf -> NaN Invalid_operation +powx611 power -Inf -Inf -> NaN Invalid_operation +powx612 power -1 -Inf -> NaN Invalid_operation +powx613 power -0.5 -Inf -> NaN Invalid_operation +powx614 power -0 -Inf -> Infinity +powx615 power 0 -Inf -> Infinity +powx616 power 0.5 -Inf -> Infinity +powx617 power 1 -Inf -> 1.00000000 Inexact Rounded +powx618 power 1000 -Inf -> 0 +powx619 power Inf -Inf -> 0 + +powx621 power NaN -Inf -> NaN +powx622 power NaN -1000 -> NaN +powx623 power NaN -1 -> NaN +powx624 power NaN -0.5 -> NaN +powx625 power NaN -0 -> NaN +powx626 power NaN 0 -> NaN +powx627 power NaN 0.5 -> NaN +powx628 power NaN 1 -> NaN +powx629 power NaN 1000 -> NaN +powx630 power NaN Inf -> NaN +powx631 power NaN NaN -> NaN +powx632 power -Inf NaN -> NaN +powx633 power -1000 NaN -> NaN +powx634 power -1 NaN -> NaN +powx635 power -0 NaN -> NaN +powx636 power 0 NaN -> NaN +powx637 power 1 NaN -> NaN +powx638 power 1000 NaN -> NaN +powx639 power Inf NaN -> NaN + +powx641 power sNaN -Inf -> NaN Invalid_operation +powx642 power sNaN -1000 -> NaN Invalid_operation +powx643 power sNaN -1 -> NaN Invalid_operation +powx644 power sNaN -0.5 -> NaN Invalid_operation +powx645 power sNaN -0 -> NaN Invalid_operation +powx646 power sNaN 0 -> NaN Invalid_operation +powx647 power sNaN 0.5 -> NaN Invalid_operation +powx648 power sNaN 1 -> NaN Invalid_operation +powx649 power sNaN 1000 -> NaN Invalid_operation +powx650 power sNaN NaN -> NaN Invalid_operation +powx651 power sNaN sNaN -> NaN Invalid_operation +powx652 power NaN sNaN -> NaN Invalid_operation +powx653 power -Inf sNaN -> NaN Invalid_operation +powx654 power -1000 sNaN -> NaN Invalid_operation +powx655 power -1 sNaN -> NaN Invalid_operation +powx656 power -0.5 sNaN -> NaN Invalid_operation +powx657 power -0 sNaN -> NaN Invalid_operation +powx658 power 0 sNaN -> NaN Invalid_operation +powx659 power 0.5 sNaN -> NaN Invalid_operation +powx660 power 1 sNaN -> NaN Invalid_operation +powx661 power 1000 sNaN -> NaN Invalid_operation +powx662 power Inf sNaN -> NaN Invalid_operation +powx663 power NaN sNaN -> NaN Invalid_operation + +-- NaN propagation +powx670 power NaN3 sNaN7 -> NaN7 Invalid_operation +powx671 power sNaN8 NaN6 -> NaN8 Invalid_operation +powx672 power 1 sNaN7 -> NaN7 Invalid_operation +powx673 power sNaN8 1 -> NaN8 Invalid_operation +powx674 power Inf sNaN7 -> NaN7 Invalid_operation +powx675 power sNaN8 Inf -> NaN8 Invalid_operation +powx676 power Inf NaN9 -> NaN9 +powx677 power NaN6 Inf -> NaN6 +powx678 power 1 NaN5 -> NaN5 +powx679 power NaN2 1 -> NaN2 +powx680 power NaN2 Nan4 -> NaN2 +powx681 power NaN Nan4 -> NaN +powx682 power NaN345 Nan -> NaN345 +powx683 power Inf -sNaN7 -> -NaN7 Invalid_operation +powx684 power -sNaN8 Inf -> -NaN8 Invalid_operation +powx685 power Inf -NaN9 -> -NaN9 +powx686 power -NaN6 Inf -> -NaN6 +powx687 power -NaN2 -Nan4 -> -NaN2 + +-- long operand and RHS range checks +maxexponent: 999 +minexponent: -999 +precision: 9 +powx701 power 12345678000 1 -> 1.23456780E+10 Rounded +powx702 power 1234567800 1 -> 1.23456780E+9 Rounded +powx703 power 1234567890 1 -> 1.23456789E+9 Rounded +powx704 power 1234567891 1 -> 1.23456789E+9 Inexact Rounded +powx705 power 12345678901 1 -> 1.23456789E+10 Inexact Rounded +powx706 power 1234567896 1 -> 1.23456790E+9 Inexact Rounded + +precision: 15 +-- still checking +powx741 power 12345678000 1 -> 12345678000 +powx742 power 1234567800 1 -> 1234567800 +powx743 power 1234567890 1 -> 1234567890 +powx744 power 1234567891 1 -> 1234567891 +powx745 power 12345678901 1 -> 12345678901 +powx746 power 1234567896 1 -> 1234567896 + +maxexponent: 999999 +minexponent: -999999 +precision: 9 + +-- near out-of-range edge cases +powx163 power '10' '999999' -> '1.00000000E+999999' Rounded +powx164 power '10' '999998' -> '1.00000000E+999998' Rounded +powx165 power '10' '999997' -> '1.00000000E+999997' Rounded +powx166 power '10' '333333' -> '1.00000000E+333333' Rounded +powx183 power '7' '1000000' -> 1.09651419E+845098 Inexact Rounded +powx184 power '7' '1000001' -> 7.67559934E+845098 Inexact Rounded +powx186 power '7' '-1000001' -> 1.30282986E-845099 Inexact Rounded +powx187 power '7' '-1000000' -> 9.11980901E-845099 Inexact Rounded +powx118 power '10' '-333333' -> 1E-333333 +powx119 power '10' '-999998' -> 1E-999998 +powx120 power '10' '-999999' -> 1E-999999 +powx181 power '7' '999998' -> 2.23778406E+845096 Inexact Rounded +powx182 power '7' '999999' -> 1.56644884E+845097 Inexact Rounded +powx189 power '7' '-999999' -> 6.38386631E-845098 Inexact Rounded +powx190 power '7' '-999998' -> 4.46870641E-845097 Inexact Rounded + +-- overflow and underflow tests +precision: 9 + +powx277 power 9 999999 -> 3.59084629E+954241 Inexact Rounded +powx278 power 9.99999999 999999 -> 9.99000501E+999998 Inexact Rounded +powx279 power 10 999999 -> 1.00000000E+999999 Rounded +powx280 power 10.0000001 999999 -> 1.01005016E+999999 Inexact Rounded +powx281 power 10.000001 999999 -> 1.10517080E+999999 Inexact Rounded +powx282 power 10.00001 999999 -> 2.71827775E+999999 Inexact Rounded +powx283 power 10.0001 999999 -> Infinity Overflow Inexact Rounded +powx285 power 11 999999 -> Infinity Overflow Inexact Rounded +powx286 power 12 999999 -> Infinity Overflow Inexact Rounded +powx287 power 999 999999 -> Infinity Overflow Inexact Rounded +powx288 power 999999999 999999 -> Infinity Overflow Inexact Rounded +powx289 power 9.9E999999999 999999 -> Infinity Overflow Inexact Rounded + +powx290 power 0.5 999999 -> 2.02006812E-301030 Inexact Rounded +powx291 power 0.1 999999 -> 1E-999999 -- unrounded +powx292 power 0.09 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx293 power 0.05 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx294 power 0.01 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx295 power 0.0001 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx297 power 0.0000001 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx298 power 0.0000000001 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx299 power 1E-999999999 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped + +powx310 power -9 999999 -> -3.59084629E+954241 Inexact Rounded +powx311 power -10 999999 -> -1.00000000E+999999 Rounded +powx312 power -10.0001 999999 -> -Infinity Overflow Inexact Rounded +powx313 power -10.1 999999 -> -Infinity Overflow Inexact Rounded +powx314 power -11 999999 -> -Infinity Overflow Inexact Rounded +powx315 power -12 999999 -> -Infinity Overflow Inexact Rounded +powx316 power -999 999999 -> -Infinity Overflow Inexact Rounded +powx317 power -999999 999999 -> -Infinity Overflow Inexact Rounded +powx318 power -999999999 999999 -> -Infinity Overflow Inexact Rounded +powx319 power -9.9E999999999 999999 -> -Infinity Overflow Inexact Rounded + +powx320 power -0.5 999999 -> -2.02006812E-301030 Inexact Rounded +powx321 power -0.1 999999 -> -1E-999999 +powx322 power -0.09 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx323 power -0.05 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx324 power -0.01 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx325 power -0.0001 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx327 power -0.0000001 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx328 power -0.0000000001 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx329 power -1E-999999999 999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped + +-- note no trim of next result +powx330 power -9 999998 -> 3.98982921E+954240 Inexact Rounded +powx331 power -10 999998 -> 1.00000000E+999998 Rounded +powx332 power -10.0001 999998 -> Infinity Overflow Inexact Rounded +powx333 power -10.1 999998 -> Infinity Overflow Inexact Rounded +powx334 power -11 999998 -> Infinity Overflow Inexact Rounded +powx335 power -12 999998 -> Infinity Overflow Inexact Rounded +powx336 power -999 999998 -> Infinity Overflow Inexact Rounded +powx337 power -999999 999998 -> Infinity Overflow Inexact Rounded +powx338 power -999999999 999998 -> Infinity Overflow Inexact Rounded +powx339 power -9.9E999999999 999998 -> Infinity Overflow Inexact Rounded + +powx340 power -0.5 999998 -> 4.04013624E-301030 Inexact Rounded +powx341 power -0.1 999998 -> 1E-999998 -- NB exact unrounded +powx342 power -0.09 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx343 power -0.05 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx344 power -0.01 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx345 power -0.0001 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx347 power -0.0000001 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx348 power -0.0000000001 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx349 power -1E-999999999 999998 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped + +-- some subnormals +precision: 9 +-- [precision is 9, so smallest exponent is -1000000007 +powx350 power 1e-1 500000 -> 1E-500000 +powx351 power 1e-2 999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped +powx352 power 1e-2 500000 -> 1E-1000000 Subnormal +powx353 power 1e-2 500001 -> 1E-1000002 Subnormal +powx354 power 1e-2 500002 -> 1E-1000004 Subnormal +powx355 power 1e-2 500003 -> 1E-1000006 Subnormal +powx356 power 1e-2 500004 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped + +powx360 power 0.010001 500000 -> 5.17176082E-999979 Inexact Rounded +powx361 power 0.010000001 500000 -> 1.0512711E-1000000 Underflow Subnormal Inexact Rounded +powx362 power 0.010000001 500001 -> 1.05127E-1000002 Underflow Subnormal Inexact Rounded +powx363 power 0.0100000009 500000 -> 1.0460279E-1000000 Underflow Subnormal Inexact Rounded +powx364 power 0.0100000001 500000 -> 1.0050125E-1000000 Underflow Subnormal Inexact Rounded +powx365 power 0.01 500000 -> 1E-1000000 Subnormal +powx366 power 0.0099999999 500000 -> 9.950125E-1000001 Underflow Subnormal Inexact Rounded +powx367 power 0.0099999998 500000 -> 9.900498E-1000001 Underflow Subnormal Inexact Rounded +powx368 power 0.0099999997 500000 -> 9.851119E-1000001 Underflow Subnormal Inexact Rounded +powx369 power 0.0099999996 500000 -> 9.801987E-1000001 Underflow Subnormal Inexact Rounded +powx370 power 0.009 500000 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped + +-- 1/subnormal -> overflow +powx371 power 1e-1 -500000 -> 1E+500000 +powx372 power 1e-2 -999999 -> Infinity Overflow Inexact Rounded +powx373 power 1e-2 -500000 -> Infinity Overflow Inexact Rounded +powx374 power 1e-2 -500001 -> Infinity Overflow Inexact Rounded +powx375 power 1e-2 -500002 -> Infinity Overflow Inexact Rounded +powx376 power 1e-2 -500003 -> Infinity Overflow Inexact Rounded +powx377 power 1e-2 -500004 -> Infinity Overflow Inexact Rounded + +powx381 power 0.010001 -500000 -> 1.93357743E+999978 Inexact Rounded +powx382 power 0.010000001 -500000 -> 9.51229427E+999999 Inexact Rounded +powx383 power 0.010000001 -500001 -> Infinity Overflow Inexact Rounded +powx384 power 0.0100000009 -500000 -> 9.55997484E+999999 Inexact Rounded +powx385 power 0.0100000001 -500000 -> 9.95012479E+999999 Inexact Rounded +powx386 power 0.01 -500000 -> Infinity Overflow Inexact Rounded +powx387 power 0.009999 -500000 -> Infinity Overflow Inexact Rounded + +-- negative power giving subnormal +powx388 power 100.000001 -500000 -> 9.950125E-1000001 Underflow Subnormal Inexact Rounded + + +-- test some 'false integer' boundaries +precision: 16 +rounding: half_even +maxExponent: 384 +minExponent: -383 +powx501 power 100 1E+1 -> 1.000000000000000E+20 Rounded +powx502 power 100 1E+2 -> 1.000000000000000E+200 Rounded +powx503 power 100 1E+3 -> Infinity Overflow Inexact Rounded +powx504 power 100 1E+4 -> Infinity Overflow Inexact Rounded +powx505 power 100 1E+5 -> Infinity Overflow Inexact Rounded +powx506 power 100 1E+6 -> Infinity Overflow Inexact Rounded +powx507 power 100 1E+7 -> Infinity Overflow Inexact Rounded +powx508 power 100 1E+8 -> Infinity Overflow Inexact Rounded +powx509 power 100 1E+9 -> Infinity Overflow Inexact Rounded +powx510 power 100 1E+10 -> Infinity Overflow Inexact Rounded +powx511 power 100 1E+11 -> Infinity Overflow Inexact Rounded +powx512 power 100 1E+12 -> Infinity Overflow Inexact Rounded +powx513 power 100 1E+13 -> Infinity Overflow Inexact Rounded +powx514 power 100 1E+14 -> Infinity Overflow Inexact Rounded +powx515 power 100 1E+15 -> Infinity Overflow Inexact Rounded +powx516 power 100 1E+16 -> Infinity Overflow Inexact Rounded +powx517 power 100 1E+17 -> Infinity Overflow Inexact Rounded +powx518 power 100 1E+18 -> Infinity Overflow Inexact Rounded +powx519 power 100 1E+19 -> Infinity Overflow Inexact Rounded +powx520 power 100 1E+20 -> Infinity Overflow Inexact Rounded +powx521 power 100 1E+21 -> Infinity Overflow Inexact Rounded +powx522 power 100 1E+22 -> Infinity Overflow Inexact Rounded +powx523 power 100 1E+23 -> Infinity Overflow Inexact Rounded +powx524 power 100 1E+24 -> Infinity Overflow Inexact Rounded +powx525 power 100 1E+25 -> Infinity Overflow Inexact Rounded +powx526 power 100 1E+26 -> Infinity Overflow Inexact Rounded +powx527 power 100 1E+27 -> Infinity Overflow Inexact Rounded +powx528 power 100 1E+28 -> Infinity Overflow Inexact Rounded +powx529 power 100 1E+29 -> Infinity Overflow Inexact Rounded +powx530 power 100 1E+30 -> Infinity Overflow Inexact Rounded +powx531 power 100 1E+40 -> Infinity Overflow Inexact Rounded +powx532 power 100 1E+50 -> Infinity Overflow Inexact Rounded +powx533 power 100 1E+100 -> Infinity Overflow Inexact Rounded +powx534 power 100 1E+383 -> Infinity Overflow Inexact Rounded + +-- a check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +powx750 power 1.2347E-40 2 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +-- Null tests +powx900 power 1 # -> NaN Invalid_operation +powx901 power # 1 -> NaN Invalid_operation + +---------------------------------------------------------------------- +-- Below here are tests with a precision or context outside of the -- +-- decNumber 'mathematical functions' restricted range. These -- +-- remain supported in decNumber to minimize breakage, but may be -- +-- outside the range of other implementations. -- +---------------------------------------------------------------------- +maxexponent: 999999999 +minexponent: -999999999 +precision: 9 +powx1063 power '10' '999999999' -> '1.00000000E+999999999' Rounded +powx1064 power '10' '999999998' -> '1.00000000E+999999998' Rounded +powx1065 power '10' '999999997' -> '1.00000000E+999999997' Rounded +powx1066 power '10' '333333333' -> '1.00000000E+333333333' Rounded +-- next two are integer-out-of range + +-- out-of-range edge cases +powx1118 power '10' '-333333333' -> 1E-333333333 +powx1119 power '10' '-999999998' -> 1E-999999998 +powx1120 power '10' '-999999999' -> 1E-999999999 +powx1181 power '7' '999999998' -> 2.10892313E+845098038 Inexact Rounded +powx1182 power '7' '999999999' -> 1.47624619E+845098039 Inexact Rounded +powx1189 power '7' '-999999999' -> 6.77393787E-845098040 Inexact Rounded +powx1190 power '7' '-999999998' -> 4.74175651E-845098039 Inexact Rounded + +-- A (rare) case where the last digit is not within 0.5 ULP with classic precision +precision: 9 +powx1215 power "-21971575.0E+31454441" "-7" -> "-4.04549502E-220181139" Inexact Rounded +precision: 20 +powx1216 power "-21971575.0E+31454441" "-7" -> "-4.0454950249324891788E-220181139" Inexact Rounded + +-- overflow and underflow tests +precision: 9 +powx1280 power 9 999999999 -> 3.05550054E+954242508 Inexact Rounded +powx1281 power 10 999999999 -> 1.00000000E+999999999 Rounded +powx1282 power 10.0001 999999999 -> Infinity Overflow Inexact Rounded +powx1283 power 10.1 999999999 -> Infinity Overflow Inexact Rounded +powx1284 power 11 999999999 -> Infinity Overflow Inexact Rounded +powx1285 power 12 999999999 -> Infinity Overflow Inexact Rounded +powx1286 power 999 999999999 -> Infinity Overflow Inexact Rounded +powx1287 power 999999 999999999 -> Infinity Overflow Inexact Rounded +powx1288 power 999999999 999999999 -> Infinity Overflow Inexact Rounded +powx1289 power 9.9E999999999 999999999 -> Infinity Overflow Inexact Rounded + +powx1290 power 0.5 999999999 -> 4.33559594E-301029996 Inexact Rounded +powx1291 power 0.1 999999999 -> 1E-999999999 -- unrounded +powx1292 power 0.09 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1293 power 0.05 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1294 power 0.01 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1295 power 0.0001 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1297 power 0.0000001 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1298 power 0.0000000001 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1299 power 1E-999999999 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped + +powx1310 power -9 999999999 -> -3.05550054E+954242508 Inexact Rounded +powx1311 power -10 999999999 -> -1.00000000E+999999999 Rounded +powx1312 power -10.0001 999999999 -> -Infinity Overflow Inexact Rounded +powx1313 power -10.1 999999999 -> -Infinity Overflow Inexact Rounded +powx1314 power -11 999999999 -> -Infinity Overflow Inexact Rounded +powx1315 power -12 999999999 -> -Infinity Overflow Inexact Rounded +powx1316 power -999 999999999 -> -Infinity Overflow Inexact Rounded +powx1317 power -999999 999999999 -> -Infinity Overflow Inexact Rounded +powx1318 power -999999999 999999999 -> -Infinity Overflow Inexact Rounded +powx1319 power -9.9E999999999 999999999 -> -Infinity Overflow Inexact Rounded + +powx1320 power -0.5 999999999 -> -4.33559594E-301029996 Inexact Rounded +powx1321 power -0.1 999999999 -> -1E-999999999 +powx1322 power -0.09 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1323 power -0.05 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1324 power -0.01 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1325 power -0.0001 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1327 power -0.0000001 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1328 power -0.0000000001 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1329 power -1E-999999999 999999999 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped + +-- note no trim of next result +powx1330 power -9 999999998 -> 3.39500060E+954242507 Inexact Rounded +powx1331 power -10 999999998 -> 1.00000000E+999999998 Rounded +powx1332 power -10.0001 999999998 -> Infinity Overflow Inexact Rounded +powx1333 power -10.1 999999998 -> Infinity Overflow Inexact Rounded +powx1334 power -11 999999998 -> Infinity Overflow Inexact Rounded +powx1335 power -12 999999998 -> Infinity Overflow Inexact Rounded +powx1336 power -999 999999998 -> Infinity Overflow Inexact Rounded +powx1337 power -999999 999999998 -> Infinity Overflow Inexact Rounded +powx1338 power -999999999 999999998 -> Infinity Overflow Inexact Rounded +powx1339 power -9.9E999999999 999999998 -> Infinity Overflow Inexact Rounded + +powx1340 power -0.5 999999998 -> 8.67119187E-301029996 Inexact Rounded +powx1341 power -0.1 999999998 -> 1E-999999998 -- NB exact unrounded +powx1342 power -0.09 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1343 power -0.05 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1344 power -0.01 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1345 power -0.0001 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1347 power -0.0000001 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1348 power -0.0000000001 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1349 power -1E-999999999 999999998 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped + +-- some subnormals +precision: 9 +-- [precision is 9, so smallest exponent is -1000000007 +powx1350 power 1e-1 500000000 -> 1E-500000000 +powx1351 power 1e-2 999999999 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1352 power 1e-2 500000000 -> 1E-1000000000 Subnormal +powx1353 power 1e-2 500000001 -> 1E-1000000002 Subnormal +powx1354 power 1e-2 500000002 -> 1E-1000000004 Subnormal +powx1355 power 1e-2 500000003 -> 1E-1000000006 Subnormal +powx1356 power 1e-2 500000004 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped + +powx1360 power 0.010001 500000000 -> 4.34941988E-999978287 Inexact Rounded +powx1361 power 0.010000001 500000000 -> 5.18469257E-999999979 Inexact Rounded +powx1362 power 0.010000001 500000001 -> 5.18469309E-999999981 Inexact Rounded +powx1363 power 0.0100000009 500000000 -> 3.49342003E-999999981 Inexact Rounded +powx1364 power 0.0100000001 500000000 -> 1.48413155E-999999998 Inexact Rounded +powx1365 power 0.01 500000000 -> 1E-1000000000 Subnormal +powx1366 power 0.0099999999 500000000 -> 6.7379E-1000000003 Underflow Subnormal Inexact Rounded +powx1367 power 0.0099999998 500000000 -> 4.54E-1000000005 Underflow Subnormal Inexact Rounded +powx1368 power 0.0099999997 500000000 -> 3E-1000000007 Underflow Subnormal Inexact Rounded +powx1369 power 0.0099999996 500000000 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +powx1370 power 0.009 500000000 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped + +-- 1/subnormal -> overflow +powx1371 power 1e-1 -500000000 -> 1E+500000000 +powx1372 power 1e-2 -999999999 -> Infinity Overflow Inexact Rounded +powx1373 power 1e-2 -500000000 -> Infinity Overflow Inexact Rounded +powx1374 power 1e-2 -500000001 -> Infinity Overflow Inexact Rounded +powx1375 power 1e-2 -500000002 -> Infinity Overflow Inexact Rounded +powx1376 power 1e-2 -500000003 -> Infinity Overflow Inexact Rounded +powx1377 power 1e-2 -500000004 -> Infinity Overflow Inexact Rounded + +powx1381 power 0.010001 -500000000 -> 2.29915719E+999978286 Inexact Rounded +powx1382 power 0.010000001 -500000000 -> 1.92875467E+999999978 Inexact Rounded +powx1383 power 0.010000001 -500000001 -> 1.92875448E+999999980 Inexact Rounded +powx1384 power 0.0100000009 -500000000 -> 2.86252438E+999999980 Inexact Rounded +powx1385 power 0.0100000001 -500000000 -> 6.73794717E+999999997 Inexact Rounded +powx1386 power 0.01 -500000000 -> Infinity Overflow Inexact Rounded +powx1387 power 0.009999 -500000000 -> Infinity Overflow Inexact Rounded + +-- negative power giving subnormal +powx1388 power 100.000001 -500000000 -> 6.7379E-1000000003 Underflow Subnormal Inexact Rounded + +---------------------------------------------------------------------- +-- Below here are the tests with a non-integer rhs, including the -- +-- tests that previously caused Invalid operation. An integer-only -- +-- (on rhs) implementation should handle all the tests above as -- +-- shown, and would flag most of the following tests as Invalid. -- +---------------------------------------------------------------------- +precision: 16 +rounding: half_even +maxExponent: 384 +minExponent: -383 + +powx2000 power 7 '10000000000' -> Infinity Overflow Inexact Rounded +powx2001 power 2 '2.000001' -> 4.000002772589683 Inexact Rounded +powx2002 power 2 '2.00000000' -> 4 +powx2003 power 2 '2.000000001' -> 4.000000002772589 Inexact Rounded +powx2004 power 2 '2.0000000001' -> 4.000000000277259 Inexact Rounded +powx2005 power 2 '2.00000000001' -> 4.000000000027726 Inexact Rounded +powx2006 power 2 '2.000000000001' -> 4.000000000002773 Inexact Rounded +powx2007 power 2 '2.0000000000001' -> 4.000000000000277 Inexact Rounded +powx2008 power 2 '2.00000000000001' -> 4.000000000000028 Inexact Rounded +powx2009 power 2 '2.000000000000001' -> 4.000000000000003 Inexact Rounded +powx2010 power 2 '2.0000000000000001' -> 4.000000000000000 Inexact Rounded +-- 1 234567890123456 + +powx2011 power 1 1234 -> 1 +precision: 4 +powx2012 power 1 1234 -> 1 +precision: 3 +powx2013 power 1 1234 -> 1 +powx2014 power 1 12.34e+2 -> 1 +powx2015 power 1 12.3 -> 1.00 Inexact Rounded +powx2016 power 1 12.0 -> 1 +powx2017 power 1 1.01 -> 1.00 Inexact Rounded +powx2018 power 2 1.00 -> 2 +powx2019 power 2 2.00 -> 4 +precision: 9 +powx2030 power 1 1.0001 -> 1.00000000 Inexact Rounded +powx2031 power 1 1.0000001 -> 1.00000000 Inexact Rounded +powx2032 power 1 1.0000000001 -> 1.00000000 Inexact Rounded +powx2033 power 1 1.0000000000001 -> 1.00000000 Inexact Rounded +precision: 5 +powx2034 power 1 1.0001 -> 1.0000 Inexact Rounded +powx2035 power 1 1.0000001 -> 1.0000 Inexact Rounded +powx2036 power 1 1.0000000001 -> 1.0000 Inexact Rounded +powx2037 power 1 1.0000000000001 -> 1.0000 Inexact Rounded +powx2038 power 1 1.0000000000001 -> 1.0000 Inexact Rounded + +rounding: ceiling +precision: 3 +powx2039 power 1 1.01 -> 1.00 Inexact Rounded +powx2040 power 1 12.3 -> 1.00 Inexact Rounded +rounding: half_even + +-- 1 ** any integer, including big ones, should be exact +powx2041 power 1 1000000000 -> 1 +powx2042 power 1 9999999999 -> 1 +powx2043 power 1 12345678000 -> 1 +powx2044 power 1 1234567800 -> 1 +powx2045 power 1 1234567890 -> 1 +powx2046 power 1 11234567891 -> 1 +powx2047 power 1 12345678901 -> 1 +powx2048 power 1 1234567896 -> 1 +powx2049 power 1 -1234567896 -> 1 +powx2051 power 1 1000000000 -> 1 +powx2052 power 1 -1000000000 -> 1 +powx2053 power 1 12345678000 -> 1 +powx2054 power 1 -1234567896 -> 1 +powx2055 power 1 1000000000 -> 1 +powx2056 power 1 4300000000 -> 1 +powx2057 power 1 -1000000000 -> 1 +-- negatives ... but not out of range for decNumber +powx2061 power -1 100000 -> 1 +powx2062 power -1 999999 -> -1 +powx2063 power -1 1278000 -> 1 +powx2064 power -1 127803 -> -1 +powx2065 power -1 127890 -> 1 +powx2066 power -1 1167891 -> -1 +powx2067 power -1 1278901 -> -1 +powx2068 power -1 127896 -> 1 +powx2069 power -1 -167897 -> -1 +powx2071 power -1 100000 -> 1 +powx2072 power -1 -100001 -> -1 +powx2073 power -1 1278000 -> 1 +powx2074 power -1 -167896 -> 1 +powx2075 power -1 100000 -> 1 +powx2076 power -1 -100009 -> -1 + +-- The above were derived from the earlier version of power.decTest; +-- now start new tests for power(x,y) for non-integer y +precision: 9 + +-- tests from specification +powx2081 power 2 3 -> '8' +powx2082 power -2 3 -> '-8' +powx2083 power 2 -3 -> '0.125' +powx2084 power 1.7 '8' -> '69.7575744' Inexact Rounded +powx2085 power 10 0.301029996 -> 2.00000000 Inexact Rounded +powx2086 power Infinity '-1' -> '0' +powx2087 power Infinity '0' -> '1' +powx2088 power Infinity '1' -> 'Infinity' +powx2089 power -Infinity '-1' -> '-0' +powx2090 power -Infinity '0' -> '1' +powx2091 power -Infinity '1' -> '-Infinity' +powx2092 power -Infinity '2' -> 'Infinity' +powx2093 power 0 0 -> 'NaN' Invalid_operation + +precision: 16 +rounding: half_even +maxExponent: 384 +minExponent: -383 + +-- basics +powx2100 power 1E-7 1E-7 -> 0.9999983881917339 Inexact Rounded +powx2101 power 0.003 1E-7 -> 0.9999994190858697 Inexact Rounded +powx2102 power 0.7 1E-7 -> 0.9999999643325062 Inexact Rounded +powx2103 power 1.2 1E-7 -> 1.000000018232156 Inexact Rounded +powx2104 power 71 1E-7 -> 1.000000426268079 Inexact Rounded +powx2105 power 9E+9 1E-7 -> 1.000002292051668 Inexact Rounded + +powx2110 power 1E-7 0.003 -> 0.9527961640236519 Inexact Rounded +powx2111 power 0.003 0.003 -> 0.9827235503366797 Inexact Rounded +powx2112 power 0.7 0.003 -> 0.9989305474406207 Inexact Rounded +powx2113 power 1.2 0.003 -> 1.000547114282834 Inexact Rounded +powx2114 power 71 0.003 -> 1.012870156273545 Inexact Rounded +powx2115 power 9E+9 0.003 -> 1.071180671278787 Inexact Rounded + +powx2120 power 1E-7 0.7 -> 0.00001258925411794167 Inexact Rounded +powx2121 power 0.003 0.7 -> 0.01713897630281030 Inexact Rounded +powx2122 power 0.7 0.7 -> 0.7790559126704491 Inexact Rounded +powx2123 power 1.2 0.7 -> 1.136126977198889 Inexact Rounded +powx2124 power 71 0.7 -> 19.76427300093870 Inexact Rounded +powx2125 power 9E+9 0.7 -> 9289016.976853710 Inexact Rounded + +powx2130 power 1E-7 1.2 -> 3.981071705534973E-9 Inexact Rounded +powx2131 power 0.003 1.2 -> 0.0009387403933595694 Inexact Rounded +powx2132 power 0.7 1.2 -> 0.6518049405663864 Inexact Rounded +powx2133 power 1.2 1.2 -> 1.244564747203978 Inexact Rounded +powx2134 power 71 1.2 -> 166.5367244638552 Inexact Rounded +powx2135 power 9E+9 1.2 -> 881233526124.8791 Inexact Rounded + +powx2140 power 1E-7 71 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +powx2141 power 0.003 71 -> 7.509466514979725E-180 Inexact Rounded +powx2142 power 0.7 71 -> 1.004525211269079E-11 Inexact Rounded +powx2143 power 1.2 71 -> 418666.7483186515 Inexact Rounded +powx2144 power 71 71 -> 2.750063734834616E+131 Inexact Rounded +powx2145 power 9E+9 71 -> Infinity Inexact Rounded Overflow + +powx2150 power 1E-7 9E+9 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +powx2151 power 0.003 9E+9 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +powx2152 power 0.7 9E+9 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +powx2153 power 1.2 9E+9 -> Infinity Inexact Rounded Overflow +powx2154 power 71 9E+9 -> Infinity Inexact Rounded Overflow +powx2155 power 9E+9 9E+9 -> Infinity Inexact Rounded Overflow + +-- number line milestones with lhs<1 and lhs>1 + +-- Overflow boundary (Nmax) +powx2202 power 71 207.966651583983200 -> Infinity Inexact Rounded Overflow +powx2201 power 71 207.966651583983199 -> 9.999999999999994E+384 Inexact Rounded +powx2204 power 0.003 -152.603449817093577 -> Infinity Inexact Rounded Overflow +powx2203 power 0.003 -152.603449817093576 -> 9.999999999999994E+384 Inexact Rounded + +-- Nmin boundary +powx2211 power 71 -206.886305341988480 -> 1.000000000000005E-383 Inexact Rounded +powx2212 power 71 -206.886305341988481 -> 1.000000000000001E-383 Inexact Rounded +powx2213 power 71 -206.886305341988482 -> 9.99999999999997E-384 Inexact Rounded Underflow Subnormal +powx2214 power 71 -206.886305341988483 -> 9.99999999999992E-384 Inexact Rounded Underflow Subnormal +-- 9.999999999999924565357019820 + +powx2215 power 0.003 151.810704623238543 -> 1.000000000000009E-383 Inexact Rounded +powx2216 power 0.003 151.810704623238544 -> 1.000000000000003E-383 Inexact Rounded +powx2217 power 0.003 151.810704623238545 -> 9.99999999999997E-384 Inexact Rounded Underflow Subnormal +powx2218 power 0.003 151.810704623238546 -> 9.99999999999991E-384 Inexact Rounded Underflow Subnormal + +-- Ntiny boundary, these edge cases determined using half_up rounding +rounding: half_up +powx2221 power 71 -215.151510469220498 -> 1E-398 Inexact Rounded Underflow Subnormal +powx2222 power 71 -215.151510469220499 -> 1E-398 Inexact Rounded Underflow Subnormal +powx2223 power 71 -215.151510469220500 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +powx2224 power 71 -215.151510469220501 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped + +powx2225 power 0.003 157.875613618285691 -> 1E-398 Inexact Rounded Underflow Subnormal +powx2226 power 0.003 157.875613618285692 -> 1E-398 Inexact Rounded Underflow Subnormal +powx2227 power 0.003 157.875613618285693 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +powx2228 power 0.003 220 -> 0E-398 Inexact Rounded Underflow Subnormal Clamped +rounding: half_even + +-- power(10, y) are important ... + +-- Integer powers are exact, unless over/underflow +powx2301 power 10 385 -> Infinity Overflow Inexact Rounded +powx2302 power 10 384 -> 1.000000000000000E+384 Rounded +powx2303 power 10 17 -> 1.000000000000000E+17 Rounded +powx2304 power 10 16 -> 1.000000000000000E+16 Rounded +powx2305 power 10 15 -> 1000000000000000 +powx2306 power 10 10 -> 10000000000 +powx2307 power 10 5 -> 100000 +powx2308 power 10 1 -> 10 +powx2309 power 10 0 -> 1 +powx2310 power 10 -1 -> 0.1 +powx2311 power 10 -5 -> 0.00001 +powx2312 power 10 -6 -> 0.000001 +powx2313 power 10 -7 -> 1E-7 +powx2314 power 10 -8 -> 1E-8 +powx2315 power 10 -9 -> 1E-9 +powx2316 power 10 -10 -> 1E-10 +powx2317 power 10 -383 -> 1E-383 +powx2318 power 10 -384 -> 1E-384 Subnormal +powx2319 power 10 -385 -> 1E-385 Subnormal +powx2320 power 10 -397 -> 1E-397 Subnormal +powx2321 power 10 -398 -> 1E-398 Subnormal +powx2322 power 10 -399 -> 0E-398 Subnormal Underflow Inexact Rounded Clamped +powx2323 power 10 -400 -> 0E-398 Subnormal Underflow Inexact Rounded Clamped + +-- Independent sanity check: 1961 Godfrey & Siddons four-figure logs +powx2351 power 10 0.0000 -> 1 +powx2352 power 10 0.3010 -> 1.999861869632744 Inexact Rounded +powx2353 power 10 0.4771 -> 2.999853181190793 Inexact Rounded +powx2354 power 10 0.6021 -> 4.000368510461250 Inexact Rounded +powx2355 power 10 0.6990 -> 5.000345349769785 Inexact Rounded +powx2356 power 10 0.7782 -> 6.000673538641164 Inexact Rounded +powx2357 power 10 0.8451 -> 7.000031591308969 Inexact Rounded +powx2358 power 10 0.9031 -> 8.000184448550990 Inexact Rounded +powx2359 power 10 0.9542 -> 8.999119108700520 Inexact Rounded +powx2360 power 10 0.9956 -> 9.899197750805841 Inexact Rounded +powx2361 power 10 0.9996 -> 9.990793899844618 Inexact Rounded +precision: 4 +powx2371 power 10 0.0000 -> 1 +powx2372 power 10 0.3010 -> 2.000 Inexact Rounded +powx2373 power 10 0.4771 -> 3.000 Inexact Rounded +powx2374 power 10 0.6021 -> 4.000 Inexact Rounded +powx2375 power 10 0.6990 -> 5.000 Inexact Rounded +powx2376 power 10 0.7782 -> 6.001 Inexact Rounded +powx2377 power 10 0.8451 -> 7.000 Inexact Rounded +powx2378 power 10 0.9031 -> 8.000 Inexact Rounded +powx2379 power 10 0.9542 -> 8.999 Inexact Rounded +powx2380 power 10 0.9956 -> 9.899 Inexact Rounded +powx2381 power 10 0.9996 -> 9.991 Inexact Rounded + +-- 10**x ~=2 (inverse of the test in log10.decTest) +precision: 50 +powx2401 power 10 0.30102999566398119521373889472449302676818988146211 -> 2.0000000000000000000000000000000000000000000000000 Inexact Rounded +precision: 49 +powx2402 power 10 0.3010299956639811952137388947244930267681898814621 -> 2.000000000000000000000000000000000000000000000000 Inexact Rounded +precision: 48 +powx2403 power 10 0.301029995663981195213738894724493026768189881462 -> 2.00000000000000000000000000000000000000000000000 Inexact Rounded +precision: 47 +powx2404 power 10 0.30102999566398119521373889472449302676818988146 -> 2.0000000000000000000000000000000000000000000000 Inexact Rounded +precision: 46 +powx2405 power 10 0.3010299956639811952137388947244930267681898815 -> 2.000000000000000000000000000000000000000000000 Inexact Rounded +precision: 45 +powx2406 power 10 0.301029995663981195213738894724493026768189881 -> 2.00000000000000000000000000000000000000000000 Inexact Rounded +precision: 44 +powx2407 power 10 0.30102999566398119521373889472449302676818988 -> 2.0000000000000000000000000000000000000000000 Inexact Rounded +precision: 43 +powx2408 power 10 0.3010299956639811952137388947244930267681899 -> 2.000000000000000000000000000000000000000000 Inexact Rounded +precision: 42 +powx2409 power 10 0.301029995663981195213738894724493026768190 -> 2.00000000000000000000000000000000000000000 Inexact Rounded +precision: 41 +powx2410 power 10 0.30102999566398119521373889472449302676819 -> 2.0000000000000000000000000000000000000000 Inexact Rounded +precision: 40 +powx2411 power 10 0.3010299956639811952137388947244930267682 -> 2.000000000000000000000000000000000000000 Inexact Rounded +precision: 39 +powx2412 power 10 0.301029995663981195213738894724493026768 -> 2.00000000000000000000000000000000000000 Inexact Rounded +precision: 38 +powx2413 power 10 0.30102999566398119521373889472449302677 -> 2.0000000000000000000000000000000000000 Inexact Rounded +precision: 37 +powx2414 power 10 0.3010299956639811952137388947244930268 -> 2.000000000000000000000000000000000000 Inexact Rounded +precision: 36 +powx2415 power 10 0.301029995663981195213738894724493027 -> 2.00000000000000000000000000000000000 Inexact Rounded +precision: 35 +powx2416 power 10 0.30102999566398119521373889472449303 -> 2.0000000000000000000000000000000000 Inexact Rounded +precision: 34 +powx2417 power 10 0.3010299956639811952137388947244930 -> 2.000000000000000000000000000000000 Inexact Rounded +precision: 33 +powx2418 power 10 0.301029995663981195213738894724493 -> 2.00000000000000000000000000000000 Inexact Rounded +precision: 32 +powx2419 power 10 0.30102999566398119521373889472449 -> 2.0000000000000000000000000000000 Inexact Rounded +precision: 31 +powx2420 power 10 0.3010299956639811952137388947245 -> 2.000000000000000000000000000000 Inexact Rounded +precision: 30 +powx2421 power 10 0.301029995663981195213738894725 -> 2.00000000000000000000000000000 Inexact Rounded +precision: 29 +powx2422 power 10 0.30102999566398119521373889472 -> 2.0000000000000000000000000000 Inexact Rounded +precision: 28 +powx2423 power 10 0.3010299956639811952137388947 -> 2.000000000000000000000000000 Inexact Rounded +precision: 27 +powx2424 power 10 0.301029995663981195213738895 -> 2.00000000000000000000000000 Inexact Rounded +precision: 26 +powx2425 power 10 0.30102999566398119521373889 -> 2.0000000000000000000000000 Inexact Rounded +precision: 25 +powx2426 power 10 0.3010299956639811952137389 -> 2.000000000000000000000000 Inexact Rounded +precision: 24 +powx2427 power 10 0.301029995663981195213739 -> 2.00000000000000000000000 Inexact Rounded +precision: 23 +powx2428 power 10 0.30102999566398119521374 -> 2.0000000000000000000000 Inexact Rounded +precision: 22 +powx2429 power 10 0.3010299956639811952137 -> 2.000000000000000000000 Inexact Rounded +precision: 21 +powx2430 power 10 0.301029995663981195214 -> 2.00000000000000000000 Inexact Rounded +precision: 20 +powx2431 power 10 0.30102999566398119521 -> 2.0000000000000000000 Inexact Rounded +precision: 19 +powx2432 power 10 0.3010299956639811952 -> 2.000000000000000000 Inexact Rounded +precision: 18 +powx2433 power 10 0.301029995663981195 -> 2.00000000000000000 Inexact Rounded +precision: 17 +powx2434 power 10 0.30102999566398120 -> 2.0000000000000000 Inexact Rounded +precision: 16 +powx2435 power 10 0.3010299956639812 -> 2.000000000000000 Inexact Rounded +precision: 15 +powx2436 power 10 0.301029995663981 -> 2.00000000000000 Inexact Rounded +precision: 14 +powx2437 power 10 0.30102999566398 -> 2.0000000000000 Inexact Rounded +precision: 13 +powx2438 power 10 0.3010299956640 -> 2.000000000000 Inexact Rounded +precision: 12 +powx2439 power 10 0.301029995664 -> 2.00000000000 Inexact Rounded +precision: 11 +powx2440 power 10 0.30102999566 -> 2.0000000000 Inexact Rounded +precision: 10 +powx2441 power 10 0.3010299957 -> 2.000000000 Inexact Rounded +precision: 9 +powx2442 power 10 0.301029996 -> 2.00000000 Inexact Rounded +precision: 8 +powx2443 power 10 0.30103000 -> 2.0000000 Inexact Rounded +precision: 7 +powx2444 power 10 0.3010300 -> 2.000000 Inexact Rounded +precision: 6 +powx2445 power 10 0.301030 -> 2.00000 Inexact Rounded +precision: 5 +powx2446 power 10 0.30103 -> 2.0000 Inexact Rounded +precision: 4 +powx2447 power 10 0.3010 -> 2.000 Inexact Rounded +precision: 3 +powx2448 power 10 0.301 -> 2.00 Inexact Rounded +precision: 2 +powx2449 power 10 0.30 -> 2.0 Inexact Rounded +precision: 1 +powx2450 power 10 0.3 -> 2 Inexact Rounded + +maxExponent: 384 +minExponent: -383 +precision: 16 +rounding: half_even + +-- Close-to-e tests +precision: 34 +powx2500 power 10 0.4342944819032518276511289189166048 -> 2.718281828459045235360287471352661 Inexact Rounded +powx2501 power 10 0.4342944819032518276511289189166049 -> 2.718281828459045235360287471352661 Inexact Rounded +powx2502 power 10 0.4342944819032518276511289189166050 -> 2.718281828459045235360287471352662 Inexact Rounded +powx2503 power 10 0.4342944819032518276511289189166051 -> 2.718281828459045235360287471352663 Inexact Rounded +powx2504 power 10 0.4342944819032518276511289189166052 -> 2.718281828459045235360287471352663 Inexact Rounded + +-- Sequence around an integer +powx2512 power 10 2.9999999999999999999999999999999997 -> 999.9999999999999999999999999999993 Inexact Rounded +powx2513 power 10 2.9999999999999999999999999999999998 -> 999.9999999999999999999999999999995 Inexact Rounded +powx2514 power 10 2.9999999999999999999999999999999999 -> 999.9999999999999999999999999999998 Inexact Rounded +powx2515 power 10 3.0000000000000000000000000000000000 -> 1000 +powx2516 power 10 3.0000000000000000000000000000000001 -> 1000.000000000000000000000000000000 Inexact Rounded +powx2517 power 10 3.0000000000000000000000000000000002 -> 1000.000000000000000000000000000000 Inexact Rounded +powx2518 power 10 3.0000000000000000000000000000000003 -> 1000.000000000000000000000000000001 Inexact Rounded + +-- randomly generated tests +maxExponent: 384 +minExponent: -383 + +-- P=34, within 0-999 -- positive arg2 +Precision: 34 +powx3201 power 5.301557744131969249145904611290735 369.3175647984435534243813466380579 -> 3.427165676345688240023113326603960E+267 Inexact Rounded +powx3202 power 0.0000000000506875655819165973738225 21.93514102704466434121826965196878 -> 1.498169860033487321566659495340789E-226 Inexact Rounded +powx3203 power 97.88877680721519917858007810494043 5.159898445242793470476673109899554 -> 18705942904.43290467281449559427982 Inexact Rounded +powx3204 power 7.380441015594399747973924380493799 17.93614173904818313507525109033288 -> 3715757985820076.273336082702577274 Inexact Rounded +powx3205 power 2.045623627647350918819219169855040 1082.999652407430697958175966996254 -> 4.208806435006704867447150904279854E+336 Inexact Rounded +powx3206 power 0.0000000762582873112118926142955423 20.30534237055073996975203864170432 -> 2.967574278677013090697130349198877E-145 Inexact Rounded +powx3207 power 0.0000000000194091470907814855660535 14.71164213947722238856835440242911 -> 2.564391397469554735037158345963280E-158 Inexact Rounded +powx3208 power 0.0000000000509434185382818596853504 20.97051498204188277347203735421595 -> 1.420157372748083000927138678417272E-216 Inexact Rounded +powx3209 power 0.0005389217212073307301395750745119 43.96798225485747315858678755538971 -> 1.957850185781292007977898626137240E-144 Inexact Rounded +powx3210 power 498.5690105989136050444077447411198 128.1038813807243375878831104745803 -> 3.882212970903893127009102293596268E+345 Inexact Rounded +powx3211 power 0.0000000935428918637303954281938975 5.736933454863278597460091596496099 -> 4.733219644540496152403967823635195E-41 Inexact Rounded +powx3212 power 8.581586784734161309180363110126352 252.0229459968869784643374981477208 -> 1.907464842458674622356177850049873E+235 Inexact Rounded +powx3213 power 294.1005302951621709143320795278305 155.5466374141708615975111014663722 -> 9.251717033292072959166737280729728E+383 Inexact Rounded +powx3214 power 0.0000000041253343654396865855722090 19.00170974760425576247662125110472 -> 4.779566288553864405790921353593512E-160 Inexact Rounded +powx3215 power 0.0000000000046912257352141395184092 24.66089523148729269098773236636878 -> 4.205126874048597849476723538057527E-280 Inexact Rounded +powx3216 power 0.0000000000036796674296520639450494 22.09713956900694689234335912523078 -> 2.173081843837539818472071316420405E-253 Inexact Rounded +powx3217 power 9.659887100303037657934372148567685 277.3765665424320875993026404492216 -> 1.614974043145519382749740616665041E+273 Inexact Rounded +powx3218 power 0.0000083231310642229204398943076403 29.33123211782131466471359128190372 -> 1.013330439786660210757226597785328E-149 Inexact Rounded +powx3219 power 0.0938084859086450954956863725653664 262.6091918199905272837286784975012 -> 1.262802485286301066967555821509344E-270 Inexact Rounded +powx3220 power 8.194926977580900145696305910223304 184.3705133945546202012995485297248 -> 2.696353910907824016690021495828584E+168 Inexact Rounded +powx3221 power 72.39594594653085161522285114566120 168.7721909489321402152033939836725 -> 7.379858293630460043361584410795031E+313 Inexact Rounded +powx3222 power 0.0000000000003436856010144185445537 26.34329868961274988994452526178983 -> 4.585379573595865689605567720192768E-329 Inexact Rounded +powx3223 power 20.18365633762226550254542489492623 127.2099705237021350103678072707790 -> 1.020919629336979353690271762206060E+166 Inexact Rounded +powx3224 power 0.0000000553723990761530290129268131 8.157597566134754638015199501162405 -> 6.349030513396147480954474615067145E-60 Inexact Rounded +powx3225 power 0.0001028742674265840656614682618035 93.99842317306603797965470281716482 -> 1.455871110222736531854990397769940E-375 Inexact Rounded +powx3226 power 95.90195152775543876489746343266050 143.5992850002211509777720799352475 -> 3.881540015848530405189834366588567E+284 Inexact Rounded +powx3227 power 0.0000000000041783747057233878360333 12.14591167764993506821334760954430 -> 6.190998557456885985124592807383163E-139 Inexact Rounded +powx3228 power 0.5572830497086740798434917090018768 1001.921811263919522230330241349166 -> 3.871145158537170450093833881625838E-255 Inexact Rounded +powx3229 power 516.4754759779093954790813881333232 29.23812463126309057800793645336343 -> 2.110986192408878294012450052929185E+79 Inexact Rounded +powx3230 power 0.0000835892099464584776847299020706 27.64279992884843877453592659341588 -> 1.891535098905506689512376224943293E-113 Inexact Rounded +powx3231 power 72.45836577748571838139900165184955 166.2562890735032545091688015160084 -> 1.784091549041561516923092542939141E+309 Inexact Rounded +powx3232 power 305.1823317643335924007629563009032 83.01065159508472884219290136319623 -> 1.757493136164395229602456782779110E+206 Inexact Rounded +powx3233 power 7.108527102951713603542835791733786 145.7057852766236365450463428821948 -> 1.285934774113104362663619896550528E+124 Inexact Rounded +powx3234 power 6.471393503175464828149365697049824 64.11741937262455725284754171995720 -> 9.978990355881803195280027533011699E+51 Inexact Rounded +powx3235 power 39.72898094138459885662380866268385 239.9677288017447400786672779735168 -> 5.422218208517098335832848487375086E+383 Inexact Rounded +powx3236 power 0.0002865592332736973000183287329933 90.34733869590583787065642532641096 -> 8.293733126976212033209243257136796E-321 Inexact Rounded +powx3237 power 0.0000011343384394864811195077357936 1.926568285528399656789140809399396 -> 3.516055639378350146874261077470142E-12 Inexact Rounded +powx3238 power 0.0000000035321610295065299384889224 7.583861778824284092434085265265582 -> 7.970899823817369764381976286536230E-65 Inexact Rounded +powx3239 power 657.5028301569352677543770758346683 90.55778453811965116200206020172758 -> 1.522530898581564200655160665723268E+255 Inexact Rounded +powx3240 power 8.484756398325748879450577520251447 389.7468292476262478578280531222417 -> 8.595142803587368093392510310811218E+361 Inexact Rounded + +-- P=16, within 0-99 -- positive arg2 +Precision: 16 +powx3101 power 0.0000215524639223 48.37532522355252 -> 1.804663257287277E-226 Inexact Rounded +powx3102 power 00.80705856227999 2706.777535121391 -> 1.029625065876157E-252 Inexact Rounded +powx3103 power 3.445441676383689 428.5185892455830 -> 1.657401683096454E+230 Inexact Rounded +powx3104 power 0.0040158689495826 159.5725558816240 -> 4.255743665762492E-383 Inexact Rounded +powx3105 power 0.0000841553281215 38.32504413453944 -> 6.738653902512052E-157 Inexact Rounded +powx3106 power 0.7322610252571353 502.1254457674118 -> 1.109978126985943E-68 Inexact Rounded +powx3107 power 10.75052532144880 67.34180604734781 -> 2.873015019470189E+69 Inexact Rounded +powx3108 power 26.20425952945617 104.6002671186488 -> 2.301859355777030E+148 Inexact Rounded +powx3109 power 0.0000055737473850 31.16285859005424 -> 1.883348470100446E-164 Inexact Rounded +powx3110 power 61.06096011360700 10.93608439088726 -> 3.382686473028249E+19 Inexact Rounded +powx3111 power 9.340880853257137 179.9094938131726 -> 3.819299795937696E+174 Inexact Rounded +powx3112 power 0.0000050767371756 72.03346394186741 -> 4.216236691569869E-382 Inexact Rounded +powx3113 power 6.838478807860596 47.49665590602285 -> 4.547621630099203E+39 Inexact Rounded +powx3114 power 0.1299324346439081 397.7440523576938 -> 3.065047705553981E-353 Inexact Rounded +powx3115 power 0.0003418047034264 20.00516791512018 -> 4.546189665380487E-70 Inexact Rounded +powx3116 power 0.0001276899611715 78.12968287355703 -> 5.960217405063995E-305 Inexact Rounded +powx3117 power 25.93160588180509 252.6245071004620 -> 1.472171597589146E+357 Inexact Rounded +powx3118 power 35.47516857763178 86.14723037360925 -> 3.324299908481125E+133 Inexact Rounded +powx3119 power 0.0000048171086721 43.31965603038666 -> 4.572331516616228E-231 Inexact Rounded +powx3120 power 17.97652681097851 144.4684576550292 -> 1.842509906097860E+181 Inexact Rounded +powx3121 power 3.622765141518729 305.1948680344950 -> 4.132320967578704E+170 Inexact Rounded +powx3122 power 0.0080959002453519 143.9899444945627 -> 6.474627812947047E-302 Inexact Rounded +powx3123 power 9.841699927276571 299.2466668837188 -> 1.489097656208736E+297 Inexact Rounded +powx3124 power 0.0786659206232355 347.4750796962570 -> 2.05764809646925E-384 Inexact Rounded Underflow Subnormal +powx3125 power 0.0000084459792645 52.47348690745487 -> 6.076251876516942E-267 Inexact Rounded +powx3126 power 27.86589909967504 191.7296537102283 -> 1.157064112989386E+277 Inexact Rounded +powx3127 power 0.0000419907937234 58.44957702730767 -> 1.496950672075162E-256 Inexact Rounded +powx3128 power 0.0000664977739382 80.06749213261876 -> 3.488517620107875E-335 Inexact Rounded +powx3129 power 58.49554484886656 125.8480768373499 -> 2.449089862146640E+222 Inexact Rounded +powx3130 power 15.02820060024449 212.3527988973338 -> 8.307913932682067E+249 Inexact Rounded +powx3131 power 0.0002650089942992 30.92173123678761 -> 2.517827664836147E-111 Inexact Rounded +powx3132 power 0.0007342977426578 69.49168880741123 -> 1.600168665674440E-218 Inexact Rounded +powx3133 power 0.0063816068650629 150.1400094183812 -> 2.705057295799001E-330 Inexact Rounded +powx3134 power 9.912921122728791 297.8274013633411 -> 4.967624993438900E+296 Inexact Rounded +powx3135 power 1.988603563989245 768.4862967922182 -> 2.692842474899596E+229 Inexact Rounded +powx3136 power 8.418014519517691 164.2431359980725 -> 9.106211585888836E+151 Inexact Rounded +powx3137 power 6.068823604450686 120.2955212365837 -> 1.599431918105982E+94 Inexact Rounded +powx3138 power 56.90062738303850 54.90468294683645 -> 2.312839177902428E+96 Inexact Rounded +powx3139 power 5.710905139750871 73.44608752962156 -> 3.775876053709929E+55 Inexact Rounded +powx3140 power 0.0000017446761203 1.223981492228899 -> 8.952936595465635E-8 Inexact Rounded + +-- P=7, within 0-9 -- positive arg2 +Precision: 7 +powx3001 power 8.738689 55.96523 -> 4.878180E+52 Inexact Rounded +powx3002 power 0.0404763 147.4965 -> 3.689722E-206 Inexact Rounded +powx3003 power 0.0604232 76.69778 -> 3.319183E-94 Inexact Rounded +powx3004 power 0.0058855 107.5018 -> 1.768875E-240 Inexact Rounded +powx3005 power 2.058302 1173.050 -> 5.778899E+367 Inexact Rounded +powx3006 power 0.0056998 85.70157 -> 4.716783E-193 Inexact Rounded +powx3007 power 0.8169297 3693.537 -> 4.475962E-325 Inexact Rounded +powx3008 power 0.2810153 659.9568 -> 1.533177E-364 Inexact Rounded +powx3009 power 4.617478 15.68308 -> 2.629748E+10 Inexact Rounded +powx3010 power 0.0296418 244.2302 -> 6.207949E-374 Inexact Rounded +powx3011 power 0.0036456 127.9987 -> 8.120891E-313 Inexact Rounded +powx3012 power 0.5012813 577.5418 -> 6.088802E-174 Inexact Rounded +powx3013 power 0.0033275 119.9800 -> 5.055049E-298 Inexact Rounded +powx3014 power 0.0037652 111.7092 -> 1.560351E-271 Inexact Rounded +powx3015 power 0.6463252 239.0568 -> 4.864564E-46 Inexact Rounded +powx3016 power 4.784378 475.0521 -> 8.964460E+322 Inexact Rounded +powx3017 power 4.610305 563.1791 -> 6.290298E+373 Inexact Rounded +powx3018 power 0.0175167 80.52208 -> 3.623472E-142 Inexact Rounded +powx3019 power 5.238307 356.7944 -> 4.011461E+256 Inexact Rounded +powx3020 power 0.0003527 96.26347 -> 4.377932E-333 Inexact Rounded +powx3021 power 0.0015155 136.0516 -> 2.57113E-384 Inexact Rounded Underflow Subnormal +powx3022 power 5.753573 273.2340 -> 4.373184E+207 Inexact Rounded +powx3023 power 7.778665 332.7917 -> 3.060640E+296 Inexact Rounded +powx3024 power 1.432479 2046.064 -> 2.325829E+319 Inexact Rounded +powx3025 power 5.610516 136.4563 -> 1.607502E+102 Inexact Rounded +powx3026 power 0.0050697 137.4513 -> 3.522315E-316 Inexact Rounded +powx3027 power 5.678737 85.16253 -> 1.713909E+64 Inexact Rounded +powx3028 power 0.0816167 236.1973 -> 9.228802E-258 Inexact Rounded +powx3029 power 0.2602805 562.0157 -> 2.944556E-329 Inexact Rounded +powx3030 power 0.0080936 24.25367 -> 1.839755E-51 Inexact Rounded +powx3031 power 4.092016 82.94603 -> 5.724948E+50 Inexact Rounded +powx3032 power 0.0078255 7.204184 -> 6.675342E-16 Inexact Rounded +powx3033 power 0.9917693 29846.44 -> 7.430177E-108 Inexact Rounded +powx3034 power 1.610380 301.2467 -> 2.170142E+62 Inexact Rounded +powx3035 power 0.0588236 212.1097 -> 1.023196E-261 Inexact Rounded +powx3036 power 2.498069 531.4647 -> 2.054561E+211 Inexact Rounded +powx3037 power 9.964342 326.5438 -> 1.089452E+326 Inexact Rounded +powx3038 power 0.0820626 268.8718 -> 1.107350E-292 Inexact Rounded +powx3039 power 6.176486 360.7779 -> 1.914449E+285 Inexact Rounded +powx3040 power 4.206363 16.17288 -> 1.231314E+10 Inexact Rounded + +-- P=34, within 0-999 -- negative arg2 +Precision: 34 +powx3701 power 376.0915270000109486633402827007902 -35.69822349904102131649243701958463 -> 1.165722831225506457828653413200143E-92 Inexact Rounded +powx3702 power 0.0000000503747440074613191665845314 -9.520308341497979093021813571450575 -> 3.000432478861883953977971226770410E+69 Inexact Rounded +powx3703 power 290.6858731495339778337953407938308 -118.5459048597789693292455673428367 -> 9.357969047113989238392527565200302E-293 Inexact Rounded +powx3704 power 4.598864607620052062908700928454182 -299.8323667698931125720218537483753 -> 2.069641269855413539579128114448478E-199 Inexact Rounded +powx3705 power 2.556952676986830645708349254938903 -425.1755373251941383147998924703593 -> 4.428799777833598654260883861514638E-174 Inexact Rounded +powx3706 power 0.0000005656198763404221986640610118 -32.83361380678301321230028730075315 -> 1.340270622401829145968477601029251E+205 Inexact Rounded +powx3707 power 012.4841978642452960750801410372125 -214.3734291828712962809866663321921 -> 9.319857751170603140459057535971202E-236 Inexact Rounded +powx3708 power 0.0000000056041586148066919174315551 -37.21129049213858341528033343116533 -> 1.118345010652454313186702341873169E+307 Inexact Rounded +powx3709 power 0.0694569218941833767199998804202152 -8.697509072368973932501239815677732 -> 11862866995.51026489032838174290271 Inexact Rounded +powx3710 power 6.380984024259450398729243522354144 -451.0635696889193561457985486366827 -> 8.800353109387322474809325670314330E-364 Inexact Rounded +powx3711 power 786.0264840756809048288007204917801 -43.09935384678762773057342161718540 -> 1.616324183365644133979585419925934E-125 Inexact Rounded +powx3712 power 96.07836427113204744101287948445130 -185.1414572546330024388914720271876 -> 8.586320815218383004023264980018610E-368 Inexact Rounded +powx3713 power 0.0000000002332189796855870659792406 -5.779561613164628076880609893753327 -> 4.678450775876385793618570483345066E+55 Inexact Rounded +powx3714 power 0.7254146672024602242369943237968857 -2115.512891397828615710130092245691 -> 8.539080958041689288202111403102495E+294 Inexact Rounded +powx3715 power 0.0017380543649702864796144008592137 -6.307668017761022788220578633538713 -> 256309141459075651.2275798017695017 Inexact Rounded +powx3716 power 05.29498758952276908267649116142379 -287.3233896734103442991981056134167 -> 1.039130027847489364009368608104291E-208 Inexact Rounded +powx3717 power 15.64403593865932622003462779104178 -110.5296633358063267478609032002475 -> 9.750540276026524527375125980296142E-133 Inexact Rounded +powx3718 power 89.69639006761571087634945077373508 -181.3209914139357665609268339422627 -> 8.335034232277762924539395632025281E-355 Inexact Rounded +powx3719 power 6.974087483731006359914914110135058 -174.6815625746710345173615508179842 -> 4.553072265122011176641590109568031E-148 Inexact Rounded +powx3720 power 0.0034393024010554821130553772681993 -93.60931598413919272595497100497364 -> 4.067468855817145539589988349449394E+230 Inexact Rounded +powx3721 power 63.32834072300379155053737260965633 -168.3926799435088324825751446957616 -> 4.207907835462640471617519501741094E-304 Inexact Rounded +powx3722 power 00.00216088174206276369011255907785 -70.12279562855442784757874508991013 -> 8.000657143378187029609343435067057E+186 Inexact Rounded +powx3723 power 934.5957982703545893572134393004375 -102.2287735565878252484031426026726 -> 2.073813769209257617246544424827240E-304 Inexact Rounded +powx3724 power 107.9116792558793921873995885441177 -44.11941092260869786313838181499158 -> 2.005476533631183268912552168759595E-90 Inexact Rounded +powx3725 power 0.0000000000188049827381428191769262 -19.32118917192242027966847501724073 -> 1.713174297100918857053338286389034E+207 Inexact Rounded +powx3726 power 614.9820907366248142166636259027728 -4.069913257030791586645250035698123 -> 4.462432572576935752713876293746717E-12 Inexact Rounded +powx3727 power 752.0655175769182096165651274049422 -22.59292060348797472013598378334370 -> 1.039881526694635205040192531504131E-65 Inexact Rounded +powx3728 power 72.20446632047659449616175456059013 -175.4705356401853924020842356605072 -> 7.529540175791582421966947814549028E-327 Inexact Rounded +powx3729 power 518.8346486600403405764055847937416 -65.87320268592761588756963215588232 -> 1.420189426992170936958891180073151E-179 Inexact Rounded +powx3730 power 3.457164372003960576453458502270716 -440.3201118177861273814529713443698 -> 6.176418595751201287186292664257369E-238 Inexact Rounded +powx3731 power 7.908352793344189720739467675503991 -298.6646112894719680394152664740255 -> 5.935857120229147638104675057695125E-269 Inexact Rounded +powx3732 power 0.0000004297399403788595027926075086 -22.66504617185071293588817501468339 -> 2.012270405520600820469665145636204E+144 Inexact Rounded +powx3733 power 0.0000008592124097322966354868716443 -9.913109586558030204789520190180906 -> 1.354958763843310237046818832755215E+60 Inexact Rounded +powx3734 power 161.4806080561258105880907470989925 -70.72907837434814261716311990271578 -> 6.632555003698945544941329872901929E-157 Inexact Rounded +powx3735 power 0.0000000090669568624173832705631918 -36.53759624613665940127058439106640 -> 7.161808401023414735428130112941559E+293 Inexact Rounded +powx3736 power 0.0000000000029440295978365709342752 -1.297354238738921988884421117731562 -> 911731060579291.7661267358872917380 Inexact Rounded +powx3737 power 21.37477220144832172175460425143692 -76.95949933640539226475686997477889 -> 4.481741242418091914011962399912885E-103 Inexact Rounded +powx3738 power 0.0000000000186657798201636342150903 -20.18296240350678245567049161730909 -> 3.483954007114900406906338526575672E+216 Inexact Rounded +powx3739 power 0.0006522464792960191985996959126792 -80.03762491483514679886504099194414 -> 9.266548513614215557228467517053035E+254 Inexact Rounded +powx3740 power 0.0000000032851343694200568966168055 -21.53462116926375512242403160008026 -> 4.873201679668455240861376213601189E+182 Inexact Rounded + +-- P=16, within 0-99 -- negative arg2 +Precision: 16 +powx3601 power 0.0000151338748474 -40.84655618364688 -> 7.628470824137755E+196 Inexact Rounded +powx3602 power 0.1542771848654862 -435.8830009466800 -> 6.389817177800744E+353 Inexact Rounded +powx3603 power 48.28477749367364 -218.5929209902050 -> 8.531049532576154E-369 Inexact Rounded +powx3604 power 7.960775891584911 -12.78113732182505 -> 3.053270889769488E-12 Inexact Rounded +powx3605 power 0.9430340651863058 -9010.470056913748 -> 3.313374654923807E+229 Inexact Rounded +powx3606 power 0.0000202661501602 -65.57915207383306 -> 5.997379176536464E+307 Inexact Rounded +powx3607 power 04.33007440798390 -232.0476834666588 -> 2.007827183010456E-148 Inexact Rounded +powx3608 power 0.0000141944643914 -11.32407921958717 -> 7.902934485074846E+54 Inexact Rounded +powx3609 power 0.0000021977758261 -53.53706138253307 -> 8.195631772317815E+302 Inexact Rounded +powx3610 power 39.51297655474188 -19.40370976012326 -> 1.040699608072659E-31 Inexact Rounded +powx3611 power 38.71210232488775 -66.58341618227921 -> 1.886855066146495E-106 Inexact Rounded +powx3612 power 0.0000804235229062 -6.715207948992859 -> 3.134757864389333E+27 Inexact Rounded +powx3613 power 0.0000073547092399 -11.27725685719934 -> 7.781428390953695E+57 Inexact Rounded +powx3614 power 52.72181272599316 -186.1422311607435 -> 2.916601998744177E-321 Inexact Rounded +powx3615 power 0.0969519963083306 -280.8220862151369 -> 3.955906885970987E+284 Inexact Rounded +powx3616 power 94.07263302150081 -148.2031146071230 -> 3.361958990752490E-293 Inexact Rounded +powx3617 power 85.80286965053704 -90.21453695813759 -> 3.715602429645798E-175 Inexact Rounded +powx3618 power 03.52699858152259 -492.0414362539196 -> 4.507309220081092E-270 Inexact Rounded +powx3619 power 0.0508278086396068 -181.0871731572167 -> 2.034428013017949E+234 Inexact Rounded +powx3620 power 0.395576740303172 -915.5524507432392 -> 5.706585187437578E+368 Inexact Rounded +powx3621 power 38.06105826789202 -49.75913753435335 -> 2.273188991431738E-79 Inexact Rounded +powx3622 power 0.0003656748910646 -73.28988491310354 -> 7.768936940568763E+251 Inexact Rounded +powx3623 power 0.0000006373551809 -51.30825234200690 -> 7.697618167701985E+317 Inexact Rounded +powx3624 power 82.41729920673856 -35.73319631625699 -> 3.424042354585529E-69 Inexact Rounded +powx3625 power 0.7845821453127670 -971.4982028897663 -> 2.283415527661089E+102 Inexact Rounded +powx3626 power 4.840983673433497 -182.3730452370515 -> 1.220591407927770E-125 Inexact Rounded +powx3627 power 0.0000006137592139 -2.122139474431484 -> 15231217034839.29 Inexact Rounded +powx3628 power 0.0003657962862984 -35.97993782448099 -> 4.512701319250839E+123 Inexact Rounded +powx3629 power 40.93693004443150 -165.1362408792997 -> 6.044276411057239E-267 Inexact Rounded +powx3630 power 0.2941552583028898 -17.41046264945892 -> 1787833103.503346 Inexact Rounded +powx3631 power 63.99335135369977 -69.92417205168579 -> 5.099359804872509E-127 Inexact Rounded +powx3632 power 0.0000657924467388 -89.14497293588313 -> 6.145878266688521E+372 Inexact Rounded +powx3633 power 11.35071250339147 -323.3705865614542 -> 6.863626248766775E-342 Inexact Rounded +powx3634 power 23.88024718470895 -277.7117513329510 -> 2.006441422612815E-383 Inexact Rounded +powx3635 power 0.0000009111939914 -58.51782946929182 -> 2.954352883996773E+353 Inexact Rounded +powx3636 power 0.0000878179048782 -75.81060420238669 -> 3.306878455207585E+307 Inexact Rounded +powx3637 power 07.39190564273779 -287.5047307244636 -> 1.692080354659805E-250 Inexact Rounded +powx3638 power 0.0000298310819799 -1.844740377759355 -> 222874718.7238888 Inexact Rounded +powx3639 power 0.0000006412929384 -28.24850078229290 -> 8.737164230666529E+174 Inexact Rounded +powx3640 power 0.0000010202965998 -47.17573701956498 -> 4.392845306049341E+282 Inexact Rounded + +-- P=7, within 0-9 -- negative arg2 +Precision: 7 +powx3501 power 0.326324 -71.96509 -> 1.000673E+35 Inexact Rounded +powx3502 power 0.0017635 -0.7186967 -> 95.28419 Inexact Rounded +powx3503 power 8.564155 -253.0899 -> 8.850512E-237 Inexact Rounded +powx3504 power 8.987272 -2.155789 -> 0.008793859 Inexact Rounded +powx3505 power 9.604856 -139.9630 -> 3.073492E-138 Inexact Rounded +powx3506 power 0.8472919 -2539.085 -> 5.372686E+182 Inexact Rounded +powx3507 power 5.312329 -60.32965 -> 1.753121E-44 Inexact Rounded +powx3508 power 0.0338294 -100.5440 -> 7.423939E+147 Inexact Rounded +powx3509 power 0.0017777 -130.8583 -> 7.565629E+359 Inexact Rounded +powx3510 power 8.016154 -405.5689 -> 2.395977E-367 Inexact Rounded +powx3511 power 5.016570 -327.8906 -> 2.203784E-230 Inexact Rounded +powx3512 power 0.8161743 -744.5276 -> 4.786899E+65 Inexact Rounded +powx3513 power 0.0666343 -164.7320 -> 5.951240E+193 Inexact Rounded +powx3514 power 0.0803966 -202.2666 -> 2.715512E+221 Inexact Rounded +powx3515 power 0.0014752 -12.55547 -> 3.518905E+35 Inexact Rounded +powx3516 power 9.737565 -14.69615 -> 2.975672E-15 Inexact Rounded +powx3517 power 0.6634172 -152.7308 -> 1.654458E+27 Inexact Rounded +powx3518 power 0.0009337 -33.32939 -> 9.575039E+100 Inexact Rounded +powx3519 power 8.679922 -224.4194 -> 2.392446E-211 Inexact Rounded +powx3520 power 7.390494 -161.9483 -> 2.088375E-141 Inexact Rounded +powx3521 power 0.4631489 -417.1673 -> 2.821106E+139 Inexact Rounded +powx3522 power 0.0095471 -7.677458 -> 3.231855E+15 Inexact Rounded +powx3523 power 6.566339 -176.1867 -> 9.965633E-145 Inexact Rounded +powx3524 power 2.696128 -26.15501 -> 5.419731E-12 Inexact Rounded +powx3525 power 0.4464366 -852.1893 -> 2.957725E+298 Inexact Rounded +powx3526 power 0.4772006 -921.4111 -> 1.118105E+296 Inexact Rounded +powx3527 power 8.923696 -359.2211 -> 3.501573E-342 Inexact Rounded +powx3528 power 0.0018008 -66.91252 -> 4.402718E+183 Inexact Rounded +powx3529 power 0.0811964 -92.83278 -> 1.701111E+101 Inexact Rounded +powx3530 power 0.0711219 -58.94347 -> 4.644148E+67 Inexact Rounded +powx3531 power 7.958121 -50.66123 -> 2.311161E-46 Inexact Rounded +powx3532 power 6.106466 -81.83610 -> 4.943285E-65 Inexact Rounded +powx3533 power 4.557634 -129.5268 -> 4.737917E-86 Inexact Rounded +powx3534 power 0.0027348 -9.180135 -> 3.383524E+23 Inexact Rounded +powx3535 power 0.0083924 -46.24016 -> 9.996212E+95 Inexact Rounded +powx3536 power 2.138523 -47.25897 -> 2.507009E-16 Inexact Rounded +powx3537 power 1.626728 -1573.830 -> 2.668117E-333 Inexact Rounded +powx3538 power 0.082615 -164.5842 -> 1.717882E+178 Inexact Rounded +powx3539 power 7.636003 -363.6763 -> 8.366174E-322 Inexact Rounded +powx3540 power 0.0021481 -138.0065 -> 1.562505E+368 Inexact Rounded + + +-- Invalid operations due to restrictions +-- [next two probably skipped by most test harnesses] +precision: 100000000 +powx4001 power 1 1.1 -> NaN Invalid_context +precision: 99999999 +powx4002 power 1 1.1 -> NaN Invalid_context + +precision: 9 +maxExponent: 1000000 +minExponent: -999999 +powx4003 power 1 1.1 -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999999 +powx4004 power 1 1.1 -> 1.00000000 Inexact Rounded +maxExponent: 999999 +minExponent: -1000000 +powx4005 power 1 1.1 -> NaN Invalid_context +maxExponent: 999999 +minExponent: -999998 +powx4006 power 1 1.1 -> 1.00000000 Inexact Rounded + +-- operand range violations +powx4007 power 1 1.1E+999999 -> 1 +-- powx4008 power 1 1.1E+1000000 -> NaN Invalid_operation +powx4009 power 1.1E+999999 1.1 -> Infinity Overflow Inexact Rounded +-- powx4010 power 1.1E+1000000 1.1 -> NaN Invalid_operation +powx4011 power 1 1.1E-1999997 -> 1.00000000 Inexact Rounded +-- powx4012 power 1 1.1E-1999998 -> NaN Invalid_operation +powx4013 power 1.1E-1999997 1.1 -> 0E-1000006 Underflow Inexact Rounded Clamped Subnormal +-- powx4014 power 1.1E-1999998 1.1 -> NaN Invalid_operation + +-- rounding modes -- power is sensitive +precision: 7 +maxExponent: 99 +minExponent: -99 + +-- 0.7 ** 3.3 => 0.30819354053418943822 +-- 0.7 ** 3.4 => 0.29739477638272533854 +-- -1.2 ** 17 => -22.18611106740436992 +-- -1.3 ** 17 => -86.50415919381337933 +-- 0.5 ** 11 => 0.00048828125 +-- 3.15 ** 3 => 31.255875 + +rounding: up +powx4100 power 0.7 3.3 -> 0.3081936 Inexact Rounded +powx4101 power 0.7 3.4 -> 0.2973948 Inexact Rounded +powx4102 power -1.2 17 -> -22.18612 Inexact Rounded +powx4103 power -1.3 17 -> -86.50416 Inexact Rounded +powx4104 power 17 81.27115 -> 9.999974E+99 Inexact Rounded +powx4105 power 17 81.27116 -> Infinity Overflow Inexact Rounded + +rounding: down +powx4120 power 0.7 3.3 -> 0.3081935 Inexact Rounded +powx4121 power 0.7 3.4 -> 0.2973947 Inexact Rounded +powx4122 power -1.2 17 -> -22.18611 Inexact Rounded +powx4123 power -1.3 17 -> -86.50415 Inexact Rounded +powx4124 power 17 81.27115 -> 9.999973E+99 Inexact Rounded +powx4125 power 17 81.27116 -> 9.999999E+99 Overflow Inexact Rounded + +rounding: floor +powx4140 power 0.7 3.3 -> 0.3081935 Inexact Rounded +powx4141 power 0.7 3.4 -> 0.2973947 Inexact Rounded +powx4142 power -1.2 17 -> -22.18612 Inexact Rounded +powx4143 power -1.3 17 -> -86.50416 Inexact Rounded +powx4144 power 17 81.27115 -> 9.999973E+99 Inexact Rounded +powx4145 power 17 81.27116 -> 9.999999E+99 Overflow Inexact Rounded + +rounding: ceiling +powx4160 power 0.7 3.3 -> 0.3081936 Inexact Rounded +powx4161 power 0.7 3.4 -> 0.2973948 Inexact Rounded +powx4162 power -1.2 17 -> -22.18611 Inexact Rounded +powx4163 power -1.3 17 -> -86.50415 Inexact Rounded +powx4164 power 17 81.27115 -> 9.999974E+99 Inexact Rounded +powx4165 power 17 81.27116 -> Infinity Overflow Inexact Rounded + +rounding: half_up +powx4180 power 0.7 3.3 -> 0.3081935 Inexact Rounded +powx4181 power 0.7 3.4 -> 0.2973948 Inexact Rounded +powx4182 power -1.2 17 -> -22.18611 Inexact Rounded +powx4183 power -1.3 17 -> -86.50416 Inexact Rounded +powx4184 power 0.5 11 -> 0.0004882813 Inexact Rounded +powx4185 power 3.15 3 -> 31.25588 Inexact Rounded +powx4186 power 17 81.27115 -> 9.999974E+99 Inexact Rounded +powx4187 power 17 81.27116 -> Infinity Overflow Inexact Rounded + +rounding: half_even +powx4200 power 0.7 3.3 -> 0.3081935 Inexact Rounded +powx4201 power 0.7 3.4 -> 0.2973948 Inexact Rounded +powx4202 power -1.2 17 -> -22.18611 Inexact Rounded +powx4203 power -1.3 17 -> -86.50416 Inexact Rounded +powx4204 power 0.5 11 -> 0.0004882812 Inexact Rounded +powx4205 power 3.15 3 -> 31.25588 Inexact Rounded +powx4206 power 17 81.27115 -> 9.999974E+99 Inexact Rounded +powx4207 power 17 81.27116 -> Infinity Overflow Inexact Rounded + +rounding: half_down +powx4220 power 0.7 3.3 -> 0.3081935 Inexact Rounded +powx4221 power 0.7 3.4 -> 0.2973948 Inexact Rounded +powx4222 power -1.2 17 -> -22.18611 Inexact Rounded +powx4223 power -1.3 17 -> -86.50416 Inexact Rounded +powx4224 power 0.5 11 -> 0.0004882812 Inexact Rounded +powx4225 power 3.15 3 -> 31.25587 Inexact Rounded +powx4226 power -3.15 3 -> -31.25587 Inexact Rounded +powx4227 power 17 81.27115 -> 9.999974E+99 Inexact Rounded +powx4228 power 17 81.27116 -> Infinity Overflow Inexact Rounded + + +-- more rounding tests as per Ilan Nehama's suggestions & analysis +-- these are likely to show > 0.5 ulp error for very small powers +precision: 7 +maxExponent: 96 +minExponent: -95 + +-- For x=nextfp(1)=1.00..001 (where the number of 0s is precision-2) +-- power(x,y)=x when the rounding is up (e.g., toward_pos_inf or +-- ceil) for any y in (0,1]. +rounding: ceiling +powx4301 power 1.000001 0 -> 1 +powx4302 power 1.000001 1e-101 -> 1.000001 Inexact Rounded +powx4303 power 1.000001 1e-95 -> 1.000001 Inexact Rounded +powx4304 power 1.000001 1e-10 -> 1.000001 Inexact Rounded +powx4305 power 1.000001 0.1 -> 1.000001 Inexact Rounded +powx4306 power 1.000001 0.1234567 -> 1.000001 Inexact Rounded +powx4307 power 1.000001 0.7 -> 1.000001 Inexact Rounded +powx4308 power 1.000001 0.9999999 -> 1.000001 Inexact Rounded +powx4309 power 1.000001 1.000000 -> 1.000001 +-- power(x,y)=1 when the rounding is down (e.g. toward_zero or +-- floor) for any y in [0,1). +rounding: floor +powx4321 power 1.000001 0 -> 1 +powx4322 power 1.000001 1e-101 -> 1.000000 Inexact Rounded +powx4323 power 1.000001 1e-95 -> 1.000000 Inexact Rounded +powx4324 power 1.000001 1e-10 -> 1.000000 Inexact Rounded +powx4325 power 1.000001 0.1 -> 1.000000 Inexact Rounded +powx4326 power 1.000001 0.1234567 -> 1.000000 Inexact Rounded +powx4327 power 1.000001 0.7 -> 1.000000 Inexact Rounded +powx4328 power 1.000001 0.9999999 -> 1.000000 Inexact Rounded +powx4329 power 1.000001 1.000000 -> 1.000001 + Added: sandbox/trunk/decimal-c/new_dt/powersqrt.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/powersqrt.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,2969 @@ +------------------------------------------------------------------------ +-- powersqrt.decTest -- decimal square root, using power -- +-- Copyright (c) IBM Corporation, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- These testcases are taken from squareroot.decTest but are +-- evaluated using the power operator. The differences in results +-- (153 out of 2856) fall into the following categories: +-- +-- x ** 0.5 (x>0) has no preferred exponent, and is Inexact +-- (and hence full precision); almost all differences are +-- in this category +-- 0.00 ** 0.5 becomes 0 (not 0.0), etc. +-- -0 ** 0.5 becomes 0 (never -0) +-- Some exact subnormals become inexact and hence underflows + +extended: 1 +precision: 9 +rounding: half_even +maxExponent: 384 +minexponent: -383 + +-- basics +pwsx001 power 1 0.5 -> 1.00000000 Inexact Rounded +pwsx002 power -1 0.5 -> NaN Invalid_operation +pwsx003 power 1.00 0.5 -> 1.00000000 Inexact Rounded +pwsx004 power -1.00 0.5 -> NaN Invalid_operation +pwsx005 power 0 0.5 -> 0 +pwsx006 power 00.0 0.5 -> 0 +pwsx007 power 0.00 0.5 -> 0 +pwsx008 power 00.00 0.5 -> 0 +pwsx009 power 00.000 0.5 -> 0 +pwsx010 power 00.0000 0.5 -> 0 +pwsx011 power 00 0.5 -> 0 + +pwsx012 power -2 0.5 -> NaN Invalid_operation +pwsx013 power 2 0.5 -> 1.41421356 Inexact Rounded +pwsx014 power -2.00 0.5 -> NaN Invalid_operation +pwsx015 power 2.00 0.5 -> 1.41421356 Inexact Rounded +pwsx016 power -0 0.5 -> 0 +pwsx017 power -0.0 0.5 -> 0 +pwsx018 power -00.00 0.5 -> 0 +pwsx019 power -00.000 0.5 -> 0 +pwsx020 power -0.0000 0.5 -> 0 +pwsx021 power -0E+9 0.5 -> 0 +pwsx022 power -0E+10 0.5 -> 0 +pwsx023 power -0E+11 0.5 -> 0 +pwsx024 power -0E+12 0.5 -> 0 +pwsx025 power -00 0.5 -> 0 +pwsx026 power 0E+5 0.5 -> 0 +pwsx027 power 4.0 0.5 -> 2.00000000 Inexact Rounded +pwsx028 power 4.00 0.5 -> 2.00000000 Inexact Rounded + +pwsx030 power +0.1 0.5 -> 0.316227766 Inexact Rounded +pwsx031 power -0.1 0.5 -> NaN Invalid_operation +pwsx032 power +0.01 0.5 -> 0.100000000 Inexact Rounded +pwsx033 power -0.01 0.5 -> NaN Invalid_operation +pwsx034 power +0.001 0.5 -> 0.0316227766 Inexact Rounded +pwsx035 power -0.001 0.5 -> NaN Invalid_operation +pwsx036 power +0.000001 0.5 -> 0.00100000000 Inexact Rounded +pwsx037 power -0.000001 0.5 -> NaN Invalid_operation +pwsx038 power +0.000000000001 0.5 -> 0.00000100000000 Inexact Rounded +pwsx039 power -0.000000000001 0.5 -> NaN Invalid_operation + +pwsx041 power 1.1 0.5 -> 1.04880885 Inexact Rounded +pwsx042 power 1.10 0.5 -> 1.04880885 Inexact Rounded +pwsx043 power 1.100 0.5 -> 1.04880885 Inexact Rounded +pwsx044 power 1.110 0.5 -> 1.05356538 Inexact Rounded +pwsx045 power -1.1 0.5 -> NaN Invalid_operation +pwsx046 power -1.10 0.5 -> NaN Invalid_operation +pwsx047 power -1.100 0.5 -> NaN Invalid_operation +pwsx048 power -1.110 0.5 -> NaN Invalid_operation +pwsx049 power 9.9 0.5 -> 3.14642654 Inexact Rounded +pwsx050 power 9.90 0.5 -> 3.14642654 Inexact Rounded +pwsx051 power 9.900 0.5 -> 3.14642654 Inexact Rounded +pwsx052 power 9.990 0.5 -> 3.16069613 Inexact Rounded +pwsx053 power -9.9 0.5 -> NaN Invalid_operation +pwsx054 power -9.90 0.5 -> NaN Invalid_operation +pwsx055 power -9.900 0.5 -> NaN Invalid_operation +pwsx056 power -9.990 0.5 -> NaN Invalid_operation + +pwsx060 power 1 0.5 -> 1.00000000 Inexact Rounded +pwsx061 power 1.0 0.5 -> 1.00000000 Inexact Rounded +pwsx062 power 1.00 0.5 -> 1.00000000 Inexact Rounded +pwsx063 power 10.0 0.5 -> 3.16227766 Inexact Rounded +pwsx064 power 10.0 0.5 -> 3.16227766 Inexact Rounded +pwsx065 power 10.0 0.5 -> 3.16227766 Inexact Rounded +pwsx066 power 10.00 0.5 -> 3.16227766 Inexact Rounded +pwsx067 power 100 0.5 -> 10.0000000 Inexact Rounded +pwsx068 power 100.0 0.5 -> 10.0000000 Inexact Rounded +pwsx069 power 100.00 0.5 -> 10.0000000 Inexact Rounded +pwsx070 power 1.1000E+3 0.5 -> 33.1662479 Inexact Rounded +pwsx071 power 1.10000E+3 0.5 -> 33.1662479 Inexact Rounded +pwsx072 power -10.0 0.5 -> NaN Invalid_operation +pwsx073 power -10.00 0.5 -> NaN Invalid_operation +pwsx074 power -100.0 0.5 -> NaN Invalid_operation +pwsx075 power -100.00 0.5 -> NaN Invalid_operation +pwsx076 power -1.1000E+3 0.5 -> NaN Invalid_operation +pwsx077 power -1.10000E+3 0.5 -> NaN Invalid_operation + +-- famous squares +pwsx080 power 1 0.5 -> 1.00000000 Inexact Rounded +pwsx081 power 4 0.5 -> 2.00000000 Inexact Rounded +pwsx082 power 9 0.5 -> 3.00000000 Inexact Rounded +pwsx083 power 16 0.5 -> 4.00000000 Inexact Rounded +pwsx084 power 25 0.5 -> 5.00000000 Inexact Rounded +pwsx085 power 36 0.5 -> 6.00000000 Inexact Rounded +pwsx086 power 49 0.5 -> 7.00000000 Inexact Rounded +pwsx087 power 64 0.5 -> 8.00000000 Inexact Rounded +pwsx088 power 81 0.5 -> 9.00000000 Inexact Rounded +pwsx089 power 100 0.5 -> 10.0000000 Inexact Rounded +pwsx090 power 121 0.5 -> 11.0000000 Inexact Rounded +pwsx091 power 144 0.5 -> 12.0000000 Inexact Rounded +pwsx092 power 169 0.5 -> 13.0000000 Inexact Rounded +pwsx093 power 256 0.5 -> 16.0000000 Inexact Rounded +pwsx094 power 1024 0.5 -> 32.0000000 Inexact Rounded +pwsx095 power 4096 0.5 -> 64.0000000 Inexact Rounded +pwsx100 power 0.01 0.5 -> 0.100000000 Inexact Rounded +pwsx101 power 0.04 0.5 -> 0.200000000 Inexact Rounded +pwsx102 power 0.09 0.5 -> 0.300000000 Inexact Rounded +pwsx103 power 0.16 0.5 -> 0.400000000 Inexact Rounded +pwsx104 power 0.25 0.5 -> 0.500000000 Inexact Rounded +pwsx105 power 0.36 0.5 -> 0.600000000 Inexact Rounded +pwsx106 power 0.49 0.5 -> 0.700000000 Inexact Rounded +pwsx107 power 0.64 0.5 -> 0.800000000 Inexact Rounded +pwsx108 power 0.81 0.5 -> 0.900000000 Inexact Rounded +pwsx109 power 1.00 0.5 -> 1.00000000 Inexact Rounded +pwsx110 power 1.21 0.5 -> 1.10000000 Inexact Rounded +pwsx111 power 1.44 0.5 -> 1.20000000 Inexact Rounded +pwsx112 power 1.69 0.5 -> 1.30000000 Inexact Rounded +pwsx113 power 2.56 0.5 -> 1.60000000 Inexact Rounded +pwsx114 power 10.24 0.5 -> 3.20000000 Inexact Rounded +pwsx115 power 40.96 0.5 -> 6.40000000 Inexact Rounded + +-- Precision 1 squareroot tests [exhaustive, plus exponent adjusts] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 1 +pwsx1201 power 0.1 0.5 -> 0.3 Inexact Rounded +pwsx1202 power 0.01 0.5 -> 0.1 Inexact Rounded +pwsx1203 power 1.0E-1 0.5 -> 0.3 Inexact Rounded +pwsx1204 power 1.00E-2 0.5 -> 0.1 Inexact Rounded +pwsx1205 power 1E-3 0.5 -> 0.03 Inexact Rounded +pwsx1206 power 1E+1 0.5 -> 3 Inexact Rounded +pwsx1207 power 1E+2 0.5 -> 1E+1 Inexact Rounded +pwsx1208 power 1E+3 0.5 -> 3E+1 Inexact Rounded +pwsx1209 power 0.2 0.5 -> 0.4 Inexact Rounded +pwsx1210 power 0.02 0.5 -> 0.1 Inexact Rounded +pwsx1211 power 2.0E-1 0.5 -> 0.4 Inexact Rounded +pwsx1212 power 2.00E-2 0.5 -> 0.1 Inexact Rounded +pwsx1213 power 2E-3 0.5 -> 0.04 Inexact Rounded +pwsx1214 power 2E+1 0.5 -> 4 Inexact Rounded +pwsx1215 power 2E+2 0.5 -> 1E+1 Inexact Rounded +pwsx1216 power 2E+3 0.5 -> 4E+1 Inexact Rounded +pwsx1217 power 0.3 0.5 -> 0.5 Inexact Rounded +pwsx1218 power 0.03 0.5 -> 0.2 Inexact Rounded +pwsx1219 power 3.0E-1 0.5 -> 0.5 Inexact Rounded +pwsx1220 power 3.00E-2 0.5 -> 0.2 Inexact Rounded +pwsx1221 power 3E-3 0.5 -> 0.05 Inexact Rounded +pwsx1222 power 3E+1 0.5 -> 5 Inexact Rounded +pwsx1223 power 3E+2 0.5 -> 2E+1 Inexact Rounded +pwsx1224 power 3E+3 0.5 -> 5E+1 Inexact Rounded +pwsx1225 power 0.4 0.5 -> 0.6 Inexact Rounded +pwsx1226 power 0.04 0.5 -> 0.2 Inexact Rounded +pwsx1227 power 4.0E-1 0.5 -> 0.6 Inexact Rounded +pwsx1228 power 4.00E-2 0.5 -> 0.2 Inexact Rounded +pwsx1229 power 4E-3 0.5 -> 0.06 Inexact Rounded +pwsx1230 power 4E+1 0.5 -> 6 Inexact Rounded +pwsx1231 power 4E+2 0.5 -> 2E+1 Inexact Rounded +pwsx1232 power 4E+3 0.5 -> 6E+1 Inexact Rounded +pwsx1233 power 0.5 0.5 -> 0.7 Inexact Rounded +pwsx1234 power 0.05 0.5 -> 0.2 Inexact Rounded +pwsx1235 power 5.0E-1 0.5 -> 0.7 Inexact Rounded +pwsx1236 power 5.00E-2 0.5 -> 0.2 Inexact Rounded +pwsx1237 power 5E-3 0.5 -> 0.07 Inexact Rounded +pwsx1238 power 5E+1 0.5 -> 7 Inexact Rounded +pwsx1239 power 5E+2 0.5 -> 2E+1 Inexact Rounded +pwsx1240 power 5E+3 0.5 -> 7E+1 Inexact Rounded +pwsx1241 power 0.6 0.5 -> 0.8 Inexact Rounded +pwsx1242 power 0.06 0.5 -> 0.2 Inexact Rounded +pwsx1243 power 6.0E-1 0.5 -> 0.8 Inexact Rounded +pwsx1244 power 6.00E-2 0.5 -> 0.2 Inexact Rounded +pwsx1245 power 6E-3 0.5 -> 0.08 Inexact Rounded +pwsx1246 power 6E+1 0.5 -> 8 Inexact Rounded +pwsx1247 power 6E+2 0.5 -> 2E+1 Inexact Rounded +pwsx1248 power 6E+3 0.5 -> 8E+1 Inexact Rounded +pwsx1249 power 0.7 0.5 -> 0.8 Inexact Rounded +pwsx1250 power 0.07 0.5 -> 0.3 Inexact Rounded +pwsx1251 power 7.0E-1 0.5 -> 0.8 Inexact Rounded +pwsx1252 power 7.00E-2 0.5 -> 0.3 Inexact Rounded +pwsx1253 power 7E-3 0.5 -> 0.08 Inexact Rounded +pwsx1254 power 7E+1 0.5 -> 8 Inexact Rounded +pwsx1255 power 7E+2 0.5 -> 3E+1 Inexact Rounded +pwsx1256 power 7E+3 0.5 -> 8E+1 Inexact Rounded +pwsx1257 power 0.8 0.5 -> 0.9 Inexact Rounded +pwsx1258 power 0.08 0.5 -> 0.3 Inexact Rounded +pwsx1259 power 8.0E-1 0.5 -> 0.9 Inexact Rounded +pwsx1260 power 8.00E-2 0.5 -> 0.3 Inexact Rounded +pwsx1261 power 8E-3 0.5 -> 0.09 Inexact Rounded +pwsx1262 power 8E+1 0.5 -> 9 Inexact Rounded +pwsx1263 power 8E+2 0.5 -> 3E+1 Inexact Rounded +pwsx1264 power 8E+3 0.5 -> 9E+1 Inexact Rounded +pwsx1265 power 0.9 0.5 -> 0.9 Inexact Rounded +pwsx1266 power 0.09 0.5 -> 0.3 Inexact Rounded +pwsx1267 power 9.0E-1 0.5 -> 0.9 Inexact Rounded +pwsx1268 power 9.00E-2 0.5 -> 0.3 Inexact Rounded +pwsx1269 power 9E-3 0.5 -> 0.09 Inexact Rounded +pwsx1270 power 9E+1 0.5 -> 9 Inexact Rounded +pwsx1271 power 9E+2 0.5 -> 3E+1 Inexact Rounded +pwsx1272 power 9E+3 0.5 -> 9E+1 Inexact Rounded + +-- Precision 2 squareroot tests [exhaustive, plus exponent adjusts] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 2 +pwsx2201 power 0.1 0.5 -> 0.32 Inexact Rounded +pwsx2202 power 0.01 0.5 -> 0.10 Inexact Rounded +pwsx2203 power 1.0E-1 0.5 -> 0.32 Inexact Rounded +pwsx2204 power 1.00E-2 0.5 -> 0.10 Inexact Rounded +pwsx2205 power 1E-3 0.5 -> 0.032 Inexact Rounded +pwsx2206 power 1E+1 0.5 -> 3.2 Inexact Rounded +pwsx2207 power 1E+2 0.5 -> 10 Inexact Rounded +pwsx2208 power 1E+3 0.5 -> 32 Inexact Rounded +pwsx2209 power 0.2 0.5 -> 0.45 Inexact Rounded +pwsx2210 power 0.02 0.5 -> 0.14 Inexact Rounded +pwsx2211 power 2.0E-1 0.5 -> 0.45 Inexact Rounded +pwsx2212 power 2.00E-2 0.5 -> 0.14 Inexact Rounded +pwsx2213 power 2E-3 0.5 -> 0.045 Inexact Rounded +pwsx2214 power 2E+1 0.5 -> 4.5 Inexact Rounded +pwsx2215 power 2E+2 0.5 -> 14 Inexact Rounded +pwsx2216 power 2E+3 0.5 -> 45 Inexact Rounded +pwsx2217 power 0.3 0.5 -> 0.55 Inexact Rounded +pwsx2218 power 0.03 0.5 -> 0.17 Inexact Rounded +pwsx2219 power 3.0E-1 0.5 -> 0.55 Inexact Rounded +pwsx2220 power 3.00E-2 0.5 -> 0.17 Inexact Rounded +pwsx2221 power 3E-3 0.5 -> 0.055 Inexact Rounded +pwsx2222 power 3E+1 0.5 -> 5.5 Inexact Rounded +pwsx2223 power 3E+2 0.5 -> 17 Inexact Rounded +pwsx2224 power 3E+3 0.5 -> 55 Inexact Rounded +pwsx2225 power 0.4 0.5 -> 0.63 Inexact Rounded +pwsx2226 power 0.04 0.5 -> 0.20 Inexact Rounded +pwsx2227 power 4.0E-1 0.5 -> 0.63 Inexact Rounded +pwsx2228 power 4.00E-2 0.5 -> 0.20 Inexact Rounded +pwsx2229 power 4E-3 0.5 -> 0.063 Inexact Rounded +pwsx2230 power 4E+1 0.5 -> 6.3 Inexact Rounded +pwsx2231 power 4E+2 0.5 -> 20 Inexact Rounded +pwsx2232 power 4E+3 0.5 -> 63 Inexact Rounded +pwsx2233 power 0.5 0.5 -> 0.71 Inexact Rounded +pwsx2234 power 0.05 0.5 -> 0.22 Inexact Rounded +pwsx2235 power 5.0E-1 0.5 -> 0.71 Inexact Rounded +pwsx2236 power 5.00E-2 0.5 -> 0.22 Inexact Rounded +pwsx2237 power 5E-3 0.5 -> 0.071 Inexact Rounded +pwsx2238 power 5E+1 0.5 -> 7.1 Inexact Rounded +pwsx2239 power 5E+2 0.5 -> 22 Inexact Rounded +pwsx2240 power 5E+3 0.5 -> 71 Inexact Rounded +pwsx2241 power 0.6 0.5 -> 0.77 Inexact Rounded +pwsx2242 power 0.06 0.5 -> 0.24 Inexact Rounded +pwsx2243 power 6.0E-1 0.5 -> 0.77 Inexact Rounded +pwsx2244 power 6.00E-2 0.5 -> 0.24 Inexact Rounded +pwsx2245 power 6E-3 0.5 -> 0.077 Inexact Rounded +pwsx2246 power 6E+1 0.5 -> 7.7 Inexact Rounded +pwsx2247 power 6E+2 0.5 -> 24 Inexact Rounded +pwsx2248 power 6E+3 0.5 -> 77 Inexact Rounded +pwsx2249 power 0.7 0.5 -> 0.84 Inexact Rounded +pwsx2250 power 0.07 0.5 -> 0.26 Inexact Rounded +pwsx2251 power 7.0E-1 0.5 -> 0.84 Inexact Rounded +pwsx2252 power 7.00E-2 0.5 -> 0.26 Inexact Rounded +pwsx2253 power 7E-3 0.5 -> 0.084 Inexact Rounded +pwsx2254 power 7E+1 0.5 -> 8.4 Inexact Rounded +pwsx2255 power 7E+2 0.5 -> 26 Inexact Rounded +pwsx2256 power 7E+3 0.5 -> 84 Inexact Rounded +pwsx2257 power 0.8 0.5 -> 0.89 Inexact Rounded +pwsx2258 power 0.08 0.5 -> 0.28 Inexact Rounded +pwsx2259 power 8.0E-1 0.5 -> 0.89 Inexact Rounded +pwsx2260 power 8.00E-2 0.5 -> 0.28 Inexact Rounded +pwsx2261 power 8E-3 0.5 -> 0.089 Inexact Rounded +pwsx2262 power 8E+1 0.5 -> 8.9 Inexact Rounded +pwsx2263 power 8E+2 0.5 -> 28 Inexact Rounded +pwsx2264 power 8E+3 0.5 -> 89 Inexact Rounded +pwsx2265 power 0.9 0.5 -> 0.95 Inexact Rounded +pwsx2266 power 0.09 0.5 -> 0.30 Inexact Rounded +pwsx2267 power 9.0E-1 0.5 -> 0.95 Inexact Rounded +pwsx2268 power 9.00E-2 0.5 -> 0.30 Inexact Rounded +pwsx2269 power 9E-3 0.5 -> 0.095 Inexact Rounded +pwsx2270 power 9E+1 0.5 -> 9.5 Inexact Rounded +pwsx2271 power 9E+2 0.5 -> 30 Inexact Rounded +pwsx2272 power 9E+3 0.5 -> 95 Inexact Rounded +pwsx2273 power 0.10 0.5 -> 0.32 Inexact Rounded +pwsx2274 power 0.010 0.5 -> 0.10 Inexact Rounded +pwsx2275 power 10.0E-1 0.5 -> 1.0 Inexact Rounded +pwsx2276 power 10.00E-2 0.5 -> 0.32 Inexact Rounded +pwsx2277 power 10E-3 0.5 -> 0.10 Inexact Rounded +pwsx2278 power 10E+1 0.5 -> 10 Inexact Rounded +pwsx2279 power 10E+2 0.5 -> 32 Inexact Rounded +pwsx2280 power 10E+3 0.5 -> 1.0E+2 Inexact Rounded +pwsx2281 power 0.11 0.5 -> 0.33 Inexact Rounded +pwsx2282 power 0.011 0.5 -> 0.10 Inexact Rounded +pwsx2283 power 11.0E-1 0.5 -> 1.0 Inexact Rounded +pwsx2284 power 11.00E-2 0.5 -> 0.33 Inexact Rounded +pwsx2285 power 11E-3 0.5 -> 0.10 Inexact Rounded +pwsx2286 power 11E+1 0.5 -> 10 Inexact Rounded +pwsx2287 power 11E+2 0.5 -> 33 Inexact Rounded +pwsx2288 power 11E+3 0.5 -> 1.0E+2 Inexact Rounded +pwsx2289 power 0.12 0.5 -> 0.35 Inexact Rounded +pwsx2290 power 0.012 0.5 -> 0.11 Inexact Rounded +pwsx2291 power 12.0E-1 0.5 -> 1.1 Inexact Rounded +pwsx2292 power 12.00E-2 0.5 -> 0.35 Inexact Rounded +pwsx2293 power 12E-3 0.5 -> 0.11 Inexact Rounded +pwsx2294 power 12E+1 0.5 -> 11 Inexact Rounded +pwsx2295 power 12E+2 0.5 -> 35 Inexact Rounded +pwsx2296 power 12E+3 0.5 -> 1.1E+2 Inexact Rounded +pwsx2297 power 0.13 0.5 -> 0.36 Inexact Rounded +pwsx2298 power 0.013 0.5 -> 0.11 Inexact Rounded +pwsx2299 power 13.0E-1 0.5 -> 1.1 Inexact Rounded +pwsx2300 power 13.00E-2 0.5 -> 0.36 Inexact Rounded +pwsx2301 power 13E-3 0.5 -> 0.11 Inexact Rounded +pwsx2302 power 13E+1 0.5 -> 11 Inexact Rounded +pwsx2303 power 13E+2 0.5 -> 36 Inexact Rounded +pwsx2304 power 13E+3 0.5 -> 1.1E+2 Inexact Rounded +pwsx2305 power 0.14 0.5 -> 0.37 Inexact Rounded +pwsx2306 power 0.014 0.5 -> 0.12 Inexact Rounded +pwsx2307 power 14.0E-1 0.5 -> 1.2 Inexact Rounded +pwsx2308 power 14.00E-2 0.5 -> 0.37 Inexact Rounded +pwsx2309 power 14E-3 0.5 -> 0.12 Inexact Rounded +pwsx2310 power 14E+1 0.5 -> 12 Inexact Rounded +pwsx2311 power 14E+2 0.5 -> 37 Inexact Rounded +pwsx2312 power 14E+3 0.5 -> 1.2E+2 Inexact Rounded +pwsx2313 power 0.15 0.5 -> 0.39 Inexact Rounded +pwsx2314 power 0.015 0.5 -> 0.12 Inexact Rounded +pwsx2315 power 15.0E-1 0.5 -> 1.2 Inexact Rounded +pwsx2316 power 15.00E-2 0.5 -> 0.39 Inexact Rounded +pwsx2317 power 15E-3 0.5 -> 0.12 Inexact Rounded +pwsx2318 power 15E+1 0.5 -> 12 Inexact Rounded +pwsx2319 power 15E+2 0.5 -> 39 Inexact Rounded +pwsx2320 power 15E+3 0.5 -> 1.2E+2 Inexact Rounded +pwsx2321 power 0.16 0.5 -> 0.40 Inexact Rounded +pwsx2322 power 0.016 0.5 -> 0.13 Inexact Rounded +pwsx2323 power 16.0E-1 0.5 -> 1.3 Inexact Rounded +pwsx2324 power 16.00E-2 0.5 -> 0.40 Inexact Rounded +pwsx2325 power 16E-3 0.5 -> 0.13 Inexact Rounded +pwsx2326 power 16E+1 0.5 -> 13 Inexact Rounded +pwsx2327 power 16E+2 0.5 -> 40 Inexact Rounded +pwsx2328 power 16E+3 0.5 -> 1.3E+2 Inexact Rounded +pwsx2329 power 0.17 0.5 -> 0.41 Inexact Rounded +pwsx2330 power 0.017 0.5 -> 0.13 Inexact Rounded +pwsx2331 power 17.0E-1 0.5 -> 1.3 Inexact Rounded +pwsx2332 power 17.00E-2 0.5 -> 0.41 Inexact Rounded +pwsx2333 power 17E-3 0.5 -> 0.13 Inexact Rounded +pwsx2334 power 17E+1 0.5 -> 13 Inexact Rounded +pwsx2335 power 17E+2 0.5 -> 41 Inexact Rounded +pwsx2336 power 17E+3 0.5 -> 1.3E+2 Inexact Rounded +pwsx2337 power 0.18 0.5 -> 0.42 Inexact Rounded +pwsx2338 power 0.018 0.5 -> 0.13 Inexact Rounded +pwsx2339 power 18.0E-1 0.5 -> 1.3 Inexact Rounded +pwsx2340 power 18.00E-2 0.5 -> 0.42 Inexact Rounded +pwsx2341 power 18E-3 0.5 -> 0.13 Inexact Rounded +pwsx2342 power 18E+1 0.5 -> 13 Inexact Rounded +pwsx2343 power 18E+2 0.5 -> 42 Inexact Rounded +pwsx2344 power 18E+3 0.5 -> 1.3E+2 Inexact Rounded +pwsx2345 power 0.19 0.5 -> 0.44 Inexact Rounded +pwsx2346 power 0.019 0.5 -> 0.14 Inexact Rounded +pwsx2347 power 19.0E-1 0.5 -> 1.4 Inexact Rounded +pwsx2348 power 19.00E-2 0.5 -> 0.44 Inexact Rounded +pwsx2349 power 19E-3 0.5 -> 0.14 Inexact Rounded +pwsx2350 power 19E+1 0.5 -> 14 Inexact Rounded +pwsx2351 power 19E+2 0.5 -> 44 Inexact Rounded +pwsx2352 power 19E+3 0.5 -> 1.4E+2 Inexact Rounded +pwsx2353 power 0.20 0.5 -> 0.45 Inexact Rounded +pwsx2354 power 0.020 0.5 -> 0.14 Inexact Rounded +pwsx2355 power 20.0E-1 0.5 -> 1.4 Inexact Rounded +pwsx2356 power 20.00E-2 0.5 -> 0.45 Inexact Rounded +pwsx2357 power 20E-3 0.5 -> 0.14 Inexact Rounded +pwsx2358 power 20E+1 0.5 -> 14 Inexact Rounded +pwsx2359 power 20E+2 0.5 -> 45 Inexact Rounded +pwsx2360 power 20E+3 0.5 -> 1.4E+2 Inexact Rounded +pwsx2361 power 0.21 0.5 -> 0.46 Inexact Rounded +pwsx2362 power 0.021 0.5 -> 0.14 Inexact Rounded +pwsx2363 power 21.0E-1 0.5 -> 1.4 Inexact Rounded +pwsx2364 power 21.00E-2 0.5 -> 0.46 Inexact Rounded +pwsx2365 power 21E-3 0.5 -> 0.14 Inexact Rounded +pwsx2366 power 21E+1 0.5 -> 14 Inexact Rounded +pwsx2367 power 21E+2 0.5 -> 46 Inexact Rounded +pwsx2368 power 21E+3 0.5 -> 1.4E+2 Inexact Rounded +pwsx2369 power 0.22 0.5 -> 0.47 Inexact Rounded +pwsx2370 power 0.022 0.5 -> 0.15 Inexact Rounded +pwsx2371 power 22.0E-1 0.5 -> 1.5 Inexact Rounded +pwsx2372 power 22.00E-2 0.5 -> 0.47 Inexact Rounded +pwsx2373 power 22E-3 0.5 -> 0.15 Inexact Rounded +pwsx2374 power 22E+1 0.5 -> 15 Inexact Rounded +pwsx2375 power 22E+2 0.5 -> 47 Inexact Rounded +pwsx2376 power 22E+3 0.5 -> 1.5E+2 Inexact Rounded +pwsx2377 power 0.23 0.5 -> 0.48 Inexact Rounded +pwsx2378 power 0.023 0.5 -> 0.15 Inexact Rounded +pwsx2379 power 23.0E-1 0.5 -> 1.5 Inexact Rounded +pwsx2380 power 23.00E-2 0.5 -> 0.48 Inexact Rounded +pwsx2381 power 23E-3 0.5 -> 0.15 Inexact Rounded +pwsx2382 power 23E+1 0.5 -> 15 Inexact Rounded +pwsx2383 power 23E+2 0.5 -> 48 Inexact Rounded +pwsx2384 power 23E+3 0.5 -> 1.5E+2 Inexact Rounded +pwsx2385 power 0.24 0.5 -> 0.49 Inexact Rounded +pwsx2386 power 0.024 0.5 -> 0.15 Inexact Rounded +pwsx2387 power 24.0E-1 0.5 -> 1.5 Inexact Rounded +pwsx2388 power 24.00E-2 0.5 -> 0.49 Inexact Rounded +pwsx2389 power 24E-3 0.5 -> 0.15 Inexact Rounded +pwsx2390 power 24E+1 0.5 -> 15 Inexact Rounded +pwsx2391 power 24E+2 0.5 -> 49 Inexact Rounded +pwsx2392 power 24E+3 0.5 -> 1.5E+2 Inexact Rounded +pwsx2393 power 0.25 0.5 -> 0.50 Inexact Rounded +pwsx2394 power 0.025 0.5 -> 0.16 Inexact Rounded +pwsx2395 power 25.0E-1 0.5 -> 1.6 Inexact Rounded +pwsx2396 power 25.00E-2 0.5 -> 0.50 Inexact Rounded +pwsx2397 power 25E-3 0.5 -> 0.16 Inexact Rounded +pwsx2398 power 25E+1 0.5 -> 16 Inexact Rounded +pwsx2399 power 25E+2 0.5 -> 50 Inexact Rounded +pwsx2400 power 25E+3 0.5 -> 1.6E+2 Inexact Rounded +pwsx2401 power 0.26 0.5 -> 0.51 Inexact Rounded +pwsx2402 power 0.026 0.5 -> 0.16 Inexact Rounded +pwsx2403 power 26.0E-1 0.5 -> 1.6 Inexact Rounded +pwsx2404 power 26.00E-2 0.5 -> 0.51 Inexact Rounded +pwsx2405 power 26E-3 0.5 -> 0.16 Inexact Rounded +pwsx2406 power 26E+1 0.5 -> 16 Inexact Rounded +pwsx2407 power 26E+2 0.5 -> 51 Inexact Rounded +pwsx2408 power 26E+3 0.5 -> 1.6E+2 Inexact Rounded +pwsx2409 power 0.27 0.5 -> 0.52 Inexact Rounded +pwsx2410 power 0.027 0.5 -> 0.16 Inexact Rounded +pwsx2411 power 27.0E-1 0.5 -> 1.6 Inexact Rounded +pwsx2412 power 27.00E-2 0.5 -> 0.52 Inexact Rounded +pwsx2413 power 27E-3 0.5 -> 0.16 Inexact Rounded +pwsx2414 power 27E+1 0.5 -> 16 Inexact Rounded +pwsx2415 power 27E+2 0.5 -> 52 Inexact Rounded +pwsx2416 power 27E+3 0.5 -> 1.6E+2 Inexact Rounded +pwsx2417 power 0.28 0.5 -> 0.53 Inexact Rounded +pwsx2418 power 0.028 0.5 -> 0.17 Inexact Rounded +pwsx2419 power 28.0E-1 0.5 -> 1.7 Inexact Rounded +pwsx2420 power 28.00E-2 0.5 -> 0.53 Inexact Rounded +pwsx2421 power 28E-3 0.5 -> 0.17 Inexact Rounded +pwsx2422 power 28E+1 0.5 -> 17 Inexact Rounded +pwsx2423 power 28E+2 0.5 -> 53 Inexact Rounded +pwsx2424 power 28E+3 0.5 -> 1.7E+2 Inexact Rounded +pwsx2425 power 0.29 0.5 -> 0.54 Inexact Rounded +pwsx2426 power 0.029 0.5 -> 0.17 Inexact Rounded +pwsx2427 power 29.0E-1 0.5 -> 1.7 Inexact Rounded +pwsx2428 power 29.00E-2 0.5 -> 0.54 Inexact Rounded +pwsx2429 power 29E-3 0.5 -> 0.17 Inexact Rounded +pwsx2430 power 29E+1 0.5 -> 17 Inexact Rounded +pwsx2431 power 29E+2 0.5 -> 54 Inexact Rounded +pwsx2432 power 29E+3 0.5 -> 1.7E+2 Inexact Rounded +pwsx2433 power 0.30 0.5 -> 0.55 Inexact Rounded +pwsx2434 power 0.030 0.5 -> 0.17 Inexact Rounded +pwsx2435 power 30.0E-1 0.5 -> 1.7 Inexact Rounded +pwsx2436 power 30.00E-2 0.5 -> 0.55 Inexact Rounded +pwsx2437 power 30E-3 0.5 -> 0.17 Inexact Rounded +pwsx2438 power 30E+1 0.5 -> 17 Inexact Rounded +pwsx2439 power 30E+2 0.5 -> 55 Inexact Rounded +pwsx2440 power 30E+3 0.5 -> 1.7E+2 Inexact Rounded +pwsx2441 power 0.31 0.5 -> 0.56 Inexact Rounded +pwsx2442 power 0.031 0.5 -> 0.18 Inexact Rounded +pwsx2443 power 31.0E-1 0.5 -> 1.8 Inexact Rounded +pwsx2444 power 31.00E-2 0.5 -> 0.56 Inexact Rounded +pwsx2445 power 31E-3 0.5 -> 0.18 Inexact Rounded +pwsx2446 power 31E+1 0.5 -> 18 Inexact Rounded +pwsx2447 power 31E+2 0.5 -> 56 Inexact Rounded +pwsx2448 power 31E+3 0.5 -> 1.8E+2 Inexact Rounded +pwsx2449 power 0.32 0.5 -> 0.57 Inexact Rounded +pwsx2450 power 0.032 0.5 -> 0.18 Inexact Rounded +pwsx2451 power 32.0E-1 0.5 -> 1.8 Inexact Rounded +pwsx2452 power 32.00E-2 0.5 -> 0.57 Inexact Rounded +pwsx2453 power 32E-3 0.5 -> 0.18 Inexact Rounded +pwsx2454 power 32E+1 0.5 -> 18 Inexact Rounded +pwsx2455 power 32E+2 0.5 -> 57 Inexact Rounded +pwsx2456 power 32E+3 0.5 -> 1.8E+2 Inexact Rounded +pwsx2457 power 0.33 0.5 -> 0.57 Inexact Rounded +pwsx2458 power 0.033 0.5 -> 0.18 Inexact Rounded +pwsx2459 power 33.0E-1 0.5 -> 1.8 Inexact Rounded +pwsx2460 power 33.00E-2 0.5 -> 0.57 Inexact Rounded +pwsx2461 power 33E-3 0.5 -> 0.18 Inexact Rounded +pwsx2462 power 33E+1 0.5 -> 18 Inexact Rounded +pwsx2463 power 33E+2 0.5 -> 57 Inexact Rounded +pwsx2464 power 33E+3 0.5 -> 1.8E+2 Inexact Rounded +pwsx2465 power 0.34 0.5 -> 0.58 Inexact Rounded +pwsx2466 power 0.034 0.5 -> 0.18 Inexact Rounded +pwsx2467 power 34.0E-1 0.5 -> 1.8 Inexact Rounded +pwsx2468 power 34.00E-2 0.5 -> 0.58 Inexact Rounded +pwsx2469 power 34E-3 0.5 -> 0.18 Inexact Rounded +pwsx2470 power 34E+1 0.5 -> 18 Inexact Rounded +pwsx2471 power 34E+2 0.5 -> 58 Inexact Rounded +pwsx2472 power 34E+3 0.5 -> 1.8E+2 Inexact Rounded +pwsx2473 power 0.35 0.5 -> 0.59 Inexact Rounded +pwsx2474 power 0.035 0.5 -> 0.19 Inexact Rounded +pwsx2475 power 35.0E-1 0.5 -> 1.9 Inexact Rounded +pwsx2476 power 35.00E-2 0.5 -> 0.59 Inexact Rounded +pwsx2477 power 35E-3 0.5 -> 0.19 Inexact Rounded +pwsx2478 power 35E+1 0.5 -> 19 Inexact Rounded +pwsx2479 power 35E+2 0.5 -> 59 Inexact Rounded +pwsx2480 power 35E+3 0.5 -> 1.9E+2 Inexact Rounded +pwsx2481 power 0.36 0.5 -> 0.60 Inexact Rounded +pwsx2482 power 0.036 0.5 -> 0.19 Inexact Rounded +pwsx2483 power 36.0E-1 0.5 -> 1.9 Inexact Rounded +pwsx2484 power 36.00E-2 0.5 -> 0.60 Inexact Rounded +pwsx2485 power 36E-3 0.5 -> 0.19 Inexact Rounded +pwsx2486 power 36E+1 0.5 -> 19 Inexact Rounded +pwsx2487 power 36E+2 0.5 -> 60 Inexact Rounded +pwsx2488 power 36E+3 0.5 -> 1.9E+2 Inexact Rounded +pwsx2489 power 0.37 0.5 -> 0.61 Inexact Rounded +pwsx2490 power 0.037 0.5 -> 0.19 Inexact Rounded +pwsx2491 power 37.0E-1 0.5 -> 1.9 Inexact Rounded +pwsx2492 power 37.00E-2 0.5 -> 0.61 Inexact Rounded +pwsx2493 power 37E-3 0.5 -> 0.19 Inexact Rounded +pwsx2494 power 37E+1 0.5 -> 19 Inexact Rounded +pwsx2495 power 37E+2 0.5 -> 61 Inexact Rounded +pwsx2496 power 37E+3 0.5 -> 1.9E+2 Inexact Rounded +pwsx2497 power 0.38 0.5 -> 0.62 Inexact Rounded +pwsx2498 power 0.038 0.5 -> 0.19 Inexact Rounded +pwsx2499 power 38.0E-1 0.5 -> 1.9 Inexact Rounded +pwsx2500 power 38.00E-2 0.5 -> 0.62 Inexact Rounded +pwsx2501 power 38E-3 0.5 -> 0.19 Inexact Rounded +pwsx2502 power 38E+1 0.5 -> 19 Inexact Rounded +pwsx2503 power 38E+2 0.5 -> 62 Inexact Rounded +pwsx2504 power 38E+3 0.5 -> 1.9E+2 Inexact Rounded +pwsx2505 power 0.39 0.5 -> 0.62 Inexact Rounded +pwsx2506 power 0.039 0.5 -> 0.20 Inexact Rounded +pwsx2507 power 39.0E-1 0.5 -> 2.0 Inexact Rounded +pwsx2508 power 39.00E-2 0.5 -> 0.62 Inexact Rounded +pwsx2509 power 39E-3 0.5 -> 0.20 Inexact Rounded +pwsx2510 power 39E+1 0.5 -> 20 Inexact Rounded +pwsx2511 power 39E+2 0.5 -> 62 Inexact Rounded +pwsx2512 power 39E+3 0.5 -> 2.0E+2 Inexact Rounded +pwsx2513 power 0.40 0.5 -> 0.63 Inexact Rounded +pwsx2514 power 0.040 0.5 -> 0.20 Inexact Rounded +pwsx2515 power 40.0E-1 0.5 -> 2.0 Inexact Rounded +pwsx2516 power 40.00E-2 0.5 -> 0.63 Inexact Rounded +pwsx2517 power 40E-3 0.5 -> 0.20 Inexact Rounded +pwsx2518 power 40E+1 0.5 -> 20 Inexact Rounded +pwsx2519 power 40E+2 0.5 -> 63 Inexact Rounded +pwsx2520 power 40E+3 0.5 -> 2.0E+2 Inexact Rounded +pwsx2521 power 0.41 0.5 -> 0.64 Inexact Rounded +pwsx2522 power 0.041 0.5 -> 0.20 Inexact Rounded +pwsx2523 power 41.0E-1 0.5 -> 2.0 Inexact Rounded +pwsx2524 power 41.00E-2 0.5 -> 0.64 Inexact Rounded +pwsx2525 power 41E-3 0.5 -> 0.20 Inexact Rounded +pwsx2526 power 41E+1 0.5 -> 20 Inexact Rounded +pwsx2527 power 41E+2 0.5 -> 64 Inexact Rounded +pwsx2528 power 41E+3 0.5 -> 2.0E+2 Inexact Rounded +pwsx2529 power 0.42 0.5 -> 0.65 Inexact Rounded +pwsx2530 power 0.042 0.5 -> 0.20 Inexact Rounded +pwsx2531 power 42.0E-1 0.5 -> 2.0 Inexact Rounded +pwsx2532 power 42.00E-2 0.5 -> 0.65 Inexact Rounded +pwsx2533 power 42E-3 0.5 -> 0.20 Inexact Rounded +pwsx2534 power 42E+1 0.5 -> 20 Inexact Rounded +pwsx2535 power 42E+2 0.5 -> 65 Inexact Rounded +pwsx2536 power 42E+3 0.5 -> 2.0E+2 Inexact Rounded +pwsx2537 power 0.43 0.5 -> 0.66 Inexact Rounded +pwsx2538 power 0.043 0.5 -> 0.21 Inexact Rounded +pwsx2539 power 43.0E-1 0.5 -> 2.1 Inexact Rounded +pwsx2540 power 43.00E-2 0.5 -> 0.66 Inexact Rounded +pwsx2541 power 43E-3 0.5 -> 0.21 Inexact Rounded +pwsx2542 power 43E+1 0.5 -> 21 Inexact Rounded +pwsx2543 power 43E+2 0.5 -> 66 Inexact Rounded +pwsx2544 power 43E+3 0.5 -> 2.1E+2 Inexact Rounded +pwsx2545 power 0.44 0.5 -> 0.66 Inexact Rounded +pwsx2546 power 0.044 0.5 -> 0.21 Inexact Rounded +pwsx2547 power 44.0E-1 0.5 -> 2.1 Inexact Rounded +pwsx2548 power 44.00E-2 0.5 -> 0.66 Inexact Rounded +pwsx2549 power 44E-3 0.5 -> 0.21 Inexact Rounded +pwsx2550 power 44E+1 0.5 -> 21 Inexact Rounded +pwsx2551 power 44E+2 0.5 -> 66 Inexact Rounded +pwsx2552 power 44E+3 0.5 -> 2.1E+2 Inexact Rounded +pwsx2553 power 0.45 0.5 -> 0.67 Inexact Rounded +pwsx2554 power 0.045 0.5 -> 0.21 Inexact Rounded +pwsx2555 power 45.0E-1 0.5 -> 2.1 Inexact Rounded +pwsx2556 power 45.00E-2 0.5 -> 0.67 Inexact Rounded +pwsx2557 power 45E-3 0.5 -> 0.21 Inexact Rounded +pwsx2558 power 45E+1 0.5 -> 21 Inexact Rounded +pwsx2559 power 45E+2 0.5 -> 67 Inexact Rounded +pwsx2560 power 45E+3 0.5 -> 2.1E+2 Inexact Rounded +pwsx2561 power 0.46 0.5 -> 0.68 Inexact Rounded +pwsx2562 power 0.046 0.5 -> 0.21 Inexact Rounded +pwsx2563 power 46.0E-1 0.5 -> 2.1 Inexact Rounded +pwsx2564 power 46.00E-2 0.5 -> 0.68 Inexact Rounded +pwsx2565 power 46E-3 0.5 -> 0.21 Inexact Rounded +pwsx2566 power 46E+1 0.5 -> 21 Inexact Rounded +pwsx2567 power 46E+2 0.5 -> 68 Inexact Rounded +pwsx2568 power 46E+3 0.5 -> 2.1E+2 Inexact Rounded +pwsx2569 power 0.47 0.5 -> 0.69 Inexact Rounded +pwsx2570 power 0.047 0.5 -> 0.22 Inexact Rounded +pwsx2571 power 47.0E-1 0.5 -> 2.2 Inexact Rounded +pwsx2572 power 47.00E-2 0.5 -> 0.69 Inexact Rounded +pwsx2573 power 47E-3 0.5 -> 0.22 Inexact Rounded +pwsx2574 power 47E+1 0.5 -> 22 Inexact Rounded +pwsx2575 power 47E+2 0.5 -> 69 Inexact Rounded +pwsx2576 power 47E+3 0.5 -> 2.2E+2 Inexact Rounded +pwsx2577 power 0.48 0.5 -> 0.69 Inexact Rounded +pwsx2578 power 0.048 0.5 -> 0.22 Inexact Rounded +pwsx2579 power 48.0E-1 0.5 -> 2.2 Inexact Rounded +pwsx2580 power 48.00E-2 0.5 -> 0.69 Inexact Rounded +pwsx2581 power 48E-3 0.5 -> 0.22 Inexact Rounded +pwsx2582 power 48E+1 0.5 -> 22 Inexact Rounded +pwsx2583 power 48E+2 0.5 -> 69 Inexact Rounded +pwsx2584 power 48E+3 0.5 -> 2.2E+2 Inexact Rounded +pwsx2585 power 0.49 0.5 -> 0.70 Inexact Rounded +pwsx2586 power 0.049 0.5 -> 0.22 Inexact Rounded +pwsx2587 power 49.0E-1 0.5 -> 2.2 Inexact Rounded +pwsx2588 power 49.00E-2 0.5 -> 0.70 Inexact Rounded +pwsx2589 power 49E-3 0.5 -> 0.22 Inexact Rounded +pwsx2590 power 49E+1 0.5 -> 22 Inexact Rounded +pwsx2591 power 49E+2 0.5 -> 70 Inexact Rounded +pwsx2592 power 49E+3 0.5 -> 2.2E+2 Inexact Rounded +pwsx2593 power 0.50 0.5 -> 0.71 Inexact Rounded +pwsx2594 power 0.050 0.5 -> 0.22 Inexact Rounded +pwsx2595 power 50.0E-1 0.5 -> 2.2 Inexact Rounded +pwsx2596 power 50.00E-2 0.5 -> 0.71 Inexact Rounded +pwsx2597 power 50E-3 0.5 -> 0.22 Inexact Rounded +pwsx2598 power 50E+1 0.5 -> 22 Inexact Rounded +pwsx2599 power 50E+2 0.5 -> 71 Inexact Rounded +pwsx2600 power 50E+3 0.5 -> 2.2E+2 Inexact Rounded +pwsx2601 power 0.51 0.5 -> 0.71 Inexact Rounded +pwsx2602 power 0.051 0.5 -> 0.23 Inexact Rounded +pwsx2603 power 51.0E-1 0.5 -> 2.3 Inexact Rounded +pwsx2604 power 51.00E-2 0.5 -> 0.71 Inexact Rounded +pwsx2605 power 51E-3 0.5 -> 0.23 Inexact Rounded +pwsx2606 power 51E+1 0.5 -> 23 Inexact Rounded +pwsx2607 power 51E+2 0.5 -> 71 Inexact Rounded +pwsx2608 power 51E+3 0.5 -> 2.3E+2 Inexact Rounded +pwsx2609 power 0.52 0.5 -> 0.72 Inexact Rounded +pwsx2610 power 0.052 0.5 -> 0.23 Inexact Rounded +pwsx2611 power 52.0E-1 0.5 -> 2.3 Inexact Rounded +pwsx2612 power 52.00E-2 0.5 -> 0.72 Inexact Rounded +pwsx2613 power 52E-3 0.5 -> 0.23 Inexact Rounded +pwsx2614 power 52E+1 0.5 -> 23 Inexact Rounded +pwsx2615 power 52E+2 0.5 -> 72 Inexact Rounded +pwsx2616 power 52E+3 0.5 -> 2.3E+2 Inexact Rounded +pwsx2617 power 0.53 0.5 -> 0.73 Inexact Rounded +pwsx2618 power 0.053 0.5 -> 0.23 Inexact Rounded +pwsx2619 power 53.0E-1 0.5 -> 2.3 Inexact Rounded +pwsx2620 power 53.00E-2 0.5 -> 0.73 Inexact Rounded +pwsx2621 power 53E-3 0.5 -> 0.23 Inexact Rounded +pwsx2622 power 53E+1 0.5 -> 23 Inexact Rounded +pwsx2623 power 53E+2 0.5 -> 73 Inexact Rounded +pwsx2624 power 53E+3 0.5 -> 2.3E+2 Inexact Rounded +pwsx2625 power 0.54 0.5 -> 0.73 Inexact Rounded +pwsx2626 power 0.054 0.5 -> 0.23 Inexact Rounded +pwsx2627 power 54.0E-1 0.5 -> 2.3 Inexact Rounded +pwsx2628 power 54.00E-2 0.5 -> 0.73 Inexact Rounded +pwsx2629 power 54E-3 0.5 -> 0.23 Inexact Rounded +pwsx2630 power 54E+1 0.5 -> 23 Inexact Rounded +pwsx2631 power 54E+2 0.5 -> 73 Inexact Rounded +pwsx2632 power 54E+3 0.5 -> 2.3E+2 Inexact Rounded +pwsx2633 power 0.55 0.5 -> 0.74 Inexact Rounded +pwsx2634 power 0.055 0.5 -> 0.23 Inexact Rounded +pwsx2635 power 55.0E-1 0.5 -> 2.3 Inexact Rounded +pwsx2636 power 55.00E-2 0.5 -> 0.74 Inexact Rounded +pwsx2637 power 55E-3 0.5 -> 0.23 Inexact Rounded +pwsx2638 power 55E+1 0.5 -> 23 Inexact Rounded +pwsx2639 power 55E+2 0.5 -> 74 Inexact Rounded +pwsx2640 power 55E+3 0.5 -> 2.3E+2 Inexact Rounded +pwsx2641 power 0.56 0.5 -> 0.75 Inexact Rounded +pwsx2642 power 0.056 0.5 -> 0.24 Inexact Rounded +pwsx2643 power 56.0E-1 0.5 -> 2.4 Inexact Rounded +pwsx2644 power 56.00E-2 0.5 -> 0.75 Inexact Rounded +pwsx2645 power 56E-3 0.5 -> 0.24 Inexact Rounded +pwsx2646 power 56E+1 0.5 -> 24 Inexact Rounded +pwsx2647 power 56E+2 0.5 -> 75 Inexact Rounded +pwsx2648 power 56E+3 0.5 -> 2.4E+2 Inexact Rounded +pwsx2649 power 0.57 0.5 -> 0.75 Inexact Rounded +pwsx2650 power 0.057 0.5 -> 0.24 Inexact Rounded +pwsx2651 power 57.0E-1 0.5 -> 2.4 Inexact Rounded +pwsx2652 power 57.00E-2 0.5 -> 0.75 Inexact Rounded +pwsx2653 power 57E-3 0.5 -> 0.24 Inexact Rounded +pwsx2654 power 57E+1 0.5 -> 24 Inexact Rounded +pwsx2655 power 57E+2 0.5 -> 75 Inexact Rounded +pwsx2656 power 57E+3 0.5 -> 2.4E+2 Inexact Rounded +pwsx2657 power 0.58 0.5 -> 0.76 Inexact Rounded +pwsx2658 power 0.058 0.5 -> 0.24 Inexact Rounded +pwsx2659 power 58.0E-1 0.5 -> 2.4 Inexact Rounded +pwsx2660 power 58.00E-2 0.5 -> 0.76 Inexact Rounded +pwsx2661 power 58E-3 0.5 -> 0.24 Inexact Rounded +pwsx2662 power 58E+1 0.5 -> 24 Inexact Rounded +pwsx2663 power 58E+2 0.5 -> 76 Inexact Rounded +pwsx2664 power 58E+3 0.5 -> 2.4E+2 Inexact Rounded +pwsx2665 power 0.59 0.5 -> 0.77 Inexact Rounded +pwsx2666 power 0.059 0.5 -> 0.24 Inexact Rounded +pwsx2667 power 59.0E-1 0.5 -> 2.4 Inexact Rounded +pwsx2668 power 59.00E-2 0.5 -> 0.77 Inexact Rounded +pwsx2669 power 59E-3 0.5 -> 0.24 Inexact Rounded +pwsx2670 power 59E+1 0.5 -> 24 Inexact Rounded +pwsx2671 power 59E+2 0.5 -> 77 Inexact Rounded +pwsx2672 power 59E+3 0.5 -> 2.4E+2 Inexact Rounded +pwsx2673 power 0.60 0.5 -> 0.77 Inexact Rounded +pwsx2674 power 0.060 0.5 -> 0.24 Inexact Rounded +pwsx2675 power 60.0E-1 0.5 -> 2.4 Inexact Rounded +pwsx2676 power 60.00E-2 0.5 -> 0.77 Inexact Rounded +pwsx2677 power 60E-3 0.5 -> 0.24 Inexact Rounded +pwsx2678 power 60E+1 0.5 -> 24 Inexact Rounded +pwsx2679 power 60E+2 0.5 -> 77 Inexact Rounded +pwsx2680 power 60E+3 0.5 -> 2.4E+2 Inexact Rounded +pwsx2681 power 0.61 0.5 -> 0.78 Inexact Rounded +pwsx2682 power 0.061 0.5 -> 0.25 Inexact Rounded +pwsx2683 power 61.0E-1 0.5 -> 2.5 Inexact Rounded +pwsx2684 power 61.00E-2 0.5 -> 0.78 Inexact Rounded +pwsx2685 power 61E-3 0.5 -> 0.25 Inexact Rounded +pwsx2686 power 61E+1 0.5 -> 25 Inexact Rounded +pwsx2687 power 61E+2 0.5 -> 78 Inexact Rounded +pwsx2688 power 61E+3 0.5 -> 2.5E+2 Inexact Rounded +pwsx2689 power 0.62 0.5 -> 0.79 Inexact Rounded +pwsx2690 power 0.062 0.5 -> 0.25 Inexact Rounded +pwsx2691 power 62.0E-1 0.5 -> 2.5 Inexact Rounded +pwsx2692 power 62.00E-2 0.5 -> 0.79 Inexact Rounded +pwsx2693 power 62E-3 0.5 -> 0.25 Inexact Rounded +pwsx2694 power 62E+1 0.5 -> 25 Inexact Rounded +pwsx2695 power 62E+2 0.5 -> 79 Inexact Rounded +pwsx2696 power 62E+3 0.5 -> 2.5E+2 Inexact Rounded +pwsx2697 power 0.63 0.5 -> 0.79 Inexact Rounded +pwsx2698 power 0.063 0.5 -> 0.25 Inexact Rounded +pwsx2699 power 63.0E-1 0.5 -> 2.5 Inexact Rounded +pwsx2700 power 63.00E-2 0.5 -> 0.79 Inexact Rounded +pwsx2701 power 63E-3 0.5 -> 0.25 Inexact Rounded +pwsx2702 power 63E+1 0.5 -> 25 Inexact Rounded +pwsx2703 power 63E+2 0.5 -> 79 Inexact Rounded +pwsx2704 power 63E+3 0.5 -> 2.5E+2 Inexact Rounded +pwsx2705 power 0.64 0.5 -> 0.80 Inexact Rounded +pwsx2706 power 0.064 0.5 -> 0.25 Inexact Rounded +pwsx2707 power 64.0E-1 0.5 -> 2.5 Inexact Rounded +pwsx2708 power 64.00E-2 0.5 -> 0.80 Inexact Rounded +pwsx2709 power 64E-3 0.5 -> 0.25 Inexact Rounded +pwsx2710 power 64E+1 0.5 -> 25 Inexact Rounded +pwsx2711 power 64E+2 0.5 -> 80 Inexact Rounded +pwsx2712 power 64E+3 0.5 -> 2.5E+2 Inexact Rounded +pwsx2713 power 0.65 0.5 -> 0.81 Inexact Rounded +pwsx2714 power 0.065 0.5 -> 0.25 Inexact Rounded +pwsx2715 power 65.0E-1 0.5 -> 2.5 Inexact Rounded +pwsx2716 power 65.00E-2 0.5 -> 0.81 Inexact Rounded +pwsx2717 power 65E-3 0.5 -> 0.25 Inexact Rounded +pwsx2718 power 65E+1 0.5 -> 25 Inexact Rounded +pwsx2719 power 65E+2 0.5 -> 81 Inexact Rounded +pwsx2720 power 65E+3 0.5 -> 2.5E+2 Inexact Rounded +pwsx2721 power 0.66 0.5 -> 0.81 Inexact Rounded +pwsx2722 power 0.066 0.5 -> 0.26 Inexact Rounded +pwsx2723 power 66.0E-1 0.5 -> 2.6 Inexact Rounded +pwsx2724 power 66.00E-2 0.5 -> 0.81 Inexact Rounded +pwsx2725 power 66E-3 0.5 -> 0.26 Inexact Rounded +pwsx2726 power 66E+1 0.5 -> 26 Inexact Rounded +pwsx2727 power 66E+2 0.5 -> 81 Inexact Rounded +pwsx2728 power 66E+3 0.5 -> 2.6E+2 Inexact Rounded +pwsx2729 power 0.67 0.5 -> 0.82 Inexact Rounded +pwsx2730 power 0.067 0.5 -> 0.26 Inexact Rounded +pwsx2731 power 67.0E-1 0.5 -> 2.6 Inexact Rounded +pwsx2732 power 67.00E-2 0.5 -> 0.82 Inexact Rounded +pwsx2733 power 67E-3 0.5 -> 0.26 Inexact Rounded +pwsx2734 power 67E+1 0.5 -> 26 Inexact Rounded +pwsx2735 power 67E+2 0.5 -> 82 Inexact Rounded +pwsx2736 power 67E+3 0.5 -> 2.6E+2 Inexact Rounded +pwsx2737 power 0.68 0.5 -> 0.82 Inexact Rounded +pwsx2738 power 0.068 0.5 -> 0.26 Inexact Rounded +pwsx2739 power 68.0E-1 0.5 -> 2.6 Inexact Rounded +pwsx2740 power 68.00E-2 0.5 -> 0.82 Inexact Rounded +pwsx2741 power 68E-3 0.5 -> 0.26 Inexact Rounded +pwsx2742 power 68E+1 0.5 -> 26 Inexact Rounded +pwsx2743 power 68E+2 0.5 -> 82 Inexact Rounded +pwsx2744 power 68E+3 0.5 -> 2.6E+2 Inexact Rounded +pwsx2745 power 0.69 0.5 -> 0.83 Inexact Rounded +pwsx2746 power 0.069 0.5 -> 0.26 Inexact Rounded +pwsx2747 power 69.0E-1 0.5 -> 2.6 Inexact Rounded +pwsx2748 power 69.00E-2 0.5 -> 0.83 Inexact Rounded +pwsx2749 power 69E-3 0.5 -> 0.26 Inexact Rounded +pwsx2750 power 69E+1 0.5 -> 26 Inexact Rounded +pwsx2751 power 69E+2 0.5 -> 83 Inexact Rounded +pwsx2752 power 69E+3 0.5 -> 2.6E+2 Inexact Rounded +pwsx2753 power 0.70 0.5 -> 0.84 Inexact Rounded +pwsx2754 power 0.070 0.5 -> 0.26 Inexact Rounded +pwsx2755 power 70.0E-1 0.5 -> 2.6 Inexact Rounded +pwsx2756 power 70.00E-2 0.5 -> 0.84 Inexact Rounded +pwsx2757 power 70E-3 0.5 -> 0.26 Inexact Rounded +pwsx2758 power 70E+1 0.5 -> 26 Inexact Rounded +pwsx2759 power 70E+2 0.5 -> 84 Inexact Rounded +pwsx2760 power 70E+3 0.5 -> 2.6E+2 Inexact Rounded +pwsx2761 power 0.71 0.5 -> 0.84 Inexact Rounded +pwsx2762 power 0.071 0.5 -> 0.27 Inexact Rounded +pwsx2763 power 71.0E-1 0.5 -> 2.7 Inexact Rounded +pwsx2764 power 71.00E-2 0.5 -> 0.84 Inexact Rounded +pwsx2765 power 71E-3 0.5 -> 0.27 Inexact Rounded +pwsx2766 power 71E+1 0.5 -> 27 Inexact Rounded +pwsx2767 power 71E+2 0.5 -> 84 Inexact Rounded +pwsx2768 power 71E+3 0.5 -> 2.7E+2 Inexact Rounded +pwsx2769 power 0.72 0.5 -> 0.85 Inexact Rounded +pwsx2770 power 0.072 0.5 -> 0.27 Inexact Rounded +pwsx2771 power 72.0E-1 0.5 -> 2.7 Inexact Rounded +pwsx2772 power 72.00E-2 0.5 -> 0.85 Inexact Rounded +pwsx2773 power 72E-3 0.5 -> 0.27 Inexact Rounded +pwsx2774 power 72E+1 0.5 -> 27 Inexact Rounded +pwsx2775 power 72E+2 0.5 -> 85 Inexact Rounded +pwsx2776 power 72E+3 0.5 -> 2.7E+2 Inexact Rounded +pwsx2777 power 0.73 0.5 -> 0.85 Inexact Rounded +pwsx2778 power 0.073 0.5 -> 0.27 Inexact Rounded +pwsx2779 power 73.0E-1 0.5 -> 2.7 Inexact Rounded +pwsx2780 power 73.00E-2 0.5 -> 0.85 Inexact Rounded +pwsx2781 power 73E-3 0.5 -> 0.27 Inexact Rounded +pwsx2782 power 73E+1 0.5 -> 27 Inexact Rounded +pwsx2783 power 73E+2 0.5 -> 85 Inexact Rounded +pwsx2784 power 73E+3 0.5 -> 2.7E+2 Inexact Rounded +pwsx2785 power 0.74 0.5 -> 0.86 Inexact Rounded +pwsx2786 power 0.074 0.5 -> 0.27 Inexact Rounded +pwsx2787 power 74.0E-1 0.5 -> 2.7 Inexact Rounded +pwsx2788 power 74.00E-2 0.5 -> 0.86 Inexact Rounded +pwsx2789 power 74E-3 0.5 -> 0.27 Inexact Rounded +pwsx2790 power 74E+1 0.5 -> 27 Inexact Rounded +pwsx2791 power 74E+2 0.5 -> 86 Inexact Rounded +pwsx2792 power 74E+3 0.5 -> 2.7E+2 Inexact Rounded +pwsx2793 power 0.75 0.5 -> 0.87 Inexact Rounded +pwsx2794 power 0.075 0.5 -> 0.27 Inexact Rounded +pwsx2795 power 75.0E-1 0.5 -> 2.7 Inexact Rounded +pwsx2796 power 75.00E-2 0.5 -> 0.87 Inexact Rounded +pwsx2797 power 75E-3 0.5 -> 0.27 Inexact Rounded +pwsx2798 power 75E+1 0.5 -> 27 Inexact Rounded +pwsx2799 power 75E+2 0.5 -> 87 Inexact Rounded +pwsx2800 power 75E+3 0.5 -> 2.7E+2 Inexact Rounded +pwsx2801 power 0.76 0.5 -> 0.87 Inexact Rounded +pwsx2802 power 0.076 0.5 -> 0.28 Inexact Rounded +pwsx2803 power 76.0E-1 0.5 -> 2.8 Inexact Rounded +pwsx2804 power 76.00E-2 0.5 -> 0.87 Inexact Rounded +pwsx2805 power 76E-3 0.5 -> 0.28 Inexact Rounded +pwsx2806 power 76E+1 0.5 -> 28 Inexact Rounded +pwsx2807 power 76E+2 0.5 -> 87 Inexact Rounded +pwsx2808 power 76E+3 0.5 -> 2.8E+2 Inexact Rounded +pwsx2809 power 0.77 0.5 -> 0.88 Inexact Rounded +pwsx2810 power 0.077 0.5 -> 0.28 Inexact Rounded +pwsx2811 power 77.0E-1 0.5 -> 2.8 Inexact Rounded +pwsx2812 power 77.00E-2 0.5 -> 0.88 Inexact Rounded +pwsx2813 power 77E-3 0.5 -> 0.28 Inexact Rounded +pwsx2814 power 77E+1 0.5 -> 28 Inexact Rounded +pwsx2815 power 77E+2 0.5 -> 88 Inexact Rounded +pwsx2816 power 77E+3 0.5 -> 2.8E+2 Inexact Rounded +pwsx2817 power 0.78 0.5 -> 0.88 Inexact Rounded +pwsx2818 power 0.078 0.5 -> 0.28 Inexact Rounded +pwsx2819 power 78.0E-1 0.5 -> 2.8 Inexact Rounded +pwsx2820 power 78.00E-2 0.5 -> 0.88 Inexact Rounded +pwsx2821 power 78E-3 0.5 -> 0.28 Inexact Rounded +pwsx2822 power 78E+1 0.5 -> 28 Inexact Rounded +pwsx2823 power 78E+2 0.5 -> 88 Inexact Rounded +pwsx2824 power 78E+3 0.5 -> 2.8E+2 Inexact Rounded +pwsx2825 power 0.79 0.5 -> 0.89 Inexact Rounded +pwsx2826 power 0.079 0.5 -> 0.28 Inexact Rounded +pwsx2827 power 79.0E-1 0.5 -> 2.8 Inexact Rounded +pwsx2828 power 79.00E-2 0.5 -> 0.89 Inexact Rounded +pwsx2829 power 79E-3 0.5 -> 0.28 Inexact Rounded +pwsx2830 power 79E+1 0.5 -> 28 Inexact Rounded +pwsx2831 power 79E+2 0.5 -> 89 Inexact Rounded +pwsx2832 power 79E+3 0.5 -> 2.8E+2 Inexact Rounded +pwsx2833 power 0.80 0.5 -> 0.89 Inexact Rounded +pwsx2834 power 0.080 0.5 -> 0.28 Inexact Rounded +pwsx2835 power 80.0E-1 0.5 -> 2.8 Inexact Rounded +pwsx2836 power 80.00E-2 0.5 -> 0.89 Inexact Rounded +pwsx2837 power 80E-3 0.5 -> 0.28 Inexact Rounded +pwsx2838 power 80E+1 0.5 -> 28 Inexact Rounded +pwsx2839 power 80E+2 0.5 -> 89 Inexact Rounded +pwsx2840 power 80E+3 0.5 -> 2.8E+2 Inexact Rounded +pwsx2841 power 0.81 0.5 -> 0.90 Inexact Rounded +pwsx2842 power 0.081 0.5 -> 0.28 Inexact Rounded +pwsx2843 power 81.0E-1 0.5 -> 2.8 Inexact Rounded +pwsx2844 power 81.00E-2 0.5 -> 0.90 Inexact Rounded +pwsx2845 power 81E-3 0.5 -> 0.28 Inexact Rounded +pwsx2846 power 81E+1 0.5 -> 28 Inexact Rounded +pwsx2847 power 81E+2 0.5 -> 90 Inexact Rounded +pwsx2848 power 81E+3 0.5 -> 2.8E+2 Inexact Rounded +pwsx2849 power 0.82 0.5 -> 0.91 Inexact Rounded +pwsx2850 power 0.082 0.5 -> 0.29 Inexact Rounded +pwsx2851 power 82.0E-1 0.5 -> 2.9 Inexact Rounded +pwsx2852 power 82.00E-2 0.5 -> 0.91 Inexact Rounded +pwsx2853 power 82E-3 0.5 -> 0.29 Inexact Rounded +pwsx2854 power 82E+1 0.5 -> 29 Inexact Rounded +pwsx2855 power 82E+2 0.5 -> 91 Inexact Rounded +pwsx2856 power 82E+3 0.5 -> 2.9E+2 Inexact Rounded +pwsx2857 power 0.83 0.5 -> 0.91 Inexact Rounded +pwsx2858 power 0.083 0.5 -> 0.29 Inexact Rounded +pwsx2859 power 83.0E-1 0.5 -> 2.9 Inexact Rounded +pwsx2860 power 83.00E-2 0.5 -> 0.91 Inexact Rounded +pwsx2861 power 83E-3 0.5 -> 0.29 Inexact Rounded +pwsx2862 power 83E+1 0.5 -> 29 Inexact Rounded +pwsx2863 power 83E+2 0.5 -> 91 Inexact Rounded +pwsx2864 power 83E+3 0.5 -> 2.9E+2 Inexact Rounded +pwsx2865 power 0.84 0.5 -> 0.92 Inexact Rounded +pwsx2866 power 0.084 0.5 -> 0.29 Inexact Rounded +pwsx2867 power 84.0E-1 0.5 -> 2.9 Inexact Rounded +pwsx2868 power 84.00E-2 0.5 -> 0.92 Inexact Rounded +pwsx2869 power 84E-3 0.5 -> 0.29 Inexact Rounded +pwsx2870 power 84E+1 0.5 -> 29 Inexact Rounded +pwsx2871 power 84E+2 0.5 -> 92 Inexact Rounded +pwsx2872 power 84E+3 0.5 -> 2.9E+2 Inexact Rounded +pwsx2873 power 0.85 0.5 -> 0.92 Inexact Rounded +pwsx2874 power 0.085 0.5 -> 0.29 Inexact Rounded +pwsx2875 power 85.0E-1 0.5 -> 2.9 Inexact Rounded +pwsx2876 power 85.00E-2 0.5 -> 0.92 Inexact Rounded +pwsx2877 power 85E-3 0.5 -> 0.29 Inexact Rounded +pwsx2878 power 85E+1 0.5 -> 29 Inexact Rounded +pwsx2879 power 85E+2 0.5 -> 92 Inexact Rounded +pwsx2880 power 85E+3 0.5 -> 2.9E+2 Inexact Rounded +pwsx2881 power 0.86 0.5 -> 0.93 Inexact Rounded +pwsx2882 power 0.086 0.5 -> 0.29 Inexact Rounded +pwsx2883 power 86.0E-1 0.5 -> 2.9 Inexact Rounded +pwsx2884 power 86.00E-2 0.5 -> 0.93 Inexact Rounded +pwsx2885 power 86E-3 0.5 -> 0.29 Inexact Rounded +pwsx2886 power 86E+1 0.5 -> 29 Inexact Rounded +pwsx2887 power 86E+2 0.5 -> 93 Inexact Rounded +pwsx2888 power 86E+3 0.5 -> 2.9E+2 Inexact Rounded +pwsx2889 power 0.87 0.5 -> 0.93 Inexact Rounded +pwsx2890 power 0.087 0.5 -> 0.29 Inexact Rounded +pwsx2891 power 87.0E-1 0.5 -> 2.9 Inexact Rounded +pwsx2892 power 87.00E-2 0.5 -> 0.93 Inexact Rounded +pwsx2893 power 87E-3 0.5 -> 0.29 Inexact Rounded +pwsx2894 power 87E+1 0.5 -> 29 Inexact Rounded +pwsx2895 power 87E+2 0.5 -> 93 Inexact Rounded +pwsx2896 power 87E+3 0.5 -> 2.9E+2 Inexact Rounded +pwsx2897 power 0.88 0.5 -> 0.94 Inexact Rounded +pwsx2898 power 0.088 0.5 -> 0.30 Inexact Rounded +pwsx2899 power 88.0E-1 0.5 -> 3.0 Inexact Rounded +pwsx2900 power 88.00E-2 0.5 -> 0.94 Inexact Rounded +pwsx2901 power 88E-3 0.5 -> 0.30 Inexact Rounded +pwsx2902 power 88E+1 0.5 -> 30 Inexact Rounded +pwsx2903 power 88E+2 0.5 -> 94 Inexact Rounded +pwsx2904 power 88E+3 0.5 -> 3.0E+2 Inexact Rounded +pwsx2905 power 0.89 0.5 -> 0.94 Inexact Rounded +pwsx2906 power 0.089 0.5 -> 0.30 Inexact Rounded +pwsx2907 power 89.0E-1 0.5 -> 3.0 Inexact Rounded +pwsx2908 power 89.00E-2 0.5 -> 0.94 Inexact Rounded +pwsx2909 power 89E-3 0.5 -> 0.30 Inexact Rounded +pwsx2910 power 89E+1 0.5 -> 30 Inexact Rounded +pwsx2911 power 89E+2 0.5 -> 94 Inexact Rounded +pwsx2912 power 89E+3 0.5 -> 3.0E+2 Inexact Rounded +pwsx2913 power 0.90 0.5 -> 0.95 Inexact Rounded +pwsx2914 power 0.090 0.5 -> 0.30 Inexact Rounded +pwsx2915 power 90.0E-1 0.5 -> 3.0 Inexact Rounded +pwsx2916 power 90.00E-2 0.5 -> 0.95 Inexact Rounded +pwsx2917 power 90E-3 0.5 -> 0.30 Inexact Rounded +pwsx2918 power 90E+1 0.5 -> 30 Inexact Rounded +pwsx2919 power 90E+2 0.5 -> 95 Inexact Rounded +pwsx2920 power 90E+3 0.5 -> 3.0E+2 Inexact Rounded +pwsx2921 power 0.91 0.5 -> 0.95 Inexact Rounded +pwsx2922 power 0.091 0.5 -> 0.30 Inexact Rounded +pwsx2923 power 91.0E-1 0.5 -> 3.0 Inexact Rounded +pwsx2924 power 91.00E-2 0.5 -> 0.95 Inexact Rounded +pwsx2925 power 91E-3 0.5 -> 0.30 Inexact Rounded +pwsx2926 power 91E+1 0.5 -> 30 Inexact Rounded +pwsx2927 power 91E+2 0.5 -> 95 Inexact Rounded +pwsx2928 power 91E+3 0.5 -> 3.0E+2 Inexact Rounded +pwsx2929 power 0.92 0.5 -> 0.96 Inexact Rounded +pwsx2930 power 0.092 0.5 -> 0.30 Inexact Rounded +pwsx2931 power 92.0E-1 0.5 -> 3.0 Inexact Rounded +pwsx2932 power 92.00E-2 0.5 -> 0.96 Inexact Rounded +pwsx2933 power 92E-3 0.5 -> 0.30 Inexact Rounded +pwsx2934 power 92E+1 0.5 -> 30 Inexact Rounded +pwsx2935 power 92E+2 0.5 -> 96 Inexact Rounded +pwsx2936 power 92E+3 0.5 -> 3.0E+2 Inexact Rounded +pwsx2937 power 0.93 0.5 -> 0.96 Inexact Rounded +pwsx2938 power 0.093 0.5 -> 0.30 Inexact Rounded +pwsx2939 power 93.0E-1 0.5 -> 3.0 Inexact Rounded +pwsx2940 power 93.00E-2 0.5 -> 0.96 Inexact Rounded +pwsx2941 power 93E-3 0.5 -> 0.30 Inexact Rounded +pwsx2942 power 93E+1 0.5 -> 30 Inexact Rounded +pwsx2943 power 93E+2 0.5 -> 96 Inexact Rounded +pwsx2944 power 93E+3 0.5 -> 3.0E+2 Inexact Rounded +pwsx2945 power 0.94 0.5 -> 0.97 Inexact Rounded +pwsx2946 power 0.094 0.5 -> 0.31 Inexact Rounded +pwsx2947 power 94.0E-1 0.5 -> 3.1 Inexact Rounded +pwsx2948 power 94.00E-2 0.5 -> 0.97 Inexact Rounded +pwsx2949 power 94E-3 0.5 -> 0.31 Inexact Rounded +pwsx2950 power 94E+1 0.5 -> 31 Inexact Rounded +pwsx2951 power 94E+2 0.5 -> 97 Inexact Rounded +pwsx2952 power 94E+3 0.5 -> 3.1E+2 Inexact Rounded +pwsx2953 power 0.95 0.5 -> 0.97 Inexact Rounded +pwsx2954 power 0.095 0.5 -> 0.31 Inexact Rounded +pwsx2955 power 95.0E-1 0.5 -> 3.1 Inexact Rounded +pwsx2956 power 95.00E-2 0.5 -> 0.97 Inexact Rounded +pwsx2957 power 95E-3 0.5 -> 0.31 Inexact Rounded +pwsx2958 power 95E+1 0.5 -> 31 Inexact Rounded +pwsx2959 power 95E+2 0.5 -> 97 Inexact Rounded +pwsx2960 power 95E+3 0.5 -> 3.1E+2 Inexact Rounded +pwsx2961 power 0.96 0.5 -> 0.98 Inexact Rounded +pwsx2962 power 0.096 0.5 -> 0.31 Inexact Rounded +pwsx2963 power 96.0E-1 0.5 -> 3.1 Inexact Rounded +pwsx2964 power 96.00E-2 0.5 -> 0.98 Inexact Rounded +pwsx2965 power 96E-3 0.5 -> 0.31 Inexact Rounded +pwsx2966 power 96E+1 0.5 -> 31 Inexact Rounded +pwsx2967 power 96E+2 0.5 -> 98 Inexact Rounded +pwsx2968 power 96E+3 0.5 -> 3.1E+2 Inexact Rounded +pwsx2969 power 0.97 0.5 -> 0.98 Inexact Rounded +pwsx2970 power 0.097 0.5 -> 0.31 Inexact Rounded +pwsx2971 power 97.0E-1 0.5 -> 3.1 Inexact Rounded +pwsx2972 power 97.00E-2 0.5 -> 0.98 Inexact Rounded +pwsx2973 power 97E-3 0.5 -> 0.31 Inexact Rounded +pwsx2974 power 97E+1 0.5 -> 31 Inexact Rounded +pwsx2975 power 97E+2 0.5 -> 98 Inexact Rounded +pwsx2976 power 97E+3 0.5 -> 3.1E+2 Inexact Rounded +pwsx2977 power 0.98 0.5 -> 0.99 Inexact Rounded +pwsx2978 power 0.098 0.5 -> 0.31 Inexact Rounded +pwsx2979 power 98.0E-1 0.5 -> 3.1 Inexact Rounded +pwsx2980 power 98.00E-2 0.5 -> 0.99 Inexact Rounded +pwsx2981 power 98E-3 0.5 -> 0.31 Inexact Rounded +pwsx2982 power 98E+1 0.5 -> 31 Inexact Rounded +pwsx2983 power 98E+2 0.5 -> 99 Inexact Rounded +pwsx2984 power 98E+3 0.5 -> 3.1E+2 Inexact Rounded +pwsx2985 power 0.99 0.5 -> 0.99 Inexact Rounded +pwsx2986 power 0.099 0.5 -> 0.31 Inexact Rounded +pwsx2987 power 99.0E-1 0.5 -> 3.1 Inexact Rounded +pwsx2988 power 99.00E-2 0.5 -> 0.99 Inexact Rounded +pwsx2989 power 99E-3 0.5 -> 0.31 Inexact Rounded +pwsx2990 power 99E+1 0.5 -> 31 Inexact Rounded +pwsx2991 power 99E+2 0.5 -> 99 Inexact Rounded +pwsx2992 power 99E+3 0.5 -> 3.1E+2 Inexact Rounded + +-- Precision 3 squareroot tests [exhaustive, f and f/10] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 3 +pwsx3001 power 0.1 0.5 -> 0.316 Inexact Rounded +pwsx3002 power 0.01 0.5 -> 0.100 Inexact Rounded +pwsx3003 power 0.2 0.5 -> 0.447 Inexact Rounded +pwsx3004 power 0.02 0.5 -> 0.141 Inexact Rounded +pwsx3005 power 0.3 0.5 -> 0.548 Inexact Rounded +pwsx3006 power 0.03 0.5 -> 0.173 Inexact Rounded +pwsx3007 power 0.4 0.5 -> 0.632 Inexact Rounded +pwsx3008 power 0.04 0.5 -> 0.200 Inexact Rounded +pwsx3009 power 0.5 0.5 -> 0.707 Inexact Rounded +pwsx3010 power 0.05 0.5 -> 0.224 Inexact Rounded +pwsx3011 power 0.6 0.5 -> 0.775 Inexact Rounded +pwsx3012 power 0.06 0.5 -> 0.245 Inexact Rounded +pwsx3013 power 0.7 0.5 -> 0.837 Inexact Rounded +pwsx3014 power 0.07 0.5 -> 0.265 Inexact Rounded +pwsx3015 power 0.8 0.5 -> 0.894 Inexact Rounded +pwsx3016 power 0.08 0.5 -> 0.283 Inexact Rounded +pwsx3017 power 0.9 0.5 -> 0.949 Inexact Rounded +pwsx3018 power 0.09 0.5 -> 0.300 Inexact Rounded +pwsx3019 power 0.11 0.5 -> 0.332 Inexact Rounded +pwsx3020 power 0.011 0.5 -> 0.105 Inexact Rounded +pwsx3021 power 0.12 0.5 -> 0.346 Inexact Rounded +pwsx3022 power 0.012 0.5 -> 0.110 Inexact Rounded +pwsx3023 power 0.13 0.5 -> 0.361 Inexact Rounded +pwsx3024 power 0.013 0.5 -> 0.114 Inexact Rounded +pwsx3025 power 0.14 0.5 -> 0.374 Inexact Rounded +pwsx3026 power 0.014 0.5 -> 0.118 Inexact Rounded +pwsx3027 power 0.15 0.5 -> 0.387 Inexact Rounded +pwsx3028 power 0.015 0.5 -> 0.122 Inexact Rounded +pwsx3029 power 0.16 0.5 -> 0.400 Inexact Rounded +pwsx3030 power 0.016 0.5 -> 0.126 Inexact Rounded +pwsx3031 power 0.17 0.5 -> 0.412 Inexact Rounded +pwsx3032 power 0.017 0.5 -> 0.130 Inexact Rounded +pwsx3033 power 0.18 0.5 -> 0.424 Inexact Rounded +pwsx3034 power 0.018 0.5 -> 0.134 Inexact Rounded +pwsx3035 power 0.19 0.5 -> 0.436 Inexact Rounded +pwsx3036 power 0.019 0.5 -> 0.138 Inexact Rounded +pwsx3037 power 0.21 0.5 -> 0.458 Inexact Rounded +pwsx3038 power 0.021 0.5 -> 0.145 Inexact Rounded +pwsx3039 power 0.22 0.5 -> 0.469 Inexact Rounded +pwsx3040 power 0.022 0.5 -> 0.148 Inexact Rounded +pwsx3041 power 0.23 0.5 -> 0.480 Inexact Rounded +pwsx3042 power 0.023 0.5 -> 0.152 Inexact Rounded +pwsx3043 power 0.24 0.5 -> 0.490 Inexact Rounded +pwsx3044 power 0.024 0.5 -> 0.155 Inexact Rounded +pwsx3045 power 0.25 0.5 -> 0.500 Inexact Rounded +pwsx3046 power 0.025 0.5 -> 0.158 Inexact Rounded +pwsx3047 power 0.26 0.5 -> 0.510 Inexact Rounded +pwsx3048 power 0.026 0.5 -> 0.161 Inexact Rounded +pwsx3049 power 0.27 0.5 -> 0.520 Inexact Rounded +pwsx3050 power 0.027 0.5 -> 0.164 Inexact Rounded +pwsx3051 power 0.28 0.5 -> 0.529 Inexact Rounded +pwsx3052 power 0.028 0.5 -> 0.167 Inexact Rounded +pwsx3053 power 0.29 0.5 -> 0.539 Inexact Rounded +pwsx3054 power 0.029 0.5 -> 0.170 Inexact Rounded +pwsx3055 power 0.31 0.5 -> 0.557 Inexact Rounded +pwsx3056 power 0.031 0.5 -> 0.176 Inexact Rounded +pwsx3057 power 0.32 0.5 -> 0.566 Inexact Rounded +pwsx3058 power 0.032 0.5 -> 0.179 Inexact Rounded +pwsx3059 power 0.33 0.5 -> 0.574 Inexact Rounded +pwsx3060 power 0.033 0.5 -> 0.182 Inexact Rounded +pwsx3061 power 0.34 0.5 -> 0.583 Inexact Rounded +pwsx3062 power 0.034 0.5 -> 0.184 Inexact Rounded +pwsx3063 power 0.35 0.5 -> 0.592 Inexact Rounded +pwsx3064 power 0.035 0.5 -> 0.187 Inexact Rounded +pwsx3065 power 0.36 0.5 -> 0.600 Inexact Rounded +pwsx3066 power 0.036 0.5 -> 0.190 Inexact Rounded +pwsx3067 power 0.37 0.5 -> 0.608 Inexact Rounded +pwsx3068 power 0.037 0.5 -> 0.192 Inexact Rounded +pwsx3069 power 0.38 0.5 -> 0.616 Inexact Rounded +pwsx3070 power 0.038 0.5 -> 0.195 Inexact Rounded +pwsx3071 power 0.39 0.5 -> 0.624 Inexact Rounded +pwsx3072 power 0.039 0.5 -> 0.197 Inexact Rounded +pwsx3073 power 0.41 0.5 -> 0.640 Inexact Rounded +pwsx3074 power 0.041 0.5 -> 0.202 Inexact Rounded +pwsx3075 power 0.42 0.5 -> 0.648 Inexact Rounded +pwsx3076 power 0.042 0.5 -> 0.205 Inexact Rounded +pwsx3077 power 0.43 0.5 -> 0.656 Inexact Rounded +pwsx3078 power 0.043 0.5 -> 0.207 Inexact Rounded +pwsx3079 power 0.44 0.5 -> 0.663 Inexact Rounded +pwsx3080 power 0.044 0.5 -> 0.210 Inexact Rounded +pwsx3081 power 0.45 0.5 -> 0.671 Inexact Rounded +pwsx3082 power 0.045 0.5 -> 0.212 Inexact Rounded +pwsx3083 power 0.46 0.5 -> 0.678 Inexact Rounded +pwsx3084 power 0.046 0.5 -> 0.214 Inexact Rounded +pwsx3085 power 0.47 0.5 -> 0.686 Inexact Rounded +pwsx3086 power 0.047 0.5 -> 0.217 Inexact Rounded +pwsx3087 power 0.48 0.5 -> 0.693 Inexact Rounded +pwsx3088 power 0.048 0.5 -> 0.219 Inexact Rounded +pwsx3089 power 0.49 0.5 -> 0.700 Inexact Rounded +pwsx3090 power 0.049 0.5 -> 0.221 Inexact Rounded +pwsx3091 power 0.51 0.5 -> 0.714 Inexact Rounded +pwsx3092 power 0.051 0.5 -> 0.226 Inexact Rounded +pwsx3093 power 0.52 0.5 -> 0.721 Inexact Rounded +pwsx3094 power 0.052 0.5 -> 0.228 Inexact Rounded +pwsx3095 power 0.53 0.5 -> 0.728 Inexact Rounded +pwsx3096 power 0.053 0.5 -> 0.230 Inexact Rounded +pwsx3097 power 0.54 0.5 -> 0.735 Inexact Rounded +pwsx3098 power 0.054 0.5 -> 0.232 Inexact Rounded +pwsx3099 power 0.55 0.5 -> 0.742 Inexact Rounded +pwsx3100 power 0.055 0.5 -> 0.235 Inexact Rounded +pwsx3101 power 0.56 0.5 -> 0.748 Inexact Rounded +pwsx3102 power 0.056 0.5 -> 0.237 Inexact Rounded +pwsx3103 power 0.57 0.5 -> 0.755 Inexact Rounded +pwsx3104 power 0.057 0.5 -> 0.239 Inexact Rounded +pwsx3105 power 0.58 0.5 -> 0.762 Inexact Rounded +pwsx3106 power 0.058 0.5 -> 0.241 Inexact Rounded +pwsx3107 power 0.59 0.5 -> 0.768 Inexact Rounded +pwsx3108 power 0.059 0.5 -> 0.243 Inexact Rounded +pwsx3109 power 0.61 0.5 -> 0.781 Inexact Rounded +pwsx3110 power 0.061 0.5 -> 0.247 Inexact Rounded +pwsx3111 power 0.62 0.5 -> 0.787 Inexact Rounded +pwsx3112 power 0.062 0.5 -> 0.249 Inexact Rounded +pwsx3113 power 0.63 0.5 -> 0.794 Inexact Rounded +pwsx3114 power 0.063 0.5 -> 0.251 Inexact Rounded +pwsx3115 power 0.64 0.5 -> 0.800 Inexact Rounded +pwsx3116 power 0.064 0.5 -> 0.253 Inexact Rounded +pwsx3117 power 0.65 0.5 -> 0.806 Inexact Rounded +pwsx3118 power 0.065 0.5 -> 0.255 Inexact Rounded +pwsx3119 power 0.66 0.5 -> 0.812 Inexact Rounded +pwsx3120 power 0.066 0.5 -> 0.257 Inexact Rounded +pwsx3121 power 0.67 0.5 -> 0.819 Inexact Rounded +pwsx3122 power 0.067 0.5 -> 0.259 Inexact Rounded +pwsx3123 power 0.68 0.5 -> 0.825 Inexact Rounded +pwsx3124 power 0.068 0.5 -> 0.261 Inexact Rounded +pwsx3125 power 0.69 0.5 -> 0.831 Inexact Rounded +pwsx3126 power 0.069 0.5 -> 0.263 Inexact Rounded +pwsx3127 power 0.71 0.5 -> 0.843 Inexact Rounded +pwsx3128 power 0.071 0.5 -> 0.266 Inexact Rounded +pwsx3129 power 0.72 0.5 -> 0.849 Inexact Rounded +pwsx3130 power 0.072 0.5 -> 0.268 Inexact Rounded +pwsx3131 power 0.73 0.5 -> 0.854 Inexact Rounded +pwsx3132 power 0.073 0.5 -> 0.270 Inexact Rounded +pwsx3133 power 0.74 0.5 -> 0.860 Inexact Rounded +pwsx3134 power 0.074 0.5 -> 0.272 Inexact Rounded +pwsx3135 power 0.75 0.5 -> 0.866 Inexact Rounded +pwsx3136 power 0.075 0.5 -> 0.274 Inexact Rounded +pwsx3137 power 0.76 0.5 -> 0.872 Inexact Rounded +pwsx3138 power 0.076 0.5 -> 0.276 Inexact Rounded +pwsx3139 power 0.77 0.5 -> 0.877 Inexact Rounded +pwsx3140 power 0.077 0.5 -> 0.277 Inexact Rounded +pwsx3141 power 0.78 0.5 -> 0.883 Inexact Rounded +pwsx3142 power 0.078 0.5 -> 0.279 Inexact Rounded +pwsx3143 power 0.79 0.5 -> 0.889 Inexact Rounded +pwsx3144 power 0.079 0.5 -> 0.281 Inexact Rounded +pwsx3145 power 0.81 0.5 -> 0.900 Inexact Rounded +pwsx3146 power 0.081 0.5 -> 0.285 Inexact Rounded +pwsx3147 power 0.82 0.5 -> 0.906 Inexact Rounded +pwsx3148 power 0.082 0.5 -> 0.286 Inexact Rounded +pwsx3149 power 0.83 0.5 -> 0.911 Inexact Rounded +pwsx3150 power 0.083 0.5 -> 0.288 Inexact Rounded +pwsx3151 power 0.84 0.5 -> 0.917 Inexact Rounded +pwsx3152 power 0.084 0.5 -> 0.290 Inexact Rounded +pwsx3153 power 0.85 0.5 -> 0.922 Inexact Rounded +pwsx3154 power 0.085 0.5 -> 0.292 Inexact Rounded +pwsx3155 power 0.86 0.5 -> 0.927 Inexact Rounded +pwsx3156 power 0.086 0.5 -> 0.293 Inexact Rounded +pwsx3157 power 0.87 0.5 -> 0.933 Inexact Rounded +pwsx3158 power 0.087 0.5 -> 0.295 Inexact Rounded +pwsx3159 power 0.88 0.5 -> 0.938 Inexact Rounded +pwsx3160 power 0.088 0.5 -> 0.297 Inexact Rounded +pwsx3161 power 0.89 0.5 -> 0.943 Inexact Rounded +pwsx3162 power 0.089 0.5 -> 0.298 Inexact Rounded +pwsx3163 power 0.91 0.5 -> 0.954 Inexact Rounded +pwsx3164 power 0.091 0.5 -> 0.302 Inexact Rounded +pwsx3165 power 0.92 0.5 -> 0.959 Inexact Rounded +pwsx3166 power 0.092 0.5 -> 0.303 Inexact Rounded +pwsx3167 power 0.93 0.5 -> 0.964 Inexact Rounded +pwsx3168 power 0.093 0.5 -> 0.305 Inexact Rounded +pwsx3169 power 0.94 0.5 -> 0.970 Inexact Rounded +pwsx3170 power 0.094 0.5 -> 0.307 Inexact Rounded +pwsx3171 power 0.95 0.5 -> 0.975 Inexact Rounded +pwsx3172 power 0.095 0.5 -> 0.308 Inexact Rounded +pwsx3173 power 0.96 0.5 -> 0.980 Inexact Rounded +pwsx3174 power 0.096 0.5 -> 0.310 Inexact Rounded +pwsx3175 power 0.97 0.5 -> 0.985 Inexact Rounded +pwsx3176 power 0.097 0.5 -> 0.311 Inexact Rounded +pwsx3177 power 0.98 0.5 -> 0.990 Inexact Rounded +pwsx3178 power 0.098 0.5 -> 0.313 Inexact Rounded +pwsx3179 power 0.99 0.5 -> 0.995 Inexact Rounded +pwsx3180 power 0.099 0.5 -> 0.315 Inexact Rounded +pwsx3181 power 0.101 0.5 -> 0.318 Inexact Rounded +pwsx3182 power 0.0101 0.5 -> 0.100 Inexact Rounded +pwsx3183 power 0.102 0.5 -> 0.319 Inexact Rounded +pwsx3184 power 0.0102 0.5 -> 0.101 Inexact Rounded +pwsx3185 power 0.103 0.5 -> 0.321 Inexact Rounded +pwsx3186 power 0.0103 0.5 -> 0.101 Inexact Rounded +pwsx3187 power 0.104 0.5 -> 0.322 Inexact Rounded +pwsx3188 power 0.0104 0.5 -> 0.102 Inexact Rounded +pwsx3189 power 0.105 0.5 -> 0.324 Inexact Rounded +pwsx3190 power 0.0105 0.5 -> 0.102 Inexact Rounded +pwsx3191 power 0.106 0.5 -> 0.326 Inexact Rounded +pwsx3192 power 0.0106 0.5 -> 0.103 Inexact Rounded +pwsx3193 power 0.107 0.5 -> 0.327 Inexact Rounded +pwsx3194 power 0.0107 0.5 -> 0.103 Inexact Rounded +pwsx3195 power 0.108 0.5 -> 0.329 Inexact Rounded +pwsx3196 power 0.0108 0.5 -> 0.104 Inexact Rounded +pwsx3197 power 0.109 0.5 -> 0.330 Inexact Rounded +pwsx3198 power 0.0109 0.5 -> 0.104 Inexact Rounded +pwsx3199 power 0.111 0.5 -> 0.333 Inexact Rounded +pwsx3200 power 0.0111 0.5 -> 0.105 Inexact Rounded +pwsx3201 power 0.112 0.5 -> 0.335 Inexact Rounded +pwsx3202 power 0.0112 0.5 -> 0.106 Inexact Rounded +pwsx3203 power 0.113 0.5 -> 0.336 Inexact Rounded +pwsx3204 power 0.0113 0.5 -> 0.106 Inexact Rounded +pwsx3205 power 0.114 0.5 -> 0.338 Inexact Rounded +pwsx3206 power 0.0114 0.5 -> 0.107 Inexact Rounded +pwsx3207 power 0.115 0.5 -> 0.339 Inexact Rounded +pwsx3208 power 0.0115 0.5 -> 0.107 Inexact Rounded +pwsx3209 power 0.116 0.5 -> 0.341 Inexact Rounded +pwsx3210 power 0.0116 0.5 -> 0.108 Inexact Rounded +pwsx3211 power 0.117 0.5 -> 0.342 Inexact Rounded +pwsx3212 power 0.0117 0.5 -> 0.108 Inexact Rounded +pwsx3213 power 0.118 0.5 -> 0.344 Inexact Rounded +pwsx3214 power 0.0118 0.5 -> 0.109 Inexact Rounded +pwsx3215 power 0.119 0.5 -> 0.345 Inexact Rounded +pwsx3216 power 0.0119 0.5 -> 0.109 Inexact Rounded +pwsx3217 power 0.121 0.5 -> 0.348 Inexact Rounded +pwsx3218 power 0.0121 0.5 -> 0.110 Inexact Rounded +pwsx3219 power 0.122 0.5 -> 0.349 Inexact Rounded +pwsx3220 power 0.0122 0.5 -> 0.110 Inexact Rounded +pwsx3221 power 0.123 0.5 -> 0.351 Inexact Rounded +pwsx3222 power 0.0123 0.5 -> 0.111 Inexact Rounded +pwsx3223 power 0.124 0.5 -> 0.352 Inexact Rounded +pwsx3224 power 0.0124 0.5 -> 0.111 Inexact Rounded +pwsx3225 power 0.125 0.5 -> 0.354 Inexact Rounded +pwsx3226 power 0.0125 0.5 -> 0.112 Inexact Rounded +pwsx3227 power 0.126 0.5 -> 0.355 Inexact Rounded +pwsx3228 power 0.0126 0.5 -> 0.112 Inexact Rounded +pwsx3229 power 0.127 0.5 -> 0.356 Inexact Rounded +pwsx3230 power 0.0127 0.5 -> 0.113 Inexact Rounded +pwsx3231 power 0.128 0.5 -> 0.358 Inexact Rounded +pwsx3232 power 0.0128 0.5 -> 0.113 Inexact Rounded +pwsx3233 power 0.129 0.5 -> 0.359 Inexact Rounded +pwsx3234 power 0.0129 0.5 -> 0.114 Inexact Rounded +pwsx3235 power 0.131 0.5 -> 0.362 Inexact Rounded +pwsx3236 power 0.0131 0.5 -> 0.114 Inexact Rounded +pwsx3237 power 0.132 0.5 -> 0.363 Inexact Rounded +pwsx3238 power 0.0132 0.5 -> 0.115 Inexact Rounded +pwsx3239 power 0.133 0.5 -> 0.365 Inexact Rounded +pwsx3240 power 0.0133 0.5 -> 0.115 Inexact Rounded +pwsx3241 power 0.134 0.5 -> 0.366 Inexact Rounded +pwsx3242 power 0.0134 0.5 -> 0.116 Inexact Rounded +pwsx3243 power 0.135 0.5 -> 0.367 Inexact Rounded +pwsx3244 power 0.0135 0.5 -> 0.116 Inexact Rounded +pwsx3245 power 0.136 0.5 -> 0.369 Inexact Rounded +pwsx3246 power 0.0136 0.5 -> 0.117 Inexact Rounded +pwsx3247 power 0.137 0.5 -> 0.370 Inexact Rounded +pwsx3248 power 0.0137 0.5 -> 0.117 Inexact Rounded +pwsx3249 power 0.138 0.5 -> 0.371 Inexact Rounded +pwsx3250 power 0.0138 0.5 -> 0.117 Inexact Rounded +pwsx3251 power 0.139 0.5 -> 0.373 Inexact Rounded +pwsx3252 power 0.0139 0.5 -> 0.118 Inexact Rounded +pwsx3253 power 0.141 0.5 -> 0.375 Inexact Rounded +pwsx3254 power 0.0141 0.5 -> 0.119 Inexact Rounded +pwsx3255 power 0.142 0.5 -> 0.377 Inexact Rounded +pwsx3256 power 0.0142 0.5 -> 0.119 Inexact Rounded +pwsx3257 power 0.143 0.5 -> 0.378 Inexact Rounded +pwsx3258 power 0.0143 0.5 -> 0.120 Inexact Rounded +pwsx3259 power 0.144 0.5 -> 0.379 Inexact Rounded +pwsx3260 power 0.0144 0.5 -> 0.120 Inexact Rounded +pwsx3261 power 0.145 0.5 -> 0.381 Inexact Rounded +pwsx3262 power 0.0145 0.5 -> 0.120 Inexact Rounded +pwsx3263 power 0.146 0.5 -> 0.382 Inexact Rounded +pwsx3264 power 0.0146 0.5 -> 0.121 Inexact Rounded +pwsx3265 power 0.147 0.5 -> 0.383 Inexact Rounded +pwsx3266 power 0.0147 0.5 -> 0.121 Inexact Rounded +pwsx3267 power 0.148 0.5 -> 0.385 Inexact Rounded +pwsx3268 power 0.0148 0.5 -> 0.122 Inexact Rounded +pwsx3269 power 0.149 0.5 -> 0.386 Inexact Rounded +pwsx3270 power 0.0149 0.5 -> 0.122 Inexact Rounded +pwsx3271 power 0.151 0.5 -> 0.389 Inexact Rounded +pwsx3272 power 0.0151 0.5 -> 0.123 Inexact Rounded +pwsx3273 power 0.152 0.5 -> 0.390 Inexact Rounded +pwsx3274 power 0.0152 0.5 -> 0.123 Inexact Rounded +pwsx3275 power 0.153 0.5 -> 0.391 Inexact Rounded +pwsx3276 power 0.0153 0.5 -> 0.124 Inexact Rounded +pwsx3277 power 0.154 0.5 -> 0.392 Inexact Rounded +pwsx3278 power 0.0154 0.5 -> 0.124 Inexact Rounded +pwsx3279 power 0.155 0.5 -> 0.394 Inexact Rounded +pwsx3280 power 0.0155 0.5 -> 0.124 Inexact Rounded +pwsx3281 power 0.156 0.5 -> 0.395 Inexact Rounded +pwsx3282 power 0.0156 0.5 -> 0.125 Inexact Rounded +pwsx3283 power 0.157 0.5 -> 0.396 Inexact Rounded +pwsx3284 power 0.0157 0.5 -> 0.125 Inexact Rounded +pwsx3285 power 0.158 0.5 -> 0.397 Inexact Rounded +pwsx3286 power 0.0158 0.5 -> 0.126 Inexact Rounded +pwsx3287 power 0.159 0.5 -> 0.399 Inexact Rounded +pwsx3288 power 0.0159 0.5 -> 0.126 Inexact Rounded +pwsx3289 power 0.161 0.5 -> 0.401 Inexact Rounded +pwsx3290 power 0.0161 0.5 -> 0.127 Inexact Rounded +pwsx3291 power 0.162 0.5 -> 0.402 Inexact Rounded +pwsx3292 power 0.0162 0.5 -> 0.127 Inexact Rounded +pwsx3293 power 0.163 0.5 -> 0.404 Inexact Rounded +pwsx3294 power 0.0163 0.5 -> 0.128 Inexact Rounded +pwsx3295 power 0.164 0.5 -> 0.405 Inexact Rounded +pwsx3296 power 0.0164 0.5 -> 0.128 Inexact Rounded +pwsx3297 power 0.165 0.5 -> 0.406 Inexact Rounded +pwsx3298 power 0.0165 0.5 -> 0.128 Inexact Rounded +pwsx3299 power 0.166 0.5 -> 0.407 Inexact Rounded +pwsx3300 power 0.0166 0.5 -> 0.129 Inexact Rounded +pwsx3301 power 0.167 0.5 -> 0.409 Inexact Rounded +pwsx3302 power 0.0167 0.5 -> 0.129 Inexact Rounded +pwsx3303 power 0.168 0.5 -> 0.410 Inexact Rounded +pwsx3304 power 0.0168 0.5 -> 0.130 Inexact Rounded +pwsx3305 power 0.169 0.5 -> 0.411 Inexact Rounded +pwsx3306 power 0.0169 0.5 -> 0.130 Inexact Rounded +pwsx3307 power 0.171 0.5 -> 0.414 Inexact Rounded +pwsx3308 power 0.0171 0.5 -> 0.131 Inexact Rounded +pwsx3309 power 0.172 0.5 -> 0.415 Inexact Rounded +pwsx3310 power 0.0172 0.5 -> 0.131 Inexact Rounded +pwsx3311 power 0.173 0.5 -> 0.416 Inexact Rounded +pwsx3312 power 0.0173 0.5 -> 0.132 Inexact Rounded +pwsx3313 power 0.174 0.5 -> 0.417 Inexact Rounded +pwsx3314 power 0.0174 0.5 -> 0.132 Inexact Rounded +pwsx3315 power 0.175 0.5 -> 0.418 Inexact Rounded +pwsx3316 power 0.0175 0.5 -> 0.132 Inexact Rounded +pwsx3317 power 0.176 0.5 -> 0.420 Inexact Rounded +pwsx3318 power 0.0176 0.5 -> 0.133 Inexact Rounded +pwsx3319 power 0.177 0.5 -> 0.421 Inexact Rounded +pwsx3320 power 0.0177 0.5 -> 0.133 Inexact Rounded +pwsx3321 power 0.178 0.5 -> 0.422 Inexact Rounded +pwsx3322 power 0.0178 0.5 -> 0.133 Inexact Rounded +pwsx3323 power 0.179 0.5 -> 0.423 Inexact Rounded +pwsx3324 power 0.0179 0.5 -> 0.134 Inexact Rounded +pwsx3325 power 0.181 0.5 -> 0.425 Inexact Rounded +pwsx3326 power 0.0181 0.5 -> 0.135 Inexact Rounded +pwsx3327 power 0.182 0.5 -> 0.427 Inexact Rounded +pwsx3328 power 0.0182 0.5 -> 0.135 Inexact Rounded +pwsx3329 power 0.183 0.5 -> 0.428 Inexact Rounded +pwsx3330 power 0.0183 0.5 -> 0.135 Inexact Rounded +pwsx3331 power 0.184 0.5 -> 0.429 Inexact Rounded +pwsx3332 power 0.0184 0.5 -> 0.136 Inexact Rounded +pwsx3333 power 0.185 0.5 -> 0.430 Inexact Rounded +pwsx3334 power 0.0185 0.5 -> 0.136 Inexact Rounded +pwsx3335 power 0.186 0.5 -> 0.431 Inexact Rounded +pwsx3336 power 0.0186 0.5 -> 0.136 Inexact Rounded +pwsx3337 power 0.187 0.5 -> 0.432 Inexact Rounded +pwsx3338 power 0.0187 0.5 -> 0.137 Inexact Rounded +pwsx3339 power 0.188 0.5 -> 0.434 Inexact Rounded +pwsx3340 power 0.0188 0.5 -> 0.137 Inexact Rounded +pwsx3341 power 0.189 0.5 -> 0.435 Inexact Rounded +pwsx3342 power 0.0189 0.5 -> 0.137 Inexact Rounded +pwsx3343 power 0.191 0.5 -> 0.437 Inexact Rounded +pwsx3344 power 0.0191 0.5 -> 0.138 Inexact Rounded +pwsx3345 power 0.192 0.5 -> 0.438 Inexact Rounded +pwsx3346 power 0.0192 0.5 -> 0.139 Inexact Rounded +pwsx3347 power 0.193 0.5 -> 0.439 Inexact Rounded +pwsx3348 power 0.0193 0.5 -> 0.139 Inexact Rounded +pwsx3349 power 0.194 0.5 -> 0.440 Inexact Rounded +pwsx3350 power 0.0194 0.5 -> 0.139 Inexact Rounded +pwsx3351 power 0.195 0.5 -> 0.442 Inexact Rounded +pwsx3352 power 0.0195 0.5 -> 0.140 Inexact Rounded +pwsx3353 power 0.196 0.5 -> 0.443 Inexact Rounded +pwsx3354 power 0.0196 0.5 -> 0.140 Inexact Rounded +pwsx3355 power 0.197 0.5 -> 0.444 Inexact Rounded +pwsx3356 power 0.0197 0.5 -> 0.140 Inexact Rounded +pwsx3357 power 0.198 0.5 -> 0.445 Inexact Rounded +pwsx3358 power 0.0198 0.5 -> 0.141 Inexact Rounded +pwsx3359 power 0.199 0.5 -> 0.446 Inexact Rounded +pwsx3360 power 0.0199 0.5 -> 0.141 Inexact Rounded +pwsx3361 power 0.201 0.5 -> 0.448 Inexact Rounded +pwsx3362 power 0.0201 0.5 -> 0.142 Inexact Rounded +pwsx3363 power 0.202 0.5 -> 0.449 Inexact Rounded +pwsx3364 power 0.0202 0.5 -> 0.142 Inexact Rounded +pwsx3365 power 0.203 0.5 -> 0.451 Inexact Rounded +pwsx3366 power 0.0203 0.5 -> 0.142 Inexact Rounded +pwsx3367 power 0.204 0.5 -> 0.452 Inexact Rounded +pwsx3368 power 0.0204 0.5 -> 0.143 Inexact Rounded +pwsx3369 power 0.205 0.5 -> 0.453 Inexact Rounded +pwsx3370 power 0.0205 0.5 -> 0.143 Inexact Rounded +pwsx3371 power 0.206 0.5 -> 0.454 Inexact Rounded +pwsx3372 power 0.0206 0.5 -> 0.144 Inexact Rounded +pwsx3373 power 0.207 0.5 -> 0.455 Inexact Rounded +pwsx3374 power 0.0207 0.5 -> 0.144 Inexact Rounded +pwsx3375 power 0.208 0.5 -> 0.456 Inexact Rounded +pwsx3376 power 0.0208 0.5 -> 0.144 Inexact Rounded +pwsx3377 power 0.209 0.5 -> 0.457 Inexact Rounded +pwsx3378 power 0.0209 0.5 -> 0.145 Inexact Rounded +pwsx3379 power 0.211 0.5 -> 0.459 Inexact Rounded +pwsx3380 power 0.0211 0.5 -> 0.145 Inexact Rounded +pwsx3381 power 0.212 0.5 -> 0.460 Inexact Rounded +pwsx3382 power 0.0212 0.5 -> 0.146 Inexact Rounded +pwsx3383 power 0.213 0.5 -> 0.462 Inexact Rounded +pwsx3384 power 0.0213 0.5 -> 0.146 Inexact Rounded +pwsx3385 power 0.214 0.5 -> 0.463 Inexact Rounded +pwsx3386 power 0.0214 0.5 -> 0.146 Inexact Rounded +pwsx3387 power 0.215 0.5 -> 0.464 Inexact Rounded +pwsx3388 power 0.0215 0.5 -> 0.147 Inexact Rounded +pwsx3389 power 0.216 0.5 -> 0.465 Inexact Rounded +pwsx3390 power 0.0216 0.5 -> 0.147 Inexact Rounded +pwsx3391 power 0.217 0.5 -> 0.466 Inexact Rounded +pwsx3392 power 0.0217 0.5 -> 0.147 Inexact Rounded +pwsx3393 power 0.218 0.5 -> 0.467 Inexact Rounded +pwsx3394 power 0.0218 0.5 -> 0.148 Inexact Rounded +pwsx3395 power 0.219 0.5 -> 0.468 Inexact Rounded +pwsx3396 power 0.0219 0.5 -> 0.148 Inexact Rounded +pwsx3397 power 0.221 0.5 -> 0.470 Inexact Rounded +pwsx3398 power 0.0221 0.5 -> 0.149 Inexact Rounded +pwsx3399 power 0.222 0.5 -> 0.471 Inexact Rounded +pwsx3400 power 0.0222 0.5 -> 0.149 Inexact Rounded +pwsx3401 power 0.223 0.5 -> 0.472 Inexact Rounded +pwsx3402 power 0.0223 0.5 -> 0.149 Inexact Rounded +pwsx3403 power 0.224 0.5 -> 0.473 Inexact Rounded +pwsx3404 power 0.0224 0.5 -> 0.150 Inexact Rounded +pwsx3405 power 0.225 0.5 -> 0.474 Inexact Rounded +pwsx3406 power 0.0225 0.5 -> 0.150 Inexact Rounded +pwsx3407 power 0.226 0.5 -> 0.475 Inexact Rounded +pwsx3408 power 0.0226 0.5 -> 0.150 Inexact Rounded +pwsx3409 power 0.227 0.5 -> 0.476 Inexact Rounded +pwsx3410 power 0.0227 0.5 -> 0.151 Inexact Rounded +pwsx3411 power 0.228 0.5 -> 0.477 Inexact Rounded +pwsx3412 power 0.0228 0.5 -> 0.151 Inexact Rounded +pwsx3413 power 0.229 0.5 -> 0.479 Inexact Rounded +pwsx3414 power 0.0229 0.5 -> 0.151 Inexact Rounded +pwsx3415 power 0.231 0.5 -> 0.481 Inexact Rounded +pwsx3416 power 0.0231 0.5 -> 0.152 Inexact Rounded +pwsx3417 power 0.232 0.5 -> 0.482 Inexact Rounded +pwsx3418 power 0.0232 0.5 -> 0.152 Inexact Rounded +pwsx3419 power 0.233 0.5 -> 0.483 Inexact Rounded +pwsx3420 power 0.0233 0.5 -> 0.153 Inexact Rounded +pwsx3421 power 0.234 0.5 -> 0.484 Inexact Rounded +pwsx3422 power 0.0234 0.5 -> 0.153 Inexact Rounded +pwsx3423 power 0.235 0.5 -> 0.485 Inexact Rounded +pwsx3424 power 0.0235 0.5 -> 0.153 Inexact Rounded +pwsx3425 power 0.236 0.5 -> 0.486 Inexact Rounded +pwsx3426 power 0.0236 0.5 -> 0.154 Inexact Rounded +pwsx3427 power 0.237 0.5 -> 0.487 Inexact Rounded +pwsx3428 power 0.0237 0.5 -> 0.154 Inexact Rounded +pwsx3429 power 0.238 0.5 -> 0.488 Inexact Rounded +pwsx3430 power 0.0238 0.5 -> 0.154 Inexact Rounded +pwsx3431 power 0.239 0.5 -> 0.489 Inexact Rounded +pwsx3432 power 0.0239 0.5 -> 0.155 Inexact Rounded +pwsx3433 power 0.241 0.5 -> 0.491 Inexact Rounded +pwsx3434 power 0.0241 0.5 -> 0.155 Inexact Rounded +pwsx3435 power 0.242 0.5 -> 0.492 Inexact Rounded +pwsx3436 power 0.0242 0.5 -> 0.156 Inexact Rounded +pwsx3437 power 0.243 0.5 -> 0.493 Inexact Rounded +pwsx3438 power 0.0243 0.5 -> 0.156 Inexact Rounded +pwsx3439 power 0.244 0.5 -> 0.494 Inexact Rounded +pwsx3440 power 0.0244 0.5 -> 0.156 Inexact Rounded +pwsx3441 power 0.245 0.5 -> 0.495 Inexact Rounded +pwsx3442 power 0.0245 0.5 -> 0.157 Inexact Rounded +pwsx3443 power 0.246 0.5 -> 0.496 Inexact Rounded +pwsx3444 power 0.0246 0.5 -> 0.157 Inexact Rounded +pwsx3445 power 0.247 0.5 -> 0.497 Inexact Rounded +pwsx3446 power 0.0247 0.5 -> 0.157 Inexact Rounded +pwsx3447 power 0.248 0.5 -> 0.498 Inexact Rounded +pwsx3448 power 0.0248 0.5 -> 0.157 Inexact Rounded +pwsx3449 power 0.249 0.5 -> 0.499 Inexact Rounded +pwsx3450 power 0.0249 0.5 -> 0.158 Inexact Rounded +pwsx3451 power 0.251 0.5 -> 0.501 Inexact Rounded +pwsx3452 power 0.0251 0.5 -> 0.158 Inexact Rounded +pwsx3453 power 0.252 0.5 -> 0.502 Inexact Rounded +pwsx3454 power 0.0252 0.5 -> 0.159 Inexact Rounded +pwsx3455 power 0.253 0.5 -> 0.503 Inexact Rounded +pwsx3456 power 0.0253 0.5 -> 0.159 Inexact Rounded +pwsx3457 power 0.254 0.5 -> 0.504 Inexact Rounded +pwsx3458 power 0.0254 0.5 -> 0.159 Inexact Rounded +pwsx3459 power 0.255 0.5 -> 0.505 Inexact Rounded +pwsx3460 power 0.0255 0.5 -> 0.160 Inexact Rounded +pwsx3461 power 0.256 0.5 -> 0.506 Inexact Rounded +pwsx3462 power 0.0256 0.5 -> 0.160 Inexact Rounded +pwsx3463 power 0.257 0.5 -> 0.507 Inexact Rounded +pwsx3464 power 0.0257 0.5 -> 0.160 Inexact Rounded +pwsx3465 power 0.258 0.5 -> 0.508 Inexact Rounded +pwsx3466 power 0.0258 0.5 -> 0.161 Inexact Rounded +pwsx3467 power 0.259 0.5 -> 0.509 Inexact Rounded +pwsx3468 power 0.0259 0.5 -> 0.161 Inexact Rounded +pwsx3469 power 0.261 0.5 -> 0.511 Inexact Rounded +pwsx3470 power 0.0261 0.5 -> 0.162 Inexact Rounded +pwsx3471 power 0.262 0.5 -> 0.512 Inexact Rounded +pwsx3472 power 0.0262 0.5 -> 0.162 Inexact Rounded +pwsx3473 power 0.263 0.5 -> 0.513 Inexact Rounded +pwsx3474 power 0.0263 0.5 -> 0.162 Inexact Rounded +pwsx3475 power 0.264 0.5 -> 0.514 Inexact Rounded +pwsx3476 power 0.0264 0.5 -> 0.162 Inexact Rounded +pwsx3477 power 0.265 0.5 -> 0.515 Inexact Rounded +pwsx3478 power 0.0265 0.5 -> 0.163 Inexact Rounded +pwsx3479 power 0.266 0.5 -> 0.516 Inexact Rounded +pwsx3480 power 0.0266 0.5 -> 0.163 Inexact Rounded +pwsx3481 power 0.267 0.5 -> 0.517 Inexact Rounded +pwsx3482 power 0.0267 0.5 -> 0.163 Inexact Rounded +pwsx3483 power 0.268 0.5 -> 0.518 Inexact Rounded +pwsx3484 power 0.0268 0.5 -> 0.164 Inexact Rounded +pwsx3485 power 0.269 0.5 -> 0.519 Inexact Rounded +pwsx3486 power 0.0269 0.5 -> 0.164 Inexact Rounded +pwsx3487 power 0.271 0.5 -> 0.521 Inexact Rounded +pwsx3488 power 0.0271 0.5 -> 0.165 Inexact Rounded +pwsx3489 power 0.272 0.5 -> 0.522 Inexact Rounded +pwsx3490 power 0.0272 0.5 -> 0.165 Inexact Rounded +pwsx3491 power 0.273 0.5 -> 0.522 Inexact Rounded +pwsx3492 power 0.0273 0.5 -> 0.165 Inexact Rounded +pwsx3493 power 0.274 0.5 -> 0.523 Inexact Rounded +pwsx3494 power 0.0274 0.5 -> 0.166 Inexact Rounded +pwsx3495 power 0.275 0.5 -> 0.524 Inexact Rounded +pwsx3496 power 0.0275 0.5 -> 0.166 Inexact Rounded +pwsx3497 power 0.276 0.5 -> 0.525 Inexact Rounded +pwsx3498 power 0.0276 0.5 -> 0.166 Inexact Rounded +pwsx3499 power 0.277 0.5 -> 0.526 Inexact Rounded +pwsx3500 power 0.0277 0.5 -> 0.166 Inexact Rounded +pwsx3501 power 0.278 0.5 -> 0.527 Inexact Rounded +pwsx3502 power 0.0278 0.5 -> 0.167 Inexact Rounded +pwsx3503 power 0.279 0.5 -> 0.528 Inexact Rounded +pwsx3504 power 0.0279 0.5 -> 0.167 Inexact Rounded +pwsx3505 power 0.281 0.5 -> 0.530 Inexact Rounded +pwsx3506 power 0.0281 0.5 -> 0.168 Inexact Rounded +pwsx3507 power 0.282 0.5 -> 0.531 Inexact Rounded +pwsx3508 power 0.0282 0.5 -> 0.168 Inexact Rounded +pwsx3509 power 0.283 0.5 -> 0.532 Inexact Rounded +pwsx3510 power 0.0283 0.5 -> 0.168 Inexact Rounded +pwsx3511 power 0.284 0.5 -> 0.533 Inexact Rounded +pwsx3512 power 0.0284 0.5 -> 0.169 Inexact Rounded +pwsx3513 power 0.285 0.5 -> 0.534 Inexact Rounded +pwsx3514 power 0.0285 0.5 -> 0.169 Inexact Rounded +pwsx3515 power 0.286 0.5 -> 0.535 Inexact Rounded +pwsx3516 power 0.0286 0.5 -> 0.169 Inexact Rounded +pwsx3517 power 0.287 0.5 -> 0.536 Inexact Rounded +pwsx3518 power 0.0287 0.5 -> 0.169 Inexact Rounded +pwsx3519 power 0.288 0.5 -> 0.537 Inexact Rounded +pwsx3520 power 0.0288 0.5 -> 0.170 Inexact Rounded +pwsx3521 power 0.289 0.5 -> 0.538 Inexact Rounded +pwsx3522 power 0.0289 0.5 -> 0.170 Inexact Rounded +pwsx3523 power 0.291 0.5 -> 0.539 Inexact Rounded +pwsx3524 power 0.0291 0.5 -> 0.171 Inexact Rounded +pwsx3525 power 0.292 0.5 -> 0.540 Inexact Rounded +pwsx3526 power 0.0292 0.5 -> 0.171 Inexact Rounded +pwsx3527 power 0.293 0.5 -> 0.541 Inexact Rounded +pwsx3528 power 0.0293 0.5 -> 0.171 Inexact Rounded +pwsx3529 power 0.294 0.5 -> 0.542 Inexact Rounded +pwsx3530 power 0.0294 0.5 -> 0.171 Inexact Rounded +pwsx3531 power 0.295 0.5 -> 0.543 Inexact Rounded +pwsx3532 power 0.0295 0.5 -> 0.172 Inexact Rounded +pwsx3533 power 0.296 0.5 -> 0.544 Inexact Rounded +pwsx3534 power 0.0296 0.5 -> 0.172 Inexact Rounded +pwsx3535 power 0.297 0.5 -> 0.545 Inexact Rounded +pwsx3536 power 0.0297 0.5 -> 0.172 Inexact Rounded +pwsx3537 power 0.298 0.5 -> 0.546 Inexact Rounded +pwsx3538 power 0.0298 0.5 -> 0.173 Inexact Rounded +pwsx3539 power 0.299 0.5 -> 0.547 Inexact Rounded +pwsx3540 power 0.0299 0.5 -> 0.173 Inexact Rounded +pwsx3541 power 0.301 0.5 -> 0.549 Inexact Rounded +pwsx3542 power 0.0301 0.5 -> 0.173 Inexact Rounded +pwsx3543 power 0.302 0.5 -> 0.550 Inexact Rounded +pwsx3544 power 0.0302 0.5 -> 0.174 Inexact Rounded +pwsx3545 power 0.303 0.5 -> 0.550 Inexact Rounded +pwsx3546 power 0.0303 0.5 -> 0.174 Inexact Rounded +pwsx3547 power 0.304 0.5 -> 0.551 Inexact Rounded +pwsx3548 power 0.0304 0.5 -> 0.174 Inexact Rounded +pwsx3549 power 0.305 0.5 -> 0.552 Inexact Rounded +pwsx3550 power 0.0305 0.5 -> 0.175 Inexact Rounded +pwsx3551 power 0.306 0.5 -> 0.553 Inexact Rounded +pwsx3552 power 0.0306 0.5 -> 0.175 Inexact Rounded +pwsx3553 power 0.307 0.5 -> 0.554 Inexact Rounded +pwsx3554 power 0.0307 0.5 -> 0.175 Inexact Rounded +pwsx3555 power 0.308 0.5 -> 0.555 Inexact Rounded +pwsx3556 power 0.0308 0.5 -> 0.175 Inexact Rounded +pwsx3557 power 0.309 0.5 -> 0.556 Inexact Rounded +pwsx3558 power 0.0309 0.5 -> 0.176 Inexact Rounded +pwsx3559 power 0.311 0.5 -> 0.558 Inexact Rounded +pwsx3560 power 0.0311 0.5 -> 0.176 Inexact Rounded +pwsx3561 power 0.312 0.5 -> 0.559 Inexact Rounded +pwsx3562 power 0.0312 0.5 -> 0.177 Inexact Rounded +pwsx3563 power 0.313 0.5 -> 0.559 Inexact Rounded +pwsx3564 power 0.0313 0.5 -> 0.177 Inexact Rounded +pwsx3565 power 0.314 0.5 -> 0.560 Inexact Rounded +pwsx3566 power 0.0314 0.5 -> 0.177 Inexact Rounded +pwsx3567 power 0.315 0.5 -> 0.561 Inexact Rounded +pwsx3568 power 0.0315 0.5 -> 0.177 Inexact Rounded +pwsx3569 power 0.316 0.5 -> 0.562 Inexact Rounded +pwsx3570 power 0.0316 0.5 -> 0.178 Inexact Rounded +pwsx3571 power 0.317 0.5 -> 0.563 Inexact Rounded +pwsx3572 power 0.0317 0.5 -> 0.178 Inexact Rounded +pwsx3573 power 0.318 0.5 -> 0.564 Inexact Rounded +pwsx3574 power 0.0318 0.5 -> 0.178 Inexact Rounded +pwsx3575 power 0.319 0.5 -> 0.565 Inexact Rounded +pwsx3576 power 0.0319 0.5 -> 0.179 Inexact Rounded +pwsx3577 power 0.321 0.5 -> 0.567 Inexact Rounded +pwsx3578 power 0.0321 0.5 -> 0.179 Inexact Rounded +pwsx3579 power 0.322 0.5 -> 0.567 Inexact Rounded +pwsx3580 power 0.0322 0.5 -> 0.179 Inexact Rounded +pwsx3581 power 0.323 0.5 -> 0.568 Inexact Rounded +pwsx3582 power 0.0323 0.5 -> 0.180 Inexact Rounded +pwsx3583 power 0.324 0.5 -> 0.569 Inexact Rounded +pwsx3584 power 0.0324 0.5 -> 0.180 Inexact Rounded +pwsx3585 power 0.325 0.5 -> 0.570 Inexact Rounded +pwsx3586 power 0.0325 0.5 -> 0.180 Inexact Rounded +pwsx3587 power 0.326 0.5 -> 0.571 Inexact Rounded +pwsx3588 power 0.0326 0.5 -> 0.181 Inexact Rounded +pwsx3589 power 0.327 0.5 -> 0.572 Inexact Rounded +pwsx3590 power 0.0327 0.5 -> 0.181 Inexact Rounded +pwsx3591 power 0.328 0.5 -> 0.573 Inexact Rounded +pwsx3592 power 0.0328 0.5 -> 0.181 Inexact Rounded +pwsx3593 power 0.329 0.5 -> 0.574 Inexact Rounded +pwsx3594 power 0.0329 0.5 -> 0.181 Inexact Rounded +pwsx3595 power 0.331 0.5 -> 0.575 Inexact Rounded +pwsx3596 power 0.0331 0.5 -> 0.182 Inexact Rounded +pwsx3597 power 0.332 0.5 -> 0.576 Inexact Rounded +pwsx3598 power 0.0332 0.5 -> 0.182 Inexact Rounded +pwsx3599 power 0.333 0.5 -> 0.577 Inexact Rounded +pwsx3600 power 0.0333 0.5 -> 0.182 Inexact Rounded +pwsx3601 power 0.334 0.5 -> 0.578 Inexact Rounded +pwsx3602 power 0.0334 0.5 -> 0.183 Inexact Rounded +pwsx3603 power 0.335 0.5 -> 0.579 Inexact Rounded +pwsx3604 power 0.0335 0.5 -> 0.183 Inexact Rounded +pwsx3605 power 0.336 0.5 -> 0.580 Inexact Rounded +pwsx3606 power 0.0336 0.5 -> 0.183 Inexact Rounded +pwsx3607 power 0.337 0.5 -> 0.581 Inexact Rounded +pwsx3608 power 0.0337 0.5 -> 0.184 Inexact Rounded +pwsx3609 power 0.338 0.5 -> 0.581 Inexact Rounded +pwsx3610 power 0.0338 0.5 -> 0.184 Inexact Rounded +pwsx3611 power 0.339 0.5 -> 0.582 Inexact Rounded +pwsx3612 power 0.0339 0.5 -> 0.184 Inexact Rounded +pwsx3613 power 0.341 0.5 -> 0.584 Inexact Rounded +pwsx3614 power 0.0341 0.5 -> 0.185 Inexact Rounded +pwsx3615 power 0.342 0.5 -> 0.585 Inexact Rounded +pwsx3616 power 0.0342 0.5 -> 0.185 Inexact Rounded +pwsx3617 power 0.343 0.5 -> 0.586 Inexact Rounded +pwsx3618 power 0.0343 0.5 -> 0.185 Inexact Rounded +pwsx3619 power 0.344 0.5 -> 0.587 Inexact Rounded +pwsx3620 power 0.0344 0.5 -> 0.185 Inexact Rounded +pwsx3621 power 0.345 0.5 -> 0.587 Inexact Rounded +pwsx3622 power 0.0345 0.5 -> 0.186 Inexact Rounded +pwsx3623 power 0.346 0.5 -> 0.588 Inexact Rounded +pwsx3624 power 0.0346 0.5 -> 0.186 Inexact Rounded +pwsx3625 power 0.347 0.5 -> 0.589 Inexact Rounded +pwsx3626 power 0.0347 0.5 -> 0.186 Inexact Rounded +pwsx3627 power 0.348 0.5 -> 0.590 Inexact Rounded +pwsx3628 power 0.0348 0.5 -> 0.187 Inexact Rounded +pwsx3629 power 0.349 0.5 -> 0.591 Inexact Rounded +pwsx3630 power 0.0349 0.5 -> 0.187 Inexact Rounded +pwsx3631 power 0.351 0.5 -> 0.592 Inexact Rounded +pwsx3632 power 0.0351 0.5 -> 0.187 Inexact Rounded +pwsx3633 power 0.352 0.5 -> 0.593 Inexact Rounded +pwsx3634 power 0.0352 0.5 -> 0.188 Inexact Rounded +pwsx3635 power 0.353 0.5 -> 0.594 Inexact Rounded +pwsx3636 power 0.0353 0.5 -> 0.188 Inexact Rounded +pwsx3637 power 0.354 0.5 -> 0.595 Inexact Rounded +pwsx3638 power 0.0354 0.5 -> 0.188 Inexact Rounded +pwsx3639 power 0.355 0.5 -> 0.596 Inexact Rounded +pwsx3640 power 0.0355 0.5 -> 0.188 Inexact Rounded +pwsx3641 power 0.356 0.5 -> 0.597 Inexact Rounded +pwsx3642 power 0.0356 0.5 -> 0.189 Inexact Rounded +pwsx3643 power 0.357 0.5 -> 0.597 Inexact Rounded +pwsx3644 power 0.0357 0.5 -> 0.189 Inexact Rounded +pwsx3645 power 0.358 0.5 -> 0.598 Inexact Rounded +pwsx3646 power 0.0358 0.5 -> 0.189 Inexact Rounded +pwsx3647 power 0.359 0.5 -> 0.599 Inexact Rounded +pwsx3648 power 0.0359 0.5 -> 0.189 Inexact Rounded +pwsx3649 power 0.361 0.5 -> 0.601 Inexact Rounded +pwsx3650 power 0.0361 0.5 -> 0.190 Inexact Rounded +pwsx3651 power 0.362 0.5 -> 0.602 Inexact Rounded +pwsx3652 power 0.0362 0.5 -> 0.190 Inexact Rounded +pwsx3653 power 0.363 0.5 -> 0.602 Inexact Rounded +pwsx3654 power 0.0363 0.5 -> 0.191 Inexact Rounded +pwsx3655 power 0.364 0.5 -> 0.603 Inexact Rounded +pwsx3656 power 0.0364 0.5 -> 0.191 Inexact Rounded +pwsx3657 power 0.365 0.5 -> 0.604 Inexact Rounded +pwsx3658 power 0.0365 0.5 -> 0.191 Inexact Rounded +pwsx3659 power 0.366 0.5 -> 0.605 Inexact Rounded +pwsx3660 power 0.0366 0.5 -> 0.191 Inexact Rounded +pwsx3661 power 0.367 0.5 -> 0.606 Inexact Rounded +pwsx3662 power 0.0367 0.5 -> 0.192 Inexact Rounded +pwsx3663 power 0.368 0.5 -> 0.607 Inexact Rounded +pwsx3664 power 0.0368 0.5 -> 0.192 Inexact Rounded +pwsx3665 power 0.369 0.5 -> 0.607 Inexact Rounded +pwsx3666 power 0.0369 0.5 -> 0.192 Inexact Rounded +pwsx3667 power 0.371 0.5 -> 0.609 Inexact Rounded +pwsx3668 power 0.0371 0.5 -> 0.193 Inexact Rounded +pwsx3669 power 0.372 0.5 -> 0.610 Inexact Rounded +pwsx3670 power 0.0372 0.5 -> 0.193 Inexact Rounded +pwsx3671 power 0.373 0.5 -> 0.611 Inexact Rounded +pwsx3672 power 0.0373 0.5 -> 0.193 Inexact Rounded +pwsx3673 power 0.374 0.5 -> 0.612 Inexact Rounded +pwsx3674 power 0.0374 0.5 -> 0.193 Inexact Rounded +pwsx3675 power 0.375 0.5 -> 0.612 Inexact Rounded +pwsx3676 power 0.0375 0.5 -> 0.194 Inexact Rounded +pwsx3677 power 0.376 0.5 -> 0.613 Inexact Rounded +pwsx3678 power 0.0376 0.5 -> 0.194 Inexact Rounded +pwsx3679 power 0.377 0.5 -> 0.614 Inexact Rounded +pwsx3680 power 0.0377 0.5 -> 0.194 Inexact Rounded +pwsx3681 power 0.378 0.5 -> 0.615 Inexact Rounded +pwsx3682 power 0.0378 0.5 -> 0.194 Inexact Rounded +pwsx3683 power 0.379 0.5 -> 0.616 Inexact Rounded +pwsx3684 power 0.0379 0.5 -> 0.195 Inexact Rounded +pwsx3685 power 0.381 0.5 -> 0.617 Inexact Rounded +pwsx3686 power 0.0381 0.5 -> 0.195 Inexact Rounded +pwsx3687 power 0.382 0.5 -> 0.618 Inexact Rounded +pwsx3688 power 0.0382 0.5 -> 0.195 Inexact Rounded +pwsx3689 power 0.383 0.5 -> 0.619 Inexact Rounded +pwsx3690 power 0.0383 0.5 -> 0.196 Inexact Rounded +pwsx3691 power 0.384 0.5 -> 0.620 Inexact Rounded +pwsx3692 power 0.0384 0.5 -> 0.196 Inexact Rounded +pwsx3693 power 0.385 0.5 -> 0.620 Inexact Rounded +pwsx3694 power 0.0385 0.5 -> 0.196 Inexact Rounded +pwsx3695 power 0.386 0.5 -> 0.621 Inexact Rounded +pwsx3696 power 0.0386 0.5 -> 0.196 Inexact Rounded +pwsx3697 power 0.387 0.5 -> 0.622 Inexact Rounded +pwsx3698 power 0.0387 0.5 -> 0.197 Inexact Rounded +pwsx3699 power 0.388 0.5 -> 0.623 Inexact Rounded +pwsx3700 power 0.0388 0.5 -> 0.197 Inexact Rounded +pwsx3701 power 0.389 0.5 -> 0.624 Inexact Rounded +pwsx3702 power 0.0389 0.5 -> 0.197 Inexact Rounded +pwsx3703 power 0.391 0.5 -> 0.625 Inexact Rounded +pwsx3704 power 0.0391 0.5 -> 0.198 Inexact Rounded +pwsx3705 power 0.392 0.5 -> 0.626 Inexact Rounded +pwsx3706 power 0.0392 0.5 -> 0.198 Inexact Rounded +pwsx3707 power 0.393 0.5 -> 0.627 Inexact Rounded +pwsx3708 power 0.0393 0.5 -> 0.198 Inexact Rounded +pwsx3709 power 0.394 0.5 -> 0.628 Inexact Rounded +pwsx3710 power 0.0394 0.5 -> 0.198 Inexact Rounded +pwsx3711 power 0.395 0.5 -> 0.628 Inexact Rounded +pwsx3712 power 0.0395 0.5 -> 0.199 Inexact Rounded +pwsx3713 power 0.396 0.5 -> 0.629 Inexact Rounded +pwsx3714 power 0.0396 0.5 -> 0.199 Inexact Rounded +pwsx3715 power 0.397 0.5 -> 0.630 Inexact Rounded +pwsx3716 power 0.0397 0.5 -> 0.199 Inexact Rounded +pwsx3717 power 0.398 0.5 -> 0.631 Inexact Rounded +pwsx3718 power 0.0398 0.5 -> 0.199 Inexact Rounded +pwsx3719 power 0.399 0.5 -> 0.632 Inexact Rounded +pwsx3720 power 0.0399 0.5 -> 0.200 Inexact Rounded +pwsx3721 power 0.401 0.5 -> 0.633 Inexact Rounded +pwsx3722 power 0.0401 0.5 -> 0.200 Inexact Rounded +pwsx3723 power 0.402 0.5 -> 0.634 Inexact Rounded +pwsx3724 power 0.0402 0.5 -> 0.200 Inexact Rounded +pwsx3725 power 0.403 0.5 -> 0.635 Inexact Rounded +pwsx3726 power 0.0403 0.5 -> 0.201 Inexact Rounded +pwsx3727 power 0.404 0.5 -> 0.636 Inexact Rounded +pwsx3728 power 0.0404 0.5 -> 0.201 Inexact Rounded +pwsx3729 power 0.405 0.5 -> 0.636 Inexact Rounded +pwsx3730 power 0.0405 0.5 -> 0.201 Inexact Rounded +pwsx3731 power 0.406 0.5 -> 0.637 Inexact Rounded +pwsx3732 power 0.0406 0.5 -> 0.201 Inexact Rounded +pwsx3733 power 0.407 0.5 -> 0.638 Inexact Rounded +pwsx3734 power 0.0407 0.5 -> 0.202 Inexact Rounded +pwsx3735 power 0.408 0.5 -> 0.639 Inexact Rounded +pwsx3736 power 0.0408 0.5 -> 0.202 Inexact Rounded +pwsx3737 power 0.409 0.5 -> 0.640 Inexact Rounded +pwsx3738 power 0.0409 0.5 -> 0.202 Inexact Rounded +pwsx3739 power 0.411 0.5 -> 0.641 Inexact Rounded +pwsx3740 power 0.0411 0.5 -> 0.203 Inexact Rounded +pwsx3741 power 0.412 0.5 -> 0.642 Inexact Rounded +pwsx3742 power 0.0412 0.5 -> 0.203 Inexact Rounded +pwsx3743 power 0.413 0.5 -> 0.643 Inexact Rounded +pwsx3744 power 0.0413 0.5 -> 0.203 Inexact Rounded +pwsx3745 power 0.414 0.5 -> 0.643 Inexact Rounded +pwsx3746 power 0.0414 0.5 -> 0.203 Inexact Rounded +pwsx3747 power 0.415 0.5 -> 0.644 Inexact Rounded +pwsx3748 power 0.0415 0.5 -> 0.204 Inexact Rounded +pwsx3749 power 0.416 0.5 -> 0.645 Inexact Rounded +pwsx3750 power 0.0416 0.5 -> 0.204 Inexact Rounded +pwsx3751 power 0.417 0.5 -> 0.646 Inexact Rounded +pwsx3752 power 0.0417 0.5 -> 0.204 Inexact Rounded +pwsx3753 power 0.418 0.5 -> 0.647 Inexact Rounded +pwsx3754 power 0.0418 0.5 -> 0.204 Inexact Rounded +pwsx3755 power 0.419 0.5 -> 0.647 Inexact Rounded +pwsx3756 power 0.0419 0.5 -> 0.205 Inexact Rounded +pwsx3757 power 0.421 0.5 -> 0.649 Inexact Rounded +pwsx3758 power 0.0421 0.5 -> 0.205 Inexact Rounded +pwsx3759 power 0.422 0.5 -> 0.650 Inexact Rounded +pwsx3760 power 0.0422 0.5 -> 0.205 Inexact Rounded +pwsx3761 power 0.423 0.5 -> 0.650 Inexact Rounded +pwsx3762 power 0.0423 0.5 -> 0.206 Inexact Rounded +pwsx3763 power 0.424 0.5 -> 0.651 Inexact Rounded +pwsx3764 power 0.0424 0.5 -> 0.206 Inexact Rounded +pwsx3765 power 0.425 0.5 -> 0.652 Inexact Rounded +pwsx3766 power 0.0425 0.5 -> 0.206 Inexact Rounded +pwsx3767 power 0.426 0.5 -> 0.653 Inexact Rounded +pwsx3768 power 0.0426 0.5 -> 0.206 Inexact Rounded +pwsx3769 power 0.427 0.5 -> 0.653 Inexact Rounded +pwsx3770 power 0.0427 0.5 -> 0.207 Inexact Rounded +pwsx3771 power 0.428 0.5 -> 0.654 Inexact Rounded +pwsx3772 power 0.0428 0.5 -> 0.207 Inexact Rounded +pwsx3773 power 0.429 0.5 -> 0.655 Inexact Rounded +pwsx3774 power 0.0429 0.5 -> 0.207 Inexact Rounded +pwsx3775 power 0.431 0.5 -> 0.657 Inexact Rounded +pwsx3776 power 0.0431 0.5 -> 0.208 Inexact Rounded +pwsx3777 power 0.432 0.5 -> 0.657 Inexact Rounded +pwsx3778 power 0.0432 0.5 -> 0.208 Inexact Rounded +pwsx3779 power 0.433 0.5 -> 0.658 Inexact Rounded +pwsx3780 power 0.0433 0.5 -> 0.208 Inexact Rounded +pwsx3781 power 0.434 0.5 -> 0.659 Inexact Rounded +pwsx3782 power 0.0434 0.5 -> 0.208 Inexact Rounded +pwsx3783 power 0.435 0.5 -> 0.660 Inexact Rounded +pwsx3784 power 0.0435 0.5 -> 0.209 Inexact Rounded +pwsx3785 power 0.436 0.5 -> 0.660 Inexact Rounded +pwsx3786 power 0.0436 0.5 -> 0.209 Inexact Rounded +pwsx3787 power 0.437 0.5 -> 0.661 Inexact Rounded +pwsx3788 power 0.0437 0.5 -> 0.209 Inexact Rounded +pwsx3789 power 0.438 0.5 -> 0.662 Inexact Rounded +pwsx3790 power 0.0438 0.5 -> 0.209 Inexact Rounded +pwsx3791 power 0.439 0.5 -> 0.663 Inexact Rounded +pwsx3792 power 0.0439 0.5 -> 0.210 Inexact Rounded +pwsx3793 power 0.441 0.5 -> 0.664 Inexact Rounded +pwsx3794 power 0.0441 0.5 -> 0.210 Inexact Rounded +pwsx3795 power 0.442 0.5 -> 0.665 Inexact Rounded +pwsx3796 power 0.0442 0.5 -> 0.210 Inexact Rounded +pwsx3797 power 0.443 0.5 -> 0.666 Inexact Rounded +pwsx3798 power 0.0443 0.5 -> 0.210 Inexact Rounded +pwsx3799 power 0.444 0.5 -> 0.666 Inexact Rounded +pwsx3800 power 0.0444 0.5 -> 0.211 Inexact Rounded +pwsx3801 power 0.445 0.5 -> 0.667 Inexact Rounded +pwsx3802 power 0.0445 0.5 -> 0.211 Inexact Rounded +pwsx3803 power 0.446 0.5 -> 0.668 Inexact Rounded +pwsx3804 power 0.0446 0.5 -> 0.211 Inexact Rounded +pwsx3805 power 0.447 0.5 -> 0.669 Inexact Rounded +pwsx3806 power 0.0447 0.5 -> 0.211 Inexact Rounded +pwsx3807 power 0.448 0.5 -> 0.669 Inexact Rounded +pwsx3808 power 0.0448 0.5 -> 0.212 Inexact Rounded +pwsx3809 power 0.449 0.5 -> 0.670 Inexact Rounded +pwsx3810 power 0.0449 0.5 -> 0.212 Inexact Rounded +pwsx3811 power 0.451 0.5 -> 0.672 Inexact Rounded +pwsx3812 power 0.0451 0.5 -> 0.212 Inexact Rounded +pwsx3813 power 0.452 0.5 -> 0.672 Inexact Rounded +pwsx3814 power 0.0452 0.5 -> 0.213 Inexact Rounded +pwsx3815 power 0.453 0.5 -> 0.673 Inexact Rounded +pwsx3816 power 0.0453 0.5 -> 0.213 Inexact Rounded +pwsx3817 power 0.454 0.5 -> 0.674 Inexact Rounded +pwsx3818 power 0.0454 0.5 -> 0.213 Inexact Rounded +pwsx3819 power 0.455 0.5 -> 0.675 Inexact Rounded +pwsx3820 power 0.0455 0.5 -> 0.213 Inexact Rounded +pwsx3821 power 0.456 0.5 -> 0.675 Inexact Rounded +pwsx3822 power 0.0456 0.5 -> 0.214 Inexact Rounded +pwsx3823 power 0.457 0.5 -> 0.676 Inexact Rounded +pwsx3824 power 0.0457 0.5 -> 0.214 Inexact Rounded +pwsx3825 power 0.458 0.5 -> 0.677 Inexact Rounded +pwsx3826 power 0.0458 0.5 -> 0.214 Inexact Rounded +pwsx3827 power 0.459 0.5 -> 0.677 Inexact Rounded +pwsx3828 power 0.0459 0.5 -> 0.214 Inexact Rounded +pwsx3829 power 0.461 0.5 -> 0.679 Inexact Rounded +pwsx3830 power 0.0461 0.5 -> 0.215 Inexact Rounded +pwsx3831 power 0.462 0.5 -> 0.680 Inexact Rounded +pwsx3832 power 0.0462 0.5 -> 0.215 Inexact Rounded +pwsx3833 power 0.463 0.5 -> 0.680 Inexact Rounded +pwsx3834 power 0.0463 0.5 -> 0.215 Inexact Rounded +pwsx3835 power 0.464 0.5 -> 0.681 Inexact Rounded +pwsx3836 power 0.0464 0.5 -> 0.215 Inexact Rounded +pwsx3837 power 0.465 0.5 -> 0.682 Inexact Rounded +pwsx3838 power 0.0465 0.5 -> 0.216 Inexact Rounded +pwsx3839 power 0.466 0.5 -> 0.683 Inexact Rounded +pwsx3840 power 0.0466 0.5 -> 0.216 Inexact Rounded +pwsx3841 power 0.467 0.5 -> 0.683 Inexact Rounded +pwsx3842 power 0.0467 0.5 -> 0.216 Inexact Rounded +pwsx3843 power 0.468 0.5 -> 0.684 Inexact Rounded +pwsx3844 power 0.0468 0.5 -> 0.216 Inexact Rounded +pwsx3845 power 0.469 0.5 -> 0.685 Inexact Rounded +pwsx3846 power 0.0469 0.5 -> 0.217 Inexact Rounded +pwsx3847 power 0.471 0.5 -> 0.686 Inexact Rounded +pwsx3848 power 0.0471 0.5 -> 0.217 Inexact Rounded +pwsx3849 power 0.472 0.5 -> 0.687 Inexact Rounded +pwsx3850 power 0.0472 0.5 -> 0.217 Inexact Rounded +pwsx3851 power 0.473 0.5 -> 0.688 Inexact Rounded +pwsx3852 power 0.0473 0.5 -> 0.217 Inexact Rounded +pwsx3853 power 0.474 0.5 -> 0.688 Inexact Rounded +pwsx3854 power 0.0474 0.5 -> 0.218 Inexact Rounded +pwsx3855 power 0.475 0.5 -> 0.689 Inexact Rounded +pwsx3856 power 0.0475 0.5 -> 0.218 Inexact Rounded +pwsx3857 power 0.476 0.5 -> 0.690 Inexact Rounded +pwsx3858 power 0.0476 0.5 -> 0.218 Inexact Rounded +pwsx3859 power 0.477 0.5 -> 0.691 Inexact Rounded +pwsx3860 power 0.0477 0.5 -> 0.218 Inexact Rounded +pwsx3861 power 0.478 0.5 -> 0.691 Inexact Rounded +pwsx3862 power 0.0478 0.5 -> 0.219 Inexact Rounded +pwsx3863 power 0.479 0.5 -> 0.692 Inexact Rounded +pwsx3864 power 0.0479 0.5 -> 0.219 Inexact Rounded +pwsx3865 power 0.481 0.5 -> 0.694 Inexact Rounded +pwsx3866 power 0.0481 0.5 -> 0.219 Inexact Rounded +pwsx3867 power 0.482 0.5 -> 0.694 Inexact Rounded +pwsx3868 power 0.0482 0.5 -> 0.220 Inexact Rounded +pwsx3869 power 0.483 0.5 -> 0.695 Inexact Rounded +pwsx3870 power 0.0483 0.5 -> 0.220 Inexact Rounded +pwsx3871 power 0.484 0.5 -> 0.696 Inexact Rounded +pwsx3872 power 0.0484 0.5 -> 0.220 Inexact Rounded +pwsx3873 power 0.485 0.5 -> 0.696 Inexact Rounded +pwsx3874 power 0.0485 0.5 -> 0.220 Inexact Rounded +pwsx3875 power 0.486 0.5 -> 0.697 Inexact Rounded +pwsx3876 power 0.0486 0.5 -> 0.220 Inexact Rounded +pwsx3877 power 0.487 0.5 -> 0.698 Inexact Rounded +pwsx3878 power 0.0487 0.5 -> 0.221 Inexact Rounded +pwsx3879 power 0.488 0.5 -> 0.699 Inexact Rounded +pwsx3880 power 0.0488 0.5 -> 0.221 Inexact Rounded +pwsx3881 power 0.489 0.5 -> 0.699 Inexact Rounded +pwsx3882 power 0.0489 0.5 -> 0.221 Inexact Rounded +pwsx3883 power 0.491 0.5 -> 0.701 Inexact Rounded +pwsx3884 power 0.0491 0.5 -> 0.222 Inexact Rounded +pwsx3885 power 0.492 0.5 -> 0.701 Inexact Rounded +pwsx3886 power 0.0492 0.5 -> 0.222 Inexact Rounded +pwsx3887 power 0.493 0.5 -> 0.702 Inexact Rounded +pwsx3888 power 0.0493 0.5 -> 0.222 Inexact Rounded +pwsx3889 power 0.494 0.5 -> 0.703 Inexact Rounded +pwsx3890 power 0.0494 0.5 -> 0.222 Inexact Rounded +pwsx3891 power 0.495 0.5 -> 0.704 Inexact Rounded +pwsx3892 power 0.0495 0.5 -> 0.222 Inexact Rounded +pwsx3893 power 0.496 0.5 -> 0.704 Inexact Rounded +pwsx3894 power 0.0496 0.5 -> 0.223 Inexact Rounded +pwsx3895 power 0.497 0.5 -> 0.705 Inexact Rounded +pwsx3896 power 0.0497 0.5 -> 0.223 Inexact Rounded +pwsx3897 power 0.498 0.5 -> 0.706 Inexact Rounded +pwsx3898 power 0.0498 0.5 -> 0.223 Inexact Rounded +pwsx3899 power 0.499 0.5 -> 0.706 Inexact Rounded +pwsx3900 power 0.0499 0.5 -> 0.223 Inexact Rounded +pwsx3901 power 0.501 0.5 -> 0.708 Inexact Rounded +pwsx3902 power 0.0501 0.5 -> 0.224 Inexact Rounded +pwsx3903 power 0.502 0.5 -> 0.709 Inexact Rounded +pwsx3904 power 0.0502 0.5 -> 0.224 Inexact Rounded +pwsx3905 power 0.503 0.5 -> 0.709 Inexact Rounded +pwsx3906 power 0.0503 0.5 -> 0.224 Inexact Rounded +pwsx3907 power 0.504 0.5 -> 0.710 Inexact Rounded +pwsx3908 power 0.0504 0.5 -> 0.224 Inexact Rounded +pwsx3909 power 0.505 0.5 -> 0.711 Inexact Rounded +pwsx3910 power 0.0505 0.5 -> 0.225 Inexact Rounded +pwsx3911 power 0.506 0.5 -> 0.711 Inexact Rounded +pwsx3912 power 0.0506 0.5 -> 0.225 Inexact Rounded +pwsx3913 power 0.507 0.5 -> 0.712 Inexact Rounded +pwsx3914 power 0.0507 0.5 -> 0.225 Inexact Rounded +pwsx3915 power 0.508 0.5 -> 0.713 Inexact Rounded +pwsx3916 power 0.0508 0.5 -> 0.225 Inexact Rounded +pwsx3917 power 0.509 0.5 -> 0.713 Inexact Rounded +pwsx3918 power 0.0509 0.5 -> 0.226 Inexact Rounded +pwsx3919 power 0.511 0.5 -> 0.715 Inexact Rounded +pwsx3920 power 0.0511 0.5 -> 0.226 Inexact Rounded +pwsx3921 power 0.512 0.5 -> 0.716 Inexact Rounded +pwsx3922 power 0.0512 0.5 -> 0.226 Inexact Rounded +pwsx3923 power 0.513 0.5 -> 0.716 Inexact Rounded +pwsx3924 power 0.0513 0.5 -> 0.226 Inexact Rounded +pwsx3925 power 0.514 0.5 -> 0.717 Inexact Rounded +pwsx3926 power 0.0514 0.5 -> 0.227 Inexact Rounded +pwsx3927 power 0.515 0.5 -> 0.718 Inexact Rounded +pwsx3928 power 0.0515 0.5 -> 0.227 Inexact Rounded +pwsx3929 power 0.516 0.5 -> 0.718 Inexact Rounded +pwsx3930 power 0.0516 0.5 -> 0.227 Inexact Rounded +pwsx3931 power 0.517 0.5 -> 0.719 Inexact Rounded +pwsx3932 power 0.0517 0.5 -> 0.227 Inexact Rounded +pwsx3933 power 0.518 0.5 -> 0.720 Inexact Rounded +pwsx3934 power 0.0518 0.5 -> 0.228 Inexact Rounded +pwsx3935 power 0.519 0.5 -> 0.720 Inexact Rounded +pwsx3936 power 0.0519 0.5 -> 0.228 Inexact Rounded +pwsx3937 power 0.521 0.5 -> 0.722 Inexact Rounded +pwsx3938 power 0.0521 0.5 -> 0.228 Inexact Rounded +pwsx3939 power 0.522 0.5 -> 0.722 Inexact Rounded +pwsx3940 power 0.0522 0.5 -> 0.228 Inexact Rounded +pwsx3941 power 0.523 0.5 -> 0.723 Inexact Rounded +pwsx3942 power 0.0523 0.5 -> 0.229 Inexact Rounded +pwsx3943 power 0.524 0.5 -> 0.724 Inexact Rounded +pwsx3944 power 0.0524 0.5 -> 0.229 Inexact Rounded +pwsx3945 power 0.525 0.5 -> 0.725 Inexact Rounded +pwsx3946 power 0.0525 0.5 -> 0.229 Inexact Rounded +pwsx3947 power 0.526 0.5 -> 0.725 Inexact Rounded +pwsx3948 power 0.0526 0.5 -> 0.229 Inexact Rounded +pwsx3949 power 0.527 0.5 -> 0.726 Inexact Rounded +pwsx3950 power 0.0527 0.5 -> 0.230 Inexact Rounded +pwsx3951 power 0.528 0.5 -> 0.727 Inexact Rounded +pwsx3952 power 0.0528 0.5 -> 0.230 Inexact Rounded +pwsx3953 power 0.529 0.5 -> 0.727 Inexact Rounded +pwsx3954 power 0.0529 0.5 -> 0.230 Inexact Rounded +pwsx3955 power 0.531 0.5 -> 0.729 Inexact Rounded +pwsx3956 power 0.0531 0.5 -> 0.230 Inexact Rounded +pwsx3957 power 0.532 0.5 -> 0.729 Inexact Rounded +pwsx3958 power 0.0532 0.5 -> 0.231 Inexact Rounded +pwsx3959 power 0.533 0.5 -> 0.730 Inexact Rounded +pwsx3960 power 0.0533 0.5 -> 0.231 Inexact Rounded +pwsx3961 power 0.534 0.5 -> 0.731 Inexact Rounded +pwsx3962 power 0.0534 0.5 -> 0.231 Inexact Rounded +pwsx3963 power 0.535 0.5 -> 0.731 Inexact Rounded +pwsx3964 power 0.0535 0.5 -> 0.231 Inexact Rounded +pwsx3965 power 0.536 0.5 -> 0.732 Inexact Rounded +pwsx3966 power 0.0536 0.5 -> 0.232 Inexact Rounded +pwsx3967 power 0.537 0.5 -> 0.733 Inexact Rounded +pwsx3968 power 0.0537 0.5 -> 0.232 Inexact Rounded +pwsx3969 power 0.538 0.5 -> 0.733 Inexact Rounded +pwsx3970 power 0.0538 0.5 -> 0.232 Inexact Rounded +pwsx3971 power 0.539 0.5 -> 0.734 Inexact Rounded +pwsx3972 power 0.0539 0.5 -> 0.232 Inexact Rounded +pwsx3973 power 0.541 0.5 -> 0.736 Inexact Rounded +pwsx3974 power 0.0541 0.5 -> 0.233 Inexact Rounded +pwsx3975 power 0.542 0.5 -> 0.736 Inexact Rounded +pwsx3976 power 0.0542 0.5 -> 0.233 Inexact Rounded +pwsx3977 power 0.543 0.5 -> 0.737 Inexact Rounded +pwsx3978 power 0.0543 0.5 -> 0.233 Inexact Rounded +pwsx3979 power 0.544 0.5 -> 0.738 Inexact Rounded +pwsx3980 power 0.0544 0.5 -> 0.233 Inexact Rounded +pwsx3981 power 0.545 0.5 -> 0.738 Inexact Rounded +pwsx3982 power 0.0545 0.5 -> 0.233 Inexact Rounded +pwsx3983 power 0.546 0.5 -> 0.739 Inexact Rounded +pwsx3984 power 0.0546 0.5 -> 0.234 Inexact Rounded +pwsx3985 power 0.547 0.5 -> 0.740 Inexact Rounded +pwsx3986 power 0.0547 0.5 -> 0.234 Inexact Rounded +pwsx3987 power 0.548 0.5 -> 0.740 Inexact Rounded +pwsx3988 power 0.0548 0.5 -> 0.234 Inexact Rounded +pwsx3989 power 0.549 0.5 -> 0.741 Inexact Rounded +pwsx3990 power 0.0549 0.5 -> 0.234 Inexact Rounded +pwsx3991 power 0.551 0.5 -> 0.742 Inexact Rounded +pwsx3992 power 0.0551 0.5 -> 0.235 Inexact Rounded +pwsx3993 power 0.552 0.5 -> 0.743 Inexact Rounded +pwsx3994 power 0.0552 0.5 -> 0.235 Inexact Rounded +pwsx3995 power 0.553 0.5 -> 0.744 Inexact Rounded +pwsx3996 power 0.0553 0.5 -> 0.235 Inexact Rounded +pwsx3997 power 0.554 0.5 -> 0.744 Inexact Rounded +pwsx3998 power 0.0554 0.5 -> 0.235 Inexact Rounded +pwsx3999 power 0.555 0.5 -> 0.745 Inexact Rounded +pwsx4000 power 0.0555 0.5 -> 0.236 Inexact Rounded +pwsx4001 power 0.556 0.5 -> 0.746 Inexact Rounded +pwsx4002 power 0.0556 0.5 -> 0.236 Inexact Rounded +pwsx4003 power 0.557 0.5 -> 0.746 Inexact Rounded +pwsx4004 power 0.0557 0.5 -> 0.236 Inexact Rounded +pwsx4005 power 0.558 0.5 -> 0.747 Inexact Rounded +pwsx4006 power 0.0558 0.5 -> 0.236 Inexact Rounded +pwsx4007 power 0.559 0.5 -> 0.748 Inexact Rounded +pwsx4008 power 0.0559 0.5 -> 0.236 Inexact Rounded +pwsx4009 power 0.561 0.5 -> 0.749 Inexact Rounded +pwsx4010 power 0.0561 0.5 -> 0.237 Inexact Rounded +pwsx4011 power 0.562 0.5 -> 0.750 Inexact Rounded +pwsx4012 power 0.0562 0.5 -> 0.237 Inexact Rounded +pwsx4013 power 0.563 0.5 -> 0.750 Inexact Rounded +pwsx4014 power 0.0563 0.5 -> 0.237 Inexact Rounded +pwsx4015 power 0.564 0.5 -> 0.751 Inexact Rounded +pwsx4016 power 0.0564 0.5 -> 0.237 Inexact Rounded +pwsx4017 power 0.565 0.5 -> 0.752 Inexact Rounded +pwsx4018 power 0.0565 0.5 -> 0.238 Inexact Rounded +pwsx4019 power 0.566 0.5 -> 0.752 Inexact Rounded +pwsx4020 power 0.0566 0.5 -> 0.238 Inexact Rounded +pwsx4021 power 0.567 0.5 -> 0.753 Inexact Rounded +pwsx4022 power 0.0567 0.5 -> 0.238 Inexact Rounded +pwsx4023 power 0.568 0.5 -> 0.754 Inexact Rounded +pwsx4024 power 0.0568 0.5 -> 0.238 Inexact Rounded +pwsx4025 power 0.569 0.5 -> 0.754 Inexact Rounded +pwsx4026 power 0.0569 0.5 -> 0.239 Inexact Rounded +pwsx4027 power 0.571 0.5 -> 0.756 Inexact Rounded +pwsx4028 power 0.0571 0.5 -> 0.239 Inexact Rounded +pwsx4029 power 0.572 0.5 -> 0.756 Inexact Rounded +pwsx4030 power 0.0572 0.5 -> 0.239 Inexact Rounded +pwsx4031 power 0.573 0.5 -> 0.757 Inexact Rounded +pwsx4032 power 0.0573 0.5 -> 0.239 Inexact Rounded +pwsx4033 power 0.574 0.5 -> 0.758 Inexact Rounded +pwsx4034 power 0.0574 0.5 -> 0.240 Inexact Rounded +pwsx4035 power 0.575 0.5 -> 0.758 Inexact Rounded +pwsx4036 power 0.0575 0.5 -> 0.240 Inexact Rounded +pwsx4037 power 0.576 0.5 -> 0.759 Inexact Rounded +pwsx4038 power 0.0576 0.5 -> 0.240 Inexact Rounded +pwsx4039 power 0.577 0.5 -> 0.760 Inexact Rounded +pwsx4040 power 0.0577 0.5 -> 0.240 Inexact Rounded +pwsx4041 power 0.578 0.5 -> 0.760 Inexact Rounded +pwsx4042 power 0.0578 0.5 -> 0.240 Inexact Rounded +pwsx4043 power 0.579 0.5 -> 0.761 Inexact Rounded +pwsx4044 power 0.0579 0.5 -> 0.241 Inexact Rounded +pwsx4045 power 0.581 0.5 -> 0.762 Inexact Rounded +pwsx4046 power 0.0581 0.5 -> 0.241 Inexact Rounded +pwsx4047 power 0.582 0.5 -> 0.763 Inexact Rounded +pwsx4048 power 0.0582 0.5 -> 0.241 Inexact Rounded +pwsx4049 power 0.583 0.5 -> 0.764 Inexact Rounded +pwsx4050 power 0.0583 0.5 -> 0.241 Inexact Rounded +pwsx4051 power 0.584 0.5 -> 0.764 Inexact Rounded +pwsx4052 power 0.0584 0.5 -> 0.242 Inexact Rounded +pwsx4053 power 0.585 0.5 -> 0.765 Inexact Rounded +pwsx4054 power 0.0585 0.5 -> 0.242 Inexact Rounded +pwsx4055 power 0.586 0.5 -> 0.766 Inexact Rounded +pwsx4056 power 0.0586 0.5 -> 0.242 Inexact Rounded +pwsx4057 power 0.587 0.5 -> 0.766 Inexact Rounded +pwsx4058 power 0.0587 0.5 -> 0.242 Inexact Rounded +pwsx4059 power 0.588 0.5 -> 0.767 Inexact Rounded +pwsx4060 power 0.0588 0.5 -> 0.242 Inexact Rounded +pwsx4061 power 0.589 0.5 -> 0.767 Inexact Rounded +pwsx4062 power 0.0589 0.5 -> 0.243 Inexact Rounded +pwsx4063 power 0.591 0.5 -> 0.769 Inexact Rounded +pwsx4064 power 0.0591 0.5 -> 0.243 Inexact Rounded +pwsx4065 power 0.592 0.5 -> 0.769 Inexact Rounded +pwsx4066 power 0.0592 0.5 -> 0.243 Inexact Rounded +pwsx4067 power 0.593 0.5 -> 0.770 Inexact Rounded +pwsx4068 power 0.0593 0.5 -> 0.244 Inexact Rounded +pwsx4069 power 0.594 0.5 -> 0.771 Inexact Rounded +pwsx4070 power 0.0594 0.5 -> 0.244 Inexact Rounded +pwsx4071 power 0.595 0.5 -> 0.771 Inexact Rounded +pwsx4072 power 0.0595 0.5 -> 0.244 Inexact Rounded +pwsx4073 power 0.596 0.5 -> 0.772 Inexact Rounded +pwsx4074 power 0.0596 0.5 -> 0.244 Inexact Rounded +pwsx4075 power 0.597 0.5 -> 0.773 Inexact Rounded +pwsx4076 power 0.0597 0.5 -> 0.244 Inexact Rounded +pwsx4077 power 0.598 0.5 -> 0.773 Inexact Rounded +pwsx4078 power 0.0598 0.5 -> 0.245 Inexact Rounded +pwsx4079 power 0.599 0.5 -> 0.774 Inexact Rounded +pwsx4080 power 0.0599 0.5 -> 0.245 Inexact Rounded +pwsx4081 power 0.601 0.5 -> 0.775 Inexact Rounded +pwsx4082 power 0.0601 0.5 -> 0.245 Inexact Rounded +pwsx4083 power 0.602 0.5 -> 0.776 Inexact Rounded +pwsx4084 power 0.0602 0.5 -> 0.245 Inexact Rounded +pwsx4085 power 0.603 0.5 -> 0.777 Inexact Rounded +pwsx4086 power 0.0603 0.5 -> 0.246 Inexact Rounded +pwsx4087 power 0.604 0.5 -> 0.777 Inexact Rounded +pwsx4088 power 0.0604 0.5 -> 0.246 Inexact Rounded +pwsx4089 power 0.605 0.5 -> 0.778 Inexact Rounded +pwsx4090 power 0.0605 0.5 -> 0.246 Inexact Rounded +pwsx4091 power 0.606 0.5 -> 0.778 Inexact Rounded +pwsx4092 power 0.0606 0.5 -> 0.246 Inexact Rounded +pwsx4093 power 0.607 0.5 -> 0.779 Inexact Rounded +pwsx4094 power 0.0607 0.5 -> 0.246 Inexact Rounded +pwsx4095 power 0.608 0.5 -> 0.780 Inexact Rounded +pwsx4096 power 0.0608 0.5 -> 0.247 Inexact Rounded +pwsx4097 power 0.609 0.5 -> 0.780 Inexact Rounded +pwsx4098 power 0.0609 0.5 -> 0.247 Inexact Rounded +pwsx4099 power 0.611 0.5 -> 0.782 Inexact Rounded +pwsx4100 power 0.0611 0.5 -> 0.247 Inexact Rounded +pwsx4101 power 0.612 0.5 -> 0.782 Inexact Rounded +pwsx4102 power 0.0612 0.5 -> 0.247 Inexact Rounded +pwsx4103 power 0.613 0.5 -> 0.783 Inexact Rounded +pwsx4104 power 0.0613 0.5 -> 0.248 Inexact Rounded +pwsx4105 power 0.614 0.5 -> 0.784 Inexact Rounded +pwsx4106 power 0.0614 0.5 -> 0.248 Inexact Rounded +pwsx4107 power 0.615 0.5 -> 0.784 Inexact Rounded +pwsx4108 power 0.0615 0.5 -> 0.248 Inexact Rounded +pwsx4109 power 0.616 0.5 -> 0.785 Inexact Rounded +pwsx4110 power 0.0616 0.5 -> 0.248 Inexact Rounded +pwsx4111 power 0.617 0.5 -> 0.785 Inexact Rounded +pwsx4112 power 0.0617 0.5 -> 0.248 Inexact Rounded +pwsx4113 power 0.618 0.5 -> 0.786 Inexact Rounded +pwsx4114 power 0.0618 0.5 -> 0.249 Inexact Rounded +pwsx4115 power 0.619 0.5 -> 0.787 Inexact Rounded +pwsx4116 power 0.0619 0.5 -> 0.249 Inexact Rounded +pwsx4117 power 0.621 0.5 -> 0.788 Inexact Rounded +pwsx4118 power 0.0621 0.5 -> 0.249 Inexact Rounded +pwsx4119 power 0.622 0.5 -> 0.789 Inexact Rounded +pwsx4120 power 0.0622 0.5 -> 0.249 Inexact Rounded +pwsx4121 power 0.623 0.5 -> 0.789 Inexact Rounded +pwsx4122 power 0.0623 0.5 -> 0.250 Inexact Rounded +pwsx4123 power 0.624 0.5 -> 0.790 Inexact Rounded +pwsx4124 power 0.0624 0.5 -> 0.250 Inexact Rounded +pwsx4125 power 0.625 0.5 -> 0.791 Inexact Rounded +pwsx4126 power 0.0625 0.5 -> 0.250 Inexact Rounded +pwsx4127 power 0.626 0.5 -> 0.791 Inexact Rounded +pwsx4128 power 0.0626 0.5 -> 0.250 Inexact Rounded +pwsx4129 power 0.627 0.5 -> 0.792 Inexact Rounded +pwsx4130 power 0.0627 0.5 -> 0.250 Inexact Rounded +pwsx4131 power 0.628 0.5 -> 0.792 Inexact Rounded +pwsx4132 power 0.0628 0.5 -> 0.251 Inexact Rounded +pwsx4133 power 0.629 0.5 -> 0.793 Inexact Rounded +pwsx4134 power 0.0629 0.5 -> 0.251 Inexact Rounded +pwsx4135 power 0.631 0.5 -> 0.794 Inexact Rounded +pwsx4136 power 0.0631 0.5 -> 0.251 Inexact Rounded +pwsx4137 power 0.632 0.5 -> 0.795 Inexact Rounded +pwsx4138 power 0.0632 0.5 -> 0.251 Inexact Rounded +pwsx4139 power 0.633 0.5 -> 0.796 Inexact Rounded +pwsx4140 power 0.0633 0.5 -> 0.252 Inexact Rounded +pwsx4141 power 0.634 0.5 -> 0.796 Inexact Rounded +pwsx4142 power 0.0634 0.5 -> 0.252 Inexact Rounded +pwsx4143 power 0.635 0.5 -> 0.797 Inexact Rounded +pwsx4144 power 0.0635 0.5 -> 0.252 Inexact Rounded +pwsx4145 power 0.636 0.5 -> 0.797 Inexact Rounded +pwsx4146 power 0.0636 0.5 -> 0.252 Inexact Rounded +pwsx4147 power 0.637 0.5 -> 0.798 Inexact Rounded +pwsx4148 power 0.0637 0.5 -> 0.252 Inexact Rounded +pwsx4149 power 0.638 0.5 -> 0.799 Inexact Rounded +pwsx4150 power 0.0638 0.5 -> 0.253 Inexact Rounded +pwsx4151 power 0.639 0.5 -> 0.799 Inexact Rounded +pwsx4152 power 0.0639 0.5 -> 0.253 Inexact Rounded +pwsx4153 power 0.641 0.5 -> 0.801 Inexact Rounded +pwsx4154 power 0.0641 0.5 -> 0.253 Inexact Rounded +pwsx4155 power 0.642 0.5 -> 0.801 Inexact Rounded +pwsx4156 power 0.0642 0.5 -> 0.253 Inexact Rounded +pwsx4157 power 0.643 0.5 -> 0.802 Inexact Rounded +pwsx4158 power 0.0643 0.5 -> 0.254 Inexact Rounded +pwsx4159 power 0.644 0.5 -> 0.802 Inexact Rounded +pwsx4160 power 0.0644 0.5 -> 0.254 Inexact Rounded +pwsx4161 power 0.645 0.5 -> 0.803 Inexact Rounded +pwsx4162 power 0.0645 0.5 -> 0.254 Inexact Rounded +pwsx4163 power 0.646 0.5 -> 0.804 Inexact Rounded +pwsx4164 power 0.0646 0.5 -> 0.254 Inexact Rounded +pwsx4165 power 0.647 0.5 -> 0.804 Inexact Rounded +pwsx4166 power 0.0647 0.5 -> 0.254 Inexact Rounded +pwsx4167 power 0.648 0.5 -> 0.805 Inexact Rounded +pwsx4168 power 0.0648 0.5 -> 0.255 Inexact Rounded +pwsx4169 power 0.649 0.5 -> 0.806 Inexact Rounded +pwsx4170 power 0.0649 0.5 -> 0.255 Inexact Rounded +pwsx4171 power 0.651 0.5 -> 0.807 Inexact Rounded +pwsx4172 power 0.0651 0.5 -> 0.255 Inexact Rounded +pwsx4173 power 0.652 0.5 -> 0.807 Inexact Rounded +pwsx4174 power 0.0652 0.5 -> 0.255 Inexact Rounded +pwsx4175 power 0.653 0.5 -> 0.808 Inexact Rounded +pwsx4176 power 0.0653 0.5 -> 0.256 Inexact Rounded +pwsx4177 power 0.654 0.5 -> 0.809 Inexact Rounded +pwsx4178 power 0.0654 0.5 -> 0.256 Inexact Rounded +pwsx4179 power 0.655 0.5 -> 0.809 Inexact Rounded +pwsx4180 power 0.0655 0.5 -> 0.256 Inexact Rounded +pwsx4181 power 0.656 0.5 -> 0.810 Inexact Rounded +pwsx4182 power 0.0656 0.5 -> 0.256 Inexact Rounded +pwsx4183 power 0.657 0.5 -> 0.811 Inexact Rounded +pwsx4184 power 0.0657 0.5 -> 0.256 Inexact Rounded +pwsx4185 power 0.658 0.5 -> 0.811 Inexact Rounded +pwsx4186 power 0.0658 0.5 -> 0.257 Inexact Rounded +pwsx4187 power 0.659 0.5 -> 0.812 Inexact Rounded +pwsx4188 power 0.0659 0.5 -> 0.257 Inexact Rounded +pwsx4189 power 0.661 0.5 -> 0.813 Inexact Rounded +pwsx4190 power 0.0661 0.5 -> 0.257 Inexact Rounded +pwsx4191 power 0.662 0.5 -> 0.814 Inexact Rounded +pwsx4192 power 0.0662 0.5 -> 0.257 Inexact Rounded +pwsx4193 power 0.663 0.5 -> 0.814 Inexact Rounded +pwsx4194 power 0.0663 0.5 -> 0.257 Inexact Rounded +pwsx4195 power 0.664 0.5 -> 0.815 Inexact Rounded +pwsx4196 power 0.0664 0.5 -> 0.258 Inexact Rounded +pwsx4197 power 0.665 0.5 -> 0.815 Inexact Rounded +pwsx4198 power 0.0665 0.5 -> 0.258 Inexact Rounded +pwsx4199 power 0.666 0.5 -> 0.816 Inexact Rounded +pwsx4200 power 0.0666 0.5 -> 0.258 Inexact Rounded +pwsx4201 power 0.667 0.5 -> 0.817 Inexact Rounded +pwsx4202 power 0.0667 0.5 -> 0.258 Inexact Rounded +pwsx4203 power 0.668 0.5 -> 0.817 Inexact Rounded +pwsx4204 power 0.0668 0.5 -> 0.258 Inexact Rounded +pwsx4205 power 0.669 0.5 -> 0.818 Inexact Rounded +pwsx4206 power 0.0669 0.5 -> 0.259 Inexact Rounded +pwsx4207 power 0.671 0.5 -> 0.819 Inexact Rounded +pwsx4208 power 0.0671 0.5 -> 0.259 Inexact Rounded +pwsx4209 power 0.672 0.5 -> 0.820 Inexact Rounded +pwsx4210 power 0.0672 0.5 -> 0.259 Inexact Rounded +pwsx4211 power 0.673 0.5 -> 0.820 Inexact Rounded +pwsx4212 power 0.0673 0.5 -> 0.259 Inexact Rounded +pwsx4213 power 0.674 0.5 -> 0.821 Inexact Rounded +pwsx4214 power 0.0674 0.5 -> 0.260 Inexact Rounded +pwsx4215 power 0.675 0.5 -> 0.822 Inexact Rounded +pwsx4216 power 0.0675 0.5 -> 0.260 Inexact Rounded +pwsx4217 power 0.676 0.5 -> 0.822 Inexact Rounded +pwsx4218 power 0.0676 0.5 -> 0.260 Inexact Rounded +pwsx4219 power 0.677 0.5 -> 0.823 Inexact Rounded +pwsx4220 power 0.0677 0.5 -> 0.260 Inexact Rounded +pwsx4221 power 0.678 0.5 -> 0.823 Inexact Rounded +pwsx4222 power 0.0678 0.5 -> 0.260 Inexact Rounded +pwsx4223 power 0.679 0.5 -> 0.824 Inexact Rounded +pwsx4224 power 0.0679 0.5 -> 0.261 Inexact Rounded +pwsx4225 power 0.681 0.5 -> 0.825 Inexact Rounded +pwsx4226 power 0.0681 0.5 -> 0.261 Inexact Rounded +pwsx4227 power 0.682 0.5 -> 0.826 Inexact Rounded +pwsx4228 power 0.0682 0.5 -> 0.261 Inexact Rounded +pwsx4229 power 0.683 0.5 -> 0.826 Inexact Rounded +pwsx4230 power 0.0683 0.5 -> 0.261 Inexact Rounded +pwsx4231 power 0.684 0.5 -> 0.827 Inexact Rounded +pwsx4232 power 0.0684 0.5 -> 0.262 Inexact Rounded +pwsx4233 power 0.685 0.5 -> 0.828 Inexact Rounded +pwsx4234 power 0.0685 0.5 -> 0.262 Inexact Rounded +pwsx4235 power 0.686 0.5 -> 0.828 Inexact Rounded +pwsx4236 power 0.0686 0.5 -> 0.262 Inexact Rounded +pwsx4237 power 0.687 0.5 -> 0.829 Inexact Rounded +pwsx4238 power 0.0687 0.5 -> 0.262 Inexact Rounded +pwsx4239 power 0.688 0.5 -> 0.829 Inexact Rounded +pwsx4240 power 0.0688 0.5 -> 0.262 Inexact Rounded +pwsx4241 power 0.689 0.5 -> 0.830 Inexact Rounded +pwsx4242 power 0.0689 0.5 -> 0.262 Inexact Rounded +pwsx4243 power 0.691 0.5 -> 0.831 Inexact Rounded +pwsx4244 power 0.0691 0.5 -> 0.263 Inexact Rounded +pwsx4245 power 0.692 0.5 -> 0.832 Inexact Rounded +pwsx4246 power 0.0692 0.5 -> 0.263 Inexact Rounded +pwsx4247 power 0.693 0.5 -> 0.832 Inexact Rounded +pwsx4248 power 0.0693 0.5 -> 0.263 Inexact Rounded +pwsx4249 power 0.694 0.5 -> 0.833 Inexact Rounded +pwsx4250 power 0.0694 0.5 -> 0.263 Inexact Rounded +pwsx4251 power 0.695 0.5 -> 0.834 Inexact Rounded +pwsx4252 power 0.0695 0.5 -> 0.264 Inexact Rounded +pwsx4253 power 0.696 0.5 -> 0.834 Inexact Rounded +pwsx4254 power 0.0696 0.5 -> 0.264 Inexact Rounded +pwsx4255 power 0.697 0.5 -> 0.835 Inexact Rounded +pwsx4256 power 0.0697 0.5 -> 0.264 Inexact Rounded +pwsx4257 power 0.698 0.5 -> 0.835 Inexact Rounded +pwsx4258 power 0.0698 0.5 -> 0.264 Inexact Rounded +pwsx4259 power 0.699 0.5 -> 0.836 Inexact Rounded +pwsx4260 power 0.0699 0.5 -> 0.264 Inexact Rounded +pwsx4261 power 0.701 0.5 -> 0.837 Inexact Rounded +pwsx4262 power 0.0701 0.5 -> 0.265 Inexact Rounded +pwsx4263 power 0.702 0.5 -> 0.838 Inexact Rounded +pwsx4264 power 0.0702 0.5 -> 0.265 Inexact Rounded +pwsx4265 power 0.703 0.5 -> 0.838 Inexact Rounded +pwsx4266 power 0.0703 0.5 -> 0.265 Inexact Rounded +pwsx4267 power 0.704 0.5 -> 0.839 Inexact Rounded +pwsx4268 power 0.0704 0.5 -> 0.265 Inexact Rounded +pwsx4269 power 0.705 0.5 -> 0.840 Inexact Rounded +pwsx4270 power 0.0705 0.5 -> 0.266 Inexact Rounded +pwsx4271 power 0.706 0.5 -> 0.840 Inexact Rounded +pwsx4272 power 0.0706 0.5 -> 0.266 Inexact Rounded +pwsx4273 power 0.707 0.5 -> 0.841 Inexact Rounded +pwsx4274 power 0.0707 0.5 -> 0.266 Inexact Rounded +pwsx4275 power 0.708 0.5 -> 0.841 Inexact Rounded +pwsx4276 power 0.0708 0.5 -> 0.266 Inexact Rounded +pwsx4277 power 0.709 0.5 -> 0.842 Inexact Rounded +pwsx4278 power 0.0709 0.5 -> 0.266 Inexact Rounded +pwsx4279 power 0.711 0.5 -> 0.843 Inexact Rounded +pwsx4280 power 0.0711 0.5 -> 0.267 Inexact Rounded +pwsx4281 power 0.712 0.5 -> 0.844 Inexact Rounded +pwsx4282 power 0.0712 0.5 -> 0.267 Inexact Rounded +pwsx4283 power 0.713 0.5 -> 0.844 Inexact Rounded +pwsx4284 power 0.0713 0.5 -> 0.267 Inexact Rounded +pwsx4285 power 0.714 0.5 -> 0.845 Inexact Rounded +pwsx4286 power 0.0714 0.5 -> 0.267 Inexact Rounded +pwsx4287 power 0.715 0.5 -> 0.846 Inexact Rounded +pwsx4288 power 0.0715 0.5 -> 0.267 Inexact Rounded +pwsx4289 power 0.716 0.5 -> 0.846 Inexact Rounded +pwsx4290 power 0.0716 0.5 -> 0.268 Inexact Rounded +pwsx4291 power 0.717 0.5 -> 0.847 Inexact Rounded +pwsx4292 power 0.0717 0.5 -> 0.268 Inexact Rounded +pwsx4293 power 0.718 0.5 -> 0.847 Inexact Rounded +pwsx4294 power 0.0718 0.5 -> 0.268 Inexact Rounded +pwsx4295 power 0.719 0.5 -> 0.848 Inexact Rounded +pwsx4296 power 0.0719 0.5 -> 0.268 Inexact Rounded +pwsx4297 power 0.721 0.5 -> 0.849 Inexact Rounded +pwsx4298 power 0.0721 0.5 -> 0.269 Inexact Rounded +pwsx4299 power 0.722 0.5 -> 0.850 Inexact Rounded +pwsx4300 power 0.0722 0.5 -> 0.269 Inexact Rounded +pwsx4301 power 0.723 0.5 -> 0.850 Inexact Rounded +pwsx4302 power 0.0723 0.5 -> 0.269 Inexact Rounded +pwsx4303 power 0.724 0.5 -> 0.851 Inexact Rounded +pwsx4304 power 0.0724 0.5 -> 0.269 Inexact Rounded +pwsx4305 power 0.725 0.5 -> 0.851 Inexact Rounded +pwsx4306 power 0.0725 0.5 -> 0.269 Inexact Rounded +pwsx4307 power 0.726 0.5 -> 0.852 Inexact Rounded +pwsx4308 power 0.0726 0.5 -> 0.269 Inexact Rounded +pwsx4309 power 0.727 0.5 -> 0.853 Inexact Rounded +pwsx4310 power 0.0727 0.5 -> 0.270 Inexact Rounded +pwsx4311 power 0.728 0.5 -> 0.853 Inexact Rounded +pwsx4312 power 0.0728 0.5 -> 0.270 Inexact Rounded +pwsx4313 power 0.729 0.5 -> 0.854 Inexact Rounded +pwsx4314 power 0.0729 0.5 -> 0.270 Inexact Rounded +pwsx4315 power 0.731 0.5 -> 0.855 Inexact Rounded +pwsx4316 power 0.0731 0.5 -> 0.270 Inexact Rounded +pwsx4317 power 0.732 0.5 -> 0.856 Inexact Rounded +pwsx4318 power 0.0732 0.5 -> 0.271 Inexact Rounded +pwsx4319 power 0.733 0.5 -> 0.856 Inexact Rounded +pwsx4320 power 0.0733 0.5 -> 0.271 Inexact Rounded +pwsx4321 power 0.734 0.5 -> 0.857 Inexact Rounded +pwsx4322 power 0.0734 0.5 -> 0.271 Inexact Rounded +pwsx4323 power 0.735 0.5 -> 0.857 Inexact Rounded +pwsx4324 power 0.0735 0.5 -> 0.271 Inexact Rounded +pwsx4325 power 0.736 0.5 -> 0.858 Inexact Rounded +pwsx4326 power 0.0736 0.5 -> 0.271 Inexact Rounded +pwsx4327 power 0.737 0.5 -> 0.858 Inexact Rounded +pwsx4328 power 0.0737 0.5 -> 0.271 Inexact Rounded +pwsx4329 power 0.738 0.5 -> 0.859 Inexact Rounded +pwsx4330 power 0.0738 0.5 -> 0.272 Inexact Rounded +pwsx4331 power 0.739 0.5 -> 0.860 Inexact Rounded +pwsx4332 power 0.0739 0.5 -> 0.272 Inexact Rounded +pwsx4333 power 0.741 0.5 -> 0.861 Inexact Rounded +pwsx4334 power 0.0741 0.5 -> 0.272 Inexact Rounded +pwsx4335 power 0.742 0.5 -> 0.861 Inexact Rounded +pwsx4336 power 0.0742 0.5 -> 0.272 Inexact Rounded +pwsx4337 power 0.743 0.5 -> 0.862 Inexact Rounded +pwsx4338 power 0.0743 0.5 -> 0.273 Inexact Rounded +pwsx4339 power 0.744 0.5 -> 0.863 Inexact Rounded +pwsx4340 power 0.0744 0.5 -> 0.273 Inexact Rounded +pwsx4341 power 0.745 0.5 -> 0.863 Inexact Rounded +pwsx4342 power 0.0745 0.5 -> 0.273 Inexact Rounded +pwsx4343 power 0.746 0.5 -> 0.864 Inexact Rounded +pwsx4344 power 0.0746 0.5 -> 0.273 Inexact Rounded +pwsx4345 power 0.747 0.5 -> 0.864 Inexact Rounded +pwsx4346 power 0.0747 0.5 -> 0.273 Inexact Rounded +pwsx4347 power 0.748 0.5 -> 0.865 Inexact Rounded +pwsx4348 power 0.0748 0.5 -> 0.273 Inexact Rounded +pwsx4349 power 0.749 0.5 -> 0.865 Inexact Rounded +pwsx4350 power 0.0749 0.5 -> 0.274 Inexact Rounded +pwsx4351 power 0.751 0.5 -> 0.867 Inexact Rounded +pwsx4352 power 0.0751 0.5 -> 0.274 Inexact Rounded +pwsx4353 power 0.752 0.5 -> 0.867 Inexact Rounded +pwsx4354 power 0.0752 0.5 -> 0.274 Inexact Rounded +pwsx4355 power 0.753 0.5 -> 0.868 Inexact Rounded +pwsx4356 power 0.0753 0.5 -> 0.274 Inexact Rounded +pwsx4357 power 0.754 0.5 -> 0.868 Inexact Rounded +pwsx4358 power 0.0754 0.5 -> 0.275 Inexact Rounded +pwsx4359 power 0.755 0.5 -> 0.869 Inexact Rounded +pwsx4360 power 0.0755 0.5 -> 0.275 Inexact Rounded +pwsx4361 power 0.756 0.5 -> 0.869 Inexact Rounded +pwsx4362 power 0.0756 0.5 -> 0.275 Inexact Rounded +pwsx4363 power 0.757 0.5 -> 0.870 Inexact Rounded +pwsx4364 power 0.0757 0.5 -> 0.275 Inexact Rounded +pwsx4365 power 0.758 0.5 -> 0.871 Inexact Rounded +pwsx4366 power 0.0758 0.5 -> 0.275 Inexact Rounded +pwsx4367 power 0.759 0.5 -> 0.871 Inexact Rounded +pwsx4368 power 0.0759 0.5 -> 0.275 Inexact Rounded +pwsx4369 power 0.761 0.5 -> 0.872 Inexact Rounded +pwsx4370 power 0.0761 0.5 -> 0.276 Inexact Rounded +pwsx4371 power 0.762 0.5 -> 0.873 Inexact Rounded +pwsx4372 power 0.0762 0.5 -> 0.276 Inexact Rounded +pwsx4373 power 0.763 0.5 -> 0.873 Inexact Rounded +pwsx4374 power 0.0763 0.5 -> 0.276 Inexact Rounded +pwsx4375 power 0.764 0.5 -> 0.874 Inexact Rounded +pwsx4376 power 0.0764 0.5 -> 0.276 Inexact Rounded +pwsx4377 power 0.765 0.5 -> 0.875 Inexact Rounded +pwsx4378 power 0.0765 0.5 -> 0.277 Inexact Rounded +pwsx4379 power 0.766 0.5 -> 0.875 Inexact Rounded +pwsx4380 power 0.0766 0.5 -> 0.277 Inexact Rounded +pwsx4381 power 0.767 0.5 -> 0.876 Inexact Rounded +pwsx4382 power 0.0767 0.5 -> 0.277 Inexact Rounded +pwsx4383 power 0.768 0.5 -> 0.876 Inexact Rounded +pwsx4384 power 0.0768 0.5 -> 0.277 Inexact Rounded +pwsx4385 power 0.769 0.5 -> 0.877 Inexact Rounded +pwsx4386 power 0.0769 0.5 -> 0.277 Inexact Rounded +pwsx4387 power 0.771 0.5 -> 0.878 Inexact Rounded +pwsx4388 power 0.0771 0.5 -> 0.278 Inexact Rounded +pwsx4389 power 0.772 0.5 -> 0.879 Inexact Rounded +pwsx4390 power 0.0772 0.5 -> 0.278 Inexact Rounded +pwsx4391 power 0.773 0.5 -> 0.879 Inexact Rounded +pwsx4392 power 0.0773 0.5 -> 0.278 Inexact Rounded +pwsx4393 power 0.774 0.5 -> 0.880 Inexact Rounded +pwsx4394 power 0.0774 0.5 -> 0.278 Inexact Rounded +pwsx4395 power 0.775 0.5 -> 0.880 Inexact Rounded +pwsx4396 power 0.0775 0.5 -> 0.278 Inexact Rounded +pwsx4397 power 0.776 0.5 -> 0.881 Inexact Rounded +pwsx4398 power 0.0776 0.5 -> 0.279 Inexact Rounded +pwsx4399 power 0.777 0.5 -> 0.881 Inexact Rounded +pwsx4400 power 0.0777 0.5 -> 0.279 Inexact Rounded +pwsx4401 power 0.778 0.5 -> 0.882 Inexact Rounded +pwsx4402 power 0.0778 0.5 -> 0.279 Inexact Rounded +pwsx4403 power 0.779 0.5 -> 0.883 Inexact Rounded +pwsx4404 power 0.0779 0.5 -> 0.279 Inexact Rounded +pwsx4405 power 0.781 0.5 -> 0.884 Inexact Rounded +pwsx4406 power 0.0781 0.5 -> 0.279 Inexact Rounded +pwsx4407 power 0.782 0.5 -> 0.884 Inexact Rounded +pwsx4408 power 0.0782 0.5 -> 0.280 Inexact Rounded +pwsx4409 power 0.783 0.5 -> 0.885 Inexact Rounded +pwsx4410 power 0.0783 0.5 -> 0.280 Inexact Rounded +pwsx4411 power 0.784 0.5 -> 0.885 Inexact Rounded +pwsx4412 power 0.0784 0.5 -> 0.280 Inexact Rounded +pwsx4413 power 0.785 0.5 -> 0.886 Inexact Rounded +pwsx4414 power 0.0785 0.5 -> 0.280 Inexact Rounded +pwsx4415 power 0.786 0.5 -> 0.887 Inexact Rounded +pwsx4416 power 0.0786 0.5 -> 0.280 Inexact Rounded +pwsx4417 power 0.787 0.5 -> 0.887 Inexact Rounded +pwsx4418 power 0.0787 0.5 -> 0.281 Inexact Rounded +pwsx4419 power 0.788 0.5 -> 0.888 Inexact Rounded +pwsx4420 power 0.0788 0.5 -> 0.281 Inexact Rounded +pwsx4421 power 0.789 0.5 -> 0.888 Inexact Rounded +pwsx4422 power 0.0789 0.5 -> 0.281 Inexact Rounded +pwsx4423 power 0.791 0.5 -> 0.889 Inexact Rounded +pwsx4424 power 0.0791 0.5 -> 0.281 Inexact Rounded +pwsx4425 power 0.792 0.5 -> 0.890 Inexact Rounded +pwsx4426 power 0.0792 0.5 -> 0.281 Inexact Rounded +pwsx4427 power 0.793 0.5 -> 0.891 Inexact Rounded +pwsx4428 power 0.0793 0.5 -> 0.282 Inexact Rounded +pwsx4429 power 0.794 0.5 -> 0.891 Inexact Rounded +pwsx4430 power 0.0794 0.5 -> 0.282 Inexact Rounded +pwsx4431 power 0.795 0.5 -> 0.892 Inexact Rounded +pwsx4432 power 0.0795 0.5 -> 0.282 Inexact Rounded +pwsx4433 power 0.796 0.5 -> 0.892 Inexact Rounded +pwsx4434 power 0.0796 0.5 -> 0.282 Inexact Rounded +pwsx4435 power 0.797 0.5 -> 0.893 Inexact Rounded +pwsx4436 power 0.0797 0.5 -> 0.282 Inexact Rounded +pwsx4437 power 0.798 0.5 -> 0.893 Inexact Rounded +pwsx4438 power 0.0798 0.5 -> 0.282 Inexact Rounded +pwsx4439 power 0.799 0.5 -> 0.894 Inexact Rounded +pwsx4440 power 0.0799 0.5 -> 0.283 Inexact Rounded +pwsx4441 power 0.801 0.5 -> 0.895 Inexact Rounded +pwsx4442 power 0.0801 0.5 -> 0.283 Inexact Rounded +pwsx4443 power 0.802 0.5 -> 0.896 Inexact Rounded +pwsx4444 power 0.0802 0.5 -> 0.283 Inexact Rounded +pwsx4445 power 0.803 0.5 -> 0.896 Inexact Rounded +pwsx4446 power 0.0803 0.5 -> 0.283 Inexact Rounded +pwsx4447 power 0.804 0.5 -> 0.897 Inexact Rounded +pwsx4448 power 0.0804 0.5 -> 0.284 Inexact Rounded +pwsx4449 power 0.805 0.5 -> 0.897 Inexact Rounded +pwsx4450 power 0.0805 0.5 -> 0.284 Inexact Rounded +pwsx4451 power 0.806 0.5 -> 0.898 Inexact Rounded +pwsx4452 power 0.0806 0.5 -> 0.284 Inexact Rounded +pwsx4453 power 0.807 0.5 -> 0.898 Inexact Rounded +pwsx4454 power 0.0807 0.5 -> 0.284 Inexact Rounded +pwsx4455 power 0.808 0.5 -> 0.899 Inexact Rounded +pwsx4456 power 0.0808 0.5 -> 0.284 Inexact Rounded +pwsx4457 power 0.809 0.5 -> 0.899 Inexact Rounded +pwsx4458 power 0.0809 0.5 -> 0.284 Inexact Rounded +pwsx4459 power 0.811 0.5 -> 0.901 Inexact Rounded +pwsx4460 power 0.0811 0.5 -> 0.285 Inexact Rounded +pwsx4461 power 0.812 0.5 -> 0.901 Inexact Rounded +pwsx4462 power 0.0812 0.5 -> 0.285 Inexact Rounded +pwsx4463 power 0.813 0.5 -> 0.902 Inexact Rounded +pwsx4464 power 0.0813 0.5 -> 0.285 Inexact Rounded +pwsx4465 power 0.814 0.5 -> 0.902 Inexact Rounded +pwsx4466 power 0.0814 0.5 -> 0.285 Inexact Rounded +pwsx4467 power 0.815 0.5 -> 0.903 Inexact Rounded +pwsx4468 power 0.0815 0.5 -> 0.285 Inexact Rounded +pwsx4469 power 0.816 0.5 -> 0.903 Inexact Rounded +pwsx4470 power 0.0816 0.5 -> 0.286 Inexact Rounded +pwsx4471 power 0.817 0.5 -> 0.904 Inexact Rounded +pwsx4472 power 0.0817 0.5 -> 0.286 Inexact Rounded +pwsx4473 power 0.818 0.5 -> 0.904 Inexact Rounded +pwsx4474 power 0.0818 0.5 -> 0.286 Inexact Rounded +pwsx4475 power 0.819 0.5 -> 0.905 Inexact Rounded +pwsx4476 power 0.0819 0.5 -> 0.286 Inexact Rounded +pwsx4477 power 0.821 0.5 -> 0.906 Inexact Rounded +pwsx4478 power 0.0821 0.5 -> 0.287 Inexact Rounded +pwsx4479 power 0.822 0.5 -> 0.907 Inexact Rounded +pwsx4480 power 0.0822 0.5 -> 0.287 Inexact Rounded +pwsx4481 power 0.823 0.5 -> 0.907 Inexact Rounded +pwsx4482 power 0.0823 0.5 -> 0.287 Inexact Rounded +pwsx4483 power 0.824 0.5 -> 0.908 Inexact Rounded +pwsx4484 power 0.0824 0.5 -> 0.287 Inexact Rounded +pwsx4485 power 0.825 0.5 -> 0.908 Inexact Rounded +pwsx4486 power 0.0825 0.5 -> 0.287 Inexact Rounded +pwsx4487 power 0.826 0.5 -> 0.909 Inexact Rounded +pwsx4488 power 0.0826 0.5 -> 0.287 Inexact Rounded +pwsx4489 power 0.827 0.5 -> 0.909 Inexact Rounded +pwsx4490 power 0.0827 0.5 -> 0.288 Inexact Rounded +pwsx4491 power 0.828 0.5 -> 0.910 Inexact Rounded +pwsx4492 power 0.0828 0.5 -> 0.288 Inexact Rounded +pwsx4493 power 0.829 0.5 -> 0.910 Inexact Rounded +pwsx4494 power 0.0829 0.5 -> 0.288 Inexact Rounded +pwsx4495 power 0.831 0.5 -> 0.912 Inexact Rounded +pwsx4496 power 0.0831 0.5 -> 0.288 Inexact Rounded +pwsx4497 power 0.832 0.5 -> 0.912 Inexact Rounded +pwsx4498 power 0.0832 0.5 -> 0.288 Inexact Rounded +pwsx4499 power 0.833 0.5 -> 0.913 Inexact Rounded +pwsx4500 power 0.0833 0.5 -> 0.289 Inexact Rounded +pwsx4501 power 0.834 0.5 -> 0.913 Inexact Rounded +pwsx4502 power 0.0834 0.5 -> 0.289 Inexact Rounded +pwsx4503 power 0.835 0.5 -> 0.914 Inexact Rounded +pwsx4504 power 0.0835 0.5 -> 0.289 Inexact Rounded +pwsx4505 power 0.836 0.5 -> 0.914 Inexact Rounded +pwsx4506 power 0.0836 0.5 -> 0.289 Inexact Rounded +pwsx4507 power 0.837 0.5 -> 0.915 Inexact Rounded +pwsx4508 power 0.0837 0.5 -> 0.289 Inexact Rounded +pwsx4509 power 0.838 0.5 -> 0.915 Inexact Rounded +pwsx4510 power 0.0838 0.5 -> 0.289 Inexact Rounded +pwsx4511 power 0.839 0.5 -> 0.916 Inexact Rounded +pwsx4512 power 0.0839 0.5 -> 0.290 Inexact Rounded +pwsx4513 power 0.841 0.5 -> 0.917 Inexact Rounded +pwsx4514 power 0.0841 0.5 -> 0.290 Inexact Rounded +pwsx4515 power 0.842 0.5 -> 0.918 Inexact Rounded +pwsx4516 power 0.0842 0.5 -> 0.290 Inexact Rounded +pwsx4517 power 0.843 0.5 -> 0.918 Inexact Rounded +pwsx4518 power 0.0843 0.5 -> 0.290 Inexact Rounded +pwsx4519 power 0.844 0.5 -> 0.919 Inexact Rounded +pwsx4520 power 0.0844 0.5 -> 0.291 Inexact Rounded +pwsx4521 power 0.845 0.5 -> 0.919 Inexact Rounded +pwsx4522 power 0.0845 0.5 -> 0.291 Inexact Rounded +pwsx4523 power 0.846 0.5 -> 0.920 Inexact Rounded +pwsx4524 power 0.0846 0.5 -> 0.291 Inexact Rounded +pwsx4525 power 0.847 0.5 -> 0.920 Inexact Rounded +pwsx4526 power 0.0847 0.5 -> 0.291 Inexact Rounded +pwsx4527 power 0.848 0.5 -> 0.921 Inexact Rounded +pwsx4528 power 0.0848 0.5 -> 0.291 Inexact Rounded +pwsx4529 power 0.849 0.5 -> 0.921 Inexact Rounded +pwsx4530 power 0.0849 0.5 -> 0.291 Inexact Rounded +pwsx4531 power 0.851 0.5 -> 0.922 Inexact Rounded +pwsx4532 power 0.0851 0.5 -> 0.292 Inexact Rounded +pwsx4533 power 0.852 0.5 -> 0.923 Inexact Rounded +pwsx4534 power 0.0852 0.5 -> 0.292 Inexact Rounded +pwsx4535 power 0.853 0.5 -> 0.924 Inexact Rounded +pwsx4536 power 0.0853 0.5 -> 0.292 Inexact Rounded +pwsx4537 power 0.854 0.5 -> 0.924 Inexact Rounded +pwsx4538 power 0.0854 0.5 -> 0.292 Inexact Rounded +pwsx4539 power 0.855 0.5 -> 0.925 Inexact Rounded +pwsx4540 power 0.0855 0.5 -> 0.292 Inexact Rounded +pwsx4541 power 0.856 0.5 -> 0.925 Inexact Rounded +pwsx4542 power 0.0856 0.5 -> 0.293 Inexact Rounded +pwsx4543 power 0.857 0.5 -> 0.926 Inexact Rounded +pwsx4544 power 0.0857 0.5 -> 0.293 Inexact Rounded +pwsx4545 power 0.858 0.5 -> 0.926 Inexact Rounded +pwsx4546 power 0.0858 0.5 -> 0.293 Inexact Rounded +pwsx4547 power 0.859 0.5 -> 0.927 Inexact Rounded +pwsx4548 power 0.0859 0.5 -> 0.293 Inexact Rounded +pwsx4549 power 0.861 0.5 -> 0.928 Inexact Rounded +pwsx4550 power 0.0861 0.5 -> 0.293 Inexact Rounded +pwsx4551 power 0.862 0.5 -> 0.928 Inexact Rounded +pwsx4552 power 0.0862 0.5 -> 0.294 Inexact Rounded +pwsx4553 power 0.863 0.5 -> 0.929 Inexact Rounded +pwsx4554 power 0.0863 0.5 -> 0.294 Inexact Rounded +pwsx4555 power 0.864 0.5 -> 0.930 Inexact Rounded +pwsx4556 power 0.0864 0.5 -> 0.294 Inexact Rounded +pwsx4557 power 0.865 0.5 -> 0.930 Inexact Rounded +pwsx4558 power 0.0865 0.5 -> 0.294 Inexact Rounded +pwsx4559 power 0.866 0.5 -> 0.931 Inexact Rounded +pwsx4560 power 0.0866 0.5 -> 0.294 Inexact Rounded +pwsx4561 power 0.867 0.5 -> 0.931 Inexact Rounded +pwsx4562 power 0.0867 0.5 -> 0.294 Inexact Rounded +pwsx4563 power 0.868 0.5 -> 0.932 Inexact Rounded +pwsx4564 power 0.0868 0.5 -> 0.295 Inexact Rounded +pwsx4565 power 0.869 0.5 -> 0.932 Inexact Rounded +pwsx4566 power 0.0869 0.5 -> 0.295 Inexact Rounded +pwsx4567 power 0.871 0.5 -> 0.933 Inexact Rounded +pwsx4568 power 0.0871 0.5 -> 0.295 Inexact Rounded +pwsx4569 power 0.872 0.5 -> 0.934 Inexact Rounded +pwsx4570 power 0.0872 0.5 -> 0.295 Inexact Rounded +pwsx4571 power 0.873 0.5 -> 0.934 Inexact Rounded +pwsx4572 power 0.0873 0.5 -> 0.295 Inexact Rounded +pwsx4573 power 0.874 0.5 -> 0.935 Inexact Rounded +pwsx4574 power 0.0874 0.5 -> 0.296 Inexact Rounded +pwsx4575 power 0.875 0.5 -> 0.935 Inexact Rounded +pwsx4576 power 0.0875 0.5 -> 0.296 Inexact Rounded +pwsx4577 power 0.876 0.5 -> 0.936 Inexact Rounded +pwsx4578 power 0.0876 0.5 -> 0.296 Inexact Rounded +pwsx4579 power 0.877 0.5 -> 0.936 Inexact Rounded +pwsx4580 power 0.0877 0.5 -> 0.296 Inexact Rounded +pwsx4581 power 0.878 0.5 -> 0.937 Inexact Rounded +pwsx4582 power 0.0878 0.5 -> 0.296 Inexact Rounded +pwsx4583 power 0.879 0.5 -> 0.938 Inexact Rounded +pwsx4584 power 0.0879 0.5 -> 0.296 Inexact Rounded +pwsx4585 power 0.881 0.5 -> 0.939 Inexact Rounded +pwsx4586 power 0.0881 0.5 -> 0.297 Inexact Rounded +pwsx4587 power 0.882 0.5 -> 0.939 Inexact Rounded +pwsx4588 power 0.0882 0.5 -> 0.297 Inexact Rounded +pwsx4589 power 0.883 0.5 -> 0.940 Inexact Rounded +pwsx4590 power 0.0883 0.5 -> 0.297 Inexact Rounded +pwsx4591 power 0.884 0.5 -> 0.940 Inexact Rounded +pwsx4592 power 0.0884 0.5 -> 0.297 Inexact Rounded +pwsx4593 power 0.885 0.5 -> 0.941 Inexact Rounded +pwsx4594 power 0.0885 0.5 -> 0.297 Inexact Rounded +pwsx4595 power 0.886 0.5 -> 0.941 Inexact Rounded +pwsx4596 power 0.0886 0.5 -> 0.298 Inexact Rounded +pwsx4597 power 0.887 0.5 -> 0.942 Inexact Rounded +pwsx4598 power 0.0887 0.5 -> 0.298 Inexact Rounded +pwsx4599 power 0.888 0.5 -> 0.942 Inexact Rounded +pwsx4600 power 0.0888 0.5 -> 0.298 Inexact Rounded +pwsx4601 power 0.889 0.5 -> 0.943 Inexact Rounded +pwsx4602 power 0.0889 0.5 -> 0.298 Inexact Rounded +pwsx4603 power 0.891 0.5 -> 0.944 Inexact Rounded +pwsx4604 power 0.0891 0.5 -> 0.298 Inexact Rounded +pwsx4605 power 0.892 0.5 -> 0.944 Inexact Rounded +pwsx4606 power 0.0892 0.5 -> 0.299 Inexact Rounded +pwsx4607 power 0.893 0.5 -> 0.945 Inexact Rounded +pwsx4608 power 0.0893 0.5 -> 0.299 Inexact Rounded +pwsx4609 power 0.894 0.5 -> 0.946 Inexact Rounded +pwsx4610 power 0.0894 0.5 -> 0.299 Inexact Rounded +pwsx4611 power 0.895 0.5 -> 0.946 Inexact Rounded +pwsx4612 power 0.0895 0.5 -> 0.299 Inexact Rounded +pwsx4613 power 0.896 0.5 -> 0.947 Inexact Rounded +pwsx4614 power 0.0896 0.5 -> 0.299 Inexact Rounded +pwsx4615 power 0.897 0.5 -> 0.947 Inexact Rounded +pwsx4616 power 0.0897 0.5 -> 0.299 Inexact Rounded +pwsx4617 power 0.898 0.5 -> 0.948 Inexact Rounded +pwsx4618 power 0.0898 0.5 -> 0.300 Inexact Rounded +pwsx4619 power 0.899 0.5 -> 0.948 Inexact Rounded +pwsx4620 power 0.0899 0.5 -> 0.300 Inexact Rounded +pwsx4621 power 0.901 0.5 -> 0.949 Inexact Rounded +pwsx4622 power 0.0901 0.5 -> 0.300 Inexact Rounded +pwsx4623 power 0.902 0.5 -> 0.950 Inexact Rounded +pwsx4624 power 0.0902 0.5 -> 0.300 Inexact Rounded +pwsx4625 power 0.903 0.5 -> 0.950 Inexact Rounded +pwsx4626 power 0.0903 0.5 -> 0.300 Inexact Rounded +pwsx4627 power 0.904 0.5 -> 0.951 Inexact Rounded +pwsx4628 power 0.0904 0.5 -> 0.301 Inexact Rounded +pwsx4629 power 0.905 0.5 -> 0.951 Inexact Rounded +pwsx4630 power 0.0905 0.5 -> 0.301 Inexact Rounded +pwsx4631 power 0.906 0.5 -> 0.952 Inexact Rounded +pwsx4632 power 0.0906 0.5 -> 0.301 Inexact Rounded +pwsx4633 power 0.907 0.5 -> 0.952 Inexact Rounded +pwsx4634 power 0.0907 0.5 -> 0.301 Inexact Rounded +pwsx4635 power 0.908 0.5 -> 0.953 Inexact Rounded +pwsx4636 power 0.0908 0.5 -> 0.301 Inexact Rounded +pwsx4637 power 0.909 0.5 -> 0.953 Inexact Rounded +pwsx4638 power 0.0909 0.5 -> 0.301 Inexact Rounded +pwsx4639 power 0.911 0.5 -> 0.954 Inexact Rounded +pwsx4640 power 0.0911 0.5 -> 0.302 Inexact Rounded +pwsx4641 power 0.912 0.5 -> 0.955 Inexact Rounded +pwsx4642 power 0.0912 0.5 -> 0.302 Inexact Rounded +pwsx4643 power 0.913 0.5 -> 0.956 Inexact Rounded +pwsx4644 power 0.0913 0.5 -> 0.302 Inexact Rounded +pwsx4645 power 0.914 0.5 -> 0.956 Inexact Rounded +pwsx4646 power 0.0914 0.5 -> 0.302 Inexact Rounded +pwsx4647 power 0.915 0.5 -> 0.957 Inexact Rounded +pwsx4648 power 0.0915 0.5 -> 0.302 Inexact Rounded +pwsx4649 power 0.916 0.5 -> 0.957 Inexact Rounded +pwsx4650 power 0.0916 0.5 -> 0.303 Inexact Rounded +pwsx4651 power 0.917 0.5 -> 0.958 Inexact Rounded +pwsx4652 power 0.0917 0.5 -> 0.303 Inexact Rounded +pwsx4653 power 0.918 0.5 -> 0.958 Inexact Rounded +pwsx4654 power 0.0918 0.5 -> 0.303 Inexact Rounded +pwsx4655 power 0.919 0.5 -> 0.959 Inexact Rounded +pwsx4656 power 0.0919 0.5 -> 0.303 Inexact Rounded +pwsx4657 power 0.921 0.5 -> 0.960 Inexact Rounded +pwsx4658 power 0.0921 0.5 -> 0.303 Inexact Rounded +pwsx4659 power 0.922 0.5 -> 0.960 Inexact Rounded +pwsx4660 power 0.0922 0.5 -> 0.304 Inexact Rounded +pwsx4661 power 0.923 0.5 -> 0.961 Inexact Rounded +pwsx4662 power 0.0923 0.5 -> 0.304 Inexact Rounded +pwsx4663 power 0.924 0.5 -> 0.961 Inexact Rounded +pwsx4664 power 0.0924 0.5 -> 0.304 Inexact Rounded +pwsx4665 power 0.925 0.5 -> 0.962 Inexact Rounded +pwsx4666 power 0.0925 0.5 -> 0.304 Inexact Rounded +pwsx4667 power 0.926 0.5 -> 0.962 Inexact Rounded +pwsx4668 power 0.0926 0.5 -> 0.304 Inexact Rounded +pwsx4669 power 0.927 0.5 -> 0.963 Inexact Rounded +pwsx4670 power 0.0927 0.5 -> 0.304 Inexact Rounded +pwsx4671 power 0.928 0.5 -> 0.963 Inexact Rounded +pwsx4672 power 0.0928 0.5 -> 0.305 Inexact Rounded +pwsx4673 power 0.929 0.5 -> 0.964 Inexact Rounded +pwsx4674 power 0.0929 0.5 -> 0.305 Inexact Rounded +pwsx4675 power 0.931 0.5 -> 0.965 Inexact Rounded +pwsx4676 power 0.0931 0.5 -> 0.305 Inexact Rounded +pwsx4677 power 0.932 0.5 -> 0.965 Inexact Rounded +pwsx4678 power 0.0932 0.5 -> 0.305 Inexact Rounded +pwsx4679 power 0.933 0.5 -> 0.966 Inexact Rounded +pwsx4680 power 0.0933 0.5 -> 0.305 Inexact Rounded +pwsx4681 power 0.934 0.5 -> 0.966 Inexact Rounded +pwsx4682 power 0.0934 0.5 -> 0.306 Inexact Rounded +pwsx4683 power 0.935 0.5 -> 0.967 Inexact Rounded +pwsx4684 power 0.0935 0.5 -> 0.306 Inexact Rounded +pwsx4685 power 0.936 0.5 -> 0.967 Inexact Rounded +pwsx4686 power 0.0936 0.5 -> 0.306 Inexact Rounded +pwsx4687 power 0.937 0.5 -> 0.968 Inexact Rounded +pwsx4688 power 0.0937 0.5 -> 0.306 Inexact Rounded +pwsx4689 power 0.938 0.5 -> 0.969 Inexact Rounded +pwsx4690 power 0.0938 0.5 -> 0.306 Inexact Rounded +pwsx4691 power 0.939 0.5 -> 0.969 Inexact Rounded +pwsx4692 power 0.0939 0.5 -> 0.306 Inexact Rounded +pwsx4693 power 0.941 0.5 -> 0.970 Inexact Rounded +pwsx4694 power 0.0941 0.5 -> 0.307 Inexact Rounded +pwsx4695 power 0.942 0.5 -> 0.971 Inexact Rounded +pwsx4696 power 0.0942 0.5 -> 0.307 Inexact Rounded +pwsx4697 power 0.943 0.5 -> 0.971 Inexact Rounded +pwsx4698 power 0.0943 0.5 -> 0.307 Inexact Rounded +pwsx4699 power 0.944 0.5 -> 0.972 Inexact Rounded +pwsx4700 power 0.0944 0.5 -> 0.307 Inexact Rounded +pwsx4701 power 0.945 0.5 -> 0.972 Inexact Rounded +pwsx4702 power 0.0945 0.5 -> 0.307 Inexact Rounded +pwsx4703 power 0.946 0.5 -> 0.973 Inexact Rounded +pwsx4704 power 0.0946 0.5 -> 0.308 Inexact Rounded +pwsx4705 power 0.947 0.5 -> 0.973 Inexact Rounded +pwsx4706 power 0.0947 0.5 -> 0.308 Inexact Rounded +pwsx4707 power 0.948 0.5 -> 0.974 Inexact Rounded +pwsx4708 power 0.0948 0.5 -> 0.308 Inexact Rounded +pwsx4709 power 0.949 0.5 -> 0.974 Inexact Rounded +pwsx4710 power 0.0949 0.5 -> 0.308 Inexact Rounded +pwsx4711 power 0.951 0.5 -> 0.975 Inexact Rounded +pwsx4712 power 0.0951 0.5 -> 0.308 Inexact Rounded +pwsx4713 power 0.952 0.5 -> 0.976 Inexact Rounded +pwsx4714 power 0.0952 0.5 -> 0.309 Inexact Rounded +pwsx4715 power 0.953 0.5 -> 0.976 Inexact Rounded +pwsx4716 power 0.0953 0.5 -> 0.309 Inexact Rounded +pwsx4717 power 0.954 0.5 -> 0.977 Inexact Rounded +pwsx4718 power 0.0954 0.5 -> 0.309 Inexact Rounded +pwsx4719 power 0.955 0.5 -> 0.977 Inexact Rounded +pwsx4720 power 0.0955 0.5 -> 0.309 Inexact Rounded +pwsx4721 power 0.956 0.5 -> 0.978 Inexact Rounded +pwsx4722 power 0.0956 0.5 -> 0.309 Inexact Rounded +pwsx4723 power 0.957 0.5 -> 0.978 Inexact Rounded +pwsx4724 power 0.0957 0.5 -> 0.309 Inexact Rounded +pwsx4725 power 0.958 0.5 -> 0.979 Inexact Rounded +pwsx4726 power 0.0958 0.5 -> 0.310 Inexact Rounded +pwsx4727 power 0.959 0.5 -> 0.979 Inexact Rounded +pwsx4728 power 0.0959 0.5 -> 0.310 Inexact Rounded +pwsx4729 power 0.961 0.5 -> 0.980 Inexact Rounded +pwsx4730 power 0.0961 0.5 -> 0.310 Inexact Rounded +pwsx4731 power 0.962 0.5 -> 0.981 Inexact Rounded +pwsx4732 power 0.0962 0.5 -> 0.310 Inexact Rounded +pwsx4733 power 0.963 0.5 -> 0.981 Inexact Rounded +pwsx4734 power 0.0963 0.5 -> 0.310 Inexact Rounded +pwsx4735 power 0.964 0.5 -> 0.982 Inexact Rounded +pwsx4736 power 0.0964 0.5 -> 0.310 Inexact Rounded +pwsx4737 power 0.965 0.5 -> 0.982 Inexact Rounded +pwsx4738 power 0.0965 0.5 -> 0.311 Inexact Rounded +pwsx4739 power 0.966 0.5 -> 0.983 Inexact Rounded +pwsx4740 power 0.0966 0.5 -> 0.311 Inexact Rounded +pwsx4741 power 0.967 0.5 -> 0.983 Inexact Rounded +pwsx4742 power 0.0967 0.5 -> 0.311 Inexact Rounded +pwsx4743 power 0.968 0.5 -> 0.984 Inexact Rounded +pwsx4744 power 0.0968 0.5 -> 0.311 Inexact Rounded +pwsx4745 power 0.969 0.5 -> 0.984 Inexact Rounded +pwsx4746 power 0.0969 0.5 -> 0.311 Inexact Rounded +pwsx4747 power 0.971 0.5 -> 0.985 Inexact Rounded +pwsx4748 power 0.0971 0.5 -> 0.312 Inexact Rounded +pwsx4749 power 0.972 0.5 -> 0.986 Inexact Rounded +pwsx4750 power 0.0972 0.5 -> 0.312 Inexact Rounded +pwsx4751 power 0.973 0.5 -> 0.986 Inexact Rounded +pwsx4752 power 0.0973 0.5 -> 0.312 Inexact Rounded +pwsx4753 power 0.974 0.5 -> 0.987 Inexact Rounded +pwsx4754 power 0.0974 0.5 -> 0.312 Inexact Rounded +pwsx4755 power 0.975 0.5 -> 0.987 Inexact Rounded +pwsx4756 power 0.0975 0.5 -> 0.312 Inexact Rounded +pwsx4757 power 0.976 0.5 -> 0.988 Inexact Rounded +pwsx4758 power 0.0976 0.5 -> 0.312 Inexact Rounded +pwsx4759 power 0.977 0.5 -> 0.988 Inexact Rounded +pwsx4760 power 0.0977 0.5 -> 0.313 Inexact Rounded +pwsx4761 power 0.978 0.5 -> 0.989 Inexact Rounded +pwsx4762 power 0.0978 0.5 -> 0.313 Inexact Rounded +pwsx4763 power 0.979 0.5 -> 0.989 Inexact Rounded +pwsx4764 power 0.0979 0.5 -> 0.313 Inexact Rounded +pwsx4765 power 0.981 0.5 -> 0.990 Inexact Rounded +pwsx4766 power 0.0981 0.5 -> 0.313 Inexact Rounded +pwsx4767 power 0.982 0.5 -> 0.991 Inexact Rounded +pwsx4768 power 0.0982 0.5 -> 0.313 Inexact Rounded +pwsx4769 power 0.983 0.5 -> 0.991 Inexact Rounded +pwsx4770 power 0.0983 0.5 -> 0.314 Inexact Rounded +pwsx4771 power 0.984 0.5 -> 0.992 Inexact Rounded +pwsx4772 power 0.0984 0.5 -> 0.314 Inexact Rounded +pwsx4773 power 0.985 0.5 -> 0.992 Inexact Rounded +pwsx4774 power 0.0985 0.5 -> 0.314 Inexact Rounded +pwsx4775 power 0.986 0.5 -> 0.993 Inexact Rounded +pwsx4776 power 0.0986 0.5 -> 0.314 Inexact Rounded +pwsx4777 power 0.987 0.5 -> 0.993 Inexact Rounded +pwsx4778 power 0.0987 0.5 -> 0.314 Inexact Rounded +pwsx4779 power 0.988 0.5 -> 0.994 Inexact Rounded +pwsx4780 power 0.0988 0.5 -> 0.314 Inexact Rounded +pwsx4781 power 0.989 0.5 -> 0.994 Inexact Rounded +pwsx4782 power 0.0989 0.5 -> 0.314 Inexact Rounded +pwsx4783 power 0.991 0.5 -> 0.995 Inexact Rounded +pwsx4784 power 0.0991 0.5 -> 0.315 Inexact Rounded +pwsx4785 power 0.992 0.5 -> 0.996 Inexact Rounded +pwsx4786 power 0.0992 0.5 -> 0.315 Inexact Rounded +pwsx4787 power 0.993 0.5 -> 0.996 Inexact Rounded +pwsx4788 power 0.0993 0.5 -> 0.315 Inexact Rounded +pwsx4789 power 0.994 0.5 -> 0.997 Inexact Rounded +pwsx4790 power 0.0994 0.5 -> 0.315 Inexact Rounded +pwsx4791 power 0.995 0.5 -> 0.997 Inexact Rounded +pwsx4792 power 0.0995 0.5 -> 0.315 Inexact Rounded +pwsx4793 power 0.996 0.5 -> 0.998 Inexact Rounded +pwsx4794 power 0.0996 0.5 -> 0.316 Inexact Rounded +pwsx4795 power 0.997 0.5 -> 0.998 Inexact Rounded +pwsx4796 power 0.0997 0.5 -> 0.316 Inexact Rounded +pwsx4797 power 0.998 0.5 -> 0.999 Inexact Rounded +pwsx4798 power 0.0998 0.5 -> 0.316 Inexact Rounded +pwsx4799 power 0.999 0.5 -> 0.999 Inexact Rounded +pwsx4800 power 0.0999 0.5 -> 0.316 Inexact Rounded + +-- A group of precision 4 tests where Hull & Abrham adjustments are +-- needed in some cases (both up and down) [see Hull1985b] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 4 +pwsx5001 power 0.0118 0.5 -> 0.1086 Inexact Rounded +pwsx5002 power 0.119 0.5 -> 0.3450 Inexact Rounded +pwsx5003 power 0.0119 0.5 -> 0.1091 Inexact Rounded +pwsx5004 power 0.121 0.5 -> 0.3479 Inexact Rounded +pwsx5005 power 0.0121 0.5 -> 0.1100 Inexact Rounded +pwsx5006 power 0.122 0.5 -> 0.3493 Inexact Rounded +pwsx5007 power 0.0122 0.5 -> 0.1105 Inexact Rounded +pwsx5008 power 0.123 0.5 -> 0.3507 Inexact Rounded +pwsx5009 power 0.494 0.5 -> 0.7029 Inexact Rounded +pwsx5010 power 0.0669 0.5 -> 0.2587 Inexact Rounded +pwsx5011 power 0.9558 0.5 -> 0.9777 Inexact Rounded +pwsx5012 power 0.9348 0.5 -> 0.9669 Inexact Rounded +pwsx5013 power 0.9345 0.5 -> 0.9667 Inexact Rounded +pwsx5014 power 0.09345 0.5 -> 0.3057 Inexact Rounded +pwsx5015 power 0.9346 0.5 -> 0.9667 Inexact Rounded +pwsx5016 power 0.09346 0.5 -> 0.3057 Inexact Rounded +pwsx5017 power 0.9347 0.5 -> 0.9668 Inexact Rounded + +-- examples from decArith +precision: 9 +pwsx700 power 0 0.5 -> '0' +pwsx701 power -0 0.5 -> '0' +pwsx702 power 0.39 0.5 -> 0.624499800 Inexact Rounded +pwsx703 power 100 0.5 -> '10.0000000' Inexact Rounded +pwsx704 power 1.00 0.5 -> '1.00000000' Inexact Rounded +pwsx705 power 7 0.5 -> '2.64575131' Inexact Rounded +pwsx706 power 10 0.5 -> 3.16227766 Inexact Rounded + +-- some one-offs +precision: 9 +pwsx711 power 0.1 0.5 -> 0.316227766 Inexact Rounded +pwsx712 power 0.2 0.5 -> 0.447213595 Inexact Rounded +pwsx713 power 0.3 0.5 -> 0.547722558 Inexact Rounded +pwsx714 power 0.4 0.5 -> 0.632455532 Inexact Rounded +pwsx715 power 0.5 0.5 -> 0.707106781 Inexact Rounded +pwsx716 power 0.6 0.5 -> 0.774596669 Inexact Rounded +pwsx717 power 0.7 0.5 -> 0.836660027 Inexact Rounded +pwsx718 power 0.8 0.5 -> 0.894427191 Inexact Rounded +pwsx719 power 0.9 0.5 -> 0.948683298 Inexact Rounded +precision: 10 -- note no normalizatoin here +pwsx720 power +0.1 0.5 -> 0.3162277660 Inexact Rounded +precision: 11 +pwsx721 power +0.1 0.5 -> 0.31622776602 Inexact Rounded +precision: 12 +pwsx722 power +0.1 0.5 -> 0.316227766017 Inexact Rounded +precision: 9 +pwsx723 power 0.39 0.5 -> 0.624499800 Inexact Rounded +precision: 15 +pwsx724 power 0.39 0.5 -> 0.624499799839840 Inexact Rounded + +-- discussion cases +precision: 7 +pwsx731 power 9 0.5 -> 3.000000 Inexact Rounded +pwsx732 power 100 0.5 -> 10.00000 Inexact Rounded +pwsx733 power 123 0.5 -> 11.09054 Inexact Rounded +pwsx734 power 144 0.5 -> 12.00000 Inexact Rounded +pwsx735 power 156 0.5 -> 12.49000 Inexact Rounded +pwsx736 power 10000 0.5 -> 100.0000 Inexact Rounded + +-- values close to overflow (if there were input rounding) +maxexponent: 99 +minexponent: -99 +precision: 5 +pwsx760 power 9.9997E+99 0.5 -> 9.9998E+49 Inexact Rounded +pwsx761 power 9.9998E+99 0.5 -> 9.9999E+49 Inexact Rounded +pwsx762 power 9.9999E+99 0.5 -> 9.9999E+49 Inexact Rounded +pwsx763 power 9.99991E+99 0.5 -> 1.0000E+50 Inexact Rounded +pwsx764 power 9.99994E+99 0.5 -> 1.0000E+50 Inexact Rounded +pwsx765 power 9.99995E+99 0.5 -> 1.0000E+50 Inexact Rounded +pwsx766 power 9.99999E+99 0.5 -> 1.0000E+50 Inexact Rounded +precision: 9 +pwsx770 power 9.9997E+99 0.5 -> 9.99985000E+49 Inexact Rounded +pwsx771 power 9.9998E+99 0.5 -> 9.99990000E+49 Inexact Rounded +pwsx772 power 9.9999E+99 0.5 -> 9.99995000E+49 Inexact Rounded +pwsx773 power 9.99991E+99 0.5 -> 9.99995500E+49 Inexact Rounded +pwsx774 power 9.99994E+99 0.5 -> 9.99997000E+49 Inexact Rounded +pwsx775 power 9.99995E+99 0.5 -> 9.99997500E+49 Inexact Rounded +pwsx776 power 9.99999E+99 0.5 -> 9.99999500E+49 Inexact Rounded +precision: 20 +pwsx780 power 9.9997E+99 0.5 -> '9.9998499988749831247E+49' Inexact Rounded +pwsx781 power 9.9998E+99 0.5 -> '9.9998999994999949999E+49' Inexact Rounded +pwsx782 power 9.9999E+99 0.5 -> '9.9999499998749993750E+49' Inexact Rounded +pwsx783 power 9.99991E+99 0.5 -> '9.9999549998987495444E+49' Inexact Rounded +pwsx784 power 9.99994E+99 0.5 -> '9.9999699999549998650E+49' Inexact Rounded +pwsx785 power 9.99995E+99 0.5 -> '9.9999749999687499219E+49' Inexact Rounded +pwsx786 power 9.99999E+99 0.5 -> '9.9999949999987499994E+49' Inexact Rounded + +-- subnormals and underflows [these can only result when eMax is < digits+1] +-- Etiny = -(Emax + (precision-1)) +-- start with subnormal operands and normal results +maxexponent: 9 +minexponent: -9 +precision: 9 -- Etiny=-17 +pwsx800 power 1E-17 0.5 -> 3.16227766E-9 Inexact Rounded +pwsx801 power 10E-17 0.5 -> 1.00000000E-8 Inexact Rounded +precision: 10 -- Etiny=-18 +pwsx802 power 10E-18 0.5 -> 3.162277660E-9 Inexact Rounded +pwsx803 power 1E-18 0.5 -> 1.000000000E-9 Inexact Rounded + +precision: 11 -- Etiny=-19 +pwsx804 power 1E-19 0.5 -> 3.162277660E-10 Underflow Subnormal Inexact Rounded +pwsx805 power 10E-19 0.5 -> 1.0000000000E-9 Inexact Rounded +precision: 12 -- Etiny=-20 +pwsx806 power 10E-20 0.5 -> 3.1622776602E-10 Underflow Subnormal Inexact Rounded +pwsx807 power 1E-20 0.5 -> 1.0000000000E-10 Underflow Subnormal Inexact Rounded + +precision: 13 -- Etiny=-21 +pwsx808 power 1E-21 0.5 -> 3.1622776602E-11 Underflow Subnormal Inexact Rounded +pwsx809 power 10E-21 0.5 -> 1.00000000000E-10 Underflow Subnormal Inexact Rounded +precision: 14 -- Etiny=-22 +pwsx810 power 1E-21 0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded +pwsx811 power 10E-22 0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded +pwsx812 power 1E-22 0.5 -> 1.00000000000E-11 Underflow Subnormal Inexact Rounded + + +-- special values +maxexponent: 999 +minexponent: -999 +pwsx820 power Inf 0.5 -> Infinity +pwsx821 power -Inf 0.5 -> NaN Invalid_operation +pwsx822 power NaN 0.5 -> NaN +pwsx823 power sNaN 0.5 -> NaN Invalid_operation +-- propagating NaNs +pwsx824 power sNaN123 0.5 -> NaN123 Invalid_operation +pwsx825 power -sNaN321 0.5 -> -NaN321 Invalid_operation +pwsx826 power NaN456 0.5 -> NaN456 +pwsx827 power -NaN654 0.5 -> -NaN654 +pwsx828 power NaN1 0.5 -> NaN1 + +-- Null test +pwsx900 power # 0.5 -> NaN Invalid_operation Added: sandbox/trunk/decimal-c/new_dt/quantize.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/quantize.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,903 @@ +------------------------------------------------------------------------ +-- quantize.decTest -- decimal quantize operation -- +-- Copyright (c) IBM Corporation, 1981, 2005. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- Most of the tests here assume a "regular pattern", where the +-- sign and coefficient are +1. +-- 2004.03.15 Underflow for quantize is suppressed +-- 2005.06.08 More extensive tests for 'does not fit' + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +-- sanity checks +quax001 quantize 0 1e0 -> 0 +quax002 quantize 1 1e0 -> 1 +quax003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded +quax005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded +quax006 quantize 0.1 1e0 -> 0 Inexact Rounded +quax007 quantize 0.1 1e-1 -> 0.1 +quax008 quantize 0.1 1e-2 -> 0.10 +quax009 quantize 0.1 1e-3 -> 0.100 +quax010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded +quax011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded +quax012 quantize 0.9 1e+0 -> 1 Inexact Rounded +quax013 quantize 0.9 1e-1 -> 0.9 +quax014 quantize 0.9 1e-2 -> 0.90 +quax015 quantize 0.9 1e-3 -> 0.900 +-- negatives +quax021 quantize -0 1e0 -> -0 +quax022 quantize -1 1e0 -> -1 +quax023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded +quax025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded +quax026 quantize -0.1 1e0 -> -0 Inexact Rounded +quax027 quantize -0.1 1e-1 -> -0.1 +quax028 quantize -0.1 1e-2 -> -0.10 +quax029 quantize -0.1 1e-3 -> -0.100 +quax030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded +quax031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded +quax032 quantize -0.9 1e+0 -> -1 Inexact Rounded +quax033 quantize -0.9 1e-1 -> -0.9 +quax034 quantize -0.9 1e-2 -> -0.90 +quax035 quantize -0.9 1e-3 -> -0.900 +quax036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded +quax037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded +quax038 quantize -0.5 1e+0 -> -1 Inexact Rounded +quax039 quantize -0.5 1e-1 -> -0.5 +quax040 quantize -0.5 1e-2 -> -0.50 +quax041 quantize -0.5 1e-3 -> -0.500 +quax042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded +quax043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded +quax044 quantize -0.9 1e+0 -> -1 Inexact Rounded +quax045 quantize -0.9 1e-1 -> -0.9 +quax046 quantize -0.9 1e-2 -> -0.90 +quax047 quantize -0.9 1e-3 -> -0.900 + +-- examples from Specification +quax060 quantize 2.17 0.001 -> 2.170 +quax061 quantize 2.17 0.01 -> 2.17 +quax062 quantize 2.17 0.1 -> 2.2 Inexact Rounded +quax063 quantize 2.17 1e+0 -> 2 Inexact Rounded +quax064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded +quax065 quantize -Inf Inf -> -Infinity +quax066 quantize 2 Inf -> NaN Invalid_operation +quax067 quantize -0.1 1 -> -0 Inexact Rounded +quax068 quantize -0 1e+5 -> -0E+5 +quax069 quantize +35236450.6 1e-2 -> NaN Invalid_operation +quax070 quantize -35236450.6 1e-2 -> NaN Invalid_operation +quax071 quantize 217 1e-1 -> 217.0 +quax072 quantize 217 1e+0 -> 217 +quax073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded +quax074 quantize 217 1e+2 -> 2E+2 Inexact Rounded + +-- general tests .. +quax089 quantize 12 1e+4 -> 0E+4 Inexact Rounded +quax090 quantize 12 1e+3 -> 0E+3 Inexact Rounded +quax091 quantize 12 1e+2 -> 0E+2 Inexact Rounded +quax092 quantize 12 1e+1 -> 1E+1 Inexact Rounded +quax093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded +quax094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded +quax095 quantize 1.2345 1e-6 -> 1.234500 +quax096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded +quax097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded +quax098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded +quax099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded +quax100 quantize 92 1e+2 -> 1E+2 Inexact Rounded + +quax101 quantize -1 1e0 -> -1 +quax102 quantize -1 1e-1 -> -1.0 +quax103 quantize -1 1e-2 -> -1.00 +quax104 quantize 0 1e0 -> 0 +quax105 quantize 0 1e-1 -> 0.0 +quax106 quantize 0 1e-2 -> 0.00 +quax107 quantize 0.00 1e0 -> 0 +quax108 quantize 0 1e+1 -> 0E+1 +quax109 quantize 0 1e+2 -> 0E+2 +quax110 quantize +1 1e0 -> 1 +quax111 quantize +1 1e-1 -> 1.0 +quax112 quantize +1 1e-2 -> 1.00 + +quax120 quantize 1.04 1e-3 -> 1.040 +quax121 quantize 1.04 1e-2 -> 1.04 +quax122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded +quax123 quantize 1.04 1e0 -> 1 Inexact Rounded +quax124 quantize 1.05 1e-3 -> 1.050 +quax125 quantize 1.05 1e-2 -> 1.05 +quax126 quantize 1.05 1e-1 -> 1.1 Inexact Rounded +quax127 quantize 1.05 1e0 -> 1 Inexact Rounded +quax128 quantize 1.05 1e-3 -> 1.050 +quax129 quantize 1.05 1e-2 -> 1.05 +quax130 quantize 1.05 1e-1 -> 1.1 Inexact Rounded +quax131 quantize 1.05 1e0 -> 1 Inexact Rounded +quax132 quantize 1.06 1e-3 -> 1.060 +quax133 quantize 1.06 1e-2 -> 1.06 +quax134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded +quax135 quantize 1.06 1e0 -> 1 Inexact Rounded + +quax140 quantize -10 1e-2 -> -10.00 +quax141 quantize +1 1e-2 -> 1.00 +quax142 quantize +10 1e-2 -> 10.00 +quax143 quantize 1E+10 1e-2 -> NaN Invalid_operation +quax144 quantize 1E-10 1e-2 -> 0.00 Inexact Rounded +quax145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded +quax146 quantize 1E-2 1e-2 -> 0.01 +quax147 quantize 1E-1 1e-2 -> 0.10 +quax148 quantize 0E-10 1e-2 -> 0.00 + +quax150 quantize 1.0600 1e-5 -> 1.06000 +quax151 quantize 1.0600 1e-4 -> 1.0600 +quax152 quantize 1.0600 1e-3 -> 1.060 Rounded +quax153 quantize 1.0600 1e-2 -> 1.06 Rounded +quax154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded +quax155 quantize 1.0600 1e0 -> 1 Inexact Rounded + +-- base tests with non-1 coefficients +quax161 quantize 0 -9e0 -> 0 +quax162 quantize 1 -7e0 -> 1 +quax163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded +quax165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded +quax166 quantize 0.1 2e0 -> 0 Inexact Rounded +quax167 quantize 0.1 3e-1 -> 0.1 +quax168 quantize 0.1 44e-2 -> 0.10 +quax169 quantize 0.1 555e-3 -> 0.100 +quax170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded +quax171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded +quax172 quantize 0.9 -88e+0 -> 1 Inexact Rounded +quax173 quantize 0.9 -9e-1 -> 0.9 +quax174 quantize 0.9 0e-2 -> 0.90 +quax175 quantize 0.9 1.1e-3 -> 0.9000 +-- negatives +quax181 quantize -0 1.1e0 -> -0.0 +quax182 quantize -1 -1e0 -> -1 +quax183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded +quax185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded +quax186 quantize -0.1 71e0 -> -0 Inexact Rounded +quax187 quantize -0.1 -91e-1 -> -0.1 +quax188 quantize -0.1 -.1e-2 -> -0.100 +quax189 quantize -0.1 -1e-3 -> -0.100 +quax190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded +quax191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded +quax192 quantize -0.9 -10e+0 -> -1 Inexact Rounded +quax193 quantize -0.9 100e-1 -> -0.9 +quax194 quantize -0.9 999e-2 -> -0.90 + +-- +ve exponents .. +quax201 quantize -1 1e+0 -> -1 +quax202 quantize -1 1e+1 -> -0E+1 Inexact Rounded +quax203 quantize -1 1e+2 -> -0E+2 Inexact Rounded +quax204 quantize 0 1e+0 -> 0 +quax205 quantize 0 1e+1 -> 0E+1 +quax206 quantize 0 1e+2 -> 0E+2 +quax207 quantize +1 1e+0 -> 1 +quax208 quantize +1 1e+1 -> 0E+1 Inexact Rounded +quax209 quantize +1 1e+2 -> 0E+2 Inexact Rounded + +quax220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded +quax221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded +quax222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded +quax223 quantize 1.04 1e+0 -> 1 Inexact Rounded +quax224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded +quax225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded +quax226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded +quax227 quantize 1.05 1e+0 -> 1 Inexact Rounded +quax228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded +quax229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded +quax230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded +quax231 quantize 1.05 1e+0 -> 1 Inexact Rounded +quax232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded +quax233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded +quax234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded +quax235 quantize 1.06 1e+0 -> 1 Inexact Rounded + +quax240 quantize -10 1e+1 -> -1E+1 Rounded +quax241 quantize +1 1e+1 -> 0E+1 Inexact Rounded +quax242 quantize +10 1e+1 -> 1E+1 Rounded +quax243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1 +quax244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1 +quax245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1 +quax246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1 +quax247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1 +quax248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1 +quax249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1 +quax250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1 +quax251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1 +-- next one tries to add 9 zeros +quax252 quantize 1E+10 1e+1 -> NaN Invalid_operation +quax253 quantize 1E-10 1e+1 -> 0E+1 Inexact Rounded +quax254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded +quax255 quantize 0E-10 1e+1 -> 0E+1 +quax256 quantize -0E-10 1e+1 -> -0E+1 +quax257 quantize -0E-1 1e+1 -> -0E+1 +quax258 quantize -0 1e+1 -> -0E+1 +quax259 quantize -0E+1 1e+1 -> -0E+1 + +quax260 quantize -10 1e+2 -> -0E+2 Inexact Rounded +quax261 quantize +1 1e+2 -> 0E+2 Inexact Rounded +quax262 quantize +10 1e+2 -> 0E+2 Inexact Rounded +quax263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded +quax264 quantize 1E+2 1e+2 -> 1E+2 +quax265 quantize 1E+3 1e+2 -> 1.0E+3 +quax266 quantize 1E+4 1e+2 -> 1.00E+4 +quax267 quantize 1E+5 1e+2 -> 1.000E+5 +quax268 quantize 1E+6 1e+2 -> 1.0000E+6 +quax269 quantize 1E+7 1e+2 -> 1.00000E+7 +quax270 quantize 1E+8 1e+2 -> 1.000000E+8 +quax271 quantize 1E+9 1e+2 -> 1.0000000E+9 +quax272 quantize 1E+10 1e+2 -> 1.00000000E+10 +quax273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded +quax274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded +quax275 quantize 0E-10 1e+2 -> 0E+2 + +quax280 quantize -10 1e+3 -> -0E+3 Inexact Rounded +quax281 quantize +1 1e+3 -> 0E+3 Inexact Rounded +quax282 quantize +10 1e+3 -> 0E+3 Inexact Rounded +quax283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded +quax284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded +quax285 quantize 1E+3 1e+3 -> 1E+3 +quax286 quantize 1E+4 1e+3 -> 1.0E+4 +quax287 quantize 1E+5 1e+3 -> 1.00E+5 +quax288 quantize 1E+6 1e+3 -> 1.000E+6 +quax289 quantize 1E+7 1e+3 -> 1.0000E+7 +quax290 quantize 1E+8 1e+3 -> 1.00000E+8 +quax291 quantize 1E+9 1e+3 -> 1.000000E+9 +quax292 quantize 1E+10 1e+3 -> 1.0000000E+10 +quax293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded +quax294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded +quax295 quantize 0E-10 1e+3 -> 0E+3 + +-- round up from below [sign wrong in JIT compiler once] +quax300 quantize 0.0078 1e-5 -> 0.00780 +quax301 quantize 0.0078 1e-4 -> 0.0078 +quax302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded +quax303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded +quax304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded +quax305 quantize 0.0078 1e0 -> 0 Inexact Rounded +quax306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded +quax307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded + +quax310 quantize -0.0078 1e-5 -> -0.00780 +quax311 quantize -0.0078 1e-4 -> -0.0078 +quax312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded +quax313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded +quax314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded +quax315 quantize -0.0078 1e0 -> -0 Inexact Rounded +quax316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded +quax317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded + +quax320 quantize 0.078 1e-5 -> 0.07800 +quax321 quantize 0.078 1e-4 -> 0.0780 +quax322 quantize 0.078 1e-3 -> 0.078 +quax323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded +quax324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded +quax325 quantize 0.078 1e0 -> 0 Inexact Rounded +quax326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded +quax327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded + +quax330 quantize -0.078 1e-5 -> -0.07800 +quax331 quantize -0.078 1e-4 -> -0.0780 +quax332 quantize -0.078 1e-3 -> -0.078 +quax333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded +quax334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded +quax335 quantize -0.078 1e0 -> -0 Inexact Rounded +quax336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded +quax337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded + +quax340 quantize 0.78 1e-5 -> 0.78000 +quax341 quantize 0.78 1e-4 -> 0.7800 +quax342 quantize 0.78 1e-3 -> 0.780 +quax343 quantize 0.78 1e-2 -> 0.78 +quax344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded +quax345 quantize 0.78 1e0 -> 1 Inexact Rounded +quax346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded +quax347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded + +quax350 quantize -0.78 1e-5 -> -0.78000 +quax351 quantize -0.78 1e-4 -> -0.7800 +quax352 quantize -0.78 1e-3 -> -0.780 +quax353 quantize -0.78 1e-2 -> -0.78 +quax354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded +quax355 quantize -0.78 1e0 -> -1 Inexact Rounded +quax356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded +quax357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded + +quax360 quantize 7.8 1e-5 -> 7.80000 +quax361 quantize 7.8 1e-4 -> 7.8000 +quax362 quantize 7.8 1e-3 -> 7.800 +quax363 quantize 7.8 1e-2 -> 7.80 +quax364 quantize 7.8 1e-1 -> 7.8 +quax365 quantize 7.8 1e0 -> 8 Inexact Rounded +quax366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded +quax367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded +quax368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded + +quax370 quantize -7.8 1e-5 -> -7.80000 +quax371 quantize -7.8 1e-4 -> -7.8000 +quax372 quantize -7.8 1e-3 -> -7.800 +quax373 quantize -7.8 1e-2 -> -7.80 +quax374 quantize -7.8 1e-1 -> -7.8 +quax375 quantize -7.8 1e0 -> -8 Inexact Rounded +quax376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded +quax377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded +quax378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded + +-- some individuals +precision: 9 +quax380 quantize 352364.506 1e-2 -> 352364.51 Inexact Rounded +quax381 quantize 3523645.06 1e-2 -> 3523645.06 +quax382 quantize 35236450.6 1e-2 -> NaN Invalid_operation +quax383 quantize 352364506 1e-2 -> NaN Invalid_operation +quax384 quantize -352364.506 1e-2 -> -352364.51 Inexact Rounded +quax385 quantize -3523645.06 1e-2 -> -3523645.06 +quax386 quantize -35236450.6 1e-2 -> NaN Invalid_operation +quax387 quantize -352364506 1e-2 -> NaN Invalid_operation + +rounding: down +quax389 quantize 35236450.6 1e-2 -> NaN Invalid_operation +-- ? should that one instead have been: +-- quax389 quantize 35236450.6 1e-2 -> NaN Invalid_operation +rounding: half_up + +-- and a few more from e-mail discussions +precision: 7 +quax391 quantize 12.34567 1e-3 -> 12.346 Inexact Rounded +quax392 quantize 123.4567 1e-3 -> 123.457 Inexact Rounded +quax393 quantize 1234.567 1e-3 -> 1234.567 +quax394 quantize 12345.67 1e-3 -> NaN Invalid_operation +quax395 quantize 123456.7 1e-3 -> NaN Invalid_operation +quax396 quantize 1234567. 1e-3 -> NaN Invalid_operation + +-- some 9999 round-up cases +precision: 9 +quax400 quantize 9.999 1e-5 -> 9.99900 +quax401 quantize 9.999 1e-4 -> 9.9990 +quax402 quantize 9.999 1e-3 -> 9.999 +quax403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded +quax404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded +quax405 quantize 9.999 1e0 -> 10 Inexact Rounded +quax406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded +quax407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded + +quax410 quantize 0.999 1e-5 -> 0.99900 +quax411 quantize 0.999 1e-4 -> 0.9990 +quax412 quantize 0.999 1e-3 -> 0.999 +quax413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded +quax414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded +quax415 quantize 0.999 1e0 -> 1 Inexact Rounded +quax416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded + +quax420 quantize 0.0999 1e-5 -> 0.09990 +quax421 quantize 0.0999 1e-4 -> 0.0999 +quax422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded +quax423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded +quax424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded +quax425 quantize 0.0999 1e0 -> 0 Inexact Rounded +quax426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded + +quax430 quantize 0.00999 1e-5 -> 0.00999 +quax431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded +quax432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded +quax433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded +quax434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded +quax435 quantize 0.00999 1e0 -> 0 Inexact Rounded +quax436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded + +quax440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded +quax441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded +quax442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded +quax443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded +quax444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded +quax445 quantize 0.000999 1e0 -> 0 Inexact Rounded +quax446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded + +precision: 8 +quax449 quantize 9.999E-15 1e-23 -> NaN Invalid_operation +quax450 quantize 9.999E-15 1e-22 -> 9.9990000E-15 +quax451 quantize 9.999E-15 1e-21 -> 9.999000E-15 +quax452 quantize 9.999E-15 1e-20 -> 9.99900E-15 +quax453 quantize 9.999E-15 1e-19 -> 9.9990E-15 +quax454 quantize 9.999E-15 1e-18 -> 9.999E-15 +quax455 quantize 9.999E-15 1e-17 -> 1.000E-14 Inexact Rounded +quax456 quantize 9.999E-15 1e-16 -> 1.00E-14 Inexact Rounded +quax457 quantize 9.999E-15 1e-15 -> 1.0E-14 Inexact Rounded +quax458 quantize 9.999E-15 1e-14 -> 1E-14 Inexact Rounded +quax459 quantize 9.999E-15 1e-13 -> 0E-13 Inexact Rounded +quax460 quantize 9.999E-15 1e-12 -> 0E-12 Inexact Rounded +quax461 quantize 9.999E-15 1e-11 -> 0E-11 Inexact Rounded +quax462 quantize 9.999E-15 1e-10 -> 0E-10 Inexact Rounded +quax463 quantize 9.999E-15 1e-9 -> 0E-9 Inexact Rounded +quax464 quantize 9.999E-15 1e-8 -> 0E-8 Inexact Rounded +quax465 quantize 9.999E-15 1e-7 -> 0E-7 Inexact Rounded +quax466 quantize 9.999E-15 1e-6 -> 0.000000 Inexact Rounded +quax467 quantize 9.999E-15 1e-5 -> 0.00000 Inexact Rounded +quax468 quantize 9.999E-15 1e-4 -> 0.0000 Inexact Rounded +quax469 quantize 9.999E-15 1e-3 -> 0.000 Inexact Rounded +quax470 quantize 9.999E-15 1e-2 -> 0.00 Inexact Rounded +quax471 quantize 9.999E-15 1e-1 -> 0.0 Inexact Rounded +quax472 quantize 9.999E-15 1e0 -> 0 Inexact Rounded +quax473 quantize 9.999E-15 1e1 -> 0E+1 Inexact Rounded + +precision: 7 +quax900 quantize 9.999E-15 1e-22 -> NaN Invalid_operation +quax901 quantize 9.999E-15 1e-21 -> 9.999000E-15 +quax902 quantize 9.999E-15 1e-20 -> 9.99900E-15 +quax903 quantize 9.999E-15 1e-19 -> 9.9990E-15 +quax904 quantize 9.999E-15 1e-18 -> 9.999E-15 +quax905 quantize 9.999E-15 1e-17 -> 1.000E-14 Inexact Rounded +quax906 quantize 9.999E-15 1e-16 -> 1.00E-14 Inexact Rounded +quax907 quantize 9.999E-15 1e-15 -> 1.0E-14 Inexact Rounded +quax908 quantize 9.999E-15 1e-14 -> 1E-14 Inexact Rounded +quax909 quantize 9.999E-15 1e-13 -> 0E-13 Inexact Rounded +quax910 quantize 9.999E-15 1e-12 -> 0E-12 Inexact Rounded +quax911 quantize 9.999E-15 1e-11 -> 0E-11 Inexact Rounded +quax912 quantize 9.999E-15 1e-10 -> 0E-10 Inexact Rounded +quax913 quantize 9.999E-15 1e-9 -> 0E-9 Inexact Rounded +quax914 quantize 9.999E-15 1e-8 -> 0E-8 Inexact Rounded +quax915 quantize 9.999E-15 1e-7 -> 0E-7 Inexact Rounded +quax916 quantize 9.999E-15 1e-6 -> 0.000000 Inexact Rounded +quax917 quantize 9.999E-15 1e-5 -> 0.00000 Inexact Rounded +quax918 quantize 9.999E-15 1e-4 -> 0.0000 Inexact Rounded +quax919 quantize 9.999E-15 1e-3 -> 0.000 Inexact Rounded +quax920 quantize 9.999E-15 1e-2 -> 0.00 Inexact Rounded +quax921 quantize 9.999E-15 1e-1 -> 0.0 Inexact Rounded +quax922 quantize 9.999E-15 1e0 -> 0 Inexact Rounded +quax923 quantize 9.999E-15 1e1 -> 0E+1 Inexact Rounded + +precision: 6 +quax930 quantize 9.999E-15 1e-22 -> NaN Invalid_operation +quax931 quantize 9.999E-15 1e-21 -> NaN Invalid_operation +quax932 quantize 9.999E-15 1e-20 -> 9.99900E-15 +quax933 quantize 9.999E-15 1e-19 -> 9.9990E-15 +quax934 quantize 9.999E-15 1e-18 -> 9.999E-15 +quax935 quantize 9.999E-15 1e-17 -> 1.000E-14 Inexact Rounded +quax936 quantize 9.999E-15 1e-16 -> 1.00E-14 Inexact Rounded +quax937 quantize 9.999E-15 1e-15 -> 1.0E-14 Inexact Rounded +quax938 quantize 9.999E-15 1e-14 -> 1E-14 Inexact Rounded +quax939 quantize 9.999E-15 1e-13 -> 0E-13 Inexact Rounded +quax940 quantize 9.999E-15 1e-12 -> 0E-12 Inexact Rounded +quax941 quantize 9.999E-15 1e-11 -> 0E-11 Inexact Rounded +quax942 quantize 9.999E-15 1e-10 -> 0E-10 Inexact Rounded +quax943 quantize 9.999E-15 1e-9 -> 0E-9 Inexact Rounded +quax944 quantize 9.999E-15 1e-8 -> 0E-8 Inexact Rounded +quax945 quantize 9.999E-15 1e-7 -> 0E-7 Inexact Rounded +quax946 quantize 9.999E-15 1e-6 -> 0.000000 Inexact Rounded +quax947 quantize 9.999E-15 1e-5 -> 0.00000 Inexact Rounded +quax948 quantize 9.999E-15 1e-4 -> 0.0000 Inexact Rounded +quax949 quantize 9.999E-15 1e-3 -> 0.000 Inexact Rounded +quax950 quantize 9.999E-15 1e-2 -> 0.00 Inexact Rounded +quax951 quantize 9.999E-15 1e-1 -> 0.0 Inexact Rounded +quax952 quantize 9.999E-15 1e0 -> 0 Inexact Rounded +quax953 quantize 9.999E-15 1e1 -> 0E+1 Inexact Rounded + +precision: 3 +quax960 quantize 9.999E-15 1e-22 -> NaN Invalid_operation +quax961 quantize 9.999E-15 1e-21 -> NaN Invalid_operation +quax962 quantize 9.999E-15 1e-20 -> NaN Invalid_operation +quax963 quantize 9.999E-15 1e-19 -> NaN Invalid_operation +quax964 quantize 9.999E-15 1e-18 -> NaN Invalid_operation +quax965 quantize 9.999E-15 1e-17 -> NaN Invalid_operation +quax966 quantize 9.999E-15 1e-16 -> 1.00E-14 Inexact Rounded +quax967 quantize 9.999E-15 1e-15 -> 1.0E-14 Inexact Rounded +quax968 quantize 9.999E-15 1e-14 -> 1E-14 Inexact Rounded +quax969 quantize 9.999E-15 1e-13 -> 0E-13 Inexact Rounded +quax970 quantize 9.999E-15 1e-12 -> 0E-12 Inexact Rounded +quax971 quantize 9.999E-15 1e-11 -> 0E-11 Inexact Rounded +quax972 quantize 9.999E-15 1e-10 -> 0E-10 Inexact Rounded +quax973 quantize 9.999E-15 1e-9 -> 0E-9 Inexact Rounded +quax974 quantize 9.999E-15 1e-8 -> 0E-8 Inexact Rounded +quax975 quantize 9.999E-15 1e-7 -> 0E-7 Inexact Rounded +quax976 quantize 9.999E-15 1e-6 -> 0.000000 Inexact Rounded +quax977 quantize 9.999E-15 1e-5 -> 0.00000 Inexact Rounded +quax978 quantize 9.999E-15 1e-4 -> 0.0000 Inexact Rounded +quax979 quantize 9.999E-15 1e-3 -> 0.000 Inexact Rounded +quax980 quantize 9.999E-15 1e-2 -> 0.00 Inexact Rounded +quax981 quantize 9.999E-15 1e-1 -> 0.0 Inexact Rounded +quax982 quantize 9.999E-15 1e0 -> 0 Inexact Rounded +quax983 quantize 9.999E-15 1e1 -> 0E+1 Inexact Rounded + +-- Fung Lee's case & similar +precision: 3 +quax1001 quantize 0.000 0.001 -> 0.000 +quax1002 quantize 0.001 0.001 -> 0.001 +quax1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded +quax1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded +quax1005 quantize 0.501 0.001 -> 0.501 +quax1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded +quax1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded +quax1008 quantize 0.999 0.001 -> 0.999 +quax1009 quantize 0.9992 0.001 -> 0.999 Inexact Rounded +quax1010 quantize 0.9998 0.001 -> NaN Invalid_operation +quax1011 quantize 1.0001 0.001 -> NaN Invalid_operation +quax1012 quantize 1.0051 0.001 -> NaN Invalid_operation +quax1013 quantize 1.0551 0.001 -> NaN Invalid_operation +quax1014 quantize 1.5551 0.001 -> NaN Invalid_operation +quax1015 quantize 1.9999 0.001 -> NaN Invalid_operation + +-- long operand checks [rhs checks removed] +maxexponent: 999 +minexponent: -999 +precision: 9 +quax481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded +quax482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded +quax483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded +quax484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded +quax485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded +quax486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded +-- a potential double-round +quax487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded +quax488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded + +precision: 15 +quax491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded +quax492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded +quax493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded +quax494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded +quax495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded +quax496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded +quax497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded +quax498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded + +-- Zeros +quax500 quantize 0 1e1 -> 0E+1 +quax501 quantize 0 1e0 -> 0 +quax502 quantize 0 1e-1 -> 0.0 +quax503 quantize 0.0 1e-1 -> 0.0 +quax504 quantize 0.0 1e0 -> 0 +quax505 quantize 0.0 1e+1 -> 0E+1 +quax506 quantize 0E+1 1e-1 -> 0.0 +quax507 quantize 0E+1 1e0 -> 0 +quax508 quantize 0E+1 1e+1 -> 0E+1 +quax509 quantize -0 1e1 -> -0E+1 +quax510 quantize -0 1e0 -> -0 +quax511 quantize -0 1e-1 -> -0.0 +quax512 quantize -0.0 1e-1 -> -0.0 +quax513 quantize -0.0 1e0 -> -0 +quax514 quantize -0.0 1e+1 -> -0E+1 +quax515 quantize -0E+1 1e-1 -> -0.0 +quax516 quantize -0E+1 1e0 -> -0 +quax517 quantize -0E+1 1e+1 -> -0E+1 + +-- Suspicious RHS values +maxexponent: 999999999 +minexponent: -999999999 +precision: 15 +quax520 quantize 1.234 1e999999000 -> 0E+999999000 Inexact Rounded +quax521 quantize 123.456 1e999999000 -> 0E+999999000 Inexact Rounded +quax522 quantize 1.234 1e999999999 -> 0E+999999999 Inexact Rounded +quax523 quantize 123.456 1e999999999 -> 0E+999999999 Inexact Rounded +quax524 quantize 123.456 1e1000000000 -> NaN Invalid_operation +quax525 quantize 123.456 1e12345678903 -> NaN Invalid_operation +-- next four are "won't fit" overflows +quax526 quantize 1.234 1e-999999000 -> NaN Invalid_operation +quax527 quantize 123.456 1e-999999000 -> NaN Invalid_operation +quax528 quantize 1.234 1e-999999999 -> NaN Invalid_operation +quax529 quantize 123.456 1e-999999999 -> NaN Invalid_operation +quax530 quantize 123.456 1e-1000000014 -> NaN Invalid_operation +quax531 quantize 123.456 1e-12345678903 -> NaN Invalid_operation + +maxexponent: 999 +minexponent: -999 +precision: 15 +quax532 quantize 1.234E+999 1e999 -> 1E+999 Inexact Rounded +quax533 quantize 1.234E+998 1e999 -> 0E+999 Inexact Rounded +quax534 quantize 1.234 1e999 -> 0E+999 Inexact Rounded +quax535 quantize 1.234 1e1000 -> NaN Invalid_operation +quax536 quantize 1.234 1e5000 -> NaN Invalid_operation +quax537 quantize 0 1e-999 -> 0E-999 +-- next two are "won't fit" overflows +quax538 quantize 1.234 1e-999 -> NaN Invalid_operation +quax539 quantize 1.234 1e-1000 -> NaN Invalid_operation +quax540 quantize 1.234 1e-5000 -> NaN Invalid_operation +-- [more below] + +-- check bounds (lhs maybe out of range for destination, etc.) +precision: 7 +quax541 quantize 1E+999 1e+999 -> 1E+999 +quax542 quantize 1E+1000 1e+999 -> NaN Invalid_operation +quax543 quantize 1E+999 1e+1000 -> NaN Invalid_operation +quax544 quantize 1E-999 1e-999 -> 1E-999 +quax545 quantize 1E-1000 1e-999 -> 0E-999 Inexact Rounded +quax546 quantize 1E-999 1e-1000 -> 1.0E-999 +quax547 quantize 1E-1005 1e-999 -> 0E-999 Inexact Rounded +quax548 quantize 1E-1006 1e-999 -> 0E-999 Inexact Rounded +quax549 quantize 1E-1007 1e-999 -> 0E-999 Inexact Rounded +quax550 quantize 1E-998 1e-1005 -> NaN Invalid_operation -- won't fit +quax551 quantize 1E-999 1e-1005 -> 1.000000E-999 +quax552 quantize 1E-1000 1e-1005 -> 1.00000E-1000 Subnormal +quax553 quantize 1E-999 1e-1006 -> NaN Invalid_operation +quax554 quantize 1E-999 1e-1007 -> NaN Invalid_operation +-- related subnormal rounding +quax555 quantize 1.666666E-999 1e-1005 -> 1.666666E-999 +quax556 quantize 1.666666E-1000 1e-1005 -> 1.66667E-1000 Subnormal Inexact Rounded +quax557 quantize 1.666666E-1001 1e-1005 -> 1.6667E-1001 Subnormal Inexact Rounded +quax558 quantize 1.666666E-1002 1e-1005 -> 1.667E-1002 Subnormal Inexact Rounded +quax559 quantize 1.666666E-1003 1e-1005 -> 1.67E-1003 Subnormal Inexact Rounded +quax560 quantize 1.666666E-1004 1e-1005 -> 1.7E-1004 Subnormal Inexact Rounded +quax561 quantize 1.666666E-1005 1e-1005 -> 2E-1005 Subnormal Inexact Rounded +quax562 quantize 1.666666E-1006 1e-1005 -> 0E-1005 Inexact Rounded +quax563 quantize 1.666666E-1007 1e-1005 -> 0E-1005 Inexact Rounded + +-- Specials +quax580 quantize Inf -Inf -> Infinity +quax581 quantize Inf 1e-1000 -> NaN Invalid_operation +quax582 quantize Inf 1e-1 -> NaN Invalid_operation +quax583 quantize Inf 1e0 -> NaN Invalid_operation +quax584 quantize Inf 1e1 -> NaN Invalid_operation +quax585 quantize Inf 1e1000 -> NaN Invalid_operation +quax586 quantize Inf Inf -> Infinity +quax587 quantize -1000 Inf -> NaN Invalid_operation +quax588 quantize -Inf Inf -> -Infinity +quax589 quantize -1 Inf -> NaN Invalid_operation +quax590 quantize 0 Inf -> NaN Invalid_operation +quax591 quantize 1 Inf -> NaN Invalid_operation +quax592 quantize 1000 Inf -> NaN Invalid_operation +quax593 quantize Inf Inf -> Infinity +quax594 quantize Inf 1e-0 -> NaN Invalid_operation +quax595 quantize -0 Inf -> NaN Invalid_operation + +quax600 quantize -Inf -Inf -> -Infinity +quax601 quantize -Inf 1e-1000 -> NaN Invalid_operation +quax602 quantize -Inf 1e-1 -> NaN Invalid_operation +quax603 quantize -Inf 1e0 -> NaN Invalid_operation +quax604 quantize -Inf 1e1 -> NaN Invalid_operation +quax605 quantize -Inf 1e1000 -> NaN Invalid_operation +quax606 quantize -Inf Inf -> -Infinity +quax607 quantize -1000 Inf -> NaN Invalid_operation +quax608 quantize -Inf -Inf -> -Infinity +quax609 quantize -1 -Inf -> NaN Invalid_operation +quax610 quantize 0 -Inf -> NaN Invalid_operation +quax611 quantize 1 -Inf -> NaN Invalid_operation +quax612 quantize 1000 -Inf -> NaN Invalid_operation +quax613 quantize Inf -Inf -> Infinity +quax614 quantize -Inf 1e-0 -> NaN Invalid_operation +quax615 quantize -0 -Inf -> NaN Invalid_operation + +quax621 quantize NaN -Inf -> NaN +quax622 quantize NaN 1e-1000 -> NaN +quax623 quantize NaN 1e-1 -> NaN +quax624 quantize NaN 1e0 -> NaN +quax625 quantize NaN 1e1 -> NaN +quax626 quantize NaN 1e1000 -> NaN +quax627 quantize NaN Inf -> NaN +quax628 quantize NaN NaN -> NaN +quax629 quantize -Inf NaN -> NaN +quax630 quantize -1000 NaN -> NaN +quax631 quantize -1 NaN -> NaN +quax632 quantize 0 NaN -> NaN +quax633 quantize 1 NaN -> NaN +quax634 quantize 1000 NaN -> NaN +quax635 quantize Inf NaN -> NaN +quax636 quantize NaN 1e-0 -> NaN +quax637 quantize -0 NaN -> NaN + +quax641 quantize sNaN -Inf -> NaN Invalid_operation +quax642 quantize sNaN 1e-1000 -> NaN Invalid_operation +quax643 quantize sNaN 1e-1 -> NaN Invalid_operation +quax644 quantize sNaN 1e0 -> NaN Invalid_operation +quax645 quantize sNaN 1e1 -> NaN Invalid_operation +quax646 quantize sNaN 1e1000 -> NaN Invalid_operation +quax647 quantize sNaN NaN -> NaN Invalid_operation +quax648 quantize sNaN sNaN -> NaN Invalid_operation +quax649 quantize NaN sNaN -> NaN Invalid_operation +quax650 quantize -Inf sNaN -> NaN Invalid_operation +quax651 quantize -1000 sNaN -> NaN Invalid_operation +quax652 quantize -1 sNaN -> NaN Invalid_operation +quax653 quantize 0 sNaN -> NaN Invalid_operation +quax654 quantize 1 sNaN -> NaN Invalid_operation +quax655 quantize 1000 sNaN -> NaN Invalid_operation +quax656 quantize Inf sNaN -> NaN Invalid_operation +quax657 quantize NaN sNaN -> NaN Invalid_operation +quax658 quantize sNaN 1e-0 -> NaN Invalid_operation +quax659 quantize -0 sNaN -> NaN Invalid_operation + +-- propagating NaNs +quax661 quantize NaN9 -Inf -> NaN9 +quax662 quantize NaN8 919 -> NaN8 +quax663 quantize NaN71 Inf -> NaN71 +quax664 quantize NaN6 NaN5 -> NaN6 +quax665 quantize -Inf NaN4 -> NaN4 +quax666 quantize -919 NaN31 -> NaN31 +quax667 quantize Inf NaN2 -> NaN2 + +quax671 quantize sNaN99 -Inf -> NaN99 Invalid_operation +quax672 quantize sNaN98 -11 -> NaN98 Invalid_operation +quax673 quantize sNaN97 NaN -> NaN97 Invalid_operation +quax674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation +quax675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation +quax676 quantize -Inf sNaN92 -> NaN92 Invalid_operation +quax677 quantize 088 sNaN91 -> NaN91 Invalid_operation +quax678 quantize Inf sNaN90 -> NaN90 Invalid_operation +quax679 quantize NaN sNaN88 -> NaN88 Invalid_operation + +quax681 quantize -NaN9 -Inf -> -NaN9 +quax682 quantize -NaN8 919 -> -NaN8 +quax683 quantize -NaN71 Inf -> -NaN71 +quax684 quantize -NaN6 -NaN5 -> -NaN6 +quax685 quantize -Inf -NaN4 -> -NaN4 +quax686 quantize -919 -NaN31 -> -NaN31 +quax687 quantize Inf -NaN2 -> -NaN2 + +quax691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation +quax692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation +quax693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation +quax694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation +quax695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation +quax696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation +quax697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation +quax698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation +quax699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation + +-- subnormals and underflow +precision: 4 +maxexponent: 999 +minexponent: -999 +quax710 quantize 1.00E-999 1e-999 -> 1E-999 Rounded +quax711 quantize 0.1E-999 2e-1000 -> 1E-1000 Subnormal +quax712 quantize 0.10E-999 3e-1000 -> 1E-1000 Subnormal Rounded +quax713 quantize 0.100E-999 4e-1000 -> 1E-1000 Subnormal Rounded +quax714 quantize 0.01E-999 5e-1001 -> 1E-1001 Subnormal +-- next is rounded to Emin +quax715 quantize 0.999E-999 1e-999 -> 1E-999 Inexact Rounded +quax716 quantize 0.099E-999 10e-1000 -> 1E-1000 Inexact Rounded Subnormal + +quax717 quantize 0.009E-999 1e-1001 -> 1E-1001 Inexact Rounded Subnormal +quax718 quantize 0.001E-999 1e-1001 -> 0E-1001 Inexact Rounded +quax719 quantize 0.0009E-999 1e-1001 -> 0E-1001 Inexact Rounded +quax720 quantize 0.0001E-999 1e-1001 -> 0E-1001 Inexact Rounded + +quax730 quantize -1.00E-999 1e-999 -> -1E-999 Rounded +quax731 quantize -0.1E-999 1e-999 -> -0E-999 Rounded Inexact +quax732 quantize -0.10E-999 1e-999 -> -0E-999 Rounded Inexact +quax733 quantize -0.100E-999 1e-999 -> -0E-999 Rounded Inexact +quax734 quantize -0.01E-999 1e-999 -> -0E-999 Inexact Rounded +-- next is rounded to Emin +quax735 quantize -0.999E-999 90e-999 -> -1E-999 Inexact Rounded +quax736 quantize -0.099E-999 -1e-999 -> -0E-999 Inexact Rounded +quax737 quantize -0.009E-999 -1e-999 -> -0E-999 Inexact Rounded +quax738 quantize -0.001E-999 -0e-999 -> -0E-999 Inexact Rounded +quax739 quantize -0.0001E-999 0e-999 -> -0E-999 Inexact Rounded + +quax740 quantize -1.00E-999 1e-1000 -> -1.0E-999 Rounded +quax741 quantize -0.1E-999 1e-1000 -> -1E-1000 Subnormal +quax742 quantize -0.10E-999 1e-1000 -> -1E-1000 Subnormal Rounded +quax743 quantize -0.100E-999 1e-1000 -> -1E-1000 Subnormal Rounded +quax744 quantize -0.01E-999 1e-1000 -> -0E-1000 Inexact Rounded +-- next is rounded to Emin +quax745 quantize -0.999E-999 1e-1000 -> -1.0E-999 Inexact Rounded +quax746 quantize -0.099E-999 1e-1000 -> -1E-1000 Inexact Rounded Subnormal +quax747 quantize -0.009E-999 1e-1000 -> -0E-1000 Inexact Rounded +quax748 quantize -0.001E-999 1e-1000 -> -0E-1000 Inexact Rounded +quax749 quantize -0.0001E-999 1e-1000 -> -0E-1000 Inexact Rounded + +quax750 quantize -1.00E-999 1e-1001 -> -1.00E-999 +quax751 quantize -0.1E-999 1e-1001 -> -1.0E-1000 Subnormal +quax752 quantize -0.10E-999 1e-1001 -> -1.0E-1000 Subnormal +quax753 quantize -0.100E-999 1e-1001 -> -1.0E-1000 Subnormal Rounded +quax754 quantize -0.01E-999 1e-1001 -> -1E-1001 Subnormal +-- next is rounded to Emin +quax755 quantize -0.999E-999 1e-1001 -> -1.00E-999 Inexact Rounded +quax756 quantize -0.099E-999 1e-1001 -> -1.0E-1000 Inexact Rounded Subnormal +quax757 quantize -0.009E-999 1e-1001 -> -1E-1001 Inexact Rounded Subnormal +quax758 quantize -0.001E-999 1e-1001 -> -0E-1001 Inexact Rounded +quax759 quantize -0.0001E-999 1e-1001 -> -0E-1001 Inexact Rounded + +quax760 quantize -1.00E-999 1e-1002 -> -1.000E-999 +quax761 quantize -0.1E-999 1e-1002 -> -1.00E-1000 Subnormal +quax762 quantize -0.10E-999 1e-1002 -> -1.00E-1000 Subnormal +quax763 quantize -0.100E-999 1e-1002 -> -1.00E-1000 Subnormal +quax764 quantize -0.01E-999 1e-1002 -> -1.0E-1001 Subnormal +quax765 quantize -0.999E-999 1e-1002 -> -9.99E-1000 Subnormal +quax766 quantize -0.099E-999 1e-1002 -> -9.9E-1001 Subnormal +quax767 quantize -0.009E-999 1e-1002 -> -9E-1002 Subnormal +quax768 quantize -0.001E-999 1e-1002 -> -1E-1002 Subnormal +quax769 quantize -0.0001E-999 1e-1002 -> -0E-1002 Inexact Rounded + +-- rhs must be no less than Etiny +quax770 quantize -1.00E-999 1e-1003 -> NaN Invalid_operation +quax771 quantize -0.1E-999 1e-1003 -> NaN Invalid_operation +quax772 quantize -0.10E-999 1e-1003 -> NaN Invalid_operation +quax773 quantize -0.100E-999 1e-1003 -> NaN Invalid_operation +quax774 quantize -0.01E-999 1e-1003 -> NaN Invalid_operation +quax775 quantize -0.999E-999 1e-1003 -> NaN Invalid_operation +quax776 quantize -0.099E-999 1e-1003 -> NaN Invalid_operation +quax777 quantize -0.009E-999 1e-1003 -> NaN Invalid_operation +quax778 quantize -0.001E-999 1e-1003 -> NaN Invalid_operation +quax779 quantize -0.0001E-999 1e-1003 -> NaN Invalid_operation +quax780 quantize -0.0001E-999 1e-1004 -> NaN Invalid_operation + +precision: 9 +maxExponent: 999999999 +minexponent: -999999999 + +-- some extremes derived from Rescale testcases +quax801 quantize 0 1e1000000000 -> NaN Invalid_operation +quax802 quantize 0 1e-1000000000 -> 0E-1000000000 +quax803 quantize 0 1e2000000000 -> NaN Invalid_operation +quax804 quantize 0 1e-2000000000 -> NaN Invalid_operation +quax805 quantize 0 1e3000000000 -> NaN Invalid_operation +quax806 quantize 0 1e-3000000000 -> NaN Invalid_operation +quax807 quantize 0 1e4000000000 -> NaN Invalid_operation +quax808 quantize 0 1e-4000000000 -> NaN Invalid_operation +quax809 quantize 0 1e5000000000 -> NaN Invalid_operation +quax810 quantize 0 1e-5000000000 -> NaN Invalid_operation +quax811 quantize 0 1e6000000000 -> NaN Invalid_operation +quax812 quantize 0 1e-6000000000 -> NaN Invalid_operation +quax813 quantize 0 1e7000000000 -> NaN Invalid_operation +quax814 quantize 0 1e-7000000000 -> NaN Invalid_operation +quax815 quantize 0 1e8000000000 -> NaN Invalid_operation +quax816 quantize 0 1e-8000000000 -> NaN Invalid_operation +quax817 quantize 0 1e9000000000 -> NaN Invalid_operation +quax818 quantize 0 1e-9000000000 -> NaN Invalid_operation +quax819 quantize 0 1e9999999999 -> NaN Invalid_operation +quax820 quantize 0 1e-9999999999 -> NaN Invalid_operation +quax821 quantize 0 1e10000000000 -> NaN Invalid_operation +quax822 quantize 0 1e-10000000000 -> NaN Invalid_operation + +quax843 quantize 0 1e999999999 -> 0E+999999999 +quax844 quantize 0 1e1000000000 -> NaN Invalid_operation +quax845 quantize 0 1e-999999999 -> 0E-999999999 +quax846 quantize 0 1e-1000000000 -> 0E-1000000000 +quax847 quantize 0 1e-1000000001 -> 0E-1000000001 +quax848 quantize 0 1e-1000000002 -> 0E-1000000002 +quax849 quantize 0 1e-1000000003 -> 0E-1000000003 +quax850 quantize 0 1e-1000000004 -> 0E-1000000004 +quax851 quantize 0 1e-1000000005 -> 0E-1000000005 +quax852 quantize 0 1e-1000000006 -> 0E-1000000006 +quax853 quantize 0 1e-1000000007 -> 0E-1000000007 +quax854 quantize 0 1e-1000000008 -> NaN Invalid_operation + +quax861 quantize 1 1e+2147483649 -> NaN Invalid_operation +quax862 quantize 1 1e+2147483648 -> NaN Invalid_operation +quax863 quantize 1 1e+2147483647 -> NaN Invalid_operation +quax864 quantize 1 1e-2147483647 -> NaN Invalid_operation +quax865 quantize 1 1e-2147483648 -> NaN Invalid_operation +quax866 quantize 1 1e-2147483649 -> NaN Invalid_operation + +-- More from Fung Lee +precision: 16 +rounding: half_up +maxExponent: 384 +minExponent: -383 +quax1021 quantize 8.666666666666000E+384 1.000000000000000E+384 -> 8.666666666666000E+384 +quax1022 quantize 64#8.666666666666000E+384 64#1.000000000000000E+384 -> 8.666666666666000E+384 +quax1023 quantize 64#8.666666666666000E+384 128#1.000000000000000E+384 -> 8.666666666666000E+384 +quax1024 quantize 64#8.666666666666000E+384 64#1E+384 -> 8.666666666666000E+384 +quax1025 quantize 64#8.666666666666000E+384 64#1E+384 -> 64#8.666666666666000E+384 +quax1026 quantize 64#8.666666666666000E+384 128#1E+384 -> 64#9E+384 Inexact Rounded Clamped +quax1027 quantize 64#8.666666666666000E+323 64#1E+31 -> NaN Invalid_operation +quax1028 quantize 64#8.666666666666000E+323 128#1E+31 -> NaN Invalid_operation +quax1029 quantize 64#8.66666666E+3 128#1E+10 -> 64#0E10 Inexact Rounded +quax1030 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded + +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +-- 1 2 3 +-- 1 234567890123456789012345678901234 +quax0a1 quantize 8.555555555555555555555555555555555E+6143 1E+6143 -> 9E+6143 Inexact Rounded +quax0a2 quantize 128#8.555555555555555555555555555555555E+6143 128#1E+6143 -> 8.55555555555555555555555555555556E+6143 Rounded Inexact +quax0a3 quantize 128#8.555555555555555555555555555555555E+6144 128#1E+6144 -> 8.555555555555555555555555555555555E+6144 + +-- Null tests +quax998 quantize 10 # -> NaN Invalid_operation +quax999 quantize # 1e10 -> NaN Invalid_operation Added: sandbox/trunk/decimal-c/new_dt/randomBound32.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/randomBound32.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,2443 @@ +------------------------------------------------------------------------ +-- randomBound32.decTest -- decimal testcases -- boundaries near 32 -- +-- Copyright (c) IBM Corporation, 1981, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- These testcases test calculations at precisions 31, 32, and 33, to +-- exercise the boundaries around 2**5 + +-- randomly generated testcases [26 Sep 2001] +extended: 1 +precision: 31 +rounding: half_up +maxExponent: 9999 +minexponent: -9999 + +addx3001 add 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 2.189320103965343717049307148600E+799 Inexact Rounded +comx3001 compare 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> -1 +divx3001 divide 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 2.262681764507965005284080800438E-787 Inexact Rounded +dvix3001 divideint 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 0 +mulx3001 multiply 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 1.084531091568672041923151632066E+812 Inexact Rounded +powx3001 power 4953734675913.065314738743322579 2 -> 24539487239343522246155890.99495 Inexact Rounded +remx3001 remainder 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 4953734675913.065314738743322579 +subx3001 subtract 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> -2.189320103965343717049307148600E+799 Inexact Rounded +addx3002 add 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> -7.886453204712287484430980636798E+944 Inexact Rounded +comx3002 compare 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> 1 +divx3002 divide 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> -1.222562801441069667849402782716E-1785 Inexact Rounded +dvix3002 divideint 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> -0 +mulx3002 multiply 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> -7.603869223099928141659831589905E+104 Inexact Rounded +powx3002 power 9641.684323386955881595490347910E-844 -8 -> 1.338988152067180337738955757587E+6720 Inexact Rounded +remx3002 remainder 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> 9.641684323386955881595490347910E-841 +subx3002 subtract 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> 7.886453204712287484430980636798E+944 Inexact Rounded +addx3003 add -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -1.028048571628326871054964307774E+529 Inexact Rounded +comx3003 compare -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -1 +divx3003 divide -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -2.089529249946971482861843692465E+515 Inexact Rounded +dvix3003 divideint -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> NaN Division_impossible +mulx3003 multiply -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -5.057999861231255549283737861207E+542 Inexact Rounded +powx3003 power -1.028048571628326871054964307774E+529 5 -> -1.148333858253704284232780819739E+2645 Inexact Rounded +remx3003 remainder -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> NaN Division_impossible +subx3003 subtract -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -1.028048571628326871054964307774E+529 Inexact Rounded +addx3004 add 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 84158050139.12535935915094076662 Inexact Rounded +comx3004 compare 479084.8561808930525417735205519 084157571054.2691784660983989931 -> -1 +divx3004 divide 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 0.000005692712493709617905493710207969 Inexact Rounded +dvix3004 divideint 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 0 +mulx3004 multiply 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 40318617825067837.47317700523687 Inexact Rounded +powx3004 power 479084.8561808930525417735205519 8 -> 2.775233598021235973545933045837E+45 Inexact Rounded +remx3004 remainder 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 479084.8561808930525417735205519 +subx3004 subtract 479084.8561808930525417735205519 084157571054.2691784660983989931 -> -84157091969.41299757304585721958 Inexact Rounded +addx3005 add -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> -363753960.6547166697980414728370 Inexact Rounded +comx3005 compare -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> -1 +divx3005 divide -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> 114672.6064337420167096295290890 Inexact Rounded +dvix3005 divideint -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> 114672 +mulx3005 multiply -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> 1153846941331.188583292239230818 Inexact Rounded +powx3005 power -0363750788.573782205664349562931 -3172 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3005 remainder -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> -1923.656911066945656824381431488 +subx3005 subtract -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> -363747616.4928477415306576530250 Inexact Rounded +addx3006 add 1381026551423669919010191878449 -82.66614775445371254999357800739 -> 1381026551423669919010191878366 Inexact Rounded +comx3006 compare 1381026551423669919010191878449 -82.66614775445371254999357800739 -> 1 +divx3006 divide 1381026551423669919010191878449 -82.66614775445371254999357800739 -> -16706071214613552377376639557.90 Inexact Rounded +dvix3006 divideint 1381026551423669919010191878449 -82.66614775445371254999357800739 -> -16706071214613552377376639557 +mulx3006 multiply 1381026551423669919010191878449 -82.66614775445371254999357800739 -> -1.141641449528127656560770057228E+32 Inexact Rounded +powx3006 power 1381026551423669919010191878449 -83 -> 2.307977908106564299925193011052E-2502 Inexact Rounded +remx3006 remainder 1381026551423669919010191878449 -82.66614775445371254999357800739 -> 74.22115953553602036042168767377 +subx3006 subtract 1381026551423669919010191878449 -82.66614775445371254999357800739 -> 1381026551423669919010191878532 Inexact Rounded +addx3007 add 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> -4410583128274.803057056669103177 Inexact Rounded +comx3007 compare 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> 1 +divx3007 divide 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> -1.049073743992404570569003129346E-9 Inexact Rounded +dvix3007 divideint 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> -0 +mulx3007 multiply 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> -20407887067124025.31576887565113 Inexact Rounded +powx3007 power 4627.026960423072127953556635585 -4 -> 2.181684167222334934221407781701E-15 Inexact Rounded +remx3007 remainder 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> 4627.026960423072127953556635585 +subx3007 subtract 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> 4410583137528.856977902813359085 Inexact Rounded +addx3008 add 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -8684111695095849922187690616727 Inexact Rounded +comx3008 compare 75353574493.84484153484918212042 -8684111695095849922263044191221 -> 1 +divx3008 divide 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -8.677177026223536475531592432118E-21 Inexact Rounded +dvix3008 divideint 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -0 +mulx3008 multiply 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -6.543788575292743281456830701127E+41 Inexact Rounded +powx3008 power 75353574493.84484153484918212042 -9 -> 1.276630670287906925570645490707E-98 Inexact Rounded +remx3008 remainder 75353574493.84484153484918212042 -8684111695095849922263044191221 -> 75353574493.84484153484918212042 +subx3008 subtract 75353574493.84484153484918212042 -8684111695095849922263044191221 -> 8684111695095849922338397765715 Inexact Rounded +addx3009 add 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 6907061.073440802792400108035410 Inexact Rounded +comx3009 compare 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 1 +divx3009 divide 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 2417586.646146283856436864121104 Inexact Rounded +dvix3009 divideint 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 2417586 +mulx3009 multiply 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 19733502.94653326211623698034717 Inexact Rounded +powx3009 power 6907058.216435355874729592373011 3 -> 329518156646369505494.8971353240 Inexact Rounded +remx3009 remainder 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 1.846043452483451396449034189630 +subx3009 subtract 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 6907055.359429908957059076710612 Inexact Rounded +addx3010 add -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -38949530427253.24030680468677190 Inexact Rounded +comx3010 compare -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -1 +divx3010 divide -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -5.469149031100999700489221122509E+996 Inexact Rounded +dvix3010 divideint -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> NaN Division_impossible +mulx3010 multiply -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -2.773861000818483769292240109417E-970 Inexact Rounded +powx3010 power -38949530427253.24030680468677190 7 -> -1.359926959823071332599817363877E+95 Inexact Rounded +remx3010 remainder -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> NaN Division_impossible +subx3010 subtract -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -38949530427253.24030680468677190 Inexact Rounded +addx3011 add -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> -1270911.495819550779479954702829 Inexact Rounded +comx3011 compare -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> -1 +divx3011 divide -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> 1.258023449218665608349145394069 Inexact Rounded +dvix3011 divideint -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> 1 +mulx3011 multiply -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> 398531319444.8556128729086112205 Inexact Rounded +powx3011 power -0708069.025667471996378081482549 -562842 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3011 remainder -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> -145226.5555153932132762082622686 +subx3011 subtract -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> -145226.5555153932132762082622686 +addx3012 add 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> -4.318314692189767383476104084575E+224 Inexact Rounded +comx3012 compare 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> 1 +divx3012 divide 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> -9.390439409913307906923909630247E-219 Inexact Rounded +dvix3012 divideint 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> -0 +mulx3012 multiply 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> -1.751114283680833039197637874453E+231 Inexact Rounded +powx3012 power 4055087.246994644709729942673976 -4 -> 3.698274893849241116195795515302E-27 Inexact Rounded +remx3012 remainder 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> 4055087.246994644709729942673976 +subx3012 subtract 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> 4.318314692189767383476104084575E+224 Inexact Rounded +addx3013 add 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> -815.9047305921862348263521876034 Inexact Rounded +comx3013 compare 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> 1 +divx3013 divide 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> -5.518899111238367862234798433551E-503 Inexact Rounded +dvix3013 divideint 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> -0 +mulx3013 multiply 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> -3.673934060071516156604453756541E-497 Inexact Rounded +powx3013 power 4502895892520.396581348110906909E-512 -816 -> Infinity Overflow Inexact Rounded +remx3013 remainder 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> 4.502895892520396581348110906909E-500 +subx3013 subtract 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> 815.9047305921862348263521876034 Inexact Rounded +addx3014 add 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> 465.6005787733070743275007572563 Inexact Rounded +comx3014 compare 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> 1 +divx3014 divide 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> -225.7594380101027705997496045999 Inexact Rounded +dvix3014 divideint 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> -225 +mulx3014 multiply 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> -968.8065431314121523074875069807 Inexact Rounded +powx3014 power 467.6721295072628100260239179865 -2 -> 0.000004572113694193221810609836080931 Inexact Rounded +remx3014 remainder 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> 1.57321436722227785831275368025 +subx3014 subtract 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> 469.7436802412185457245470787168 Inexact Rounded +addx3015 add 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> -8677147.586389401682712180146855 Inexact Rounded +comx3015 compare 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> 1 +divx3015 divide 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> -2.485604044230163799604243529005E-578 Inexact Rounded +dvix3015 divideint 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> -0 +mulx3015 multiply 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> -1.871483124723381986272837942577E-564 Inexact Rounded +powx3015 power 2.156795313311150143949997552501E-571 -8677148 -> Infinity Overflow Inexact Rounded +remx3015 remainder 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> 2.156795313311150143949997552501E-571 +subx3015 subtract 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> 8677147.586389401682712180146855 Inexact Rounded +addx3016 add -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> -694070746.6469215276170700777068 Inexact Rounded +comx3016 compare -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 1 +divx3016 divide -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 0.001406664546942092941961075608769 Inexact Rounded +dvix3016 divideint -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 0 +mulx3016 multiply -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 675736017210596.9899587749991363 Inexact Rounded +powx3016 power -974953.2801637208368002585822457 -693095793 -> -0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3016 remainder -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> -974953.2801637208368002585822457 +subx3016 subtract -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 692120840.0865940859434695605424 Inexact Rounded +addx3017 add -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -7634680140009571846155654339781 Inexact Rounded +comx3017 compare -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -1 +divx3017 divide -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -2.536749610869326753741024659948E+508 Inexact Rounded +dvix3017 divideint -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> NaN Division_impossible +mulx3017 multiply -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -2.297756963892134373657544025107E-447 Inexact Rounded +powx3017 power -7634680140009571846155654339781 3 -> -4.450128382072157170207584847831E+92 Inexact Rounded +remx3017 remainder -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> NaN Division_impossible +subx3017 subtract -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -7634680140009571846155654339781 Inexact Rounded +addx3018 add 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 74177.21073338090843145838835480 Inexact Rounded +comx3018 compare 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> -1 +divx3018 divide 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 3.535762799545274329358292065343E-624 Inexact Rounded +dvix3018 divideint 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 0 +mulx3018 multiply 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 1.945468124372395349192665031675E-614 Inexact Rounded +powx3018 power 262273.0222851186523650889896428E-624 74177 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3018 remainder 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 2.622730222851186523650889896428E-619 +subx3018 subtract 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> -74177.21073338090843145838835480 Inexact Rounded +addx3019 add -8036052748815903177624716581732 -066677357.4438809548850966167573 -> -8036052748815903177624783259089 Inexact Rounded +comx3019 compare -8036052748815903177624716581732 -066677357.4438809548850966167573 -> -1 +divx3019 divide -8036052748815903177624716581732 -066677357.4438809548850966167573 -> 120521464210387351732732.6271469 Inexact Rounded +dvix3019 divideint -8036052748815903177624716581732 -066677357.4438809548850966167573 -> 120521464210387351732732 +mulx3019 multiply -8036052748815903177624716581732 -066677357.4438809548850966167573 -> 5.358227615706800711033262124598E+38 Inexact Rounded +powx3019 power -8036052748815903177624716581732 -66677357 -> -0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3019 remainder -8036052748815903177624716581732 -066677357.4438809548850966167573 -> -41816499.5048993028288978900564 +subx3019 subtract -8036052748815903177624716581732 -066677357.4438809548850966167573 -> -8036052748815903177624649904375 Inexact Rounded +addx3020 add 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> 8.834295928031498103637713570166E+770 Inexact Rounded +comx3020 compare 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> 1 +divx3020 divide 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> -2.008754492913739633208672455025E+766 Inexact Rounded +dvix3020 divideint 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> NaN Division_impossible +mulx3020 multiply 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> -3.885232606540600490321438191516E+775 Inexact Rounded +powx3020 power 883429.5928031498103637713570166E+765 -43979 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3020 remainder 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> NaN Division_impossible +subx3020 subtract 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> 8.834295928031498103637713570166E+770 Inexact Rounded +addx3021 add 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> -5588536565419.943265474528122494 Inexact Rounded +comx3021 compare 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> 1 +divx3021 divide 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> -0.004416506865458415275182120038399 Inexact Rounded +dvix3021 divideint 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> -0 +mulx3021 multiply 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> -139161701088530765925120.8408852 Inexact Rounded +powx3021 power 24791301060.37938360567775506973 -6 -> 4.307289712375673028996126249656E-63 Inexact Rounded +remx3021 remainder 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> 24791301060.37938360567775506973 +subx3021 subtract 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> 5638119167540.702032685883632634 Inexact Rounded +addx3022 add -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> -930712184.3335760878938383398937 Inexact Rounded +comx3022 compare -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> -1 +divx3022 divide -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> 1257062.290270583507131602958799 Inexact Rounded +dvix3022 divideint -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> 1257062 +mulx3022 multiply -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> 689085814282.3968746911100154133 Inexact Rounded +powx3022 power -930711443.9474781586162910776139 -740 -> 1.193603394165051899997226995178E-6637 Inexact Rounded +remx3022 remainder -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> -214.9123046664996750639167712140 +subx3022 subtract -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> -930710703.5613802293387438153341 Inexact Rounded +addx3023 add 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 2358276428979.423170691006252127 Inexact Rounded +comx3023 compare 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 1 +divx3023 divide 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 11001528525.07089502152736489473 Inexact Rounded +dvix3023 divideint 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 11001528525 +mulx3023 multiply 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 505517728904226.6233443209659001 Inexact Rounded +powx3023 power 2358276428765.064191082773385539 214 -> 5.435856480782850080741276939256E+2647 Inexact Rounded +remx3023 remainder 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 15.1969844739096415643561521775 +subx3023 subtract 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 2358276428550.705211474540518951 Inexact Rounded +addx3024 add -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -3.868744449795653651638308926987E+750 Inexact Rounded +comx3024 compare -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -1 +divx3024 divide -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -4.677779235812959233092739433453E+746 Inexact Rounded +dvix3024 divideint -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> NaN Division_impossible +mulx3024 multiply -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -3.199634455434813294426505526063E+754 Inexact Rounded +powx3024 power -3.868744449795653651638308926987E+750 8270 -> Infinity Overflow Inexact Rounded +remx3024 remainder -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> NaN Division_impossible +subx3024 subtract -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -3.868744449795653651638308926987E+750 Inexact Rounded +addx3025 add 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> -567195652586.2454217069003186487 Inexact Rounded +comx3025 compare 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> 1 +divx3025 divide 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> -2.475725421131866851190640203633E-451 Inexact Rounded +dvix3025 divideint 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> -0 +mulx3025 multiply 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> -7.964678739652657498503799559950E-428 Inexact Rounded +powx3025 power 140422069.5863246490180206814374E-447 -6 -> 1.304330899731988395473578425854E+2633 Inexact Rounded +remx3025 remainder 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> 1.404220695863246490180206814374E-439 +subx3025 subtract 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> 567195652586.2454217069003186487 Inexact Rounded +addx3026 add 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> -9.452601935038035195726041512900E+467 Inexact Rounded +comx3026 compare 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> 1 +divx3026 divide 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> -8.032613347885465805613265604973E-305 Inexact Rounded +dvix3026 divideint 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> -0 +mulx3026 multiply 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> -7.177275242712723733041569606882E+631 Inexact Rounded +powx3026 power 75929096475.63450425339472559646E+153 -9 -> 1.192136299657177324051477375561E-1475 Inexact Rounded +remx3026 remainder 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> 7.592909647563450425339472559646E+163 +subx3026 subtract 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> 9.452601935038035195726041512900E+467 Inexact Rounded +addx3027 add 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> -5.641317823202274083982487558514E+637 Inexact Rounded +comx3027 compare 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> 1 +divx3027 divide 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> -1.118943925332481944765809682502E-628 Inexact Rounded +dvix3027 divideint 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> -0 +mulx3027 multiply 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> -3.560979378308906043783023726787E+647 Inexact Rounded +powx3027 power 6312318309.142044953357460463732 -6 -> 1.580762611512787720076533747265E-59 Inexact Rounded +remx3027 remainder 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> 6312318309.142044953357460463732 +subx3027 subtract 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> 5.641317823202274083982487558514E+637 Inexact Rounded +addx3028 add 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 93793652428100.52105928239469937 Inexact Rounded +comx3028 compare 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 1 +divx3028 divide 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 1.022544815694674972559924997256E+723 Inexact Rounded +dvix3028 divideint 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> NaN Division_impossible +mulx3028 multiply 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 8.603289656137796526769786965341E-696 Inexact Rounded +powx3028 power 93793652428100.52105928239469937 9 -> 5.617732206663136654187263964365E+125 Inexact Rounded +remx3028 remainder 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> NaN Division_impossible +subx3028 subtract 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 93793652428100.52105928239469937 Inexact Rounded +addx3029 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337115 Inexact Rounded +comx3029 compare 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 1 +divx3029 divide 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> -4103968.106336710126241266685434 Inexact Rounded +dvix3029 divideint 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> -4103968 +mulx3029 multiply 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> -2362732023235112.375960528304974 Inexact Rounded +powx3029 power 98471198160.56524417578665886060 -23994 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3029 remainder 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 2551.45824316125588493249246784 +subx3029 subtract 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471222154.70837811518409435005 Inexact Rounded +addx3030 add 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> 329324100.9201858301191681987940 Inexact Rounded +comx3030 compare 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> 1 +divx3030 divide 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> -134358.6406732917173739187421978 Inexact Rounded +dvix3030 divideint 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> -134358 +mulx3030 multiply 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> -807212527028.0005401736893474430 Inexact Rounded +powx3030 power 329326552.0208398002250836592043 -2451 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3030 remainder 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> 1570.35472430963565384668749322 +subx3030 subtract 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> 329329003.1214937703309991196146 Inexact Rounded +addx3031 add -92980.68431371090354435763218439 -2282178507046019721925800997065 -> -2282178507046019721925801090046 Inexact Rounded +comx3031 compare -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 1 +divx3031 divide -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 4.074207342968196863070496994457E-26 Inexact Rounded +dvix3031 divideint -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 0 +mulx3031 multiply -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 2.121985193111820147170707717938E+35 Inexact Rounded +powx3031 power -92980.68431371090354435763218439 -2 -> 1.156683455371909793870207184337E-10 Inexact Rounded +remx3031 remainder -92980.68431371090354435763218439 -2282178507046019721925800997065 -> -92980.68431371090354435763218439 +subx3031 subtract -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 2282178507046019721925800904084 Inexact Rounded +addx3032 add 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1.213581776227858606259822256987E+748 Inexact Rounded +comx3032 compare 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1 +divx3032 divide 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1.233860374149945561886955398724E+1648 Inexact Rounded +dvix3032 divideint 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> NaN Division_impossible +mulx3032 multiply 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1.193636458750059340733188876015E-152 Inexact Rounded +powx3032 power 12135817762.27858606259822256987E+738 10 -> 6.929317520577437720457517499936E+7480 Inexact Rounded +remx3032 remainder 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> NaN Division_impossible +subx3032 subtract 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1.213581776227858606259822256987E+748 Inexact Rounded +addx3033 add 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> -392513.2044337156627881674596002 Inexact Rounded +comx3033 compare 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> 1 +divx3033 divide 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> -0.00009495486002714264641177211062199 Inexact Rounded +dvix3033 divideint 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> -0 +mulx3033 multiply 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> -14632152.58043001234518095997140 Inexact Rounded +powx3033 power 37.27457578793521166809739140081 -392550 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3033 remainder 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> 37.27457578793521166809739140081 +subx3033 subtract 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> 392587.7535852915332115036543830 Inexact Rounded +addx3034 add -2787.980590304199878755265273703 7117631179305319208210387565324 -> 7117631179305319208210387562536 Inexact Rounded +comx3034 compare -2787.980590304199878755265273703 7117631179305319208210387565324 -> -1 +divx3034 divide -2787.980590304199878755265273703 7117631179305319208210387565324 -> -3.917006262435063093475140250870E-28 Inexact Rounded +dvix3034 divideint -2787.980590304199878755265273703 7117631179305319208210387565324 -> -0 +mulx3034 multiply -2787.980590304199878755265273703 7117631179305319208210387565324 -> -1.984381757684722217801410305714E+34 Inexact Rounded +powx3034 power -2787.980590304199878755265273703 7 -> -1309266999233099220127139.440082 Inexact Rounded +remx3034 remainder -2787.980590304199878755265273703 7117631179305319208210387565324 -> -2787.980590304199878755265273703 +subx3034 subtract -2787.980590304199878755265273703 7117631179305319208210387565324 -> -7117631179305319208210387568112 Inexact Rounded +addx3035 add -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> -9.890633854609434943559831911276E+977 Inexact Rounded +comx3035 compare -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> -1 +divx3035 divide -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> 5.098302376420396260404821158158E+968 Inexact Rounded +dvix3035 divideint -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> NaN Division_impossible +mulx3035 multiply -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> 1.918768853302706825964087702307E+987 Inexact Rounded +powx3035 power -9890633.854609434943559831911276E+971 -2 -> 1.022237362667592867768511487814E-1956 Inexact Rounded +remx3035 remainder -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> NaN Division_impossible +subx3035 subtract -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> -9.890633854609434943559831911276E+977 Inexact Rounded +addx3036 add 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> 3927209601.042340294247970850347 Inexact Rounded +comx3036 compare 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> 1 +divx3036 divide 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> -227.2123393091837706827708196101 Inexact Rounded +dvix3036 divideint 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> -227 +mulx3036 multiply 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> -68480589931920481.56020043213767 Inexact Rounded +powx3036 power 3944570323.331121750661920475191 -17360722 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3036 remainder 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> 3686363.77773114469535563568018 +subx3036 subtract 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> 3961931045.619903207075870100035 Inexact Rounded +addx3037 add 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 1786717307.025364028452423865075 Inexact Rounded +comx3037 compare 19544.14018503427029002552872707 1786697762.885178994182133839546 -> -1 +divx3037 divide 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 0.00001093869404832867759234359871991 Inexact Rounded +dvix3037 divideint 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 0 +mulx3037 multiply 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 34919471546115.05897163496162290 Inexact Rounded +powx3037 power 19544.14018503427029002552872707 2 -> 381973415.5722714009298802557940 Inexact Rounded +remx3037 remainder 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 19544.14018503427029002552872707 +subx3037 subtract 19544.14018503427029002552872707 1786697762.885178994182133839546 -> -1786678218.744993959911843814017 Inexact Rounded +addx3038 add -05.75485957937617757983513662981 5564476875.989640431173694372083 -> 5564476870.234780851797516792248 Inexact Rounded +comx3038 compare -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -1 +divx3038 divide -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -1.034213944568271324841608825136E-9 Inexact Rounded +dvix3038 divideint -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -0 +mulx3038 multiply -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -32022783054.00620878436398990135 Inexact Rounded +powx3038 power -05.75485957937617757983513662981 6 -> 36325.23118223611421303238908472 Inexact Rounded +remx3038 remainder -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -5.75485957937617757983513662981 +subx3038 subtract -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -5564476881.744500010549871951918 Inexact Rounded +addx3039 add -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> 6.268877553774705678201112845462E+211 Inexact Rounded +comx3039 compare -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -1 +divx3039 divide -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -6.713834913211527184907421856434E-206 Inexact Rounded +dvix3039 divideint -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -0 +mulx3039 multiply -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -2.638458285983158789458925170267E+218 Inexact Rounded +powx3039 power -4208820.898718069194008526302746 6 -> 5.558564783291260359142223337994E+39 Inexact Rounded +remx3039 remainder -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -4208820.898718069194008526302746 +subx3039 subtract -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -6.268877553774705678201112845462E+211 Inexact Rounded +addx3040 add -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -7.007719547806630896979085821269E+562 Inexact Rounded +comx3040 compare -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -1 +divx3040 divide -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -1.521048673498997627360230078306E+559 Inexact Rounded +dvix3040 divideint -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> NaN Division_impossible +mulx3040 multiply -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -3.228570795682925509478191397878E+566 Inexact Rounded +powx3040 power -70077195478066.30896979085821269E+549 4607 -> -Infinity Overflow Inexact Rounded +remx3040 remainder -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> NaN Division_impossible +subx3040 subtract -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -7.007719547806630896979085821269E+562 Inexact Rounded +addx3041 add -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> -68569709.81053713470972973953995 Inexact Rounded +comx3041 compare -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 1 +divx3041 divide -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 0.006501728568934042143913111768557 Inexact Rounded +dvix3041 divideint -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 0 +mulx3041 multiply -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 30176190149574.84386395947593970 Inexact Rounded +powx3041 power -442941.7541811527940918244383454 -68126768 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3041 remainder -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> -442941.7541811527940918244383454 +subx3041 subtract -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 67683826.30217482912154609066325 Inexact Rounded +addx3042 add -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -40726479019.92472703575370611619 Inexact Rounded +comx3042 compare -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -1 +divx3042 divide -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -135895.4741975690872548233111888 Inexact Rounded +dvix3042 divideint -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -135895 +mulx3042 multiply -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -12205487445696816.02175665622242 Inexact Rounded +powx3042 power -040726778711.8677615616711676159 299692 -> Infinity Overflow Inexact Rounded +remx3042 remainder -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -142113.1908620082406650022240180 +subx3042 subtract -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -40727078403.81079608758862911561 Inexact Rounded +addx3043 add -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -1934197516.927615489663964685661 Inexact Rounded +comx3043 compare -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -1 +divx3043 divide -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -507563287.7312566071537233697473 Inexact Rounded +dvix3043 divideint -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -507563287 +mulx3043 multiply -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -7370745953.579062985130438309023 Inexact Rounded +powx3043 power -1934197520.738366912179143085955 4 -> 1.399597922275400947497855539475E+37 Inexact Rounded +remx3043 remainder -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -2.786637155934674312936704177047 +subx3043 subtract -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -1934197524.549118334694321486249 Inexact Rounded +addx3044 add 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> -303284009454.0558644298079356347 Inexact Rounded +comx3044 compare 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> 1 +divx3044 divide 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> -0.000002681514904267770294213381485108 Inexact Rounded +dvix3044 divideint 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> -0 +mulx3044 multiply 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> -246650255735392080.1357404280431 Inexact Rounded +powx3044 power 813262.7723533833038829559646830 -3 -> 1.859119568310997605545914895133E-18 Inexact Rounded +remx3044 remainder 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> 813262.7723533833038829559646830 +subx3044 subtract 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> 303285635979.6005711964157015467 Inexact Rounded +addx3045 add 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 36105954884.94621434979365589311 Inexact Rounded +comx3045 compare 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 1 +divx3045 divide 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 4.842808328786805821411674302686E+953 Inexact Rounded +dvix3045 divideint 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> NaN Division_impossible +mulx3045 multiply 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 2.691909094160561673391352743869E-933 Inexact Rounded +powx3045 power 36105954884.94621434979365589311 7 -> 7.999297449713301719582732447386E+73 Inexact Rounded +remx3045 remainder 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> NaN Division_impossible +subx3045 subtract 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 36105954884.94621434979365589311 Inexact Rounded +addx3046 add -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -48556402282.66602309736499370002 +comx3046 compare -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -1 +divx3046 divide -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -2.799666682029089956269018541649 Inexact Rounded +dvix3046 divideint -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -2 +mulx3046 multiply -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -2038051610593641947717.268652175 Inexact Rounded +powx3046 power -075537177538.1814516621962185490 3 -> -4.310049518987988084595264617727E+32 Inexact Rounded +remx3046 remainder -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -21575627027.15059453253376885104 +subx3046 subtract -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -102517952793.6968802270274433980 Inexact Rounded +addx3047 add -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> -4223765.415319564898840040697647 Inexact Rounded +comx3047 compare -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> -1 +divx3047 divide -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> 1.630425855588347356570076909053E+191 Inexact Rounded +dvix3047 divideint -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> NaN Division_impossible +mulx3047 multiply -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> 1.094204573762229308798604845395E-178 Inexact Rounded +powx3047 power -4223765.415319564898840040697647 -3 -> -1.327090775863616939309569791138E-20 Inexact Rounded +remx3047 remainder -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> NaN Division_impossible +subx3047 subtract -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> -4223765.415319564898840040697647 Inexact Rounded +addx3048 add -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> -7.877324314273694312164407794939E+270 Inexact Rounded +comx3048 compare -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 1 +divx3048 divide -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 8.212057140774706874666307246628E-268 Inexact Rounded +dvix3048 divideint -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 0 +mulx3048 multiply -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 5.095765270616284455922747530676E+274 Inexact Rounded +powx3048 power -6468.903738522951259063099946195 -8 -> 3.261027724982089298030362367616E-31 Inexact Rounded +remx3048 remainder -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> -6468.903738522951259063099946195 +subx3048 subtract -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 7.877324314273694312164407794939E+270 Inexact Rounded +addx3049 add -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> 1650.198961256061165362319471264 Inexact Rounded +comx3049 compare -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -1 +divx3049 divide -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -5.797616777301250711985729776957E-200 Inexact Rounded +dvix3049 divideint -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -0 +mulx3049 multiply -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -1.578781845938805737527304303976E-193 Inexact Rounded +powx3049 power -9567221.183663236817239254783372E-203 1650 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3049 remainder -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -9.567221183663236817239254783372E-197 +subx3049 subtract -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -1650.198961256061165362319471264 Inexact Rounded +addx3050 add 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 2.679017380163975186972720427030E+572 Inexact Rounded +comx3050 compare 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> -1 +divx3050 divide 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 3.289379965960065573444140749635E-988 Inexact Rounded +dvix3050 divideint 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 0 +mulx3050 multiply 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 2.360832119793036398127652187732E+157 Inexact Rounded +powx3050 power 8812306098770.200752139142033569E-428 3 -> 6.843349527476967274129043949969E-1246 Inexact Rounded +remx3050 remainder 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 8.812306098770200752139142033569E-416 +subx3050 subtract 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> -2.679017380163975186972720427030E+572 Inexact Rounded +addx3051 add 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> -706127147059.6372708438205200619 Inexact Rounded +comx3051 compare 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> 1 +divx3051 divide 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> -0.0001134341690057060105325397863996 Inexact Rounded +dvix3051 divideint 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> -0 +mulx3051 multiply 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> -56572874185674332398.36004114372 Inexact Rounded +powx3051 power 80108033.12724838718736922500904 -7 -> 4.723539145042336483008674060324E-56 Inexact Rounded +remx3051 remainder 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> 80108033.12724838718736922500904 +subx3051 subtract 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> 706287363125.8917676181952585119 Inexact Rounded +addx3052 add -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> -37942846288.41047269183344038636 Inexact Rounded +comx3052 compare -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> -1 +divx3052 divide -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> 6716194607.139224735032566328960 Inexact Rounded +dvix3052 divideint -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> 6716194607 +mulx3052 multiply -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> 214356442635.9672009449140933366 Inexact Rounded +powx3052 power -37942846282.76101663789059003505 -6 -> 3.351355986382646046773008753885E-64 Inexact Rounded +remx3052 remainder -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> -0.786544022188321089603127981421 +subx3052 subtract -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> -37942846277.11156058394773968374 Inexact Rounded +addx3053 add 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 92659632115305.13735437728445541 Inexact Rounded +comx3053 compare 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 1 +divx3053 divide 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 1.429174267919135710410529211791E+146 Inexact Rounded +dvix3053 divideint 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> NaN Division_impossible +mulx3053 multiply 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 6.007530093754446085819255987878E-119 Inexact Rounded +powx3053 power 92659632115305.13735437728445541 6 -> 6.329121451953461546696051563323E+83 Inexact Rounded +remx3053 remainder 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> NaN Division_impossible +subx3053 subtract 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 92659632115305.13735437728445541 Inexact Rounded +addx3054 add 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 569549865196.1367939656357237466 Inexact Rounded +comx3054 compare 2838948.589837595494152150647194 569547026247.5469563701415715960 -> -1 +divx3054 divide 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 0.000004984572755198057481907281080406 Inexact Rounded +dvix3054 divideint 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 0 +mulx3054 multiply 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 1616914727011669419.390959984273 Inexact Rounded +powx3054 power 2838948.589837595494152150647194 6 -> 5.235343334986059753096884080673E+38 Inexact Rounded +remx3054 remainder 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 2838948.589837595494152150647194 +subx3054 subtract 2838948.589837595494152150647194 569547026247.5469563701415715960 -> -569544187298.9571187746474194454 Inexact Rounded +addx3055 add 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 5.249952045236053307941775794287E+705 Inexact Rounded +comx3055 compare 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 1 +divx3055 divide 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 3.302685669286670708554753139233E+675 Inexact Rounded +dvix3055 divideint 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> NaN Division_impossible +mulx3055 multiply 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 8.345328389435009812933599889447E+735 Inexact Rounded +powx3055 power 524995204523.6053307941775794287E+694 2 -> 2.756199647727821911857160230849E+1411 Inexact Rounded +remx3055 remainder 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> NaN Division_impossible +subx3055 subtract 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 5.249952045236053307941775794287E+705 Inexact Rounded +addx3056 add -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -52461892246715.82764070853532913 Inexact Rounded +comx3056 compare -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -1 +divx3056 divide -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -12.23457628210057733643575143694 Inexact Rounded +dvix3056 divideint -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -12 +mulx3056 multiply -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -266786248710342647746063322.0544 Inexact Rounded +powx3056 power -57131573677452.15449921725097290 5 -> -6.086686503752679375430019503679E+68 Inexact Rounded +remx3056 remainder -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -1095396508616.232197112663247672 +subx3056 subtract -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -61801255108188.48135772596661667 Inexact Rounded +addx3057 add 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> 90794821.08377791746707352380646 Inexact Rounded +comx3057 compare 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> 1 +divx3057 divide 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> -16594131.20365054928428313232246 Inexact Rounded +dvix3057 divideint 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> -16594131 +mulx3057 multiply 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> -496784099.6333617958496589124964 Inexact Rounded +powx3057 power 90794826.55528018781830463383411 -5 -> 1.620669590532856523565742953997E-40 Inexact Rounded +remx3057 remainder 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> 1.114274442767230442307896655232 +subx3057 subtract 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> 90794832.02678245816953574386176 Inexact Rounded +addx3058 add 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> 58461733862.10202881160156091690 Inexact Rounded +comx3058 compare 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> 1 +divx3058 divide 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> -1243.257894477021678809337875304 Inexact Rounded +dvix3058 divideint 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> -1243 +mulx3058 multiply 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> -2753474621708672573.249029643967 Inexact Rounded +powx3058 power 58508794729.35191160840980489138 -47060867 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3058 remainder 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> 12136737.74759517576254461832107 +subx3058 subtract 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> 58555855596.60179440521804886586 Inexact Rounded +addx3059 add -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> 9.595418300613754556671852801667E+391 Inexact Rounded +comx3059 compare -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -1 +divx3059 divide -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -7.775628465932789700547872511745E-381 Inexact Rounded +dvix3059 divideint -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -0 +mulx3059 multiply -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -7.159180712764549711669939947084E+403 Inexact Rounded +powx3059 power -746104.0768078474426464219416332E+006 10 -> 5.345571346302582882805035996696E+118 Inexact Rounded +remx3059 remainder -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -746104076807.8474426464219416332 +subx3059 subtract -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -9.595418300613754556671852801667E+391 Inexact Rounded +addx3060 add 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> 5.599427632688387400403789659459E+120 Inexact Rounded +comx3060 compare 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> 1 +divx3060 divide 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> -6.105892851759828176655685111491E+119 Inexact Rounded +dvix3060 divideint 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> NaN Division_impossible +mulx3060 multiply 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> -5.134972161307679939281170944556E+121 Inexact Rounded +powx3060 power 55.99427632688387400403789659459E+119 -9 -> 1.848022584764384077672041056396E-1087 Inexact Rounded +remx3060 remainder 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> NaN Division_impossible +subx3060 subtract 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> 5.599427632688387400403789659459E+120 Inexact Rounded +addx3061 add -41214265628.83801241467317270595 1015336323798389903361978271354 -> 1015336323798389903320764005725 Inexact Rounded +comx3061 compare -41214265628.83801241467317270595 1015336323798389903361978271354 -> -1 +divx3061 divide -41214265628.83801241467317270595 1015336323798389903361978271354 -> -4.059173759750342247620706384027E-20 Inexact Rounded +dvix3061 divideint -41214265628.83801241467317270595 1015336323798389903361978271354 -> -0 +mulx3061 multiply -41214265628.83801241467317270595 1015336323798389903361978271354 -> -4.184634095163472384028549378392E+40 Inexact Rounded +powx3061 power -41214265628.83801241467317270595 1 -> -41214265628.83801241467317270595 +remx3061 remainder -41214265628.83801241467317270595 1015336323798389903361978271354 -> -41214265628.83801241467317270595 +subx3061 subtract -41214265628.83801241467317270595 1015336323798389903361978271354 -> -1015336323798389903403192536983 Inexact Rounded +addx3062 add 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 82351554300031.00628677123370689 Inexact Rounded +comx3062 compare 89937.39749201095570357557430822 82351554210093.60879476027800331 -> -1 +divx3062 divide 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 1.092115362662913415592930982129E-9 Inexact Rounded +dvix3062 divideint 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 0 +mulx3062 multiply 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 7406484465078077191.920015793662 Inexact Rounded +powx3062 power 89937.39749201095570357557430822 8 -> 4.280776267723913043050100934291E+39 Inexact Rounded +remx3062 remainder 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 89937.39749201095570357557430822 +subx3062 subtract 89937.39749201095570357557430822 82351554210093.60879476027800331 -> -82351554120156.21130274932229973 Inexact Rounded +addx3063 add 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 1.712661646770821562841254869430E+365 Inexact Rounded +comx3063 compare 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 1 +divx3063 divide 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 2.956290925475414185960999788848E+397 Inexact Rounded +dvix3063 divideint 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> NaN Division_impossible +mulx3063 multiply 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 9.921925785595813587655312307930E+332 Inexact Rounded +powx3063 power 01712661.64677082156284125486943E+359 6 -> 2.523651803323047711735501944959E+2191 Inexact Rounded +remx3063 remainder 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> NaN Division_impossible +subx3063 subtract 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 1.712661646770821562841254869430E+365 Inexact Rounded +addx3064 add -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> -658179152015.9868345843925715053 Inexact Rounded +comx3064 compare -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 1 +divx3064 divide -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 0.004038849497560303158639192895544 Inexact Rounded +dvix3064 divideint -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 0 +mulx3064 multiply -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 1735580967057433153120.099643641 Inexact Rounded +powx3064 power -2647593306.528617691373470059213 -7 -> -1.096581914005902583413810201571E-66 Inexact Rounded +remx3064 remainder -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> -2647593306.528617691373470059213 +subx3064 subtract -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 652883965402.9295992016456313869 Inexact Rounded +addx3065 add 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> -7.145586619176091599264717047885E+788 Inexact Rounded +comx3065 compare 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> 1 +divx3065 divide 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> -4.064157144036712325084472022316E-1088 Inexact Rounded +dvix3065 divideint 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> -0 +mulx3065 multiply 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> -2.075134583305571527962710017262E+490 Inexact Rounded +powx3065 power 2904078690665765116603253099668E-329 -7 -> 5.740389208842895561250128407803E+2089 Inexact Rounded +remx3065 remainder 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> 2.904078690665765116603253099668E-299 +subx3065 subtract 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> 7.145586619176091599264717047885E+788 Inexact Rounded +addx3066 add 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> 22094338972.39109726522477999515 Inexact Rounded +comx3066 compare 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> 1 +divx3066 divide 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> -5.390880808019174194010224736965E+497 Inexact Rounded +dvix3066 divideint 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> NaN Division_impossible +mulx3066 multiply 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> -9.055288588476315822113975426730E-478 Inexact Rounded +powx3066 power 22094338972.39109726522477999515 -4 -> 4.196391022354122686725315209967E-42 Inexact Rounded +remx3066 remainder 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> NaN Division_impossible +subx3066 subtract 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> 22094338972.39109726522477999515 Inexact Rounded +addx3067 add -3374988581607586061255542201048 82293895124.90045271504836568681 -> -3374988581607586061173248305923 Inexact Rounded +comx3067 compare -3374988581607586061255542201048 82293895124.90045271504836568681 -> -1 +divx3067 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81310977038 Inexact Rounded +dvix3067 divideint -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797 +mulx3067 multiply -3374988581607586061255542201048 82293895124.90045271504836568681 -> -2.777409563825512202793336132310E+41 Inexact Rounded +powx3067 power -3374988581607586061255542201048 8 -> 1.683365657238878057620634207267E+244 Inexact Rounded +remx3067 remainder -3374988581607586061255542201048 82293895124.90045271504836568681 -> -66913970168.62046257175566384243 +subx3067 subtract -3374988581607586061255542201048 82293895124.90045271504836568681 -> -3374988581607586061337836096173 Inexact Rounded +addx3068 add -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> -84172558171932.94780431960508260 Inexact Rounded +comx3068 compare -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> -1 +divx3068 divide -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> 7467674426.467986736459678347587 Inexact Rounded +dvix3068 divideint -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> 7467674426 +mulx3068 multiply -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> 948758494638999235.1953022970755 Inexact Rounded +powx3068 power -84172558160661.35863831029352323 -11272 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3068 remainder -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> -5274.95422851496534479122656860 +subx3068 subtract -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> -84172558149389.76947230098196386 Inexact Rounded +addx3069 add -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -7.004693232461490596396237508541E-555 Inexact Rounded +comx3069 compare -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -1 +divx3069 divide -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -2.082768876995463487926920072359E+362 Inexact Rounded +dvix3069 divideint -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> NaN Division_impossible +mulx3069 multiply -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -2.355793185832144388285949021738E-1471 Inexact Rounded +powx3069 power -70046932324614.90596396237508541E-568 3 -> -3.436903678302639677280508409829E-1663 Inexact Rounded +remx3069 remainder -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> NaN Division_impossible +subx3069 subtract -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -7.004693232461490596396237508541E-555 Inexact Rounded +addx3070 add 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> 4125384407.053782660115680886000 Inexact Rounded +comx3070 compare 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> 1 +divx3070 divide 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> -1.053928941287132717250540955457E+649 Inexact Rounded +dvix3070 divideint 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> NaN Division_impossible +mulx3070 multiply 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> -1.614795442013190139080634449273E-630 Inexact Rounded +powx3070 power 0004125384407.053782660115680886 -4 -> 3.452568541597450106266555783362E-39 Inexact Rounded +remx3070 remainder 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> NaN Division_impossible +subx3070 subtract 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> 4125384407.053782660115680886000 Inexact Rounded +addx3071 add -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> 9.291391582947237200286427030028E+775 Inexact Rounded +comx3071 compare -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -1 +divx3071 divide -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -3.425012375468251447194400841658E-1209 Inexact Rounded +dvix3071 divideint -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -0 +mulx3071 multiply -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -2.956811729743937541973845029816E+343 Inexact Rounded +powx3071 power -31823131.15691583393820628480997E-440 9 -> -3.347234803487575870321338308655E-3893 Inexact Rounded +remx3071 remainder -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -3.182313115691583393820628480997E-433 +subx3071 subtract -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -9.291391582947237200286427030028E+775 Inexact Rounded +addx3072 add 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 55573868488.43891477926020011694 Inexact Rounded +comx3072 compare 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 1 +divx3072 divide 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 92696782.14318796763098335498657 Inexact Rounded +dvix3072 divideint 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 92696782 +mulx3072 multiply 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 33317820972080.24347717542221477 Inexact Rounded +powx3072 power 55573867888.91575330563698128150 600 -> 8.363240671070136278221965616973E+6446 Inexact Rounded +remx3072 remainder 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 85.8445030391099686478265169012 +subx3072 subtract 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 55573867289.39259183201376244606 Inexact Rounded +addx3073 add -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> 5.487207142687001607026665515349E-356 Inexact Rounded +comx3073 compare -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -1 +divx3073 divide -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -9.928051387110587327889009363069E-415 Inexact Rounded +dvix3073 divideint -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -0 +mulx3073 multiply -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -2.989280896644635352838087864373E-1125 Inexact Rounded +powx3073 power -5447727448431680878699555714796E-800 5 -> -4.798183553278543065204833300725E-3847 Inexact Rounded +remx3073 remainder -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -5.447727448431680878699555714796E-770 +subx3073 subtract -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -5.487207142687001607026665515349E-356 Inexact Rounded +addx3074 add 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 418359224750.4711631202083513795 Inexact Rounded +comx3074 compare 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 1 +divx3074 divide 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 42602.13713335803513874339309132 Inexact Rounded +dvix3074 divideint 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 42602 +mulx3074 multiply 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 4108155982352814348.343441299082 Inexact Rounded +powx3074 power 0418349404834.547110239542290134 9819916 -> Infinity Overflow Inexact Rounded +remx3074 remainder 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 1346638.04628810400110728063718 +subx3074 subtract 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 418339584918.6230573588762288885 Inexact Rounded +addx3075 add -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> -7.983992600094836304387324162042E+420 Inexact Rounded +comx3075 compare -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 1 +divx3075 divide -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 3.281838669494274896180376328433E-416 Inexact Rounded +dvix3075 divideint -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 0 +mulx3075 multiply -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 2.091979765115329268275803385534E+426 Inexact Rounded +powx3075 power -262021.7565194737396448014286436 -8 -> 4.500918721033033032706782304195E-44 Inexact Rounded +remx3075 remainder -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> -262021.7565194737396448014286436 +subx3075 subtract -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 7.983992600094836304387324162042E+420 Inexact Rounded +addx3076 add 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> -3.386875233985057267609967806187E+831 Inexact Rounded +comx3076 compare 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> 1 +divx3076 divide 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> -1.437786964892976582009952172420E-1326 Inexact Rounded +dvix3076 divideint 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> -0 +mulx3076 multiply 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> -1.649274478764579569246425611629E+337 Inexact Rounded +powx3076 power 48696050631.42565380301204592392E-505 -3 -> 8.660017688773759463020340778853E+1482 Inexact Rounded +remx3076 remainder 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> 4.869605063142565380301204592392E-495 +subx3076 subtract 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> 3.386875233985057267609967806187E+831 Inexact Rounded +addx3077 add 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> 95256207.85635086953625240702318 Inexact Rounded +comx3077 compare 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> 1 +divx3077 divide 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> -1567.937180706641856870286122623 Inexact Rounded +dvix3077 divideint 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> -1567 +mulx3077 multiply 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> -5794447919993.150493301061195714 Inexact Rounded +powx3077 power 95316999.19440144356471126680708 -60791 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3077 remainder 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> 56972.46915194096967798542896355 +subx3077 subtract 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> 95377790.53245201759317012659098 Inexact Rounded +addx3078 add -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> 8032459.450998820205916538543258 Inexact Rounded +comx3078 compare -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -1 +divx3078 divide -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -6.631471131473117487839243582873E-113 Inexact Rounded +dvix3078 divideint -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -0 +mulx3078 multiply -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -4.278652020339705265013632757349E-99 Inexact Rounded +powx3078 power -5326702296402708234722215224979E-136 8032459 -> -0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3078 remainder -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -5.326702296402708234722215224979E-106 +subx3078 subtract -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -8032459.450998820205916538543258 Inexact Rounded +addx3079 add 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 6.718750684079501575335482615780E-280 Inexact Rounded +comx3079 compare 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 1 +divx3079 divide 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 9.152153872187460598958616592442E+571 Inexact Rounded +dvix3079 divideint 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> NaN Division_impossible +mulx3079 multiply 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 4.932348317700372401849231767007E-1131 Inexact Rounded +powx3079 power 67.18750684079501575335482615780E-281 7 -> 6.180444071023111300817518409550E-1955 Inexact Rounded +remx3079 remainder 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> NaN Division_impossible +subx3079 subtract 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 6.718750684079501575335482615780E-280 Inexact Rounded +addx3080 add -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -8738791762039.358125211204773930 Inexact Rounded +comx3080 compare -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -1 +divx3080 divide -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -17216.56012577673731612130068130 Inexact Rounded +dvix3080 divideint -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -17216 +mulx3080 multiply -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -4436156407404759833857.580707024 Inexact Rounded +powx3080 power -8739299372114.092482914139281669 507610075 -> -Infinity Overflow Inexact Rounded +remx3080 remainder -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -284325487.3902691936540542102992 +subx3080 subtract -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -8739806982188.826840617073789408 Inexact Rounded +addx3081 add 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 2454.002078468928665008217727731 Inexact Rounded +comx3081 compare 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 1 +divx3081 divide 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 4.205327278123112611006652533618E+141 Inexact Rounded +dvix3081 divideint 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> NaN Division_impossible +mulx3081 multiply 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 1.432023194118096842806010293027E-135 Inexact Rounded +powx3081 power 2454.002078468928665008217727731 6 -> 218398452792293853786.9263054420 Inexact Rounded +remx3081 remainder 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> NaN Division_impossible +subx3081 subtract 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 2454.002078468928665008217727731 Inexact Rounded +addx3082 add 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 829181.6561975853393326976860680 Inexact Rounded +comx3082 compare 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 1 +divx3082 divide 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 11.83500633601553578851124281417 Inexact Rounded +dvix3082 divideint 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 11 +mulx3082 multiply 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 49394169921.82458094138096628957 Inexact Rounded +powx3082 power 764578.5204849936912066033177429 64603 -> Infinity Overflow Inexact Rounded +remx3082 remainder 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 53944.02764648556181956526616724 +subx3082 subtract 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 699975.3847724020430805089494178 Inexact Rounded +addx3083 add 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 846389013551.3654139910676568223 Inexact Rounded +comx3083 compare 079203.7330103777716903518367560 846388934347.6324036132959664705 -> -1 +divx3083 divide 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 9.357841270860339858146471876044E-8 Inexact Rounded +dvix3083 divideint 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 0 +mulx3083 multiply 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 67037163179008037.19983564789203 Inexact Rounded +powx3083 power 079203.7330103777716903518367560 8 -> 1.548692549503356788115682996756E+39 Inexact Rounded +remx3083 remainder 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 79203.7330103777716903518367560 +subx3083 subtract 079203.7330103777716903518367560 846388934347.6324036132959664705 -> -846388855143.8993932355242761187 Inexact Rounded +addx3084 add -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> 5.474973992953902631890208360829 Inexact Rounded +comx3084 compare -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -1 +divx3084 divide -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -7.814797878848469282033896969532E-327 Inexact Rounded +dvix3084 divideint -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -0 +mulx3084 multiply -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -2.342512251965378028433584538870E-325 Inexact Rounded +powx3084 power -4278.581514688669249247007127899E-329 5 -> -1.433834587801771244104676682986E-1627 Inexact Rounded +remx3084 remainder -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -4.278581514688669249247007127899E-326 +subx3084 subtract -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -5.474973992953902631890208360829 Inexact Rounded +addx3085 add 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 6.149612565404080501157093851895E+817 Inexact Rounded +comx3085 compare 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> -1 +divx3085 divide 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 9.897699923417617920996187420968E-160 Inexact Rounded +dvix3085 divideint 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 0 +mulx3085 multiply 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 3.743085898893072544197564013497E+1476 Inexact Rounded +powx3085 power 60867019.81764798845468445196869E+651 6 -> 5.085014897388871736767602086646E+3952 Inexact Rounded +remx3085 remainder 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 6.086701981764798845468445196869E+658 +subx3085 subtract 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> -6.149612565404080501157093851895E+817 Inexact Rounded +addx3086 add 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> -8.945059095290523784746184357820E+538 Inexact Rounded +comx3086 compare 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> 1 +divx3086 divide 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> -2.074264411286709228674841672954E-908 Inexact Rounded +dvix3086 divideint 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> -0 +mulx3086 multiply 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> -1.659703631470633700884136887614E+170 Inexact Rounded +powx3086 power 18554417738217.62218590965803605E-382 -9 -> 3.836842998295531899082688721531E+3318 Inexact Rounded +remx3086 remainder 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> 1.855441773821762218590965803605E-369 +subx3086 subtract 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> 8.945059095290523784746184357820E+538 Inexact Rounded +addx3087 add 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 9.977847825356104634823627327033E+127 Inexact Rounded +comx3087 compare 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> -1 +divx3087 divide 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 6.922670772910807388395384866884E-115 Inexact Rounded +dvix3087 divideint 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 0 +mulx3087 multiply 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 6.892034301367879802693422066425E+141 Inexact Rounded +powx3087 power 69073355517144.36356688642213839 10 -> 2.472324890841334302628435461516E+138 Inexact Rounded +remx3087 remainder 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 69073355517144.36356688642213839 +subx3087 subtract 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> -9.977847825356104634823627327033E+127 Inexact Rounded +addx3088 add 450282259072.8657099359104277477 -1791307965314309175477911369824 -> -1791307965314309175027629110751 Inexact Rounded +comx3088 compare 450282259072.8657099359104277477 -1791307965314309175477911369824 -> 1 +divx3088 divide 450282259072.8657099359104277477 -1791307965314309175477911369824 -> -2.513706564096350714213771006483E-19 Inexact Rounded +dvix3088 divideint 450282259072.8657099359104277477 -1791307965314309175477911369824 -> -0 +mulx3088 multiply 450282259072.8657099359104277477 -1791307965314309175477911369824 -> -8.065941973169457071650996861677E+41 Inexact Rounded +powx3088 power 450282259072.8657099359104277477 -2 -> 4.932082442194544671633570348838E-24 Inexact Rounded +remx3088 remainder 450282259072.8657099359104277477 -1791307965314309175477911369824 -> 450282259072.8657099359104277477 +subx3088 subtract 450282259072.8657099359104277477 -1791307965314309175477911369824 -> 1791307965314309175928193628897 Inexact Rounded +addx3089 add 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 954821400.4934353520984462184316 Inexact Rounded +comx3089 compare 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 1 +divx3089 divide 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 6676.599951968811589335427770046 Inexact Rounded +dvix3089 divideint 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 6676 +mulx3089 multiply 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 136508234203444.8694879431412375 Inexact Rounded +powx3089 power 954678411.7838149266455177850037 142989 -> Infinity Overflow Inexact Rounded +remx3089 remainder 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 85786.3578546028952962204808256 +subx3089 subtract 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 954535423.0741945011925893515758 Inexact Rounded +addx3090 add -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -9.244530976220812127155852389807E+566 Inexact Rounded +comx3090 compare -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -1 +divx3090 divide -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -1.708503207395591002370649848757E+561 Inexact Rounded +dvix3090 divideint -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> NaN Division_impossible +mulx3090 multiply -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -5.002118380601798392363043558941E+572 Inexact Rounded +powx3090 power -9244530976.220812127155852389807E+557 541089 -> -Infinity Overflow Inexact Rounded +remx3090 remainder -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> NaN Division_impossible +subx3090 subtract -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -9.244530976220812127155852389807E+566 Inexact Rounded +addx3091 add -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> -14760496803372.56259241638975169 Inexact Rounded +comx3091 compare -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 1 +divx3091 divide -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 0.000005114489797920668836278344635108 Inexact Rounded +dvix3091 divideint -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 0 +mulx3091 multiply -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 1114294082984662825831.464787487 Inexact Rounded +powx3091 power -75492024.20990197005974241975449 -1 -> -1.324643246046162082348970735576E-8 Inexact Rounded +remx3091 remainder -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> -75492024.20990197005974241975449 +subx3091 subtract -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 14760345819324.14278847627026685 Inexact Rounded +addx3092 add 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 2.475976333144824613591228097330E+99 Inexact Rounded +comx3092 compare 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> -1 +divx3092 divide 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 1.283322837007852247594216151634E-546 Inexact Rounded +dvix3092 divideint 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 0 +mulx3092 multiply 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 7.867357782318786860404997647513E-348 Inexact Rounded +powx3092 power 317747.6972215715434186596178036E-452 2 -> 1.009635990896115043331231496209E-893 Inexact Rounded +remx3092 remainder 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 3.177476972215715434186596178036E-447 +subx3092 subtract 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> -2.475976333144824613591228097330E+99 Inexact Rounded +addx3093 add -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> -17.87120645617324368279740020695 Inexact Rounded +comx3093 compare -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 1 +divx3093 divide -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 0.8390040956188859972044344532019 Inexact Rounded +dvix3093 divideint -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 0 +mulx3093 multiply -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 79.23306057789328578902960605222 Inexact Rounded +powx3093 power -8.153334430358647134334545353427 -10 -> 7.702778966876727056635952801162E-10 Inexact Rounded +remx3093 remainder -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> -8.153334430358647134334545353427 +subx3093 subtract -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 1.564537595455949414128309500095 +addx3094 add 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 5054015481833.263541189916208065 Inexact Rounded +comx3094 compare 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> -1 +divx3094 divide 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 1.437934890309606594895299558654E-490 Inexact Rounded +dvix3094 divideint 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 0 +mulx3094 multiply 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 3.672927513995607308048737751972E-465 Inexact Rounded +powx3094 power 7.267345197492967332320456062961E-478 5 -> 2.027117616846668568108096583897E-2386 Inexact Rounded +remx3094 remainder 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 7.267345197492967332320456062961E-478 +subx3094 subtract 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> -5054015481833.263541189916208065 Inexact Rounded +addx3095 add -1223354029.862567054230912271171 8135774223401322785475014855625 -> 8135774223401322785473791501595 Inexact Rounded +comx3095 compare -1223354029.862567054230912271171 8135774223401322785475014855625 -> -1 +divx3095 divide -1223354029.862567054230912271171 8135774223401322785475014855625 -> -1.503672540892020337688277553692E-22 Inexact Rounded +dvix3095 divideint -1223354029.862567054230912271171 8135774223401322785475014855625 -> -0 +mulx3095 multiply -1223354029.862567054230912271171 8135774223401322785475014855625 -> -9.952932182250005119307429060894E+39 Inexact Rounded +powx3095 power -1223354029.862567054230912271171 8 -> 5.016689887192830666848068841227E+72 Inexact Rounded +remx3095 remainder -1223354029.862567054230912271171 8135774223401322785475014855625 -> -1223354029.862567054230912271171 +subx3095 subtract -1223354029.862567054230912271171 8135774223401322785475014855625 -> -8135774223401322785476238209655 Inexact Rounded +addx3096 add 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> 2.853976441115655679961211349982E+656 Inexact Rounded +comx3096 compare 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> 1 +divx3096 divide 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> -1.151029280076495626421134733122E+626 Inexact Rounded +dvix3096 divideint 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> NaN Division_impossible +mulx3096 multiply 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> -7.076432952167704614138411740001E+686 Inexact Rounded +powx3096 power 285397644111.5655679961211349982E+645 -2 -> 1.227719722087860401233030479451E-1313 Inexact Rounded +remx3096 remainder 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> NaN Division_impossible +subx3096 subtract 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> 2.853976441115655679961211349982E+656 Inexact Rounded +addx3097 add -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> -4676542.661845508839813784891890 Inexact Rounded +comx3097 compare -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> -1 +divx3097 divide -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> 1362.424151323477505064686589716 Inexact Rounded +dvix3097 divideint -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> 1362 +mulx3097 multiply -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> 16028768973.31252639476148371361 Inexact Rounded +powx3097 power -4673112.663442366293812346653429 -3430 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3097 remainder -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> -1454.838362218639853465869604204 +subx3097 subtract -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> -4669682.665039223747810908414968 Inexact Rounded +addx3098 add 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 3.869394621006514751889096510923E+144 Inexact Rounded +comx3098 compare 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> -1 +divx3098 divide 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 2.299194926095985647821385937618E-143 Inexact Rounded +dvix3098 divideint 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 0 +mulx3098 multiply 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 3.442404014670364763780946297856E+146 Inexact Rounded +powx3098 power 88.96492479681278079861456051103 4 -> 62643391.73078290226474758858970 Inexact Rounded +remx3098 remainder 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 88.96492479681278079861456051103 +subx3098 subtract 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> -3.869394621006514751889096510923E+144 Inexact Rounded +addx3099 add 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 92.23649942010862087149015091350 Inexact Rounded +comx3099 compare 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> -1 +divx3099 divide 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 6.974120530708230229344349531719E-937 Inexact Rounded +dvix3099 divideint 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 0 +mulx3099 multiply 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 5.933283133313013755814405436342E-933 Inexact Rounded +powx3099 power 064326846.4286437304788069444326E-942 92 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3099 remainder 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 6.43268464286437304788069444326E-935 +subx3099 subtract 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> -92.23649942010862087149015091350 Inexact Rounded +addx3100 add 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 1109894.721947227977782971677146 Inexact Rounded +comx3100 compare 504507.0043949324433170405699360 605387.7175522955344659311072099 -> -1 +divx3100 divide 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 0.8333618105678718895216067463832 Inexact Rounded +dvix3100 divideint 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 0 +mulx3100 multiply 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 305422343879.7940838630401656585 Inexact Rounded +powx3100 power 504507.0043949324433170405699360 605388 -> Infinity Overflow Inexact Rounded +remx3100 remainder 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 504507.0043949324433170405699360 +subx3100 subtract 504507.0043949324433170405699360 605387.7175522955344659311072099 -> -100880.7131573630911488905372739 + +-- randomly generated testcases [26 Sep 2001] +precision: 32 +rounding: half_up +maxExponent: 9999 + +addx3201 add 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> -0.1294608320983180201262861125848 +comx3201 compare 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> 1 +divx3201 divide 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> -0.92190879812324313630282980110280 Inexact Rounded +dvix3201 divideint 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> -0 +mulx3201 multiply 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> -2.5337311682687808926633910761614 Inexact Rounded +powx3201 power 1.5283550163839789319142430253644 -2 -> 0.42810618916584924451466691603128 Inexact Rounded +remx3201 remainder 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> 1.5283550163839789319142430253644 +subx3201 subtract 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> 3.1861708648662758839547721633136 +addx3202 add -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -616383641998.15356482333651785302 Inexact Rounded +comx3202 compare -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -1 +divx3202 divide -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -95.546234185785110491676894153510 Inexact Rounded +dvix3202 divideint -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -95 +mulx3202 multiply -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -4060946921076840449949.6988828486 Inexact Rounded +powx3202 power -622903030605.2867503937836507326 7 -> -3.6386736597702404352813308064300E+82 Inexact Rounded +remx3202 remainder -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -3561112927.6341212013060271723005 +subx3202 subtract -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -629422419212.41993596423078361218 Inexact Rounded +addx3203 add -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> 73908233965.134822146441861002895 Inexact Rounded +comx3203 compare -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -1 +divx3203 divide -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -0.000076790894376056827552388054657082 Inexact Rounded +dvix3203 divideint -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -0 +mulx3203 multiply -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -419529088021865067.23307352973589 Inexact Rounded +powx3203 power -5675915.2465457487632250245209054 7 -> -1.8978038060207777231389234721908E+47 Inexact Rounded +remx3203 remainder -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -5675915.2465457487632250245209054 +subx3203 subtract -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -73919585795.627913643968311051937 Inexact Rounded +addx3204 add 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 102.50941233130989977580658947572 Inexact Rounded +comx3204 compare 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 1 +divx3204 divide 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 20.083399916665466374741708949621 Inexact Rounded +dvix3204 divideint 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 20 +mulx3204 multiply 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 474.77017694916635398652276042175 Inexact Rounded +powx3204 power 97.647321172555144900685605318635 5 -> 8877724578.7935312939231828719842 Inexact Rounded +remx3204 remainder 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 0.4054979974600473982659221768650 +subx3204 subtract 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 92.785230013800390025564621161547 Inexact Rounded +addx3205 add -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> -2.6692539695193820424002013488480E+366 Inexact Rounded +comx3205 compare -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 1 +divx3205 divide -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 3.6404378818903462695633337631098E-354 Inexact Rounded +dvix3205 divideint -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 0 +mulx3205 multiply -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 2.5937816855830431899123217912144E+379 Inexact Rounded +powx3205 power -9717253267024.5380651435435603552 -3 -> -1.0898567880085337780041328661330E-39 Inexact Rounded +remx3205 remainder -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> -9717253267024.5380651435435603552 +subx3205 subtract -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 2.6692539695193820424002013488480E+366 Inexact Rounded +addx3206 add -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> 12772.807105920712660991033689206 Inexact Rounded +comx3206 compare -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -1 +divx3206 divide -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -3.1956477052150593175206769891434E-771 Inexact Rounded +dvix3206 divideint -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -0 +mulx3206 multiply -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -5.2135267097047531336100750110314E-763 Inexact Rounded +powx3206 power -4.0817391717190128506083001702335E-767 12773 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3206 remainder -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -4.0817391717190128506083001702335E-767 +subx3206 subtract -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -12772.807105920712660991033689206 Inexact Rounded +addx3207 add 68625322655934146845003028928647 -59.634169944840280159782488098700 -> 68625322655934146845003028928587 Inexact Rounded +comx3207 compare 68625322655934146845003028928647 -59.634169944840280159782488098700 -> 1 +divx3207 divide 68625322655934146845003028928647 -59.634169944840280159782488098700 -> -1150771826276954946844322988192.5 Inexact Rounded +dvix3207 divideint 68625322655934146845003028928647 -59.634169944840280159782488098700 -> -1150771826276954946844322988192 +mulx3207 multiply 68625322655934146845003028928647 -59.634169944840280159782488098700 -> -4.0924141537834748501140151997778E+33 Inexact Rounded +powx3207 power 68625322655934146845003028928647 -60 -> 6.4704731111943370171711131942603E-1911 Inexact Rounded +remx3207 remainder 68625322655934146845003028928647 -59.634169944840280159782488098700 -> 28.201254004897257552939369449600 +subx3207 subtract 68625322655934146845003028928647 -59.634169944840280159782488098700 -> 68625322655934146845003028928707 Inexact Rounded +addx3208 add 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> -92134479103305.554299334115573170 Inexact Rounded +comx3208 compare 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> 1 +divx3208 divide 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> -7.9505063318943846655593887991914E-9 Inexact Rounded +dvix3208 divideint 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> -0 +mulx3208 multiply 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> -67489959009342175728.710494356322 Inexact Rounded +powx3208 power 732515.76532049290815665856727641 -9 -> 1.6468241050443471359358016585877E-53 Inexact Rounded +remx3208 remainder 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> 732515.76532049290815665856727641 +subx3208 subtract 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> 92134480568337.084940319931886488 Inexact Rounded +addx3209 add -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> -5.0233720245976651023364304104030E+861 Inexact Rounded +comx3209 compare -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 1 +divx3209 divide -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 6.0632602550311410821483001305010E-861 Inexact Rounded +dvix3209 divideint -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 0 +mulx3209 multiply -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 1.5300192511921895929031818638961E+863 Inexact Rounded +powx3209 power -30.458011942978338421676454778733 -5 -> -3.8149797481405136042487643253109E-8 Inexact Rounded +remx3209 remainder -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> -30.458011942978338421676454778733 +subx3209 subtract -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 5.0233720245976651023364304104030E+861 Inexact Rounded +addx3210 add -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> -58703509398.895039317872169695760 Inexact Rounded +comx3210 compare -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 1 +divx3210 divide -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 0.0000015269995260536025237167199970238 Inexact Rounded +dvix3210 divideint -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 0 +mulx3210 multiply -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 5262180074071519.7018252171579753 Inexact Rounded +powx3210 power -89640.094149414644660480286430462 -6 -> 1.9274635591165405888724595165741E-30 Inexact Rounded +remx3210 remainder -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> -89640.094149414644660480286430462 +subx3210 subtract -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 58703330118.706740488582848735188 Inexact Rounded +addx3211 add 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 458653.15678700818100529177142590 Inexact Rounded +comx3211 compare 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 1 +divx3211 divide 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 2.4990492117594160215641311760498E+33 Inexact Rounded +dvix3211 divideint 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> NaN Division_impossible +mulx3211 multiply 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 8.4177101131428047497998594379593E-23 Inexact Rounded +powx3211 power 458653.1567870081810052917714259 2 -> 210362718230.68790865117452429990 Inexact Rounded +remx3211 remainder 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> NaN Division_impossible +subx3211 subtract 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 458653.15678700818100529177142590 Inexact Rounded +addx3212 add 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> -2.1051638816432817393202262710630E+439 Inexact Rounded +comx3212 compare 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> 1 +divx3212 divide 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> -4.3388138824102151127273259092613E-434 Inexact Rounded +dvix3212 divideint 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> -0 +mulx3212 multiply 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> -1.9228386428540135340600836707270E+445 Inexact Rounded +powx3212 power 913391.42744224458216174967853722 -2 -> 1.1986327439971532470297300128074E-12 Inexact Rounded +remx3212 remainder 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> 913391.42744224458216174967853722 +subx3212 subtract 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> 2.1051638816432817393202262710630E+439 Inexact Rounded +addx3213 add -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> -2.8892177726858026955513438843371E+739 Inexact Rounded +comx3213 compare -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 1 +divx3213 divide -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 3.1759165595057674196644927106447E-728 Inexact Rounded +dvix3213 divideint -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 0 +mulx3213 multiply -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 2.6511215451353541156703914721725E+751 Inexact Rounded +powx3213 power -917591456829.12109027484399536567 -3 -> -1.2943505591853739240003453341911E-36 Inexact Rounded +remx3213 remainder -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> -917591456829.12109027484399536567 +subx3213 subtract -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 2.8892177726858026955513438843371E+739 Inexact Rounded +addx3214 add 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 34938410840676.731620092461631064 Inexact Rounded +comx3214 compare 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 1 +divx3214 divide 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 1133693327999.7879503260098666966 Inexact Rounded +dvix3214 divideint 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 1133693327999 +mulx3214 multiply 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 1076739645476675.3318519289128961 Inexact Rounded +powx3214 power 34938410840645.913399699219228218 31 -> 6.9566085958798732786509909683267E+419 Inexact Rounded +remx3214 remainder 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 24.283226805899273551376371736548 +subx3214 subtract 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 34938410840615.095179305976825372 Inexact Rounded +addx3215 add 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 29771833428054709077850588904653 Inexact Rounded +comx3215 compare 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> -1 +divx3215 divide 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 2.0269955680376683526099444523691E-545 Inexact Rounded +dvix3215 divideint 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 0 +mulx3215 multiply 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 1.7966519787854159464382359411642E-482 Inexact Rounded +powx3215 power 6034.7374411022598081745006769023E-517 3 -> 2.1977340597301840681528507640032E-1540 Inexact Rounded +remx3215 remainder 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 6.0347374411022598081745006769023E-514 +subx3215 subtract 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> -29771833428054709077850588904653 Inexact Rounded +addx3216 add -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> -5565747672224.4775959193681631431 Inexact Rounded +comx3216 compare -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> -1 +divx3216 divide -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> 11351510433.365074871574519756245 Inexact Rounded +dvix3216 divideint -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> 11351510433 +mulx3216 multiply -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> 2728936147066663.4580064428639745 Inexact Rounded +powx3216 power -5565747671734.1686009705574503152 -490 -> 4.9371745297619526113991728953197E-6246 Inexact Rounded +remx3216 remainder -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> -178.99949336276892685183308348801 +subx3216 subtract -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> -5565747671243.8596060217467374873 Inexact Rounded +addx3217 add 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> 3.1954551189203199952335879232538E+44 Inexact Rounded +comx3217 compare 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> 1 +divx3217 divide 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> -108102711781422.68663084859902931 Inexact Rounded +dvix3217 divideint 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> -108102711781422 +mulx3217 multiply 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> -9.4455848967786959996525702197139E+74 Inexact Rounded +powx3217 power 319545511.89203495546689273564728E+036 -3 -> 3.0647978448946294457985223953472E-134 Inexact Rounded +remx3217 remainder 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> 2029642017122316721531728309258 +subx3217 subtract 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> 3.1954551189203791141042667896918E+44 Inexact Rounded +addx3218 add -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> -42682764.676651465089307430325104 Rounded +comx3218 compare -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> -1 +divx3218 divide -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> 6.3204380807318655475459047410160 Inexact Rounded +dvix3218 divideint -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> 6 +mulx3218 multiply -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> 214871156882133.34437417534873098 Inexact Rounded +powx3218 power -36852134.84194296250843579428931 -5830630 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3218 remainder -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> -1868355.8336919470232059780745460 +subx3218 subtract -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> -31021505.007234459927564158253516 Rounded +addx3219 add 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> -39505285344943.729681835377530908 Inexact Rounded +comx3219 compare 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> 1 +divx3219 divide 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> -2.1774783867700502002511486885272E-387 Inexact Rounded +dvix3219 divideint 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> -0 +mulx3219 multiply 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> -3.3983199030116951081865430362053E-360 Inexact Rounded +powx3219 power 8.6021905001798578659275880018221E-374 -4 -> 1.8262649155820433126240754123257E+1492 Inexact Rounded +remx3219 remainder 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> 8.6021905001798578659275880018221E-374 +subx3219 subtract 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> 39505285344943.729681835377530908 Inexact Rounded +addx3220 add -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -54862429.012326453703398777272191 Inexact Rounded +comx3220 compare -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -1 +divx3220 divide -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -74528.182826764384088602813142847 Inexact Rounded +dvix3220 divideint -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -74528 +mulx3220 multiply -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -40386962037.048345148338122539405 Inexact Rounded +powx3220 power -54863165.152174109720312887805017 736 -> 1.2903643981679111625370174573639E+5696 Inexact Rounded +remx3220 remainder -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -134.5860664811454830973740198416 +subx3220 subtract -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -54863901.292021765737226998337843 Inexact Rounded +addx3221 add -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -3263743464517851012531706353100.8 Inexact Rounded +comx3221 compare -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -1 +divx3221 divide -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -1328233422952076975055082.5768082 Inexact Rounded +dvix3221 divideint -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -1328233422952076975055082 +mulx3221 multiply -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -8.0196908300261262548565838031943E+36 Inexact Rounded +powx3221 power -3263743464517851012531708810307 2457206 -> Infinity Overflow Inexact Rounded +remx3221 remainder -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -1417336.7573398366062994535940062 +subx3221 subtract -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -3263743464517851012531711267513.2 Inexact Rounded +addx3222 add 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 9.5354563764657694835860339582821E+91 Inexact Rounded +comx3222 compare 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> -1 +divx3222 divide 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 2.9957525170007980008712828968300E-978 Inexact Rounded +dvix3222 divideint 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 0 +mulx3222 multiply 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 2.7238858283525541854826594343954E-794 Inexact Rounded +powx3222 power 2856586744.0548637797291151154902E-895 10 -> 3.6180466753307072256807593988336E-8856 Inexact Rounded +remx3222 remainder 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 2.8565867440548637797291151154902E-886 +subx3222 subtract 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> -9.5354563764657694835860339582821E+91 Inexact Rounded +addx3223 add 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 631722566499.28075196842125460014 Inexact Rounded +comx3223 compare 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> -1 +divx3223 divide 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 0.0089828645946207580492752544218316 Inexact Rounded +dvix3223 divideint 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 0 +mulx3223 multiply 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 3521275897257796938833.8975037909 Inexact Rounded +powx3223 power 5624157233.3433661009203529937625 6 -> 3.1647887196303262540158328459030E+58 Inexact Rounded +remx3223 remainder 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 5624157233.3433661009203529937625 +subx3223 subtract 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> -620474252032.59401976658054861262 Inexact Rounded +addx3224 add -213499362.91476998701834067092611 419272438.02555757699863022643444 -> 205773075.11078758998028955550833 +comx3224 compare -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -1 +divx3224 divide -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -0.50921392286166855779828061147786 Inexact Rounded +dvix3224 divideint -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -0 +mulx3224 multiply -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -89514398406178925.073260776410672 Inexact Rounded +powx3224 power -213499362.91476998701834067092611 419272438 -> Infinity Overflow Inexact Rounded +remx3224 remainder -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -213499362.91476998701834067092611 +subx3224 subtract -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -632771800.94032756401697089736055 +addx3225 add 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 30274.392356614101238316845401518 Inexact Rounded +comx3225 compare 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1 +divx3225 divide 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 6300.1252178837655359831527173832 Inexact Rounded +dvix3225 divideint 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 6300 +mulx3225 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119336967191651199283 Inexact Rounded +powx3225 power 30269.587755640502150977251770554 5 -> 25411630481547464128383.220368208 Inexact Rounded +remx3225 remainder 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 0.6016219662519115373766970119100 +subx3225 subtract 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 30264.783154666903063637658139590 Inexact Rounded +addx3226 add 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> 4.7525676459351505682005359699680E+705 Inexact Rounded +comx3226 compare 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> 1 +divx3226 divide 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> -8.1057651538555854520994438038537E+673 Inexact Rounded +dvix3226 divideint 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> NaN Division_impossible +mulx3226 multiply 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> -2.7865227773649353769876975366506E+737 Inexact Rounded +powx3226 power 47.525676459351505682005359699680E+704 -6 -> 8.6782100393941226535150385475464E-4235 Inexact Rounded +remx3226 remainder 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> NaN Division_impossible +subx3226 subtract 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> 4.7525676459351505682005359699680E+705 Inexact Rounded +addx3227 add -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> -74396977890406.153948943614775470 Inexact Rounded +comx3227 compare -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> -1 +divx3227 divide -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> 643479.03948459716424778005613112 Inexact Rounded +dvix3227 divideint -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> 643479 +mulx3227 multiply -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> 8601512678051025297297.7169654467 Inexact Rounded +powx3227 power -74396862273800.625679130772935550 -115616606 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3227 remainder -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> -4565075.09478147646296920746797 +subx3227 subtract -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> -74396746657195.097409317931095630 Inexact Rounded +addx3228 add 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 67586387.525464115583388327481014 Inexact Rounded +comx3228 compare 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 1 +divx3228 divide 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 81727.439437354248789852715586510 Inexact Rounded +dvix3228 divideint 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 81727 +mulx3228 multiply 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 55890751355.998983433895910295596 Inexact Rounded +powx3228 power 67585560.562561229497720955705979 827 -> 1.9462204583352191108781197788255E+6475 Inexact Rounded +remx3228 remainder 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 363.39839010616042789746007924349 +subx3228 subtract 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 67584733.599658343412053583930944 Inexact Rounded +addx3229 add 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 390.31542898606435093937697545510 Inexact Rounded +comx3229 compare 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> -1 +divx3229 divide 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 1.7620074325054038174571564409871E-225 Inexact Rounded +dvix3229 divideint 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 0 +mulx3229 multiply 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 2.6843502060572691408091663822732E-220 Inexact Rounded +powx3229 power 6877386868.9498051860742298735156E-232 390 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3229 remainder 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 6.8773868689498051860742298735156E-223 +subx3229 subtract 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> -390.31542898606435093937697545510 Inexact Rounded +addx3230 add -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> -186656471117.70574263160637723440 Inexact Rounded +comx3230 compare -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 1 +divx3230 divide -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 0.0000088255699357876233458660331146583 Inexact Rounded +dvix3230 divideint -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 0 +mulx3230 multiply -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 307483061680363807.48775619333285 Inexact Rounded +powx3230 power -1647335.201144609256134925838937 -2 -> 3.6849876990439502152784389237891E-13 Inexact Rounded +remx3230 remainder -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> -1647335.201144609256134925838937 +subx3230 subtract -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 186653176447.30345341309410738272 Inexact Rounded +addx3231 add 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> 41407818140948.866630923934138155 Inexact Rounded +comx3231 compare 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> 1 +divx3231 divide 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> -8.0298091128179204076796507697517E+972 Inexact Rounded +dvix3231 divideint 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> NaN Division_impossible +mulx3231 multiply 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> -2.1353028186646179369220834691156E-946 Inexact Rounded +powx3231 power 41407818140948.866630923934138155 -5 -> 8.2146348556648547525693528004081E-69 Inexact Rounded +remx3231 remainder 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> NaN Division_impossible +subx3231 subtract 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> 41407818140948.866630923934138155 Inexact Rounded +addx3232 add -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> -574454585586.71690214265053093061 Inexact Rounded +comx3232 compare -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 1 +divx3232 divide -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 1.1584453442097568745411568037078E-11 Inexact Rounded +dvix3232 divideint -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 0 +mulx3232 multiply -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 3822847288253.1035559206691532826 Inexact Rounded +powx3232 power -6.6547424012516834662011706165297 -6 -> 0.000011513636283388791488128239232906 Inexact Rounded +remx3232 remainder -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> -6.6547424012516834662011706165297 +subx3232 subtract -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 574454585573.40741734014716399821 Inexact Rounded +addx3233 add -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> -23385972217069.468331815025891947 Inexact Rounded +comx3233 compare -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 1 +divx3233 divide -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 1.1813816642548920194709898111624E-9 Inexact Rounded +dvix3233 divideint -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 0 +mulx3233 multiply -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 646101997676091306.41485393678655 Inexact Rounded +powx3233 power -27627.758745381267780885067447671 -2 -> 1.3101128009560812529198521922269E-9 Inexact Rounded +remx3233 remainder -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> -27627.758745381267780885067447671 +subx3233 subtract -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 23385972161813.950841052490330177 Inexact Rounded +addx3234 add 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> 2.0981974379099914752963711944307E-223 Inexact Rounded +comx3234 compare 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> 1 +divx3234 divide 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> -4.7661318949867060595545765053187E+731 Inexact Rounded +dvix3234 divideint 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> NaN Division_impossible +mulx3234 multiply 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> -9.2369086409102239573726316593648E-1178 Inexact Rounded +powx3234 power 209819.74379099914752963711944307E-228 -4 -> 5.1595828494111690910650919776705E+890 Inexact Rounded +remx3234 remainder 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> NaN Division_impossible +subx3234 subtract 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> 2.0981974379099914752963711944307E-223 Inexact Rounded +addx3235 add 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 2.3488457600415474270259330865184 Inexact Rounded +comx3235 compare 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 1 +divx3235 divide 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 2.5579771002708402753412266574941E+605 Inexact Rounded +dvix3235 divideint 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> NaN Division_impossible +mulx3235 multiply 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 2.1568122732142531556215204459407E-605 Inexact Rounded +powx3235 power 2.3488457600415474270259330865184 9 -> 2176.1583446147511579113022622255 Inexact Rounded +remx3235 remainder 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> NaN Division_impossible +subx3235 subtract 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 2.3488457600415474270259330865184 Inexact Rounded +addx3236 add -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -5107586300197.9703941034404557409 Inexact Rounded +comx3236 compare -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -1 +divx3236 divide -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -9.0225606358909877855326357402242E+775 Inexact Rounded +dvix3236 divideint -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> NaN Division_impossible +mulx3236 multiply -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -2.8913563307290346152596212593532E-751 Inexact Rounded +powx3236 power -5107586300197.9703941034404557409 6 -> 1.7753920894188022125919559565029E+76 Inexact Rounded +remx3236 remainder -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> NaN Division_impossible +subx3236 subtract -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -5107586300197.9703941034404557409 Inexact Rounded +addx3237 add -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> -70454076296048.077427972135182788 Inexact Rounded +comx3237 compare -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> -1 +divx3237 divide -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> 11363232.779549422490548997517194 Inexact Rounded +dvix3237 divideint -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> 11363232 +mulx3237 multiply -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> 436827801504436566945.76663687924 Inexact Rounded +powx3237 power -70454070095869.70717871212601390 -6200178 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3237 remainder -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> -4833345.467866203920028883583808 +subx3237 subtract -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> -70454063895691.336929452116845012 Inexact Rounded +addx3238 add 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 29119.220621511046558757900645228 Inexact Rounded +comx3238 compare 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 1 +divx3238 divide 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 8.2781197380089684063239752337467E+219 Inexact Rounded +dvix3238 divideint 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> NaN Division_impossible +mulx3238 multiply 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 1.0243014554512542440592768088600E-211 Inexact Rounded +powx3238 power 29119.220621511046558757900645228 4 -> 718983605328417461.32835984217255 Inexact Rounded +remx3238 remainder 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> NaN Division_impossible +subx3238 subtract 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 29119.220621511046558757900645228 Inexact Rounded +addx3239 add -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> -5695442.3185284567660037344669935 Inexact Rounded +comx3239 compare -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 1 +divx3239 divide -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 0.00090825526554639915580539316714451 Inexact Rounded +dvix3239 divideint -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 0 +mulx3239 multiply -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 29408596423.801454053855793898323 Inexact Rounded +powx3239 power -5168.2214111091132913776042214525 -5690274 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3239 remainder -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> -5168.2214111091132913776042214525 +subx3239 subtract -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 5685105.8757062385394209792585505 Inexact Rounded +addx3240 add 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> 31712.980161250558571611312236423 Inexact Rounded +comx3240 compare 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> 1 +divx3240 divide 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> -16.319683055519892881394358449220 Inexact Rounded +dvix3240 divideint 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> -16 +mulx3240 multiply 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> -69933662.130469766080574235843448 Inexact Rounded +powx3240 power 33783.060857197067391462144517964 -2070 -> 3.9181336001803008597293818984406E-9375 Inexact Rounded +remx3240 remainder 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> 661.7697220529262738488280133144 +subx3240 subtract 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> 35853.141553143576211312976799505 Inexact Rounded +addx3241 add 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 7.3330633078828216018536326743325E+986 Inexact Rounded +comx3241 compare 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> -1 +divx3241 divide 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 5.7557712676064206636178247554056E-1879 Inexact Rounded +dvix3241 divideint 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 0 +mulx3241 multiply 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 3.0950979358603075650592433398939E+95 Inexact Rounded +powx3241 power 42207435091050.840296353874733169E-905 7 -> 2.3862872940615283599573082966642E-6240 Inexact Rounded +remx3241 remainder 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 4.2207435091050840296353874733169E-892 +subx3241 subtract 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> -7.3330633078828216018536326743325E+986 Inexact Rounded +addx3242 add -71800.806700868784841045406679641 -39617456964250697902519150526701 -> -39617456964250697902519150598502 Inexact Rounded +comx3242 compare -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 1 +divx3242 divide -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 1.8123527405017220178579049964126E-27 Inexact Rounded +dvix3242 divideint -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 0 +mulx3242 multiply -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 2.8445653694701522164901827524538E+36 Inexact Rounded +powx3242 power -71800.806700868784841045406679641 -4 -> 3.7625536850895480882178599428774E-20 Inexact Rounded +remx3242 remainder -71800.806700868784841045406679641 -39617456964250697902519150526701 -> -71800.806700868784841045406679641 +subx3242 subtract -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 39617456964250697902519150454900 Inexact Rounded +addx3243 add 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 53627809061.200981502803149181991 Inexact Rounded +comx3243 compare 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 1 +divx3243 divide 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 163369.13159039717901500465109839 Inexact Rounded +dvix3243 divideint 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 163369 +mulx3243 multiply 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 17603733760058752.363123585224369 Inexact Rounded +powx3243 power 53627480801.631504892310016062160 328260 -> Infinity Overflow Inexact Rounded +remx3243 remainder 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 43195.80712523964536237599604393 +subx3243 subtract 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 53627152542.062028281816882942329 Inexact Rounded +addx3244 add -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> -5150456970.7802587986281516264289 Inexact Rounded +comx3244 compare -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> -1 +divx3244 divide -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> 51.633359351732432283879274192947 Inexact Rounded +dvix3244 divideint -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> 51 +mulx3244 multiply -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> 494424210127893893.12581512954787 Inexact Rounded +powx3244 power -5052601598.5559371338428368438728 -97855372 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3244 remainder -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> -61977615.115532229791782933513536 +subx3244 subtract -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> -4954746226.3316154690575220613167 Inexact Rounded +addx3245 add 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 4.2708691760149477598920960628392E+477 Inexact Rounded +comx3245 compare 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> -1 +divx3245 divide 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 9.8531098643021951048744078027283E-320 Inexact Rounded +dvix3245 divideint 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 0 +mulx3245 multiply 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 1.7972391158952189002169082753183E+636 Inexact Rounded +powx3245 power 4208134320733.7069742988228068191E+146 4 -> 3.1358723439830872127129821963857E+634 Inexact Rounded +remx3245 remainder 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 4.2081343207337069742988228068191E+158 +subx3245 subtract 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> -4.2708691760149477598920960628392E+477 Inexact Rounded +addx3246 add -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -8.5077009657942581515590471189084E+308 Inexact Rounded +comx3246 compare -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -1 +divx3246 divide -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -8.8143110457236089978070419047970E+548 Inexact Rounded +dvix3246 divideint -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> NaN Division_impossible +mulx3246 multiply -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -8.2117564660363596283732942091852E+68 Inexact Rounded +powx3246 power -8.5077009657942581515590471189084E+308 10 -> 1.9866536812573207868350640760678E+3089 Inexact Rounded +remx3246 remainder -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> NaN Division_impossible +subx3246 subtract -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -8.5077009657942581515590471189084E+308 Inexact Rounded +addx3247 add -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> -9.5049703032286960790904181078063E+622 Inexact Rounded +comx3247 compare -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> -1 +divx3247 divide -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> 1.1020772033225707125391212519421E+621 Inexact Rounded +dvix3247 divideint -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> NaN Division_impossible +mulx3247 multiply -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> 8.1976525957425311427858087117655E+624 Inexact Rounded +powx3247 power -9504.9703032286960790904181078063E+619 -86 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3247 remainder -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> NaN Division_impossible +subx3247 subtract -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> -9.5049703032286960790904181078063E+622 Inexact Rounded +addx3248 add -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> -440323641.68311120898457496019108 Inexact Rounded +comx3248 compare -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> -1 +divx3248 divide -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> 4285.4305022264473269770246126234 Inexact Rounded +dvix3248 divideint -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> 4285 +mulx3248 multiply -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> 45221700683419.655596771711603505 Inexact Rounded +powx3248 power -440220916.66716743026896931194749 -102725 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3248 remainder -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> -44223.34807563389876658817398125 +subx3248 subtract -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> -440118191.65122365155336366370390 Inexact Rounded +addx3249 add -46.250735086006350517943464758019 14656357555174.263295266074908024 -> 14656357555128.012560180068557506 Inexact Rounded +comx3249 compare -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -1 +divx3249 divide -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -3.1556773169523313932207725522866E-12 Inexact Rounded +dvix3249 divideint -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -0 +mulx3249 multiply -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -677867310610152.55569620459788530 Inexact Rounded +powx3249 power -46.250735086006350517943464758019 1 -> -46.250735086006350517943464758019 +remx3249 remainder -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -46.250735086006350517943464758019 +subx3249 subtract -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -14656357555220.514030352081258542 Inexact Rounded +addx3250 add -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> -6.1641121299391316420647102699627E+776 Inexact Rounded +comx3250 compare -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> -1 +divx3250 divide -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> 6.7076702065897819604716946852581E+291 Inexact Rounded +dvix3250 divideint -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> NaN Division_impossible +mulx3250 multiply -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> 5.6646014458394584921579417504939E+1261 Inexact Rounded +powx3250 power -61641121299391.316420647102699627E+763 -9 -> -7.7833261179975532508748150708605E-6992 Inexact Rounded +remx3250 remainder -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> NaN Division_impossible +subx3250 subtract -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> -6.1641121299391316420647102699627E+776 Inexact Rounded +addx3251 add 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> -1.9498732131365824921639467044927E-511 Inexact Rounded +comx3251 compare 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> 1 +divx3251 divide 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> -4.9576772044192514715453215933704E-314 Inexact Rounded +dvix3251 divideint 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> -0 +mulx3251 multiply 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> -1.8849116232962331617140676274611E-1335 Inexact Rounded +powx3251 power 96668419802749.555738010239087449E-838 -2 -> 1.0701157625268896323611633350003E+1648 Inexact Rounded +remx3251 remainder 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> 9.6668419802749555738010239087449E-825 +subx3251 subtract 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> 1.9498732131365824921639467044927E-511 Inexact Rounded +addx3252 add -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -8.5345439111979959060312457195190E+154 Inexact Rounded +comx3252 compare -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -1 +divx3252 divide -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -5.1764925822381062287959523371316E+141 Inexact Rounded +dvix3252 divideint -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> NaN Division_impossible +mulx3252 multiply -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -1.4071002443255581217471698731240E+168 Inexact Rounded +powx3252 power -8534543911197995906031245719519E+124 2 -> 7.2838439772166785429482995041337E+309 Inexact Rounded +remx3252 remainder -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> NaN Division_impossible +subx3252 subtract -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -8.5345439111979959060312457195190E+154 Inexact Rounded +addx3253 add -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> 9.2570938837239134052589184917186E+916 Inexact Rounded +comx3253 compare -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -1 +divx3253 divide -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -6.7692307720384142592597124956951E-907 Inexact Rounded +dvix3253 divideint -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -0 +mulx3253 multiply -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -5.8008102109774576654709018012876E+927 Inexact Rounded +powx3253 power -62663404777.352508979582846931050 9 -> -1.4897928814133059615670462753825E+97 Inexact Rounded +remx3253 remainder -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -62663404777.352508979582846931050 +subx3253 subtract -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -9.2570938837239134052589184917186E+916 Inexact Rounded +addx3254 add 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> -1.7353669504253419489494030651507E-630 Inexact Rounded +comx3254 compare 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> 1 +divx3254 divide 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> -1.0053212169604565230497117966004E-197 Inexact Rounded +dvix3254 divideint 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> -0 +mulx3254 multiply 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> -3.0275232892710668432895049546233E-1457 Inexact Rounded +powx3254 power 1.744601214474560992754529320172E-827 -2 -> 3.2855468099615282394992542515980E+1653 Inexact Rounded +remx3254 remainder 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> 1.744601214474560992754529320172E-827 +subx3254 subtract 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> 1.7353669504253419489494030651507E-630 Inexact Rounded +addx3255 add 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 4.4103206624152665337631438377420E+751 Inexact Rounded +comx3255 compare 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> -1 +divx3255 divide 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 8.3257335949720619093963917942525E-723 Inexact Rounded +dvix3255 divideint 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 0 +mulx3255 multiply 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 1.6194324757808363802947192054966E+781 Inexact Rounded +powx3255 power 0367191549036702224827734853471 4 -> 1.8179030119354318182493703269258E+118 Inexact Rounded +remx3255 remainder 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 367191549036702224827734853471 +subx3255 subtract 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> -4.4103206624152665337631438377420E+751 Inexact Rounded +addx3256 add 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> 97607380.048316862763014969003011 Inexact Rounded +comx3256 compare 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> 1 +divx3256 divide 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> -1010.0036335861757252324592571874 Inexact Rounded +dvix3256 divideint 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> -1010 +mulx3256 multiply 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> -9451544582305.1234805483449772252 Inexact Rounded +powx3256 power 097704116.4492566721965710365073 -96736 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3256 remainder 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> 351.500049144304942857175263550 +subx3256 subtract 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> 97800852.850196481630127104011589 Inexact Rounded +addx3257 add 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 19533298.147150158931958733807878 Inexact Rounded +comx3257 compare 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 1 +divx3257 divide 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 2.4373460837728485395672882395171E+646 Inexact Rounded +dvix3257 divideint 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> NaN Division_impossible +mulx3257 multiply 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 1.5654311016630284502459158971272E-632 Inexact Rounded +powx3257 power 19533298.147150158931958733807878 8 -> 2.1193595047638230427530063654613E+58 Inexact Rounded +remx3257 remainder 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> NaN Division_impossible +subx3257 subtract 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 19533298.147150158931958733807878 Inexact Rounded +addx3258 add -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> -23765003221220177430797028997378 Inexact Rounded +comx3258 compare -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> -1 +divx3258 divide -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> 1.5631405336020930064824135669541E+966 Inexact Rounded +dvix3258 divideint -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> NaN Division_impossible +mulx3258 multiply -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> 3.6130812678955994625210007005216E-904 Inexact Rounded +powx3258 power -23765003221220177430797028997378 -2 -> 1.7706154318483481190364979209436E-63 Inexact Rounded +remx3258 remainder -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> NaN Division_impossible +subx3258 subtract -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> -23765003221220177430797028997378 Inexact Rounded +addx3259 add 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> 1.2925541937932433359193338910552E+937 Inexact Rounded +comx3259 compare 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> 1 +divx3259 divide 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> -4.5956836453828213050223260551064E+928 Inexact Rounded +dvix3259 divideint 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> NaN Division_impossible +mulx3259 multiply 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> -3.6353597697504958096931088780367E+945 Inexact Rounded +powx3259 power 129255.41937932433359193338910552E+932 -281253953 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3259 remainder 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> NaN Division_impossible +subx3259 subtract 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> 1.2925541937932433359193338910552E+937 Inexact Rounded +addx3260 add -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -86331.770222938687407130786425993 Inexact Rounded +comx3260 compare -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -1 +divx3260 divide -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -163.42858201815891408475902229649 Inexact Rounded +dvix3260 divideint -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -163 +mulx3260 multiply -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -46168354.810498682140456143534524 Inexact Rounded +powx3260 power -86863.276249466008289214762980838 532 -> 2.8897579184173839519859710217510E+2627 Inexact Rounded +remx3260 remainder -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -227.79392551270450952658454114212 +subx3260 subtract -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -87394.782275993329171298739535683 Inexact Rounded +addx3261 add -40707.169006771111855573524157083 -68795521421321853333274411827749 -> -68795521421321853333274411868456 Inexact Rounded +comx3261 compare -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 1 +divx3261 divide -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 5.9171248601300236694386185513139E-28 Inexact Rounded +dvix3261 divideint -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 0 +mulx3261 multiply -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 2.8004709174066910577370895499575E+36 Inexact Rounded +powx3261 power -40707.169006771111855573524157083 -7 -> -5.3988802915897595722440392884051E-33 Inexact Rounded +remx3261 remainder -40707.169006771111855573524157083 -68795521421321853333274411827749 -> -40707.169006771111855573524157083 +subx3261 subtract -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 68795521421321853333274411787042 Inexact Rounded +addx3262 add -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> -9.0838752568673728630494658778003E+108 Inexact Rounded +comx3262 compare -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> -1 +divx3262 divide -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> 1.2308545518588430875268553851424E+106 Inexact Rounded +dvix3262 divideint -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> NaN Division_impossible +mulx3262 multiply -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> 6.7040244160213718891633678248127E+111 Inexact Rounded +powx3262 power -90838752568673.728630494658778003E+095 -738 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3262 remainder -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> NaN Division_impossible +subx3262 subtract -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> -9.0838752568673728630494658778003E+108 Inexact Rounded +addx3263 add -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> -3.1196062390425302071032035080570 Inexact Rounded +comx3263 compare -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 1 +divx3263 divide -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 1.3608643662980066356437236081969E-670 Inexact Rounded +dvix3263 divideint -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 0 +mulx3263 multiply -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 1.3243854561493627844105290415330E-669 Inexact Rounded +powx3263 power -4245360967593.9206771555839718158E-682 -3 -> -1.3069414504933253288042820429894E+2008 Inexact Rounded +remx3263 remainder -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> -4.2453609675939206771555839718158E-670 +subx3263 subtract -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 3.1196062390425302071032035080570 Inexact Rounded +addx3264 add -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> -60810.964656409685060465379447110 Inexact Rounded +comx3264 compare -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 1 +divx3264 divide -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 5.6275137635287882875914124742650E-16 Inexact Rounded +dvix3264 divideint -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 0 +mulx3264 multiply -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 0.0000020810396331962224323288744910607 Inexact Rounded +powx3264 power -3422145405774.0800213000547612240E-023 -60811 -> -Infinity Overflow Inexact Rounded +remx3264 remainder -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> -3.4221454057740800213000547612240E-11 +subx3264 subtract -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 60810.964656409616617557263965510 Inexact Rounded +addx3265 add -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> -94860846133404815410816234000694 Inexact Rounded +comx3265 compare -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 1 +divx3265 divide -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 2.5850297647576657819483988845904E-686 Inexact Rounded +dvix3265 divideint -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 0 +mulx3265 multiply -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 2.3261597474398006215017751785104E-622 Inexact Rounded +powx3265 power -24521811.07649485796598387627478E-661 -9 -> -3.1190843559949184618590264246586E+5882 Inexact Rounded +remx3265 remainder -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> -2.452181107649485796598387627478E-654 +subx3265 subtract -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 94860846133404815410816234000694 Inexact Rounded +addx3266 add -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -5038638032824.4395321279731805825 Inexact Rounded +comx3266 compare -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -1 +divx3266 divide -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -1295.6457979549894351378127413283 Inexact Rounded +dvix3266 divideint -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -1295 +mulx3266 multiply -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -19625045834830808256871.952659048 Inexact Rounded +powx3266 power -5042529937498.8944492248538951438 4 -> 6.4653782991800009492580180960839E+50 Inexact Rounded +remx3266 remainder -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -2513384079.7768087643285383187045 +subx3266 subtract -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -5046421842173.3493663217346097051 Inexact Rounded +addx3267 add -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> 2732988.5891363639325008206099712 Inexact Rounded +comx3267 compare -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -1 +divx3267 divide -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -1.9605795855687791246611683328346E-663 Inexact Rounded +dvix3267 divideint -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -0 +mulx3267 multiply -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -1.4644013247528895376254850705597E-650 Inexact Rounded +powx3267 power -535824163.54531747646293693868651E-665 2732989 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3267 remainder -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -5.3582416354531747646293693868651E-657 +subx3267 subtract -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -2732988.5891363639325008206099712 Inexact Rounded +addx3268 add 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 52864854.899420632375589206704068 Inexact Rounded +comx3268 compare 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> -1 +divx3268 divide 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 4.5460641203455697917573431961511E-513 Inexact Rounded +dvix3268 divideint 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 0 +mulx3268 multiply 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 1.2704853045231735885074945710576E-497 Inexact Rounded +powx3268 power 24032.702008553084252925140858134E-509 52864855 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3268 remainder 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 2.4032702008553084252925140858134E-505 +subx3268 subtract 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> -52864854.899420632375589206704068 Inexact Rounded +addx3269 add 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 754.44220417415325444943566016062 Inexact Rounded +comx3269 compare 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> -1 +divx3269 divide 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 9.4842547068617879794218050008353E-489 Inexact Rounded +dvix3269 divideint 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 0 +mulx3269 multiply 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 5.3982769208667021044675146787248E-483 Inexact Rounded +powx3269 power 71553220259.938950698030519906727E-496 754 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3269 remainder 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 7.1553220259938950698030519906727E-486 +subx3269 subtract 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> -754.44220417415325444943566016062 Inexact Rounded +addx3270 add 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 35572.960284795962697740953932508 Inexact Rounded +comx3270 compare 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 1 +divx3270 divide 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 6.8357605153869556504869061469852E+732 Inexact Rounded +dvix3270 divideint 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> NaN Division_impossible +mulx3270 multiply 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 1.8511992931514185102474609686066E-724 Inexact Rounded +powx3270 power 35572.960284795962697740953932508 5 -> 56963942247985404337401.149353169 Inexact Rounded +remx3270 remainder 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> NaN Division_impossible +subx3270 subtract 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 35572.960284795962697740953932508 Inexact Rounded +addx3271 add 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> 5.3035405018123760598334895413057E+849 Inexact Rounded +comx3271 compare 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> 1 +divx3271 divide 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> -5.5485278436266802470202487233285E+836 Inexact Rounded +dvix3271 divideint 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> NaN Division_impossible +mulx3271 multiply 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> -5.0693702270365259274203181894613E+862 Inexact Rounded +powx3271 power 53035405018123760598334895413057E+818 -10 -> 5.6799053935427267944455848135618E-8498 Inexact Rounded +remx3271 remainder 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> NaN Division_impossible +subx3271 subtract 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> 5.3035405018123760598334895413057E+849 Inexact Rounded +addx3272 add 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 9.8701498316307365714167410690192E+135 Inexact Rounded +comx3272 compare 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> -1 +divx3272 divide 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 9.6747012716293341927566515915016E-135 Inexact Rounded +dvix3272 divideint 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 0 +mulx3272 multiply 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 9.4250802116091862185764800227004E+137 Inexact Rounded +powx3272 power 95.490751127249945886828257312118 10 -> 63039548646186864162.847491534337 Inexact Rounded +remx3272 remainder 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 95.490751127249945886828257312118 +subx3272 subtract 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> -9.8701498316307365714167410690192E+135 Inexact Rounded +addx3273 add 69434850287.460788550936730296153 -35119136549015044241569827542264 -> -35119136549015044241500392691977 Inexact Rounded +comx3273 compare 69434850287.460788550936730296153 -35119136549015044241569827542264 -> 1 +divx3273 divide 69434850287.460788550936730296153 -35119136549015044241569827542264 -> -1.9771229338327273644129394734299E-21 Inexact Rounded +dvix3273 divideint 69434850287.460788550936730296153 -35119136549015044241569827542264 -> -0 +mulx3273 multiply 69434850287.460788550936730296153 -35119136549015044241569827542264 -> -2.4384919885057519302646522425980E+42 Inexact Rounded +powx3273 power 69434850287.460788550936730296153 -4 -> 4.3021939605842038995370443743844E-44 Inexact Rounded +remx3273 remainder 69434850287.460788550936730296153 -35119136549015044241569827542264 -> 69434850287.460788550936730296153 +subx3273 subtract 69434850287.460788550936730296153 -35119136549015044241569827542264 -> 35119136549015044241639262392551 Inexact Rounded +addx3274 add -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> -65551667.214560244414938327003123 Inexact Rounded +comx3274 compare -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 1 +divx3274 divide -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 0.0000059835205237890809449684317245033 Inexact Rounded +dvix3274 divideint -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 0 +mulx3274 multiply -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 25711006105.487929108329637701882 Inexact Rounded +powx3274 power -392.22739924621965621739098725407 -65551275 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3274 remainder -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> -392.22739924621965621739098725407 +subx3274 subtract -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 65550882.759761751975625892221149 Inexact Rounded +addx3275 add 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 6437779.6650608333186472347196668 Inexact Rounded +comx3275 compare 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 1 +divx3275 divide 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 261.61406460270241498757868681883 Inexact Rounded +dvix3275 divideint 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 261 +mulx3275 multiply 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 157216217318.36494525300694583138 Inexact Rounded +powx3275 power 6413265.4423561191792972085539457 24514 -> Infinity Overflow Inexact Rounded +remx3275 remainder 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 15053.316425728808940379300726594 +subx3275 subtract 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 6388751.2196514050399471823882246 Inexact Rounded +addx3276 add -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -6.9667706389122107760046184064057E+487 Inexact Rounded +comx3276 compare -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -1 +divx3276 divide -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -2.1498522911689997341347293419761E+486 Inexact Rounded +dvix3276 divideint -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> NaN Division_impossible +mulx3276 multiply -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -2.2576385054257595259511556258470E+489 Inexact Rounded +powx3276 power -6.9667706389122107760046184064057E+487 32 -> Infinity Overflow Inexact Rounded +remx3276 remainder -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> NaN Division_impossible +subx3276 subtract -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -6.9667706389122107760046184064057E+487 Inexact Rounded +addx3277 add 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> 77986002255.07800973642274406015 +comx3277 compare 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> 1 +divx3277 divide 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> -1.2597639604731753284599748820876 Inexact Rounded +dvix3277 divideint 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> -1 +mulx3277 multiply 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> -113544133799497082075557.21180430 Inexact Rounded +powx3277 power 378204716633.40024100602896057615 -3 -> 1.8484988212401886887562779996737E-35 Inexact Rounded +remx3277 remainder 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> 77986002255.07800973642274406015 +subx3277 subtract 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> 678423431011.72247227563517709215 +addx3278 add -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -4.4234512012457148027685282969235E+505 Inexact Rounded +comx3278 compare -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -1 +divx3278 divide -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -2.0742325477916347193181603963257E+499 Inexact Rounded +dvix3278 divideint -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> NaN Division_impossible +mulx3278 multiply -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -9.4333301975395170465982968019915E+511 Inexact Rounded +powx3278 power -44234.512012457148027685282969235E+501 2132572 -> Infinity Overflow Inexact Rounded +remx3278 remainder -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> NaN Division_impossible +subx3278 subtract -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -4.4234512012457148027685282969235E+505 Inexact Rounded +addx3279 add -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> 9.7520428746722497621936998533848E+519 Inexact Rounded +comx3279 compare -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -1 +divx3279 divide -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -3.6449692061227100572768330912162E-590 Inexact Rounded +dvix3279 divideint -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -0 +mulx3279 multiply -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -3.4664510156653491769901435777060E+450 Inexact Rounded +powx3279 power -3554.5895974968741465654022772100E-073 10 -> 3.2202875716019266933215387456197E-695 Inexact Rounded +remx3279 remainder -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -3.5545895974968741465654022772100E-70 +subx3279 subtract -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -9.7520428746722497621936998533848E+519 Inexact Rounded +addx3280 add 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 4633944440549.3093886865008969464 Inexact Rounded +comx3280 compare 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> -1 +divx3280 divide 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 0.00016191587157664541463871807382759 Inexact Rounded +dvix3280 divideint 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 0 +mulx3280 multiply 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 3475765273659325895012.7612107556 Inexact Rounded +powx3280 power 750187685.63632608923397234391668 5 -> 2.3760176068829529745152188798557E+44 Inexact Rounded +remx3280 remainder 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 750187685.63632608923397234391668 +subx3280 subtract 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> -4632444065178.0367365080329522586 Inexact Rounded +addx3281 add 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 8038885676320423832297608779.9751 Inexact Rounded +comx3281 compare 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> -1 +divx3281 divide 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 3.7554998862319807295903348960280E-43 Inexact Rounded +dvix3281 divideint 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 0 +mulx3281 multiply 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 24269423384249.611263728854793731 Inexact Rounded +powx3281 power 30190034242853.251165951457589386E-028 8 -> 6.9009494305612589578332690692113E-117 Inexact Rounded +remx3281 remainder 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 3.0190034242853251165951457589386E-15 +subx3281 subtract 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> -8038885676320423832297608779.9751 Inexact Rounded +addx3282 add 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 125946917326.41330773874663377538 Inexact Rounded +comx3282 compare 65.537942676774715953400768803539 125946917260.87536506197191782198 -> -1 +divx3282 divide 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 5.2036162616846894920389414735878E-10 Inexact Rounded +dvix3282 divideint 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 0 +mulx3282 multiply 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 8254301843759.7376990957355411370 Inexact Rounded +powx3282 power 65.537942676774715953400768803539 1 -> 65.537942676774715953400768803539 +remx3282 remainder 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 65.537942676774715953400768803539 +subx3282 subtract 65.537942676774715953400768803539 125946917260.87536506197191782198 -> -125946917195.33742238519720186858 Inexact Rounded +addx3283 add 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 8015272349626.7792105333859739528 Inexact Rounded +comx3283 compare 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 1 +divx3283 divide 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 8443970438.5560107978790084430110 Inexact Rounded +dvix3283 divideint 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 8443970438 +mulx3283 multiply 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 7608339144595734.8984281431471741 Inexact Rounded +powx3283 power 8015272348677.5489394183881813700 949 -> Infinity Overflow Inexact Rounded +remx3283 remainder 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 527.78228041355742397895303690364 +subx3283 subtract 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 8015272347728.3186683033903887872 Inexact Rounded +addx3284 add -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -32595333982.670686221204518042250 Inexact Rounded +comx3284 compare -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -1 +divx3284 divide -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -4.7150744038935574574681609457727E+867 Inexact Rounded +dvix3284 divideint -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> NaN Division_impossible +mulx3284 multiply -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -2.2533171407952851885446213697715E-847 Inexact Rounded +powx3284 power -32595333982.67068622120451804225 7 -> -3.9092014148031739666525606093306E+73 Inexact Rounded +remx3284 remainder -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> NaN Division_impossible +subx3284 subtract -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -32595333982.670686221204518042250 Inexact Rounded +addx3285 add -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> 292178000.06450804618299520094843 Inexact Rounded +comx3285 compare -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -1 +divx3285 divide -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -6.0046235559392715334668277026896E-533 Inexact Rounded +dvix3285 divideint -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -0 +mulx3285 multiply -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -5.1260260597833406461110136952456E-516 Inexact Rounded +powx3285 power -17544189017145.710117633021800426E-537 292178000 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3285 remainder -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -1.7544189017145710117633021800426E-524 +subx3285 subtract -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -292178000.06450804618299520094843 Inexact Rounded +addx3286 add -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -506639.97552899703974189156234893 Inexact Rounded +comx3286 compare -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -1 +divx3286 divide -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -45982.150707356329027698717189104 Inexact Rounded +dvix3286 divideint -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -45982 +mulx3286 multiply -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -5582497.2457419607392940234271222 Inexact Rounded +powx3286 power -506650.99395649907139204052441630 11 -> -5.6467412678809885333313818078829E+62 Inexact Rounded +remx3286 remainder -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -1.660558079734242466742739640844 +subx3286 subtract -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -506662.01238400110304218948648367 Inexact Rounded +addx3287 add 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> -84.001893040865864590122330800768 Inexact Rounded +comx3287 compare 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> 1 +divx3287 divide 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> -5.7699118247660357814641813260524E-234 Inexact Rounded +dvix3287 divideint 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> -0 +mulx3287 multiply 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> -4.0714332866277514481192856925775E-230 Inexact Rounded +powx3287 power 4846835159.5922372307656000769395E-241 -84 -> Infinity Overflow Inexact Rounded +remx3287 remainder 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> 4.8468351595922372307656000769395E-232 +subx3287 subtract 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> 84.001893040865864590122330800768 Inexact Rounded +addx3288 add -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> -3994308913.2287755451637127790293 Inexact Rounded +comx3288 compare -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 1 +divx3288 divide -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 8.7698052609323004543538163061774E-9 Inexact Rounded +dvix3288 divideint -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 0 +mulx3288 multiply -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 139917887979.72053637272961120639 Inexact Rounded +powx3288 power -35.029311013822259358116556164908 -4 -> 6.6416138040522124693495178218096E-7 Inexact Rounded +remx3288 remainder -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> -35.029311013822259358116556164908 +subx3288 subtract -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 3994308843.1701535175191940627961 Inexact Rounded +addx3289 add 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> -5.4918146394484565418284686127552E+374 Inexact Rounded +comx3289 compare 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> 1 +divx3289 divide 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> -1.3850911310869487895947733090204E-199 Inexact Rounded +dvix3289 divideint 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> -0 +mulx3289 multiply 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> -4.1774387343310777190917128006589E+550 Inexact Rounded +powx3289 power 7606663750.6735265233044420887018E+166 -5 -> 3.9267106978887346373957314818178E-880 Inexact Rounded +remx3289 remainder 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> 7.6066637506735265233044420887018E+175 +subx3289 subtract 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> 5.4918146394484565418284686127552E+374 Inexact Rounded +addx3290 add -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> -2.5677829660831741274207326697052E-159 Inexact Rounded +comx3290 compare -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> -1 +divx3290 divide -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> 2.7277550199853009708493167299838E+671 Inexact Rounded +dvix3290 divideint -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> NaN Division_impossible +mulx3290 multiply -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> 2.4171926410541199393728294762559E-989 Inexact Rounded +powx3290 power -25677.829660831741274207326697052E-163 -9 -> -2.0605121420682764897867221992174E+1427 Inexact Rounded +remx3290 remainder -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> NaN Division_impossible +subx3290 subtract -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> -2.5677829660831741274207326697052E-159 Inexact Rounded +addx3291 add 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> -1.5412563837540810793697955063295E+554 Inexact Rounded +comx3291 compare 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> 1 +divx3291 divide 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> -6.3111872313890646144473652645030E-544 Inexact Rounded +dvix3291 divideint 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> -0 +mulx3291 multiply 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> -1.4992043761340180288065959300090E+565 Inexact Rounded +powx3291 power 97271576094.456406729671729224827 -2 -> 1.0568858765852073181352309401343E-22 Inexact Rounded +remx3291 remainder 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> 97271576094.456406729671729224827 +subx3291 subtract 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> 1.5412563837540810793697955063295E+554 Inexact Rounded +addx3292 add 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> 41139789894.401826915757391777544 Inexact Rounded +comx3292 compare 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> 1 +divx3292 divide 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> -2196474369511625389289506461551.0 Inexact Rounded +dvix3292 divideint 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> -2196474369511625389289506461551 +mulx3292 multiply 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> -7.7054498611419776714291080928601E-10 Inexact Rounded +powx3292 power 41139789894.401826915757391777563 -2 -> 5.9084812442741091550891451069919E-22 Inexact Rounded +remx3292 remainder 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> 6.98141022640544018935102953527E-22 +subx3292 subtract 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> 41139789894.401826915757391777582 Inexact Rounded +addx3293 add -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> -83310831287241.777598696853498149 Inexact Rounded +comx3293 compare -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> -1 +divx3293 divide -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> 1.5202754978845438636605170857478E+333 Inexact Rounded +dvix3293 divideint -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> NaN Division_impossible +mulx3293 multiply -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> 4.5654189779610386760330527839588E-306 Inexact Rounded +powx3293 power -83310831287241.777598696853498149 -5 -> -2.4916822606682624827900581728387E-70 Inexact Rounded +remx3293 remainder -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> NaN Division_impossible +subx3293 subtract -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> -83310831287241.777598696853498149 Inexact Rounded +addx3294 add 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> 4506653461.4414974233678331771169 Inexact Rounded +comx3294 compare 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> 1 +divx3294 divide 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> -6.0124409901781490054438220048629E+888 Inexact Rounded +dvix3294 divideint 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> NaN Division_impossible +mulx3294 multiply 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> -3.3779833273541776470902903512949E-870 Inexact Rounded +powx3294 power 4506653461.4414974233678331771169 -7 -> 2.6486272911486461102735412463189E-68 Inexact Rounded +remx3294 remainder 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> NaN Division_impossible +subx3294 subtract 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> 4506653461.4414974233678331771169 Inexact Rounded +addx3295 add 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 744537.89692255653780778146167691 Inexact Rounded +comx3295 compare 23777.857951114967684767609401626 720760.03897144157012301385227528 -> -1 +divx3295 divide 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 0.032989978169498808275308039034795 Inexact Rounded +dvix3295 divideint 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 0 +mulx3295 multiply 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 17138129823.503025913034987537096 Inexact Rounded +powx3295 power 23777.857951114967684767609401626 720760 -> Infinity Overflow Inexact Rounded +remx3295 remainder 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 23777.857951114967684767609401626 +subx3295 subtract 23777.857951114967684767609401626 720760.03897144157012301385227528 -> -696982.18102032660243824624287365 Inexact Rounded +addx3296 add -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> 6.0802728403071490445256786982100E+541 Inexact Rounded +comx3296 compare -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -1 +divx3296 divide -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -3.5093578667274020123788514069885E-511 Inexact Rounded +dvix3296 divideint -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -0 +mulx3296 multiply -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -1.2973997003625843317417981902198E+573 Inexact Rounded +powx3296 power -21337853323980858055292469611948 6 -> 9.4385298321304970306180652097874E+187 Inexact Rounded +remx3296 remainder -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -21337853323980858055292469611948 +subx3296 subtract -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -6.0802728403071490445256786982100E+541 Inexact Rounded +addx3297 add -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -818408481.65082668425744179302401 Inexact Rounded +comx3297 compare -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -1 +divx3297 divide -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -1081991.4954690752676494129493403 Inexact Rounded +dvix3297 divideint -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -1081991 +mulx3297 multiply -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -619037842458.03980537370328252817 Inexact Rounded +powx3297 power -818409238.0423893439849743856947 756 -> 1.6058883946373232750995543573461E+6738 Inexact Rounded +remx3297 remainder -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -374.76862809126749803143314108840 +subx3297 subtract -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -818409994.43395200371250697836539 Inexact Rounded +addx3298 add 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 47567380385008.954845377769826287 Inexact Rounded +comx3298 compare 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 1 +divx3298 divide 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 730853388480.86247690474303493972 Inexact Rounded +dvix3298 divideint 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 730853388480 +mulx3298 multiply 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 3095909128079784.3348591472999468 Inexact Rounded +powx3298 power 47567380384943.87013600286155046 65 -> 1.0594982876763214301042437482634E+889 Inexact Rounded +remx3298 remainder 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 56.134058687770878126430844955520 +subx3298 subtract 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 47567380384878.785426627953274633 Inexact Rounded +addx3299 add -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> -302031659.49048519905267279799984 Inexact Rounded +comx3299 compare -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> -1 +divx3299 divide -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> 54.765366028496664530688259272591 Inexact Rounded +dvix3299 divideint -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> 54 +mulx3299 multiply -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> 1606504025402196.8484885386501478 Inexact Rounded +powx3299 power -296615544.05897984545127115290251 -5416115 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3299 remainder -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> -4145310.7576907509755823176468844 +subx3299 subtract -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> -291199428.62747449184986950780518 Inexact Rounded +addx3300 add 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> 6.1391705914046707180652185247584E+749 Inexact Rounded +comx3300 compare 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> 1 +divx3300 divide 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> -9.0818539468906248593699700040068E+737 Inexact Rounded +dvix3300 divideint 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> NaN Division_impossible +mulx3300 multiply 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> -4.1499693532587347944890300176290E+761 Inexact Rounded +powx3300 power 61391705914.046707180652185247584E+739 -7 -> 3.0425105291210947473420999890124E-5249 Inexact Rounded +remx3300 remainder 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> NaN Division_impossible +subx3300 subtract 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> 6.1391705914046707180652185247584E+749 Inexact Rounded + +-- randomly generated testcases [26 Sep 2001] +precision: 33 +rounding: half_up +maxExponent: 9999 + +addx3401 add 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> -1364112374596.82605557115996067822 Inexact Rounded +comx3401 compare 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> 1 +divx3401 divide 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> -3.12789896373176963160811150593867E-11 Inexact Rounded +dvix3401 divideint 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> -0 +mulx3401 multiply 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> -58204024324286.5595453066065234923 Inexact Rounded +powx3401 power 042.668056830485571428877212944418 -1 -> 0.0234367363850869744523417227148909 Inexact Rounded +remx3401 remainder 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> 42.668056830485571428877212944418 +subx3401 subtract 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> 1364112374682.16216923213110353598 Inexact Rounded +addx3402 add -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -3.27179426341653256363531809227344E+455 Inexact Rounded +comx3402 compare -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -1 +divx3402 divide -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -4.31028129684803083255704680611589E+446 Inexact Rounded +dvix3402 divideint -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> NaN Division_impossible +mulx3402 multiply -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -2.48351255171055445110558613627379E+464 Inexact Rounded +powx3402 power -327.179426341653256363531809227344E+453 759067457 -> -Infinity Overflow Inexact Rounded +remx3402 remainder -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> NaN Division_impossible +subx3402 subtract -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -3.27179426341653256363531809227344E+455 Inexact Rounded +addx3403 add 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 900181194.826119246619069527471177 Inexact Rounded +comx3403 compare 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> -1 +divx3403 divide 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 0.0000907917210693679220610511319812826 Inexact Rounded +dvix3403 divideint 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 0 +mulx3403 multiply 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 73557551389502.7779979042453102926 Inexact Rounded +powx3403 power 81721.5803096185422787702538493471 900099473 -> Infinity Overflow Inexact Rounded +remx3403 remainder 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 81721.5803096185422787702538493471 +subx3403 subtract 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> -900017751.665500009534511986963479 Inexact Rounded +addx3404 add 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 72.3239822255871305731314565069132 Inexact Rounded +comx3404 compare 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> -1 +divx3404 divide 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 5.51900935695390664984598248115290E-806 Inexact Rounded +dvix3404 divideint 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 0 +mulx3404 multiply 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 2.88686045809784034794803928177854E-802 Inexact Rounded +powx3404 power 3991.56734635183403814636354392163E-807 72 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3404 remainder 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 3.99156734635183403814636354392163E-804 +subx3404 subtract 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> -72.3239822255871305731314565069132 Inexact Rounded +addx3405 add -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -61.2544651290911805069948520197050 Inexact Rounded +comx3405 compare -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -1 +divx3405 divide -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -13.0464272560079276694749924915850 Inexact Rounded +dvix3405 divideint -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -13 +mulx3405 multiply -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -337.326590072564290813539036280205 Inexact Rounded +powx3405 power -66.3393308595957726456416979163306 5 -> -1284858888.27285822259184896667990 Inexact Rounded +remx3405 remainder -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -0.23607636303607484323270126019793 +subx3405 subtract -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -71.4241965901003647842885438129562 Inexact Rounded +addx3406 add -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> -3.93606873703567753255097095208112E+116 Inexact Rounded +comx3406 compare -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> -1 +divx3406 divide -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> 1.85284350396137075010428736564737E+107 Inexact Rounded +dvix3406 divideint -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> NaN Division_impossible +mulx3406 multiply -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> 8.36154649302353269818801263275941E+125 Inexact Rounded +powx3406 power -393606.873703567753255097095208112E+111 -2 -> 6.45467904123103560528919747688443E-234 Inexact Rounded +remx3406 remainder -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> NaN Division_impossible +subx3406 subtract -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> -3.93606873703567753255097095208112E+116 Inexact Rounded +addx3407 add -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> -877573445.238180259264773343614397 +comx3407 compare -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 1 +divx3407 divide -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 0.0222888053076312565797460650311070 Inexact Rounded +dvix3407 divideint -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 0 +mulx3407 multiply -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 16425043456056213.7395191514029288 Inexact Rounded +powx3407 power -019133598.609812524622150421584346 -858439847 -> -0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3407 remainder -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> -19133598.609812524622150421584346 +subx3407 subtract -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 839306248.018555210020472500445705 +addx3408 add 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 240910.327926825971183391888394542 Inexact Rounded +comx3408 compare 465.351982159046525762715549761814 240444.975944666924657629172844780 -> -1 +divx3408 divide 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 0.00193537827243326122782974132829095 Inexact Rounded +dvix3408 divideint 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 0 +mulx3408 multiply 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 111891546.156035013780371395668674 Inexact Rounded +powx3408 power 465.351982159046525762715549761814 240445 -> Infinity Overflow Inexact Rounded +remx3408 remainder 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 465.351982159046525762715549761814 +subx3408 subtract 465.351982159046525762715549761814 240444.975944666924657629172844780 -> -239979.623962507878131866457295018 Inexact Rounded +addx3409 add 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 28066955004783.1076824222873384828 Inexact Rounded +comx3409 compare 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 1 +divx3409 divide 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 4.90938543219432390013656968123815E+722 Inexact Rounded +dvix3409 divideint 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> NaN Division_impossible +mulx3409 multiply 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 1.60458773123547770690452195569223E-696 Inexact Rounded +powx3409 power 28066955004783.1076824222873384828 6 -> 4.88845689938951583020171325568218E+80 Inexact Rounded +remx3409 remainder 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> NaN Division_impossible +subx3409 subtract 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 28066955004783.1076824222873384828 Inexact Rounded +addx3410 add 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 2.82120384825243127096613158419270E+429 Inexact Rounded +comx3410 compare 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> -1 +divx3410 divide 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 1.00224012330435927467559203688861E-416 Inexact Rounded +dvix3410 divideint 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 0 +mulx3410 multiply 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 7.97702072298089605706798770013561E+442 Inexact Rounded +powx3410 power 28275236927392.4960902824105246047 3 -> 2.26057415546622161347322061281516E+40 Inexact Rounded +remx3410 remainder 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 28275236927392.4960902824105246047 +subx3410 subtract 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> -2.82120384825243127096613158419270E+429 Inexact Rounded +addx3411 add 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> 11783.4098484281593848173575655680 Inexact Rounded +comx3411 compare 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> 1 +divx3411 divide 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> -1394.73214754836418731335761858151 Inexact Rounded +dvix3411 divideint 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> -1394 +mulx3411 multiply 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> -99695.1757167732926302533138186716 Inexact Rounded +powx3411 power 11791.8644211874630234271801789996 -8 -> 2.67510099318723516565332928253711E-33 Inexact Rounded +remx3411 remainder 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> 6.18999471819080133445705535281046 +subx3411 subtract 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> 11800.3189939467666620370027924312 Inexact Rounded +addx3412 add 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> -9292.34554725628103950730533220061 Inexact Rounded +comx3412 compare 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> 1 +divx3412 divide 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> -0.00478829121953512281527242631775613 Inexact Rounded +dvix3412 divideint 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> -0 +mulx3412 multiply 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> -417446.000545543168866158913077419 Inexact Rounded +powx3412 power 44.7085340739581668975502342787578 -9337 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3412 remainder 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> 44.7085340739581668975502342787578 +subx3412 subtract 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> 9381.76261540419737330240580075813 Inexact Rounded +addx3413 add 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> 9.33545274288045458053295581965867E+589 Inexact Rounded +comx3413 compare 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> 1 +divx3413 divide 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> -1.08992064752484400353231056271614E+578 Inexact Rounded +dvix3413 divideint 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> NaN Division_impossible +mulx3413 multiply 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> -7.99605715447900642683774360731254E+601 Inexact Rounded +powx3413 power 93354527428804.5458053295581965867E+576 -9 -> 1.85687015691763406448005521221518E-5310 Inexact Rounded +remx3413 remainder 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> NaN Division_impossible +subx3413 subtract 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> 9.33545274288045458053295581965867E+589 Inexact Rounded +addx3414 add -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> -367399415798804503177950095289166 Inexact Rounded +comx3414 compare -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> -1 +divx3414 divide -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> 6698784465980529140072174.30474769 Inexact Rounded +dvix3414 divideint -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> 6698784465980529140072174 +mulx3414 multiply -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> 2.01502722493617222018040789291414E+40 Inexact Rounded +powx3414 power -367399415798804503177950040443482 -54845684 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3414 remainder -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> -16714095.6549657189177857892292804 +subx3414 subtract -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> -367399415798804503177949985597798 Inexact Rounded +addx3415 add -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> 89529730127.7712289354674386343440 Inexact Rounded +comx3415 compare -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -1 +divx3415 divide -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -3.20738060264454013174835928754430E-11 Inexact Rounded +dvix3415 divideint -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -0 +mulx3415 multiply -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -257089920034.115975469931085527642 Inexact Rounded +powx3415 power -2.87155919781024108503670175443740 9 -> -13275.7774683251354527310820885737 Inexact Rounded +remx3415 remainder -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -2.87155919781024108503670175443740 +subx3415 subtract -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -89529730133.5143473310879208044174 Inexact Rounded +addx3416 add -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -1.06939343381794796521780572792040E+189 Inexact Rounded +comx3416 compare -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -1 +divx3416 divide -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -4.03774938598259547575707503087638E+184 Inexact Rounded +dvix3416 divideint -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> NaN Division_impossible +mulx3416 multiply -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -2.83227661494558963558481633880647E+193 Inexact Rounded +powx3416 power -010.693934338179479652178057279204E+188 26485 -> -Infinity Overflow Inexact Rounded +remx3416 remainder -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> NaN Division_impossible +subx3416 subtract -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -1.06939343381794796521780572792040E+189 Inexact Rounded +addx3417 add 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 621838312788.308537943268041906168 +comx3417 compare 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 1 +divx3417 divide 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 60.0678575886074367081836436812959 Inexact Rounded +dvix3417 divideint 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 60 +mulx3417 multiply 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 6228331603681663511826.60450280350 Inexact Rounded +powx3417 power 611655569568.832698912762075889186 1 -> 611655569568.832698912762075889186 +remx3417 remainder 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 690976400.282357082404114870266 +subx3417 subtract 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 601472826349.356859882256109872204 +addx3418 add 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> 3457945.39110674985794181949638944 Inexact Rounded +comx3418 compare 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> 1 +divx3418 divide 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> -1729387.11663991852426428263230475 Inexact Rounded +dvix3418 divideint 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> -1729387 +mulx3418 multiply 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> -6914241.49127918361259252956576654 Inexact Rounded +powx3418 power 3457947.39062863674882672518304442 -2 -> 8.36302195229701913376802373659526E-14 Inexact Rounded +remx3418 remainder 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> 0.2332240699744359979851713353525 +subx3418 subtract 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> 3457949.39015052363971163086969940 Inexact Rounded +addx3419 add -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> -53308666960535.7393391289364591513 Inexact Rounded +comx3419 compare -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> -1 +divx3419 divide -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> 8.16740037282731870883136714441204E+451 Inexact Rounded +dvix3419 divideint -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> NaN Division_impossible +mulx3419 multiply -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> 3.47945961185390084641156250100085E-425 Inexact Rounded +powx3419 power -53308666960535.7393391289364591513 -7 -> -8.17363502380497033342380498988958E-97 Inexact Rounded +remx3419 remainder -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> NaN Division_impossible +subx3419 subtract -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> -53308666960535.7393391289364591513 Inexact Rounded +addx3420 add -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> -413474500.320043571235254629529038 Inexact Rounded +comx3420 compare -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 1 +divx3420 divide -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 0.0136503290701197094953429018013146 Inexact Rounded +dvix3420 divideint -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 0 +mulx3420 multiply -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 2271246398971702.91169807728132089 Inexact Rounded +powx3420 power -5568057.17870139549478277980540034 -407906443 -> -0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3420 remainder -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> -5568057.17870139549478277980540034 +subx3420 subtract -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 402338385.962640780245689069918238 Inexact Rounded +addx3421 add 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 9804385357.63872821851861785530505 Inexact Rounded +comx3421 compare 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 1 +divx3421 divide 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 116519965.821719977402398190558439 Inexact Rounded +dvix3421 divideint 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 116519965 +mulx3421 multiply 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 824974242939.691780798621180901714 Inexact Rounded +powx3421 power 9804385273.49533524416415189990857 84 -> 1.90244010779692739037080418507909E+839 Inexact Rounded +remx3421 remainder 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 69.1423069734476624350435642749915 +subx3421 subtract 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 9804385189.35194226980968594451209 Inexact Rounded +addx3422 add -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> -5874220715892.91440069210512515154 Inexact Rounded +comx3422 compare -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 1 +divx3422 divide -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 8.91166886601477021757439826903776E-548 Inexact Rounded +dvix3422 divideint -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 0 +mulx3422 multiply -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 3.07510225632952455144944282925583E-522 Inexact Rounded +powx3422 power -5234910986592.18801727046580014273E-547 -6 -> 4.85896970703117149235935037271084E+3205 Inexact Rounded +remx3422 remainder -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> -5.23491098659218801727046580014273E-535 +subx3422 subtract -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 5874220715892.91440069210512515154 Inexact Rounded +addx3423 add 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 5.17546816784872628933218985216916E-259 Inexact Rounded +comx3423 compare 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> -1 +divx3423 divide 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 1.34947513442491971488363250398908E-204 Inexact Rounded +dvix3423 divideint 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 0 +mulx3423 multiply 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 3.61463267496484976064271305679796E-721 Inexact Rounded +powx3423 power 698416560151955285929747633786867E-495 5 -> 1.66177661007189430761396979787413E-2311 Inexact Rounded +remx3423 remainder 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 6.98416560151955285929747633786867E-463 +subx3423 subtract 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> -5.17546816784872628933218985216916E-259 Inexact Rounded +addx3424 add 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> 107635.497735316515080720330536027 Inexact Rounded +comx3424 compare 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> 1 +divx3424 divide 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> -2.70980469844599888443309571235597E+603 Inexact Rounded +dvix3424 divideint 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> NaN Division_impossible +mulx3424 multiply 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> -4.27536360069537352698066408021773E-594 Inexact Rounded +powx3424 power 107635.497735316515080720330536027 -4 -> 7.45037111502910487803432806334714E-21 Inexact Rounded +remx3424 remainder 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> NaN Division_impossible +subx3424 subtract 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> 107635.497735316515080720330536027 Inexact Rounded +addx3425 add -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> 7.95188637593855925052747867099091E+421 Inexact Rounded +comx3425 compare -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -1 +divx3425 divide -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -4.04612060894658007715621807881076E-409 Inexact Rounded +dvix3425 divideint -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -0 +mulx3425 multiply -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -2.55846309007242668513226814043593E+435 Inexact Rounded +powx3425 power -32174291345686.5371446616670961807 8 -> 1.14834377656109143210058690590666E+108 Inexact Rounded +remx3425 remainder -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -32174291345686.5371446616670961807 +subx3425 subtract -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -7.95188637593855925052747867099091E+421 Inexact Rounded +addx3426 add -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> -9.31730631474527142307644239919480E+904 Inexact Rounded +comx3426 compare -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 1 +divx3426 divide -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 8.74902060655796717043678441884283E-208 Inexact Rounded +dvix3426 divideint -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 0 +mulx3426 multiply -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 7.59521700128037149179751467730962E+1602 Inexact Rounded +powx3426 power -8151730494.53190523620899410544099E+688 -9 -> -6.29146352774842448375275282183700E-6282 Inexact Rounded +remx3426 remainder -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> -8.15173049453190523620899410544099E+697 +subx3426 subtract -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 9.31730631474527142307644239919480E+904 Inexact Rounded +addx3427 add 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> -5.66230530039528969825480755159562E+463 Inexact Rounded +comx3427 compare 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> 1 +divx3427 divide 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> -2.36034255052700900395787131334608E-464 Inexact Rounded +dvix3427 divideint 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> -0 +mulx3427 multiply 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> -7.56765978558098558928268129700052E+463 Inexact Rounded +powx3427 power 1.33649801345976199708341799505220 -6 -> 0.175464835912284900180305028965188 Inexact Rounded +remx3427 remainder 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> 1.33649801345976199708341799505220 +subx3427 subtract 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> 5.66230530039528969825480755159562E+463 Inexact Rounded +addx3428 add 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> 67762238162788.6551061476018185196 Inexact Rounded +comx3428 compare 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> 1 +divx3428 divide 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> -1.10348321777294157014941951870409E+832 Inexact Rounded +dvix3428 divideint 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> NaN Division_impossible +mulx3428 multiply 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> -4.16111531818085838717201828773857E-805 Inexact Rounded +powx3428 power 67762238162788.6551061476018185196 -6 -> 1.03293631708006509074972764670281E-83 Inexact Rounded +remx3428 remainder 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> NaN Division_impossible +subx3428 subtract 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> 67762238162788.6551061476018185196 Inexact Rounded +addx3429 add 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 6.28677291578497580015557979349893E+823 Inexact Rounded +comx3429 compare 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> -1 +divx3429 divide 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 6.81838333133660025740681459349372E-818 Inexact Rounded +dvix3429 divideint 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 0 +mulx3429 multiply 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 2.69486466971438542975159893306219E+830 Inexact Rounded +powx3429 power 4286562.76568866751577306056498271 6 -> 6.20376193064412081058181881805108E+39 Inexact Rounded +remx3429 remainder 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 4286562.76568866751577306056498271 +subx3429 subtract 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> -6.28677291578497580015557979349893E+823 Inexact Rounded +addx3430 add -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -765715.663995796739622174820554104 Inexact Rounded +comx3430 compare -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -1 +divx3430 divide -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -11401.7814363639478774761697650867 Inexact Rounded +dvix3430 divideint -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -11401 +mulx3430 multiply -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -51432606.5679912088468256122315944 Inexact Rounded +powx3430 power -765782.827432642697305644096365566 67 -> -1.71821200770749773595473594136582E+394 Inexact Rounded +remx3430 remainder -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -52.4839518791480724305698888408548 +subx3430 subtract -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -765849.990869488654989113372177028 Inexact Rounded +addx3431 add 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 105.582516975019937108929234216907 Inexact Rounded +comx3431 compare 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> -1 +divx3431 divide 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 0.780513207299722975882416995140701 Inexact Rounded +dvix3431 divideint 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 0 +mulx3431 multiply 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 2744.56726509164060561370653286614 Inexact Rounded +powx3431 power 46.2835931916106252756465724211276 59 -> 1.82052645780601002671007943923993E+98 Inexact Rounded +remx3431 remainder 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 46.2835931916106252756465724211276 +subx3431 subtract 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> -13.0153305917986865576360893746515 +addx3432 add -3029555.82298840234029474459694644 857535844655004737373089601128532 -> 857535844655004737373089598098976 Inexact Rounded +comx3432 compare -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -1 +divx3432 divide -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -3.53286202771759704502126811323937E-27 Inexact Rounded +dvix3432 divideint -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -0 +mulx3432 multiply -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -2.59795271159584761928986181925721E+39 Inexact Rounded +powx3432 power -3029555.82298840234029474459694644 9 -> -2.14986224790431302561340100746360E+58 Inexact Rounded +remx3432 remainder -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -3029555.82298840234029474459694644 +subx3432 subtract -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -857535844655004737373089604158088 Inexact Rounded +addx3433 add -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> 481026979918882487383654367924619 Inexact Rounded +comx3433 compare -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -1 +divx3433 divide -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -2.87856597038397207797777811199804E-970 Inexact Rounded +dvix3433 divideint -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -0 +mulx3433 multiply -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -6.66062615833636908683785283687416E-905 Inexact Rounded +powx3433 power -0138466789523.10694176543700501945E-948 5 -> -5.09012109092637525843636056746667E-4685 Inexact Rounded +remx3433 remainder -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -1.3846678952310694176543700501945E-937 +subx3433 subtract -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -481026979918882487383654367924619 Inexact Rounded +addx3434 add -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> -8.76320343474845477961976776833770E+779 Inexact Rounded +comx3434 compare -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 1 +divx3434 divide -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 1.09475564939253134070730299863765E-770 Inexact Rounded +dvix3434 divideint -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 0 +mulx3434 multiply -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 8.40703746148119867711463485065336E+789 Inexact Rounded +powx3434 power -9593566466.96690575714244442109870 -9 -> -1.45271091841882960010964421066745E-90 Inexact Rounded +remx3434 remainder -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> -9593566466.96690575714244442109870 +subx3434 subtract -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 8.76320343474845477961976776833770E+779 Inexact Rounded +addx3435 add -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> 5.65688889355241946154894311253202E-458 Inexact Rounded +comx3435 compare -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -1 +divx3435 divide -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -5.63791814686655486612569970629128E-438 Inexact Rounded +dvix3435 divideint -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -0 +mulx3435 multiply -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -1.80415590504280580443565448126548E-1352 Inexact Rounded +powx3435 power -3189.30765477670526823106100241863E-898 6 -> 1.05239431027683904514311527228736E-5367 Inexact Rounded +remx3435 remainder -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -3.18930765477670526823106100241863E-895 +subx3435 subtract -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -5.65688889355241946154894311253202E-458 Inexact Rounded +addx3436 add -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> -6.31925802672685034379197328370812E+538 Inexact Rounded +comx3436 compare -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 1 +divx3436 divide -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 2.70356936263934622050341328519534E-529 Inexact Rounded +dvix3436 divideint -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 0 +mulx3436 multiply -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 1.07961694859382462346866817306769E+549 Inexact Rounded +powx3436 power -17084552395.6714834680088150543965 -6 -> 4.02141014977177984123011868387622E-62 Inexact Rounded +remx3436 remainder -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> -17084552395.6714834680088150543965 +subx3436 subtract -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 6.31925802672685034379197328370812E+538 Inexact Rounded +addx3437 add 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> 34956830.3498233068159118874697600 Inexact Rounded +comx3437 compare 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> 1 +divx3437 divide 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> -5.67473494371787737607169979602343E+666 Inexact Rounded +dvix3437 divideint 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> NaN Division_impossible +mulx3437 multiply 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> -2.15336927667273841617128781173293E-652 Inexact Rounded +powx3437 power 034956830.349823306815911887469760 -6 -> 5.48034272566098493462169431762597E-46 Inexact Rounded +remx3437 remainder 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> NaN Division_impossible +subx3437 subtract 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> 34956830.3498233068159118874697600 Inexact Rounded +addx3438 add -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -743.513686646195531912469919819067 Inexact Rounded +comx3438 compare -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -1 +divx3438 divide -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -38.3130314835722766807703585435688 Inexact Rounded +dvix3438 divideint -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -38 +mulx3438 multiply -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -15212.5977643862002585039364868883 Inexact Rounded +powx3438 power -763.440067781256632695791981893608 20 -> 4.52375407727336769552481661250924E+57 Inexact Rounded +remx3438 remainder -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -6.2375846489348029295536230610386 +subx3438 subtract -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -783.366448916317733479114043968149 Inexact Rounded +addx3439 add -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -5.10472027868440667684575147556654E+821 Inexact Rounded +comx3439 compare -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -1 +divx3439 divide -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -6.11437198047603754107526874071737E+788 Inexact Rounded +dvix3439 divideint -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> NaN Division_impossible +mulx3439 multiply -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -4.26178996090176289115594057419892E+854 Inexact Rounded +powx3439 power -510472027868440667684575147556654E+789 8 -> 4.61079266619522147262600755274182E+6573 Inexact Rounded +remx3439 remainder -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> NaN Division_impossible +subx3439 subtract -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -5.10472027868440667684575147556654E+821 Inexact Rounded +addx3440 add 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> 7.03047615605170866769935030348280E-87 Inexact Rounded +comx3440 compare 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> 1 +divx3440 divide 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> -3.95554019499502537743883483402608E+670 Inexact Rounded +dvix3440 divideint 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> NaN Division_impossible +mulx3440 multiply 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> -1.24957888288817581538108991453732E-843 Inexact Rounded +powx3440 power 070304761.560517086676993503034828E-094 -2 -> 2.02316135427631488479902919959627E+172 Inexact Rounded +remx3440 remainder 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> NaN Division_impossible +subx3440 subtract 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> 7.03047615605170866769935030348280E-87 Inexact Rounded +addx3441 add -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> -970725702203.695030010334183533769 Inexact Rounded +comx3441 compare -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> -1 +divx3441 divide -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> 213749425.654447811698884007553614 Inexact Rounded +dvix3441 divideint -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> 213749425 +mulx3441 multiply -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> 4408472103336875.21161867891724392 Inexact Rounded +powx3441 power -0970725697662.27605454336231195463 -4541 -> -0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3441 remainder -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> -2972.12171050214753770792631747550 +subx3441 subtract -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> -970725693120.857079076390440375491 Inexact Rounded +addx3442 add -808178238631844268316111259558675 -598400.265108644514211244980426520 -> -808178238631844268316111260157075 Inexact Rounded +comx3442 compare -808178238631844268316111259558675 -598400.265108644514211244980426520 -> -1 +divx3442 divide -808178238631844268316111259558675 -598400.265108644514211244980426520 -> 1350564640015847635178945884.97836 Inexact Rounded +dvix3442 divideint -808178238631844268316111259558675 -598400.265108644514211244980426520 -> 1350564640015847635178945884 +mulx3442 multiply -808178238631844268316111259558675 -598400.265108644514211244980426520 -> 4.83614072252332979731348423145208E+38 Inexact Rounded +powx3442 power -808178238631844268316111259558675 -598400 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3442 remainder -808178238631844268316111259558675 -598400.265108644514211244980426520 -> -585452.097764536570956813681556320 +subx3442 subtract -808178238631844268316111259558675 -598400.265108644514211244980426520 -> -808178238631844268316111258960275 Inexact Rounded +addx3443 add -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> -41.5341827319983835079860474697980 Rounded +comx3443 compare -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 1 +divx3443 divide -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 0.313295770023233218639213140599856 Inexact Rounded +dvix3443 divideint -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 0 +mulx3443 multiply -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 313.357994403604968250936036978086 Inexact Rounded +powx3443 power -9.90826595069053564311371766315200 -32 -> 1.34299698259038003011439568004625E-32 Inexact Rounded +remx3443 remainder -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> -9.90826595069053564311371766315200 +subx3443 subtract -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 21.7176508306173122217586121434940 Rounded +addx3444 add -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> -238194.467436351098567470879626885 Inexact Rounded +comx3444 compare -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> -1 +divx3444 divide -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> 4.77175317088274715226553516820589 Inexact Rounded +dvix3444 divideint -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> 4 +mulx3444 multiply -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> 8126916733.40905487026003135987472 Inexact Rounded +powx3444 power -196925.469891897719160698483752907 -41269 -> -0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3444 remainder -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> -31849.4797140842015336089002569958 +subx3444 subtract -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> -155656.472347444339753926087878929 Inexact Rounded +addx3445 add 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 421071135212152225162086005824310 Inexact Rounded +comx3445 compare 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 1 +divx3445 divide 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 3.15333426537349744281860005497304E+627 Inexact Rounded +dvix3445 divideint 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> NaN Division_impossible +mulx3445 multiply 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 5.62264847262712040027311932121460E-563 Inexact Rounded +powx3445 power 421071135212152225162086005824310 1 -> 421071135212152225162086005824310 +remx3445 remainder 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> NaN Division_impossible +subx3445 subtract 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 421071135212152225162086005824310 Inexact Rounded +addx3446 add 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> 1249441.46421514282301182772247227 Inexact Rounded +comx3446 compare 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> 1 +divx3446 divide 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> -4.31066764178328992440635387255816E+676 Inexact Rounded +dvix3446 divideint 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> NaN Division_impossible +mulx3446 multiply 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> -3.62148999233506984566620611700349E-665 Inexact Rounded +powx3446 power 1249441.46421514282301182772247227 -3 -> 5.12686942572191282348415024932322E-19 Inexact Rounded +remx3446 remainder 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> NaN Division_impossible +subx3446 subtract 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> 1249441.46421514282301182772247227 Inexact Rounded +addx3447 add 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> -6.90425401708167622194241915195001E+923 Inexact Rounded +comx3447 compare 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> 1 +divx3447 divide 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> -1.08360729901578455109968388309079E-916 Inexact Rounded +dvix3447 divideint 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> -0 +mulx3447 multiply 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> -5.16541767544616308732028810026275E+931 Inexact Rounded +powx3447 power 74815000.4716875558358937279052903 -7 -> 7.62218032252683815537906972439985E-56 Inexact Rounded +remx3447 remainder 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> 74815000.4716875558358937279052903 +subx3447 subtract 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> 6.90425401708167622194241915195001E+923 Inexact Rounded +addx3448 add -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> -72394386611338.3523609383834372430 Inexact Rounded +comx3448 compare -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 1 +divx3448 divide -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 2.32613829621244113284301004158794E-8 Inexact Rounded +dvix3448 divideint -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 0 +mulx3448 multiply -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 121911674530293613615.441384822381 Inexact Rounded +powx3448 power -1683993.51210241555668790556759021 -7 -> -2.60385683509956889000676113860292E-44 Inexact Rounded +remx3448 remainder -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> -1683993.51210241555668790556759021 +subx3448 subtract -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 72394383243351.3281561072700614318 Inexact Rounded +addx3449 add -763.148530974741766171756970448158 517370.808956957601473642272664647 -> 516607.660425982859707470515694199 Inexact Rounded +comx3449 compare -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -1 +divx3449 divide -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -0.00147505139014951946381155525173867 Inexact Rounded +dvix3449 divideint -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -0 +mulx3449 multiply -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -394830772.824715962925351447322187 Inexact Rounded +powx3449 power -763.148530974741766171756970448158 517371 -> -Infinity Overflow Inexact Rounded +remx3449 remainder -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -763.148530974741766171756970448158 +subx3449 subtract -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -518133.957487932343239814029635095 Inexact Rounded +addx3450 add -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> -9.27540422641025050968830154578151E+532 Inexact Rounded +comx3450 compare -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 1 +divx3450 divide -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 8.36450164191471769978415758342237E-532 Inexact Rounded +dvix3450 divideint -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 0 +mulx3450 multiply -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 7.19624203304351070562409746475943E+534 Inexact Rounded +powx3450 power -77.5841338812312523460591226178754 -9 -> -9.81846856873938549466341693997829E-18 Inexact Rounded +remx3450 remainder -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> -77.5841338812312523460591226178754 +subx3450 subtract -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 9.27540422641025050968830154578151E+532 Inexact Rounded +addx3451 add 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> 5176165576.79580866488385418967956 Inexact Rounded +comx3451 compare 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> 1 +divx3451 divide 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> -39899.5720067736855444089432524094 Inexact Rounded +dvix3451 divideint 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> -39899 +mulx3451 multiply 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> -671536855852442.071887385512001794 Inexact Rounded +powx3451 power 5176295309.89943746236102209837813 -129733 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3451 remainder 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> 74208.214046920838632934314641965 +subx3451 subtract 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> 5176425043.00306625983819000707670 Inexact Rounded +addx3452 add 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 4.47163484116690197229286530307326E+184 Inexact Rounded +comx3452 compare 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 1 +divx3452 divide 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 1.41906636616314987705536737025932E+1129 Inexact Rounded +dvix3452 divideint 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> NaN Division_impossible +mulx3452 multiply 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 1.40906152309150441010046222214810E-760 Inexact Rounded +powx3452 power 4471634841166.90197229286530307326E+172 3 -> 8.94126556389673498386397569249516E+553 Inexact Rounded +remx3452 remainder 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> NaN Division_impossible +subx3452 subtract 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 4.47163484116690197229286530307326E+184 Inexact Rounded +addx3453 add -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -8189130.15945231049670285726774317 Inexact Rounded +comx3453 compare -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -1 +divx3453 divide -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -3.17515949922556778343526099830093E+372 Inexact Rounded +dvix3453 divideint -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> NaN Division_impossible +mulx3453 multiply -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -2.11207823685103185039979144161848E-359 Inexact Rounded +powx3453 power -8189130.15945231049670285726774317 3 -> -549178241054875982731.000937875885 Inexact Rounded +remx3453 remainder -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> NaN Division_impossible +subx3453 subtract -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -8189130.15945231049670285726774317 Inexact Rounded +addx3454 add -254346232981353293392888785643245 -764.416902486152093758287929678445 -> -254346232981353293392888785644009 Inexact Rounded +comx3454 compare -254346232981353293392888785643245 -764.416902486152093758287929678445 -> -1 +divx3454 divide -254346232981353293392888785643245 -764.416902486152093758287929678445 -> 332732350833857889204406356900.665 Inexact Rounded +dvix3454 divideint -254346232981353293392888785643245 -764.416902486152093758287929678445 -> 332732350833857889204406356900 +mulx3454 multiply -254346232981353293392888785643245 -764.416902486152093758287929678445 -> 1.94426559574627262006307326336289E+35 Inexact Rounded +powx3454 power -254346232981353293392888785643245 -764 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3454 remainder -254346232981353293392888785643245 -764.416902486152093758287929678445 -> -508.299323962538610580669092979500 +subx3454 subtract -254346232981353293392888785643245 -764.416902486152093758287929678445 -> -254346232981353293392888785642481 Inexact Rounded +addx3455 add -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> -16063.2166595009220002171676000611 Inexact Rounded +comx3455 compare -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 1 +divx3455 divide -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 0.218031569091122520391599541575615 Inexact Rounded +dvix3455 divideint -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 0 +mulx3455 multiply -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 37919912.4040225840727281633024665 Inexact Rounded +powx3455 power -2875.36745499544177964804277329726 -13188 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3455 remainder -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> -2875.36745499544177964804277329726 +subx3455 subtract -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 10312.4817495100384409210820534665 Inexact Rounded +addx3456 add -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -7.26927570984219944693602140223103 Inexact Rounded +comx3456 compare -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -1 +divx3456 divide -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -4.51836100553039917574557235275173E+427 Inexact Rounded +dvix3456 divideint -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> NaN Division_impossible +mulx3456 multiply -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -1.16950304061635681891361504442479E-426 Inexact Rounded +powx3456 power -7.26927570984219944693602140223103 2 -> 52.8423693457018126451998096211036 Inexact Rounded +remx3456 remainder -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> NaN Division_impossible +subx3456 subtract -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -7.26927570984219944693602140223103 Inexact Rounded +addx3457 add -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> -2.85671516868762752241056540028515E+505 Inexact Rounded +comx3457 compare -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> -1 +divx3457 divide -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> 6.39064071690455919792707589054106E+501 Inexact Rounded +dvix3457 divideint -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> NaN Division_impossible +mulx3457 multiply -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> 1.27699583132923253605397736797000E+509 Inexact Rounded +powx3457 power -28567151.6868762752241056540028515E+498 -4470 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3457 remainder -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> NaN Division_impossible +subx3457 subtract -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> -2.85671516868762752241056540028515E+505 Inexact Rounded +addx3458 add 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 7191835.18758398207642347765831492 Inexact Rounded +comx3458 compare 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 1 +divx3458 divide 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 88363.9812586188186733935569874100 Inexact Rounded +dvix3458 divideint 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 88363 +mulx3458 multiply 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 585321326.397904638863485891524555 Inexact Rounded +powx3458 power 7191753.79974136447257468282073718 81 -> 2.53290983138561482612557404148760E+555 Inexact Rounded +remx3458 remainder 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 79.8625220355815164499390351500273 +subx3458 subtract 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 7191672.41189874686872588798315944 Inexact Rounded +addx3459 add 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 502976488.859892968179149660674285 Inexact Rounded +comx3459 compare 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 1 +divx3459 divide 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 734496.390406706323899801641278933 Inexact Rounded +dvix3459 divideint 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 734496 +mulx3459 multiply 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 344432815169.648082754214631086270 Inexact Rounded +powx3459 power 502975804.069864536104621700404770 685 -> 3.62876716573623552761739177592677E+5960 Inexact Rounded +remx3459 remainder 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 267.346619523615915582548420925472 +subx3459 subtract 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 502975119.279836104030093740135255 Inexact Rounded +addx3460 add 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> 1040125.74219736715313697451377660 Inexact Rounded +comx3460 compare 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> 1 +divx3460 divide 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> -3.23566278503319947059213001405065 Inexact Rounded +dvix3460 divideint 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> -3 +mulx3460 multiply 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> -700361636056.225618266296899048765 Inexact Rounded +powx3460 power 1505368.42063731861590460453659570 -465243 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3460 remainder 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> 109640.385317464227601714468138385 +subx3460 subtract 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> 1970611.09907727007867223455941481 Inexact Rounded +addx3461 add 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 77809073.3514961963946898136677398 Inexact Rounded +comx3461 compare 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 1 +divx3461 divide 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 8.06437785764050431295652411163382 Inexact Rounded +dvix3461 divideint 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 8 +mulx3461 multiply 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 594231065731939.137329770485497261 Inexact Rounded +powx3461 power 69225023.2850142784063416137144829 8584050 -> Infinity Overflow Inexact Rounded +remx3461 remainder 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 552622.75315893449955601408842746 +subx3461 subtract 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 60640973.2185323604179934137612260 Inexact Rounded +addx3462 add -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -5.56695018537751006841940471339310E+624 Inexact Rounded +comx3462 compare -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -1 +divx3462 divide -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -9.06661464189378059067792554300676E+616 Inexact Rounded +dvix3462 divideint -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> NaN Division_impossible +mulx3462 multiply -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -3.41813737437080390787865389703565E+632 Inexact Rounded +powx3462 power -55669501853.7751006841940471339310E+614 61400538 -> Infinity Overflow Inexact Rounded +remx3462 remainder -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> NaN Division_impossible +subx3462 subtract -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -5.56695018537751006841940471339310E+624 Inexact Rounded +addx3463 add -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> -834662.599983953345718523807123972 Inexact Rounded +comx3463 compare -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 1 +divx3463 divide -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 6.32071595497552015656909892339226E-409 Inexact Rounded +dvix3463 divideint -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 0 +mulx3463 multiply -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 4.40340044311040151960763108019957E-397 Inexact Rounded +powx3463 power -527566.521273992424649346837337602E-408 -834663 -> -Infinity Overflow Inexact Rounded +remx3463 remainder -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> -5.27566521273992424649346837337602E-403 +subx3463 subtract -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 834662.599983953345718523807123972 Inexact Rounded +addx3464 add 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 69065510.0459653699418083455335366 Inexact Rounded +comx3464 compare 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 1 +divx3464 divide 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 9.93964810285396646889830919492683E+827 Inexact Rounded +dvix3464 divideint 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> NaN Division_impossible +mulx3464 multiply 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 4.79900759921241352562381181332720E-813 Inexact Rounded +powx3464 power 69065510.0459653699418083455335366 7 -> 7.49598249763416483824919118973567E+54 Inexact Rounded +remx3464 remainder 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> NaN Division_impossible +subx3464 subtract 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 69065510.0459653699418083455335366 Inexact Rounded +addx3465 add -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> -2921982.82411285505229122890041841 Inexact Rounded +comx3465 compare -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> -1 +divx3465 divide -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> 4.00300943792444663467732029501716E+764 Inexact Rounded +dvix3465 divideint -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> NaN Division_impossible +mulx3465 multiply -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> 2.13289120518223547921212412642411E-752 Inexact Rounded +powx3465 power -2921982.82411285505229122890041841 -7 -> -5.49865394870631248479668782154131E-46 Inexact Rounded +remx3465 remainder -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> NaN Division_impossible +subx3465 subtract -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> -2921982.82411285505229122890041841 Inexact Rounded +addx3466 add 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 3873389.71099271106554595739922987 Inexact Rounded +comx3466 compare 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> -1 +divx3466 divide 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 0.00000116465942888322776753062580106351 Inexact Rounded +dvix3466 divideint 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 0 +mulx3466 multiply 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 17473516.9087705701652062546164705 Inexact Rounded +powx3466 power 4.51117459466491451401835756593793 3873385 -> Infinity Overflow Inexact Rounded +remx3466 remainder 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 4.51117459466491451401835756593793 +subx3466 subtract 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> -3873380.68864352173571692936251473 Inexact Rounded +addx3467 add 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 3.61713861293896216593840817950781E+411 Inexact Rounded +comx3467 compare 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> -1 +divx3467 divide 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 1.36997137177543416190811827685231E-398 Inexact Rounded +dvix3467 divideint 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 0 +mulx3467 multiply 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 1.79242831280777466554271332425735E+425 Inexact Rounded +powx3467 power 49553763474698.8118661758811091120 4 -> 6.02985091099730236635954801474802E+54 Inexact Rounded +remx3467 remainder 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 49553763474698.8118661758811091120 +subx3467 subtract 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> -3.61713861293896216593840817950781E+411 Inexact Rounded +addx3468 add 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 7.55985583344379951506071499170749E+967 Inexact Rounded +comx3468 compare 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 1 +divx3468 divide 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 1.01213580367212873025671916758669E+935 Inexact Rounded +dvix3468 divideint 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> NaN Division_impossible +mulx3468 multiply 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 5.64661580146688255286933753616580E+1000 Inexact Rounded +powx3468 power 755985583344.379951506071499170749E+956 7 -> 1.41121958516547725677142981375469E+6775 Inexact Rounded +remx3468 remainder 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> NaN Division_impossible +subx3468 subtract 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 7.55985583344379951506071499170749E+967 Inexact Rounded +addx3469 add -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> -20497230690.0922299809209551116556 Inexact Rounded +comx3469 compare -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> -1 +divx3469 divide -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> 50.8179779735012053661447873666816 Inexact Rounded +dvix3469 divideint -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> 50 +mulx3469 multiply -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> 7951459193692715079.09328760016914 Inexact Rounded +powx3469 power -20101668541.7472260497594230105456 -395562148 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3469 remainder -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> -323561124.497029491682817955047400 +subx3469 subtract -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> -19706106393.4022221185978909094356 Inexact Rounded +addx3470 add 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 460874498597.269108074612032613370 Inexact Rounded +comx3470 compare 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> -1 +divx3470 divide 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 0.0000121160334374633240168068405467307 Inexact Rounded +dvix3470 divideint 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 0 +mulx3470 multiply 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 2573447398655758659.39475672905225 Inexact Rounded +powx3470 power 5583903.18072100716072011264668631 5 -> 5.42861943589418603298670454702901E+33 Inexact Rounded +remx3470 remainder 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 5583903.18072100716072011264668631 +subx3470 subtract 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> -460863330790.907666060290592388076 Inexact Rounded +addx3471 add -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> -5.08580148958769104511751975720470E+667 Inexact Rounded +comx3471 compare -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 1 +divx3471 divide -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 1.87903204624039476408191264564568E-615 Inexact Rounded +dvix3471 divideint -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 0 +mulx3471 multiply -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 4.86018718792967378985838739820108E+720 Inexact Rounded +powx3471 power -955638397975240685017992436116257E+020 -5 -> -1.25467730420304189161768408462414E-265 Inexact Rounded +remx3471 remainder -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> -9.55638397975240685017992436116257E+52 +subx3471 subtract -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 5.08580148958769104511751975720470E+667 Inexact Rounded +addx3472 add -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -1.36243796098020983814115584402407E+828 Inexact Rounded +comx3472 compare -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -1 +divx3472 divide -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -2.06771226638255600634939371365920E+818 Inexact Rounded +dvix3472 divideint -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> NaN Division_impossible +mulx3472 multiply -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -8.97725098263977535966921696143011E+837 Inexact Rounded +powx3472 power -136243796098020983814115584402407E+796 7 -> -8.71399185551742199752832286984005E+5796 Inexact Rounded +remx3472 remainder -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> NaN Division_impossible +subx3472 subtract -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -1.36243796098020983814115584402407E+828 Inexact Rounded +addx3473 add -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -8.08498482718304598213092937543934E+526 Inexact Rounded +comx3473 compare -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -1 +divx3473 divide -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -1.68419126177106468565397017107736E+522 Inexact Rounded +dvix3473 divideint -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> NaN Division_impossible +mulx3473 multiply -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -3.88120881158362912220132691803539E+531 Inexact Rounded +powx3473 power -808498.482718304598213092937543934E+521 48005 -> -Infinity Overflow Inexact Rounded +remx3473 remainder -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> NaN Division_impossible +subx3473 subtract -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -8.08498482718304598213092937543934E+526 Inexact Rounded +addx3474 add -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> -3.19563111559114001594257448970812E+989 Inexact Rounded +comx3474 compare -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 1 +divx3474 divide -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 2.54180257724779721448484781056040E-591 Inexact Rounded +dvix3474 divideint -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 0 +mulx3474 multiply -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 2.59570359202261082537505332325404E+1388 Inexact Rounded +powx3474 power -812.266340554281305985524813074211E+396 -3 -> -1.86596988030914616216741808216469E-1197 Inexact Rounded +remx3474 remainder -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> -8.12266340554281305985524813074211E+398 +subx3474 subtract -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 3.19563111559114001594257448970812E+989 Inexact Rounded +addx3475 add -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> -9.29889720905183397678866648217793E+139 Inexact Rounded +comx3475 compare -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> -1 +divx3475 divide -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> 3.31747801646964399331556971055197E+128 Inexact Rounded +dvix3475 divideint -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> NaN Division_impossible +mulx3475 multiply -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> 2.60648266168558079957349074609920E+151 Inexact Rounded +powx3475 power -929889.720905183397678866648217793E+134 -3 -> -1.24367143370300189518778505830181E-420 Inexact Rounded +remx3475 remainder -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> NaN Division_impossible +subx3475 subtract -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> -9.29889720905183397678866648217793E+139 Inexact Rounded +addx3476 add 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 492754319.251171861122327008214092 Inexact Rounded +comx3476 compare 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> -1 +divx3476 divide 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 0.000170389819117633485695890041185782 Inexact Rounded +dvix3476 divideint 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 0 +mulx3476 multiply 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 41357714926052.9282985560380064649 Inexact Rounded +powx3476 power 83946.0157801953636255078996185540 492670373 -> Infinity Overflow Inexact Rounded +remx3476 remainder 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 83946.0157801953636255078996185540 +subx3476 subtract 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> -492586427.219611470395075992414854 Inexact Rounded +addx3477 add 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 7812758113817.99135851825223122508 Inexact Rounded +comx3477 compare 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 1 +divx3477 divide 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 2.57210790001590171809512871857381E+163 Inexact Rounded +dvix3477 divideint 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> NaN Division_impossible +mulx3477 multiply 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 2.37311931372130583136091717093935E-138 Inexact Rounded +powx3477 power 7812758113817.99135851825223122508 3 -> 4.76884421816246896090414314934253E+38 Inexact Rounded +remx3477 remainder 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> NaN Division_impossible +subx3477 subtract 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 7812758113817.99135851825223122508 Inexact Rounded +addx3478 add 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 490328689.266902084767070133475071 Inexact Rounded +comx3478 compare 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 1 +divx3478 divide 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 430.269702657525223124148258641358 Inexact Rounded +dvix3478 divideint 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 430 +mulx3478 multiply 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 556182701222751.588454129518830550 Inexact Rounded +powx3478 power 489191747.148674326757767356626016 1136942 -> Infinity Overflow Inexact Rounded +remx3478 remainder 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 306636.3107383827575733115325810 +subx3478 subtract 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 488054805.030446568748464579776962 Inexact Rounded +addx3479 add -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> -5.99369540373174482335865567937853E+297 Inexact Rounded +comx3479 compare -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> -1 +divx3479 divide -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> 1.56540833065089684132688143737586E+287 Inexact Rounded +dvix3479 divideint -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> NaN Division_impossible +mulx3479 multiply -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> 2.29488906436173641324091638963715E+308 Inexact Rounded +powx3479 power -599369540.373174482335865567937853E+289 -4 -> 7.74856580646291366270329165540958E-1192 Inexact Rounded +remx3479 remainder -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> NaN Division_impossible +subx3479 subtract -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> -5.99369540373174482335865567937853E+297 Inexact Rounded +addx3480 add -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> -68624373320.5930758945974232604298 Inexact Rounded +comx3480 compare -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 1 +divx3480 divide -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 0.0517550008335747813596332404664731 Inexact Rounded +dvix3480 divideint -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 0 +mulx3480 multiply -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 220333194736887939420.719579906257 Inexact Rounded +powx3480 power -3376883870.85961692148022521960139 -7 -> -1.99704163718361153125735756179280E-67 Inexact Rounded +remx3480 remainder -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> -3376883870.85961692148022521960139 +subx3480 subtract -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 61870605578.8738420516369728212270 Inexact Rounded +addx3481 add 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 60.2702299236537409084931002396185 +comx3481 compare 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 1 +divx3481 divide 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 36.8450651616286048437498576613622 Inexact Rounded +dvix3481 divideint 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 36 +mulx3481 multiply 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 93.4472468622373769590900258060029 Inexact Rounded +powx3481 power 58.6776780370008364590621772421025 2 -> 3443.06989981393033632008313505230 Inexact Rounded +remx3481 remainder 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 1.3458101174962762795489493315265 +subx3481 subtract 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 57.0851261503479320096312542445865 +addx3482 add 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 4099616630.75768235660057557396732 Inexact Rounded +comx3482 compare 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 1 +divx3482 divide 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 14097951.1289920788134209002390834 Inexact Rounded +dvix3482 divideint 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 14097951 +mulx3482 multiply 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 1192148701687.90798437501397900174 Inexact Rounded +powx3482 power 4099616339.96249499552808575717579 291 -> 2.03364757877800497409765979877258E+2797 Inexact Rounded +remx3482 remainder 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 37.510275726642959858538282144855 +subx3482 subtract 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 4099616049.16730763445559594038426 Inexact Rounded +addx3483 add 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> -2140306990376.46573014981378406578 Inexact Rounded +comx3483 compare 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> 1 +divx3483 divide 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> -0.0000401191663393971853092748263233128 Inexact Rounded +dvix3483 divideint 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> -0 +mulx3483 multiply 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> -183797198561136797328.508878254848 Inexact Rounded +powx3483 power 85870777.2282833141709970713739108 -2 -> 1.35615463448707573424578785973269E-16 Inexact Rounded +remx3483 remainder 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> 85870777.2282833141709970713739108 +subx3483 subtract 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> 2140478731930.92229677815577820852 Inexact Rounded +addx3484 add 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> 20862.2147613905641948547078989489 Inexact Rounded +comx3484 compare 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> 1 +divx3484 divide 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> -539.315627388386430188627412639767 Inexact Rounded +dvix3484 divideint 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> -539 +mulx3484 multiply 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> -810009.016386974103738622793670566 Inexact Rounded +powx3484 power 20900.9693761555165742010339929779 -39 -> 3.26219014701526335296044439989665E-169 Inexact Rounded +remx3484 remainder 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> 12.2320178461841065312693113692685 +subx3484 subtract 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> 20939.7239909204689535473600870069 Inexact Rounded +addx3485 add 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 379130602.210390198240885543797232 Inexact Rounded +comx3485 compare 448.827596155587910947511170319456 379130153.382794042652974596286062 -> -1 +divx3485 divide 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 0.00000118383513458615061394140895596979 Inexact Rounded +dvix3485 divideint 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 0 +mulx3485 multiply 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 170164075372.898786469094460692097 Inexact Rounded +powx3485 power 448.827596155587910947511170319456 379130153 -> Infinity Overflow Inexact Rounded +remx3485 remainder 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 448.827596155587910947511170319456 +subx3485 subtract 448.827596155587910947511170319456 379130153.382794042652974596286062 -> -379129704.555197887065063648774892 Inexact Rounded +addx3486 add 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 3404725642.18381024654682525116780 Inexact Rounded +comx3486 compare 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> -1 +divx3486 divide 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 2.89049673833970863420201979291523E-8 Inexact Rounded +dvix3486 divideint 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 0 +mulx3486 multiply 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 335070891904.214504811798212040413 Inexact Rounded +powx3486 power 98.4134807921002817357000140482039 3 -> 953155.543384739667965055839894682 Inexact Rounded +remx3486 remainder 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 98.4134807921002817357000140482039 +subx3486 subtract 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> -3404725445.35684866234626177976778 Inexact Rounded +addx3487 add 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> -5.14995709970912830072802043560650E-425 Inexact Rounded +comx3487 compare 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> 1 +divx3487 divide 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> -1.05971064046375011086850722752614E-354 Inexact Rounded +dvix3487 divideint 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> -0 +mulx3487 multiply 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> -2.81057072061345688074304873033317E-1203 Inexact Rounded +powx3487 power 545746433.649359734136476718176330E-787 -5 -> 2.06559640092667166976186801348662E+3891 Inexact Rounded +remx3487 remainder 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> 5.45746433649359734136476718176330E-779 +subx3487 subtract 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> 5.14995709970912830072802043560650E-425 Inexact Rounded +addx3488 add 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 741304513547.273820525801608231737 Inexact Rounded +comx3488 compare 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 1 +divx3488 divide 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 1.87090281565101612623398174727653E+839 Inexact Rounded +dvix3488 divideint 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> NaN Division_impossible +mulx3488 multiply 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 2.93725776244737788947443361076095E-816 Inexact Rounded +powx3488 power 741304513547.273820525801608231737 4 -> 3.01985838652892073903194846668712E+47 Inexact Rounded +remx3488 remainder 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> NaN Division_impossible +subx3488 subtract 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 741304513547.273820525801608231737 Inexact Rounded +addx3489 add -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> 4033.67985686310526747345220908179 Inexact Rounded +comx3489 compare -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -1 +divx3489 divide -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -0.148981244172527671907534117771626 Inexact Rounded +dvix3489 divideint -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -0 +mulx3489 multiply -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -3347003.65129295988793454267973464 Inexact Rounded +powx3489 power -706.145005094292315613907254240553 4740 -> Infinity Overflow Inexact Rounded +remx3489 remainder -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -706.145005094292315613907254240553 +subx3489 subtract -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -5445.96986705168989870126671756289 Inexact Rounded +addx3490 add -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> -769956988.821146059252782194757952 Inexact Rounded +comx3490 compare -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> -1 +divx3490 divide -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> 24675.5283319978698932292028650803 Inexact Rounded +dvix3490 divideint -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> 24675 +mulx3490 multiply -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> 24023222896770.8161787236737395477 Inexact Rounded +powx3490 power -769925786.823099083228795187975893 -31202 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3490 remainder -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> -16485.0139656913494028406582486750 +subx3490 subtract -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> -769894584.825052107204808181193834 Inexact Rounded +addx3491 add 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 8.44386105460497256507419289692857E+919 Inexact Rounded +comx3491 compare 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 1 +divx3491 divide 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 1.60516736512701978695559003341922E+888 Inexact Rounded +dvix3491 divideint 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> NaN Division_impossible +mulx3491 multiply 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 4.44182899917309231779837668210610E+951 Inexact Rounded +powx3491 power 84438610546049.7256507419289692857E+906 5 -> 4.29245144719689283247342866988213E+4599 Inexact Rounded +remx3491 remainder 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> NaN Division_impossible +subx3491 subtract 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 8.44386105460497256507419289692857E+919 Inexact Rounded +addx3492 add 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 549926.071394341400088797374170467 Inexact Rounded +comx3492 compare 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 1 +divx3492 divide 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 3328.65471667062107598395714348089 Inexact Rounded +dvix3492 divideint 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 3328 +mulx3492 multiply 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 90798561.3782451425861113694732484 Inexact Rounded +powx3492 power 549760.911304725795164589619286514 165 -> 1.34488925442386544028875603347654E+947 Inexact Rounded +remx3492 remainder 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 108.133063992607401181365489319248 +subx3492 subtract 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 549595.751215110190240381864402561 Inexact Rounded +addx3493 add 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 11737235.5901860743933857728701908 Inexact Rounded +comx3493 compare 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> -1 +divx3493 divide 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 0.451420792712387250865423208234291 Inexact Rounded +dvix3493 divideint 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 0 +mulx3493 multiply 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 29520691206417.5831886752808745421 Inexact Rounded +powx3493 power 3650514.18649737956855828939662794 8086721 -> Infinity Overflow Inexact Rounded +remx3493 remainder 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 3650514.18649737956855828939662794 +subx3493 subtract 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> -4436207.21719131525626919407693496 +addx3494 add 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> 55067723881941.2298810010885806451 Inexact Rounded +comx3494 compare 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> 1 +divx3494 divide 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> -6184039198391.19853088419484117054 Inexact Rounded +dvix3494 divideint 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> -6184039198391 +mulx3494 multiply 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> -490367883555396.250365158593373279 Inexact Rounded +powx3494 power 55067723881950.1346958179604099594 -9 -> 2.14746386538529270173788457887121E-124 Inexact Rounded +remx3494 remainder 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> 1.76788075918488693086347720461547 +subx3494 subtract 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> 55067723881959.0395106348322392737 Inexact Rounded +addx3495 add 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 5.57966504537858308541154858567656E+140 Inexact Rounded +comx3495 compare 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> -1 +divx3495 divide 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 1.55609900657590706155251902725027E-113 Inexact Rounded +dvix3495 divideint 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 0 +mulx3495 multiply 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 4.84455044392374106106966779322483E+168 Inexact Rounded +powx3495 power 868251123.413992653362860637541060E+019 6 -> 4.28422354304291884802690733853227E+167 Inexact Rounded +remx3495 remainder 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 8682511234139926533628606375.41060 +subx3495 subtract 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> -5.57966504537858308541154858567656E+140 Inexact Rounded +addx3496 add -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> -646.464431574014407536004990059069 Inexact Rounded +comx3496 compare -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> -1 +divx3496 divide -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> 8.09416521887063886613527228353543E+36 Inexact Rounded +dvix3496 divideint -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> NaN Division_impossible +mulx3496 multiply -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> 5.16317927778381197995451363439626E-32 Inexact Rounded +powx3496 power -646.464431574014407536004990059069 -8 -> 3.27825641569860861774700548035691E-23 Inexact Rounded +remx3496 remainder -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> NaN Division_impossible +subx3496 subtract -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> -646.464431574014407536004990059069 Inexact Rounded +addx3497 add 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> 354.546679975219753598558273421556 Inexact Rounded +comx3497 compare 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> 1 +divx3497 divide 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> -5.03655799102477192579414523352028E+446 Inexact Rounded +dvix3497 divideint 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> NaN Division_impossible +mulx3497 multiply 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> -2.49581854324831161267369292071408E-442 Inexact Rounded +powx3497 power 354.546679975219753598558273421556 -7 -> 1.41999246365875617298270414304233E-18 Inexact Rounded +remx3497 remainder 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> NaN Division_impossible +subx3497 subtract 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> 354.546679975219753598558273421556 Inexact Rounded +addx3498 add 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> 91936087917435.5974889495278215874 Inexact Rounded +comx3498 compare 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> 1 +divx3498 divide 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> -1.37052712434303366569304688993783E+760 Inexact Rounded +dvix3498 divideint 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> NaN Division_impossible +mulx3498 multiply 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> -6.16714847260980448099292763939423E-733 Inexact Rounded +powx3498 power 91936087917435.5974889495278215874 -7 -> 1.80134899939035708719659065082630E-98 Inexact Rounded +remx3498 remainder 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> NaN Division_impossible +subx3498 subtract 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> 91936087917435.5974889495278215874 Inexact Rounded +addx3499 add -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -7.34564225185285561365214172598110E-597 Inexact Rounded +comx3499 compare -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -1 +divx3499 divide -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -1.78342822299163842247184303878022E+159 Inexact Rounded +dvix3499 divideint -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> NaN Division_impossible +mulx3499 multiply -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -3.02554705575380338274126867655676E-1352 Inexact Rounded +powx3499 power -07345.6422518528556136521417259811E-600 4 -> 2.91151541552217582082937236255996E-2385 Inexact Rounded +remx3499 remainder -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> NaN Division_impossible +subx3499 subtract -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -7.34564225185285561365214172598110E-597 Inexact Rounded +addx3500 add -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> 6.16988426425908872398170896375634E+401 Inexact Rounded +comx3500 compare -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -1 +divx3500 divide -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -4.10511306357337753351655511866170E-394 Inexact Rounded +dvix3500 divideint -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -0 +mulx3500 multiply -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -1.56271275924409657991913620522315E+410 Inexact Rounded +powx3500 power -253280724.939458021588167965038184 6 -> 2.64005420221406808782284459794424E+50 Inexact Rounded +remx3500 remainder -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -253280724.939458021588167965038184 +subx3500 subtract -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -6.16988426425908872398170896375634E+401 Inexact Rounded Added: sandbox/trunk/decimal-c/new_dt/randombound32.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/randombound32.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,2443 @@ +------------------------------------------------------------------------ +-- randomBound32.decTest -- decimal testcases -- boundaries near 32 -- +-- Copyright (c) IBM Corporation, 1981, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- These testcases test calculations at precisions 31, 32, and 33, to +-- exercise the boundaries around 2**5 + +-- randomly generated testcases [26 Sep 2001] +extended: 1 +precision: 31 +rounding: half_up +maxExponent: 9999 +minexponent: -9999 + +addx3001 add 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 2.189320103965343717049307148600E+799 Inexact Rounded +comx3001 compare 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> -1 +divx3001 divide 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 2.262681764507965005284080800438E-787 Inexact Rounded +dvix3001 divideint 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 0 +mulx3001 multiply 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 1.084531091568672041923151632066E+812 Inexact Rounded +powx3001 power 4953734675913.065314738743322579 2 -> 24539487239343522246155890.99495 Inexact Rounded +remx3001 remainder 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> 4953734675913.065314738743322579 +subx3001 subtract 4953734675913.065314738743322579 0218.932010396534371704930714860E+797 -> -2.189320103965343717049307148600E+799 Inexact Rounded +addx3002 add 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> -7.886453204712287484430980636798E+944 Inexact Rounded +comx3002 compare 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> 1 +divx3002 divide 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> -1.222562801441069667849402782716E-1785 Inexact Rounded +dvix3002 divideint 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> -0 +mulx3002 multiply 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> -7.603869223099928141659831589905E+104 Inexact Rounded +powx3002 power 9641.684323386955881595490347910E-844 -8 -> 1.338988152067180337738955757587E+6720 Inexact Rounded +remx3002 remainder 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> 9.641684323386955881595490347910E-841 +subx3002 subtract 9641.684323386955881595490347910E-844 -78864532047.12287484430980636798E+934 -> 7.886453204712287484430980636798E+944 Inexact Rounded +addx3003 add -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -1.028048571628326871054964307774E+529 Inexact Rounded +comx3003 compare -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -1 +divx3003 divide -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -2.089529249946971482861843692465E+515 Inexact Rounded +dvix3003 divideint -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> NaN Division_impossible +mulx3003 multiply -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -5.057999861231255549283737861207E+542 Inexact Rounded +powx3003 power -1.028048571628326871054964307774E+529 5 -> -1.148333858253704284232780819739E+2645 Inexact Rounded +remx3003 remainder -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> NaN Division_impossible +subx3003 subtract -1.028048571628326871054964307774E+529 49200008645699.35577937582714739 -> -1.028048571628326871054964307774E+529 Inexact Rounded +addx3004 add 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 84158050139.12535935915094076662 Inexact Rounded +comx3004 compare 479084.8561808930525417735205519 084157571054.2691784660983989931 -> -1 +divx3004 divide 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 0.000005692712493709617905493710207969 Inexact Rounded +dvix3004 divideint 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 0 +mulx3004 multiply 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 40318617825067837.47317700523687 Inexact Rounded +powx3004 power 479084.8561808930525417735205519 8 -> 2.775233598021235973545933045837E+45 Inexact Rounded +remx3004 remainder 479084.8561808930525417735205519 084157571054.2691784660983989931 -> 479084.8561808930525417735205519 +subx3004 subtract 479084.8561808930525417735205519 084157571054.2691784660983989931 -> -84157091969.41299757304585721958 Inexact Rounded +addx3005 add -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> -363753960.6547166697980414728370 Inexact Rounded +comx3005 compare -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> -1 +divx3005 divide -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> 114672.6064337420167096295290890 Inexact Rounded +dvix3005 divideint -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> 114672 +mulx3005 multiply -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> 1153846941331.188583292239230818 Inexact Rounded +powx3005 power -0363750788.573782205664349562931 -3172 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3005 remainder -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> -1923.656911066945656824381431488 +subx3005 subtract -0363750788.573782205664349562931 -3172.080934464133691909905980096 -> -363747616.4928477415306576530250 Inexact Rounded +addx3006 add 1381026551423669919010191878449 -82.66614775445371254999357800739 -> 1381026551423669919010191878366 Inexact Rounded +comx3006 compare 1381026551423669919010191878449 -82.66614775445371254999357800739 -> 1 +divx3006 divide 1381026551423669919010191878449 -82.66614775445371254999357800739 -> -16706071214613552377376639557.90 Inexact Rounded +dvix3006 divideint 1381026551423669919010191878449 -82.66614775445371254999357800739 -> -16706071214613552377376639557 +mulx3006 multiply 1381026551423669919010191878449 -82.66614775445371254999357800739 -> -1.141641449528127656560770057228E+32 Inexact Rounded +powx3006 power 1381026551423669919010191878449 -83 -> 2.307977908106564299925193011052E-2502 Inexact Rounded +remx3006 remainder 1381026551423669919010191878449 -82.66614775445371254999357800739 -> 74.22115953553602036042168767377 +subx3006 subtract 1381026551423669919010191878449 -82.66614775445371254999357800739 -> 1381026551423669919010191878532 Inexact Rounded +addx3007 add 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> -4410583128274.803057056669103177 Inexact Rounded +comx3007 compare 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> 1 +divx3007 divide 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> -1.049073743992404570569003129346E-9 Inexact Rounded +dvix3007 divideint 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> -0 +mulx3007 multiply 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> -20407887067124025.31576887565113 Inexact Rounded +powx3007 power 4627.026960423072127953556635585 -4 -> 2.181684167222334934221407781701E-15 Inexact Rounded +remx3007 remainder 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> 4627.026960423072127953556635585 +subx3007 subtract 4627.026960423072127953556635585 -4410583132901.830017479741231131 -> 4410583137528.856977902813359085 Inexact Rounded +addx3008 add 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -8684111695095849922187690616727 Inexact Rounded +comx3008 compare 75353574493.84484153484918212042 -8684111695095849922263044191221 -> 1 +divx3008 divide 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -8.677177026223536475531592432118E-21 Inexact Rounded +dvix3008 divideint 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -0 +mulx3008 multiply 75353574493.84484153484918212042 -8684111695095849922263044191221 -> -6.543788575292743281456830701127E+41 Inexact Rounded +powx3008 power 75353574493.84484153484918212042 -9 -> 1.276630670287906925570645490707E-98 Inexact Rounded +remx3008 remainder 75353574493.84484153484918212042 -8684111695095849922263044191221 -> 75353574493.84484153484918212042 +subx3008 subtract 75353574493.84484153484918212042 -8684111695095849922263044191221 -> 8684111695095849922338397765715 Inexact Rounded +addx3009 add 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 6907061.073440802792400108035410 Inexact Rounded +comx3009 compare 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 1 +divx3009 divide 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 2417586.646146283856436864121104 Inexact Rounded +dvix3009 divideint 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 2417586 +mulx3009 multiply 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 19733502.94653326211623698034717 Inexact Rounded +powx3009 power 6907058.216435355874729592373011 3 -> 329518156646369505494.8971353240 Inexact Rounded +remx3009 remainder 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 1.846043452483451396449034189630 +subx3009 subtract 6907058.216435355874729592373011 2.857005446917670515662398741545 -> 6907055.359429908957059076710612 Inexact Rounded +addx3010 add -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -38949530427253.24030680468677190 Inexact Rounded +comx3010 compare -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -1 +divx3010 divide -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -5.469149031100999700489221122509E+996 Inexact Rounded +dvix3010 divideint -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> NaN Division_impossible +mulx3010 multiply -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -2.773861000818483769292240109417E-970 Inexact Rounded +powx3010 power -38949530427253.24030680468677190 7 -> -1.359926959823071332599817363877E+95 Inexact Rounded +remx3010 remainder -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> NaN Division_impossible +subx3010 subtract -38949530427253.24030680468677190 712168021.1265384466442576619064E-992 -> -38949530427253.24030680468677190 Inexact Rounded +addx3011 add -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> -1270911.495819550779479954702829 Inexact Rounded +comx3011 compare -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> -1 +divx3011 divide -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> 1.258023449218665608349145394069 Inexact Rounded +dvix3011 divideint -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> 1 +mulx3011 multiply -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> 398531319444.8556128729086112205 Inexact Rounded +powx3011 power -0708069.025667471996378081482549 -562842 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3011 remainder -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> -145226.5555153932132762082622686 +subx3011 subtract -0708069.025667471996378081482549 -562842.4701520787831018732202804 -> -145226.5555153932132762082622686 +addx3012 add 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> -4.318314692189767383476104084575E+224 Inexact Rounded +comx3012 compare 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> 1 +divx3012 divide 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> -9.390439409913307906923909630247E-219 Inexact Rounded +dvix3012 divideint 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> -0 +mulx3012 multiply 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> -1.751114283680833039197637874453E+231 Inexact Rounded +powx3012 power 4055087.246994644709729942673976 -4 -> 3.698274893849241116195795515302E-27 Inexact Rounded +remx3012 remainder 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> 4055087.246994644709729942673976 +subx3012 subtract 4055087.246994644709729942673976 -43183146921897.67383476104084575E+211 -> 4.318314692189767383476104084575E+224 Inexact Rounded +addx3013 add 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> -815.9047305921862348263521876034 Inexact Rounded +comx3013 compare 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> 1 +divx3013 divide 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> -5.518899111238367862234798433551E-503 Inexact Rounded +dvix3013 divideint 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> -0 +mulx3013 multiply 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> -3.673934060071516156604453756541E-497 Inexact Rounded +powx3013 power 4502895892520.396581348110906909E-512 -816 -> Infinity Overflow Inexact Rounded +remx3013 remainder 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> 4.502895892520396581348110906909E-500 +subx3013 subtract 4502895892520.396581348110906909E-512 -815.9047305921862348263521876034 -> 815.9047305921862348263521876034 Inexact Rounded +addx3014 add 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> 465.6005787733070743275007572563 Inexact Rounded +comx3014 compare 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> 1 +divx3014 divide 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> -225.7594380101027705997496045999 Inexact Rounded +dvix3014 divideint 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> -225 +mulx3014 multiply 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> -968.8065431314121523074875069807 Inexact Rounded +powx3014 power 467.6721295072628100260239179865 -2 -> 0.000004572113694193221810609836080931 Inexact Rounded +remx3014 remainder 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> 1.57321436722227785831275368025 +subx3014 subtract 467.6721295072628100260239179865 -02.07155073395573569852316073025 -> 469.7436802412185457245470787168 Inexact Rounded +addx3015 add 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> -8677147.586389401682712180146855 Inexact Rounded +comx3015 compare 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> 1 +divx3015 divide 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> -2.485604044230163799604243529005E-578 Inexact Rounded +dvix3015 divideint 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> -0 +mulx3015 multiply 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> -1.871483124723381986272837942577E-564 Inexact Rounded +powx3015 power 2.156795313311150143949997552501E-571 -8677148 -> Infinity Overflow Inexact Rounded +remx3015 remainder 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> 2.156795313311150143949997552501E-571 +subx3015 subtract 2.156795313311150143949997552501E-571 -8677147.586389401682712180146855 -> 8677147.586389401682712180146855 Inexact Rounded +addx3016 add -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> -694070746.6469215276170700777068 Inexact Rounded +comx3016 compare -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 1 +divx3016 divide -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 0.001406664546942092941961075608769 Inexact Rounded +dvix3016 divideint -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 0 +mulx3016 multiply -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 675736017210596.9899587749991363 Inexact Rounded +powx3016 power -974953.2801637208368002585822457 -693095793 -> -0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3016 remainder -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> -974953.2801637208368002585822457 +subx3016 subtract -974953.2801637208368002585822457 -693095793.3667578067802698191246 -> 692120840.0865940859434695605424 Inexact Rounded +addx3017 add -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -7634680140009571846155654339781 Inexact Rounded +comx3017 compare -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -1 +divx3017 divide -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -2.536749610869326753741024659948E+508 Inexact Rounded +dvix3017 divideint -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> NaN Division_impossible +mulx3017 multiply -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -2.297756963892134373657544025107E-447 Inexact Rounded +powx3017 power -7634680140009571846155654339781 3 -> -4.450128382072157170207584847831E+92 Inexact Rounded +remx3017 remainder -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> NaN Division_impossible +subx3017 subtract -7634680140009571846155654339781 3009630949502.035852433434214413E-490 -> -7634680140009571846155654339781 Inexact Rounded +addx3018 add 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 74177.21073338090843145838835480 Inexact Rounded +comx3018 compare 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> -1 +divx3018 divide 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 3.535762799545274329358292065343E-624 Inexact Rounded +dvix3018 divideint 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 0 +mulx3018 multiply 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 1.945468124372395349192665031675E-614 Inexact Rounded +powx3018 power 262273.0222851186523650889896428E-624 74177 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3018 remainder 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> 2.622730222851186523650889896428E-619 +subx3018 subtract 262273.0222851186523650889896428E-624 74177.21073338090843145838835480 -> -74177.21073338090843145838835480 Inexact Rounded +addx3019 add -8036052748815903177624716581732 -066677357.4438809548850966167573 -> -8036052748815903177624783259089 Inexact Rounded +comx3019 compare -8036052748815903177624716581732 -066677357.4438809548850966167573 -> -1 +divx3019 divide -8036052748815903177624716581732 -066677357.4438809548850966167573 -> 120521464210387351732732.6271469 Inexact Rounded +dvix3019 divideint -8036052748815903177624716581732 -066677357.4438809548850966167573 -> 120521464210387351732732 +mulx3019 multiply -8036052748815903177624716581732 -066677357.4438809548850966167573 -> 5.358227615706800711033262124598E+38 Inexact Rounded +powx3019 power -8036052748815903177624716581732 -66677357 -> -0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3019 remainder -8036052748815903177624716581732 -066677357.4438809548850966167573 -> -41816499.5048993028288978900564 +subx3019 subtract -8036052748815903177624716581732 -066677357.4438809548850966167573 -> -8036052748815903177624649904375 Inexact Rounded +addx3020 add 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> 8.834295928031498103637713570166E+770 Inexact Rounded +comx3020 compare 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> 1 +divx3020 divide 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> -2.008754492913739633208672455025E+766 Inexact Rounded +dvix3020 divideint 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> NaN Division_impossible +mulx3020 multiply 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> -3.885232606540600490321438191516E+775 Inexact Rounded +powx3020 power 883429.5928031498103637713570166E+765 -43979 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3020 remainder 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> NaN Division_impossible +subx3020 subtract 883429.5928031498103637713570166E+765 -43978.97283712939198111043032726 -> 8.834295928031498103637713570166E+770 Inexact Rounded +addx3021 add 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> -5588536565419.943265474528122494 Inexact Rounded +comx3021 compare 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> 1 +divx3021 divide 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> -0.004416506865458415275182120038399 Inexact Rounded +dvix3021 divideint 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> -0 +mulx3021 multiply 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> -139161701088530765925120.8408852 Inexact Rounded +powx3021 power 24791301060.37938360567775506973 -6 -> 4.307289712375673028996126249656E-63 Inexact Rounded +remx3021 remainder 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> 24791301060.37938360567775506973 +subx3021 subtract 24791301060.37938360567775506973 -5613327866480.322649080205877564 -> 5638119167540.702032685883632634 Inexact Rounded +addx3022 add -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> -930712184.3335760878938383398937 Inexact Rounded +comx3022 compare -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> -1 +divx3022 divide -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> 1257062.290270583507131602958799 Inexact Rounded +dvix3022 divideint -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> 1257062 +mulx3022 multiply -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> 689085814282.3968746911100154133 Inexact Rounded +powx3022 power -930711443.9474781586162910776139 -740 -> 1.193603394165051899997226995178E-6637 Inexact Rounded +remx3022 remainder -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> -214.9123046664996750639167712140 +subx3022 subtract -930711443.9474781586162910776139 -740.3860979292775472622798348030 -> -930710703.5613802293387438153341 Inexact Rounded +addx3023 add 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 2358276428979.423170691006252127 Inexact Rounded +comx3023 compare 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 1 +divx3023 divide 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 11001528525.07089502152736489473 Inexact Rounded +dvix3023 divideint 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 11001528525 +mulx3023 multiply 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 505517728904226.6233443209659001 Inexact Rounded +powx3023 power 2358276428765.064191082773385539 214 -> 5.435856480782850080741276939256E+2647 Inexact Rounded +remx3023 remainder 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 15.1969844739096415643561521775 +subx3023 subtract 2358276428765.064191082773385539 214.3589796082328665878602304469 -> 2358276428550.705211474540518951 Inexact Rounded +addx3024 add -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -3.868744449795653651638308926987E+750 Inexact Rounded +comx3024 compare -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -1 +divx3024 divide -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -4.677779235812959233092739433453E+746 Inexact Rounded +dvix3024 divideint -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> NaN Division_impossible +mulx3024 multiply -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -3.199634455434813294426505526063E+754 Inexact Rounded +powx3024 power -3.868744449795653651638308926987E+750 8270 -> Infinity Overflow Inexact Rounded +remx3024 remainder -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> NaN Division_impossible +subx3024 subtract -3.868744449795653651638308926987E+750 8270.472492965559872384018329418 -> -3.868744449795653651638308926987E+750 Inexact Rounded +addx3025 add 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> -567195652586.2454217069003186487 Inexact Rounded +comx3025 compare 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> 1 +divx3025 divide 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> -2.475725421131866851190640203633E-451 Inexact Rounded +dvix3025 divideint 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> -0 +mulx3025 multiply 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> -7.964678739652657498503799559950E-428 Inexact Rounded +powx3025 power 140422069.5863246490180206814374E-447 -6 -> 1.304330899731988395473578425854E+2633 Inexact Rounded +remx3025 remainder 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> 1.404220695863246490180206814374E-439 +subx3025 subtract 140422069.5863246490180206814374E-447 -567195652586.2454217069003186487 -> 567195652586.2454217069003186487 Inexact Rounded +addx3026 add 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> -9.452601935038035195726041512900E+467 Inexact Rounded +comx3026 compare 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> 1 +divx3026 divide 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> -8.032613347885465805613265604973E-305 Inexact Rounded +dvix3026 divideint 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> -0 +mulx3026 multiply 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> -7.177275242712723733041569606882E+631 Inexact Rounded +powx3026 power 75929096475.63450425339472559646E+153 -9 -> 1.192136299657177324051477375561E-1475 Inexact Rounded +remx3026 remainder 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> 7.592909647563450425339472559646E+163 +subx3026 subtract 75929096475.63450425339472559646E+153 -0945260193.503803519572604151290E+459 -> 9.452601935038035195726041512900E+467 Inexact Rounded +addx3027 add 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> -5.641317823202274083982487558514E+637 Inexact Rounded +comx3027 compare 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> 1 +divx3027 divide 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> -1.118943925332481944765809682502E-628 Inexact Rounded +dvix3027 divideint 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> -0 +mulx3027 multiply 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> -3.560979378308906043783023726787E+647 Inexact Rounded +powx3027 power 6312318309.142044953357460463732 -6 -> 1.580762611512787720076533747265E-59 Inexact Rounded +remx3027 remainder 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> 6312318309.142044953357460463732 +subx3027 subtract 6312318309.142044953357460463732 -5641317823.202274083982487558514E+628 -> 5.641317823202274083982487558514E+637 Inexact Rounded +addx3028 add 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 93793652428100.52105928239469937 Inexact Rounded +comx3028 compare 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 1 +divx3028 divide 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 1.022544815694674972559924997256E+723 Inexact Rounded +dvix3028 divideint 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> NaN Division_impossible +mulx3028 multiply 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 8.603289656137796526769786965341E-696 Inexact Rounded +powx3028 power 93793652428100.52105928239469937 9 -> 5.617732206663136654187263964365E+125 Inexact Rounded +remx3028 remainder 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> NaN Division_impossible +subx3028 subtract 93793652428100.52105928239469937 917.2571313109730433369594936416E-712 -> 93793652428100.52105928239469937 Inexact Rounded +addx3029 add 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337115 Inexact Rounded +comx3029 compare 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 1 +divx3029 divide 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> -4103968.106336710126241266685434 Inexact Rounded +dvix3029 divideint 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> -4103968 +mulx3029 multiply 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> -2362732023235112.375960528304974 Inexact Rounded +powx3029 power 98471198160.56524417578665886060 -23994 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3029 remainder 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 2551.45824316125588493249246784 +subx3029 subtract 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471222154.70837811518409435005 Inexact Rounded +addx3030 add 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> 329324100.9201858301191681987940 Inexact Rounded +comx3030 compare 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> 1 +divx3030 divide 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> -134358.6406732917173739187421978 Inexact Rounded +dvix3030 divideint 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> -134358 +mulx3030 multiply 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> -807212527028.0005401736893474430 Inexact Rounded +powx3030 power 329326552.0208398002250836592043 -2451 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3030 remainder 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> 1570.35472430963565384668749322 +subx3030 subtract 329326552.0208398002250836592043 -02451.10065397010591546041034041 -> 329329003.1214937703309991196146 Inexact Rounded +addx3031 add -92980.68431371090354435763218439 -2282178507046019721925800997065 -> -2282178507046019721925801090046 Inexact Rounded +comx3031 compare -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 1 +divx3031 divide -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 4.074207342968196863070496994457E-26 Inexact Rounded +dvix3031 divideint -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 0 +mulx3031 multiply -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 2.121985193111820147170707717938E+35 Inexact Rounded +powx3031 power -92980.68431371090354435763218439 -2 -> 1.156683455371909793870207184337E-10 Inexact Rounded +remx3031 remainder -92980.68431371090354435763218439 -2282178507046019721925800997065 -> -92980.68431371090354435763218439 +subx3031 subtract -92980.68431371090354435763218439 -2282178507046019721925800997065 -> 2282178507046019721925800904084 Inexact Rounded +addx3032 add 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1.213581776227858606259822256987E+748 Inexact Rounded +comx3032 compare 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1 +divx3032 divide 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1.233860374149945561886955398724E+1648 Inexact Rounded +dvix3032 divideint 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> NaN Division_impossible +mulx3032 multiply 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1.193636458750059340733188876015E-152 Inexact Rounded +powx3032 power 12135817762.27858606259822256987E+738 10 -> 6.929317520577437720457517499936E+7480 Inexact Rounded +remx3032 remainder 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> NaN Division_impossible +subx3032 subtract 12135817762.27858606259822256987E+738 98.35649167872356132249561021910E-902 -> 1.213581776227858606259822256987E+748 Inexact Rounded +addx3033 add 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> -392513.2044337156627881674596002 Inexact Rounded +comx3033 compare 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> 1 +divx3033 divide 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> -0.00009495486002714264641177211062199 Inexact Rounded +dvix3033 divideint 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> -0 +mulx3033 multiply 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> -14632152.58043001234518095997140 Inexact Rounded +powx3033 power 37.27457578793521166809739140081 -392550 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3033 remainder 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> 37.27457578793521166809739140081 +subx3033 subtract 37.27457578793521166809739140081 -392550.4790095035979998355569916 -> 392587.7535852915332115036543830 Inexact Rounded +addx3034 add -2787.980590304199878755265273703 7117631179305319208210387565324 -> 7117631179305319208210387562536 Inexact Rounded +comx3034 compare -2787.980590304199878755265273703 7117631179305319208210387565324 -> -1 +divx3034 divide -2787.980590304199878755265273703 7117631179305319208210387565324 -> -3.917006262435063093475140250870E-28 Inexact Rounded +dvix3034 divideint -2787.980590304199878755265273703 7117631179305319208210387565324 -> -0 +mulx3034 multiply -2787.980590304199878755265273703 7117631179305319208210387565324 -> -1.984381757684722217801410305714E+34 Inexact Rounded +powx3034 power -2787.980590304199878755265273703 7 -> -1309266999233099220127139.440082 Inexact Rounded +remx3034 remainder -2787.980590304199878755265273703 7117631179305319208210387565324 -> -2787.980590304199878755265273703 +subx3034 subtract -2787.980590304199878755265273703 7117631179305319208210387565324 -> -7117631179305319208210387568112 Inexact Rounded +addx3035 add -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> -9.890633854609434943559831911276E+977 Inexact Rounded +comx3035 compare -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> -1 +divx3035 divide -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> 5.098302376420396260404821158158E+968 Inexact Rounded +dvix3035 divideint -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> NaN Division_impossible +mulx3035 multiply -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> 1.918768853302706825964087702307E+987 Inexact Rounded +powx3035 power -9890633.854609434943559831911276E+971 -2 -> 1.022237362667592867768511487814E-1956 Inexact Rounded +remx3035 remainder -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> NaN Division_impossible +subx3035 subtract -9890633.854609434943559831911276E+971 -1939985729.436827777055699361237 -> -9.890633854609434943559831911276E+977 Inexact Rounded +addx3036 add 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> 3927209601.042340294247970850347 Inexact Rounded +comx3036 compare 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> 1 +divx3036 divide 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> -227.2123393091837706827708196101 Inexact Rounded +dvix3036 divideint 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> -227 +mulx3036 multiply 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> -68480589931920481.56020043213767 Inexact Rounded +powx3036 power 3944570323.331121750661920475191 -17360722 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3036 remainder 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> 3686363.77773114469535563568018 +subx3036 subtract 3944570323.331121750661920475191 -17360722.28878145641394962484366 -> 3961931045.619903207075870100035 Inexact Rounded +addx3037 add 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 1786717307.025364028452423865075 Inexact Rounded +comx3037 compare 19544.14018503427029002552872707 1786697762.885178994182133839546 -> -1 +divx3037 divide 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 0.00001093869404832867759234359871991 Inexact Rounded +dvix3037 divideint 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 0 +mulx3037 multiply 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 34919471546115.05897163496162290 Inexact Rounded +powx3037 power 19544.14018503427029002552872707 2 -> 381973415.5722714009298802557940 Inexact Rounded +remx3037 remainder 19544.14018503427029002552872707 1786697762.885178994182133839546 -> 19544.14018503427029002552872707 +subx3037 subtract 19544.14018503427029002552872707 1786697762.885178994182133839546 -> -1786678218.744993959911843814017 Inexact Rounded +addx3038 add -05.75485957937617757983513662981 5564476875.989640431173694372083 -> 5564476870.234780851797516792248 Inexact Rounded +comx3038 compare -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -1 +divx3038 divide -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -1.034213944568271324841608825136E-9 Inexact Rounded +dvix3038 divideint -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -0 +mulx3038 multiply -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -32022783054.00620878436398990135 Inexact Rounded +powx3038 power -05.75485957937617757983513662981 6 -> 36325.23118223611421303238908472 Inexact Rounded +remx3038 remainder -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -5.75485957937617757983513662981 +subx3038 subtract -05.75485957937617757983513662981 5564476875.989640431173694372083 -> -5564476881.744500010549871951918 Inexact Rounded +addx3039 add -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> 6.268877553774705678201112845462E+211 Inexact Rounded +comx3039 compare -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -1 +divx3039 divide -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -6.713834913211527184907421856434E-206 Inexact Rounded +dvix3039 divideint -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -0 +mulx3039 multiply -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -2.638458285983158789458925170267E+218 Inexact Rounded +powx3039 power -4208820.898718069194008526302746 6 -> 5.558564783291260359142223337994E+39 Inexact Rounded +remx3039 remainder -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -4208820.898718069194008526302746 +subx3039 subtract -4208820.898718069194008526302746 626887.7553774705678201112845462E+206 -> -6.268877553774705678201112845462E+211 Inexact Rounded +addx3040 add -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -7.007719547806630896979085821269E+562 Inexact Rounded +comx3040 compare -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -1 +divx3040 divide -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -1.521048673498997627360230078306E+559 Inexact Rounded +dvix3040 divideint -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> NaN Division_impossible +mulx3040 multiply -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -3.228570795682925509478191397878E+566 Inexact Rounded +powx3040 power -70077195478066.30896979085821269E+549 4607 -> -Infinity Overflow Inexact Rounded +remx3040 remainder -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> NaN Division_impossible +subx3040 subtract -70077195478066.30896979085821269E+549 4607.163248554155483681430013073 -> -7.007719547806630896979085821269E+562 Inexact Rounded +addx3041 add -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> -68569709.81053713470972973953995 Inexact Rounded +comx3041 compare -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 1 +divx3041 divide -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 0.006501728568934042143913111768557 Inexact Rounded +dvix3041 divideint -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 0 +mulx3041 multiply -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 30176190149574.84386395947593970 Inexact Rounded +powx3041 power -442941.7541811527940918244383454 -68126768 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3041 remainder -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> -442941.7541811527940918244383454 +subx3041 subtract -442941.7541811527940918244383454 -068126768.0563559819156379151016 -> 67683826.30217482912154609066325 Inexact Rounded +addx3042 add -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -40726479019.92472703575370611619 Inexact Rounded +comx3042 compare -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -1 +divx3042 divide -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -135895.4741975690872548233111888 Inexact Rounded +dvix3042 divideint -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -135895 +mulx3042 multiply -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -12205487445696816.02175665622242 Inexact Rounded +powx3042 power -040726778711.8677615616711676159 299692 -> Infinity Overflow Inexact Rounded +remx3042 remainder -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -142113.1908620082406650022240180 +subx3042 subtract -040726778711.8677615616711676159 299691.9430345259174614997064916 -> -40727078403.81079608758862911561 Inexact Rounded +addx3043 add -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -1934197516.927615489663964685661 Inexact Rounded +comx3043 compare -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -1 +divx3043 divide -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -507563287.7312566071537233697473 Inexact Rounded +dvix3043 divideint -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -507563287 +mulx3043 multiply -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -7370745953.579062985130438309023 Inexact Rounded +powx3043 power -1934197520.738366912179143085955 4 -> 1.399597922275400947497855539475E+37 Inexact Rounded +remx3043 remainder -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -2.786637155934674312936704177047 +subx3043 subtract -1934197520.738366912179143085955 3.810751422515178400293693371519 -> -1934197524.549118334694321486249 Inexact Rounded +addx3044 add 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> -303284009454.0558644298079356347 Inexact Rounded +comx3044 compare 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> 1 +divx3044 divide 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> -0.000002681514904267770294213381485108 Inexact Rounded +dvix3044 divideint 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> -0 +mulx3044 multiply 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> -246650255735392080.1357404280431 Inexact Rounded +powx3044 power 813262.7723533833038829559646830 -3 -> 1.859119568310997605545914895133E-18 Inexact Rounded +remx3044 remainder 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> 813262.7723533833038829559646830 +subx3044 subtract 813262.7723533833038829559646830 -303284822716.8282178131118185907 -> 303285635979.6005711964157015467 Inexact Rounded +addx3045 add 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 36105954884.94621434979365589311 Inexact Rounded +comx3045 compare 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 1 +divx3045 divide 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 4.842808328786805821411674302686E+953 Inexact Rounded +dvix3045 divideint 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> NaN Division_impossible +mulx3045 multiply 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 2.691909094160561673391352743869E-933 Inexact Rounded +powx3045 power 36105954884.94621434979365589311 7 -> 7.999297449713301719582732447386E+73 Inexact Rounded +remx3045 remainder 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> NaN Division_impossible +subx3045 subtract 36105954884.94621434979365589311 745558205.7692397481313005659523E-952 -> 36105954884.94621434979365589311 Inexact Rounded +addx3046 add -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -48556402282.66602309736499370002 +comx3046 compare -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -1 +divx3046 divide -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -2.799666682029089956269018541649 Inexact Rounded +dvix3046 divideint -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -2 +mulx3046 multiply -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -2038051610593641947717.268652175 Inexact Rounded +powx3046 power -075537177538.1814516621962185490 3 -> -4.310049518987988084595264617727E+32 Inexact Rounded +remx3046 remainder -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -21575627027.15059453253376885104 +subx3046 subtract -075537177538.1814516621962185490 26980775255.51542856483122484898 -> -102517952793.6968802270274433980 Inexact Rounded +addx3047 add -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> -4223765.415319564898840040697647 Inexact Rounded +comx3047 compare -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> -1 +divx3047 divide -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> 1.630425855588347356570076909053E+191 Inexact Rounded +dvix3047 divideint -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> NaN Division_impossible +mulx3047 multiply -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> 1.094204573762229308798604845395E-178 Inexact Rounded +powx3047 power -4223765.415319564898840040697647 -3 -> -1.327090775863616939309569791138E-20 Inexact Rounded +remx3047 remainder -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> NaN Division_impossible +subx3047 subtract -4223765.415319564898840040697647 -2590590305497454185455459149918E-215 -> -4223765.415319564898840040697647 Inexact Rounded +addx3048 add -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> -7.877324314273694312164407794939E+270 Inexact Rounded +comx3048 compare -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 1 +divx3048 divide -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 8.212057140774706874666307246628E-268 Inexact Rounded +dvix3048 divideint -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 0 +mulx3048 multiply -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 5.095765270616284455922747530676E+274 Inexact Rounded +powx3048 power -6468.903738522951259063099946195 -8 -> 3.261027724982089298030362367616E-31 Inexact Rounded +remx3048 remainder -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> -6468.903738522951259063099946195 +subx3048 subtract -6468.903738522951259063099946195 -7877.324314273694312164407794939E+267 -> 7.877324314273694312164407794939E+270 Inexact Rounded +addx3049 add -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> 1650.198961256061165362319471264 Inexact Rounded +comx3049 compare -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -1 +divx3049 divide -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -5.797616777301250711985729776957E-200 Inexact Rounded +dvix3049 divideint -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -0 +mulx3049 multiply -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -1.578781845938805737527304303976E-193 Inexact Rounded +powx3049 power -9567221.183663236817239254783372E-203 1650 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3049 remainder -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -9.567221183663236817239254783372E-197 +subx3049 subtract -9567221.183663236817239254783372E-203 1650.198961256061165362319471264 -> -1650.198961256061165362319471264 Inexact Rounded +addx3050 add 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 2.679017380163975186972720427030E+572 Inexact Rounded +comx3050 compare 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> -1 +divx3050 divide 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 3.289379965960065573444140749635E-988 Inexact Rounded +dvix3050 divideint 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 0 +mulx3050 multiply 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 2.360832119793036398127652187732E+157 Inexact Rounded +powx3050 power 8812306098770.200752139142033569E-428 3 -> 6.843349527476967274129043949969E-1246 Inexact Rounded +remx3050 remainder 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> 8.812306098770200752139142033569E-416 +subx3050 subtract 8812306098770.200752139142033569E-428 26790.17380163975186972720427030E+568 -> -2.679017380163975186972720427030E+572 Inexact Rounded +addx3051 add 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> -706127147059.6372708438205200619 Inexact Rounded +comx3051 compare 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> 1 +divx3051 divide 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> -0.0001134341690057060105325397863996 Inexact Rounded +dvix3051 divideint 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> -0 +mulx3051 multiply 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> -56572874185674332398.36004114372 Inexact Rounded +powx3051 power 80108033.12724838718736922500904 -7 -> 4.723539145042336483008674060324E-56 Inexact Rounded +remx3051 remainder 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> 80108033.12724838718736922500904 +subx3051 subtract 80108033.12724838718736922500904 -706207255092.7645192310078892869 -> 706287363125.8917676181952585119 Inexact Rounded +addx3052 add -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> -37942846288.41047269183344038636 Inexact Rounded +comx3052 compare -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> -1 +divx3052 divide -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> 6716194607.139224735032566328960 Inexact Rounded +dvix3052 divideint -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> 6716194607 +mulx3052 multiply -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> 214356442635.9672009449140933366 Inexact Rounded +powx3052 power -37942846282.76101663789059003505 -6 -> 3.351355986382646046773008753885E-64 Inexact Rounded +remx3052 remainder -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> -0.786544022188321089603127981421 +subx3052 subtract -37942846282.76101663789059003505 -5.649456053942850351313869983197 -> -37942846277.11156058394773968374 Inexact Rounded +addx3053 add 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 92659632115305.13735437728445541 Inexact Rounded +comx3053 compare 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 1 +divx3053 divide 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 1.429174267919135710410529211791E+146 Inexact Rounded +dvix3053 divideint 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> NaN Division_impossible +mulx3053 multiply 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 6.007530093754446085819255987878E-119 Inexact Rounded +powx3053 power 92659632115305.13735437728445541 6 -> 6.329121451953461546696051563323E+83 Inexact Rounded +remx3053 remainder 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> NaN Division_impossible +subx3053 subtract 92659632115305.13735437728445541 6483438.317862851676468094261410E-139 -> 92659632115305.13735437728445541 Inexact Rounded +addx3054 add 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 569549865196.1367939656357237466 Inexact Rounded +comx3054 compare 2838948.589837595494152150647194 569547026247.5469563701415715960 -> -1 +divx3054 divide 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 0.000004984572755198057481907281080406 Inexact Rounded +dvix3054 divideint 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 0 +mulx3054 multiply 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 1616914727011669419.390959984273 Inexact Rounded +powx3054 power 2838948.589837595494152150647194 6 -> 5.235343334986059753096884080673E+38 Inexact Rounded +remx3054 remainder 2838948.589837595494152150647194 569547026247.5469563701415715960 -> 2838948.589837595494152150647194 +subx3054 subtract 2838948.589837595494152150647194 569547026247.5469563701415715960 -> -569544187298.9571187746474194454 Inexact Rounded +addx3055 add 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 5.249952045236053307941775794287E+705 Inexact Rounded +comx3055 compare 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 1 +divx3055 divide 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 3.302685669286670708554753139233E+675 Inexact Rounded +dvix3055 divideint 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> NaN Division_impossible +mulx3055 multiply 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 8.345328389435009812933599889447E+735 Inexact Rounded +powx3055 power 524995204523.6053307941775794287E+694 2 -> 2.756199647727821911857160230849E+1411 Inexact Rounded +remx3055 remainder 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> NaN Division_impossible +subx3055 subtract 524995204523.6053307941775794287E+694 1589600879689517100527293028553 -> 5.249952045236053307941775794287E+705 Inexact Rounded +addx3056 add -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -52461892246715.82764070853532913 Inexact Rounded +comx3056 compare -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -1 +divx3056 divide -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -12.23457628210057733643575143694 Inexact Rounded +dvix3056 divideint -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -12 +mulx3056 multiply -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -266786248710342647746063322.0544 Inexact Rounded +powx3056 power -57131573677452.15449921725097290 5 -> -6.086686503752679375430019503679E+68 Inexact Rounded +remx3056 remainder -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -1095396508616.232197112663247672 +subx3056 subtract -57131573677452.15449921725097290 4669681430736.326858508715643769 -> -61801255108188.48135772596661667 Inexact Rounded +addx3057 add 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> 90794821.08377791746707352380646 Inexact Rounded +comx3057 compare 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> 1 +divx3057 divide 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> -16594131.20365054928428313232246 Inexact Rounded +dvix3057 divideint 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> -16594131 +mulx3057 multiply 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> -496784099.6333617958496589124964 Inexact Rounded +powx3057 power 90794826.55528018781830463383411 -5 -> 1.620669590532856523565742953997E-40 Inexact Rounded +remx3057 remainder 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> 1.114274442767230442307896655232 +subx3057 subtract 90794826.55528018781830463383411 -5.471502270351231110027647216128 -> 90794832.02678245816953574386176 Inexact Rounded +addx3058 add 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> 58461733862.10202881160156091690 Inexact Rounded +comx3058 compare 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> 1 +divx3058 divide 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> -1243.257894477021678809337875304 Inexact Rounded +dvix3058 divideint 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> -1243 +mulx3058 multiply 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> -2753474621708672573.249029643967 Inexact Rounded +powx3058 power 58508794729.35191160840980489138 -47060867 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3058 remainder 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> 12136737.74759517576254461832107 +subx3058 subtract 58508794729.35191160840980489138 -47060867.24988279680824397447551 -> 58555855596.60179440521804886586 Inexact Rounded +addx3059 add -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> 9.595418300613754556671852801667E+391 Inexact Rounded +comx3059 compare -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -1 +divx3059 divide -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -7.775628465932789700547872511745E-381 Inexact Rounded +dvix3059 divideint -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -0 +mulx3059 multiply -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -7.159180712764549711669939947084E+403 Inexact Rounded +powx3059 power -746104.0768078474426464219416332E+006 10 -> 5.345571346302582882805035996696E+118 Inexact Rounded +remx3059 remainder -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -746104076807.8474426464219416332 +subx3059 subtract -746104.0768078474426464219416332E+006 9595418.300613754556671852801667E+385 -> -9.595418300613754556671852801667E+391 Inexact Rounded +addx3060 add 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> 5.599427632688387400403789659459E+120 Inexact Rounded +comx3060 compare 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> 1 +divx3060 divide 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> -6.105892851759828176655685111491E+119 Inexact Rounded +dvix3060 divideint 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> NaN Division_impossible +mulx3060 multiply 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> -5.134972161307679939281170944556E+121 Inexact Rounded +powx3060 power 55.99427632688387400403789659459E+119 -9 -> 1.848022584764384077672041056396E-1087 Inexact Rounded +remx3060 remainder 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> NaN Division_impossible +subx3060 subtract 55.99427632688387400403789659459E+119 -9.170530450881612853998489340127 -> 5.599427632688387400403789659459E+120 Inexact Rounded +addx3061 add -41214265628.83801241467317270595 1015336323798389903361978271354 -> 1015336323798389903320764005725 Inexact Rounded +comx3061 compare -41214265628.83801241467317270595 1015336323798389903361978271354 -> -1 +divx3061 divide -41214265628.83801241467317270595 1015336323798389903361978271354 -> -4.059173759750342247620706384027E-20 Inexact Rounded +dvix3061 divideint -41214265628.83801241467317270595 1015336323798389903361978271354 -> -0 +mulx3061 multiply -41214265628.83801241467317270595 1015336323798389903361978271354 -> -4.184634095163472384028549378392E+40 Inexact Rounded +powx3061 power -41214265628.83801241467317270595 1 -> -41214265628.83801241467317270595 +remx3061 remainder -41214265628.83801241467317270595 1015336323798389903361978271354 -> -41214265628.83801241467317270595 +subx3061 subtract -41214265628.83801241467317270595 1015336323798389903361978271354 -> -1015336323798389903403192536983 Inexact Rounded +addx3062 add 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 82351554300031.00628677123370689 Inexact Rounded +comx3062 compare 89937.39749201095570357557430822 82351554210093.60879476027800331 -> -1 +divx3062 divide 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 1.092115362662913415592930982129E-9 Inexact Rounded +dvix3062 divideint 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 0 +mulx3062 multiply 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 7406484465078077191.920015793662 Inexact Rounded +powx3062 power 89937.39749201095570357557430822 8 -> 4.280776267723913043050100934291E+39 Inexact Rounded +remx3062 remainder 89937.39749201095570357557430822 82351554210093.60879476027800331 -> 89937.39749201095570357557430822 +subx3062 subtract 89937.39749201095570357557430822 82351554210093.60879476027800331 -> -82351554120156.21130274932229973 Inexact Rounded +addx3063 add 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 1.712661646770821562841254869430E+365 Inexact Rounded +comx3063 compare 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 1 +divx3063 divide 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 2.956290925475414185960999788848E+397 Inexact Rounded +dvix3063 divideint 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> NaN Division_impossible +mulx3063 multiply 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 9.921925785595813587655312307930E+332 Inexact Rounded +powx3063 power 01712661.64677082156284125486943E+359 6 -> 2.523651803323047711735501944959E+2191 Inexact Rounded +remx3063 remainder 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> NaN Division_impossible +subx3063 subtract 01712661.64677082156284125486943E+359 57932.78435529483241552042115837E-037 -> 1.712661646770821562841254869430E+365 Inexact Rounded +addx3064 add -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> -658179152015.9868345843925715053 Inexact Rounded +comx3064 compare -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 1 +divx3064 divide -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 0.004038849497560303158639192895544 Inexact Rounded +dvix3064 divideint -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 0 +mulx3064 multiply -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 1735580967057433153120.099643641 Inexact Rounded +powx3064 power -2647593306.528617691373470059213 -7 -> -1.096581914005902583413810201571E-66 Inexact Rounded +remx3064 remainder -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> -2647593306.528617691373470059213 +subx3064 subtract -2647593306.528617691373470059213 -655531558709.4582168930191014461 -> 652883965402.9295992016456313869 Inexact Rounded +addx3065 add 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> -7.145586619176091599264717047885E+788 Inexact Rounded +comx3065 compare 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> 1 +divx3065 divide 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> -4.064157144036712325084472022316E-1088 Inexact Rounded +dvix3065 divideint 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> -0 +mulx3065 multiply 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> -2.075134583305571527962710017262E+490 Inexact Rounded +powx3065 power 2904078690665765116603253099668E-329 -7 -> 5.740389208842895561250128407803E+2089 Inexact Rounded +remx3065 remainder 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> 2.904078690665765116603253099668E-299 +subx3065 subtract 2904078690665765116603253099668E-329 -71.45586619176091599264717047885E+787 -> 7.145586619176091599264717047885E+788 Inexact Rounded +addx3066 add 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> 22094338972.39109726522477999515 Inexact Rounded +comx3066 compare 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> 1 +divx3066 divide 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> -5.390880808019174194010224736965E+497 Inexact Rounded +dvix3066 divideint 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> NaN Division_impossible +mulx3066 multiply 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> -9.055288588476315822113975426730E-478 Inexact Rounded +powx3066 power 22094338972.39109726522477999515 -4 -> 4.196391022354122686725315209967E-42 Inexact Rounded +remx3066 remainder 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> NaN Division_impossible +subx3066 subtract 22094338972.39109726522477999515 -409846549371.3900805039668417203E-499 -> 22094338972.39109726522477999515 Inexact Rounded +addx3067 add -3374988581607586061255542201048 82293895124.90045271504836568681 -> -3374988581607586061173248305923 Inexact Rounded +comx3067 compare -3374988581607586061255542201048 82293895124.90045271504836568681 -> -1 +divx3067 divide -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797.81310977038 Inexact Rounded +dvix3067 divideint -3374988581607586061255542201048 82293895124.90045271504836568681 -> -41011408883796817797 +mulx3067 multiply -3374988581607586061255542201048 82293895124.90045271504836568681 -> -2.777409563825512202793336132310E+41 Inexact Rounded +powx3067 power -3374988581607586061255542201048 8 -> 1.683365657238878057620634207267E+244 Inexact Rounded +remx3067 remainder -3374988581607586061255542201048 82293895124.90045271504836568681 -> -66913970168.62046257175566384243 +subx3067 subtract -3374988581607586061255542201048 82293895124.90045271504836568681 -> -3374988581607586061337836096173 Inexact Rounded +addx3068 add -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> -84172558171932.94780431960508260 Inexact Rounded +comx3068 compare -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> -1 +divx3068 divide -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> 7467674426.467986736459678347587 Inexact Rounded +dvix3068 divideint -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> 7467674426 +mulx3068 multiply -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> 948758494638999235.1953022970755 Inexact Rounded +powx3068 power -84172558160661.35863831029352323 -11272 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3068 remainder -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> -5274.95422851496534479122656860 +subx3068 subtract -84172558160661.35863831029352323 -11271.58916600931155937291904890 -> -84172558149389.76947230098196386 Inexact Rounded +addx3069 add -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -7.004693232461490596396237508541E-555 Inexact Rounded +comx3069 compare -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -1 +divx3069 divide -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -2.082768876995463487926920072359E+362 Inexact Rounded +dvix3069 divideint -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> NaN Division_impossible +mulx3069 multiply -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -2.355793185832144388285949021738E-1471 Inexact Rounded +powx3069 power -70046932324614.90596396237508541E-568 3 -> -3.436903678302639677280508409829E-1663 Inexact Rounded +remx3069 remainder -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> NaN Division_impossible +subx3069 subtract -70046932324614.90596396237508541E-568 33.63163964004608865836577297698E-918 -> -7.004693232461490596396237508541E-555 Inexact Rounded +addx3070 add 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> 4125384407.053782660115680886000 Inexact Rounded +comx3070 compare 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> 1 +divx3070 divide 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> -1.053928941287132717250540955457E+649 Inexact Rounded +dvix3070 divideint 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> NaN Division_impossible +mulx3070 multiply 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> -1.614795442013190139080634449273E-630 Inexact Rounded +powx3070 power 0004125384407.053782660115680886 -4 -> 3.452568541597450106266555783362E-39 Inexact Rounded +remx3070 remainder 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> NaN Division_impossible +subx3070 subtract 0004125384407.053782660115680886 -391429084.5847321402514385603223E-648 -> 4125384407.053782660115680886000 Inexact Rounded +addx3071 add -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> 9.291391582947237200286427030028E+775 Inexact Rounded +comx3071 compare -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -1 +divx3071 divide -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -3.425012375468251447194400841658E-1209 Inexact Rounded +dvix3071 divideint -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -0 +mulx3071 multiply -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -2.956811729743937541973845029816E+343 Inexact Rounded +powx3071 power -31823131.15691583393820628480997E-440 9 -> -3.347234803487575870321338308655E-3893 Inexact Rounded +remx3071 remainder -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -3.182313115691583393820628480997E-433 +subx3071 subtract -31823131.15691583393820628480997E-440 92913.91582947237200286427030028E+771 -> -9.291391582947237200286427030028E+775 Inexact Rounded +addx3072 add 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 55573868488.43891477926020011694 Inexact Rounded +comx3072 compare 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 1 +divx3072 divide 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 92696782.14318796763098335498657 Inexact Rounded +dvix3072 divideint 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 92696782 +mulx3072 multiply 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 33317820972080.24347717542221477 Inexact Rounded +powx3072 power 55573867888.91575330563698128150 600 -> 8.363240671070136278221965616973E+6446 Inexact Rounded +remx3072 remainder 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 85.8445030391099686478265169012 +subx3072 subtract 55573867888.91575330563698128150 599.5231614736232188354393212234 -> 55573867289.39259183201376244606 Inexact Rounded +addx3073 add -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> 5.487207142687001607026665515349E-356 Inexact Rounded +comx3073 compare -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -1 +divx3073 divide -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -9.928051387110587327889009363069E-415 Inexact Rounded +dvix3073 divideint -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -0 +mulx3073 multiply -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -2.989280896644635352838087864373E-1125 Inexact Rounded +powx3073 power -5447727448431680878699555714796E-800 5 -> -4.798183553278543065204833300725E-3847 Inexact Rounded +remx3073 remainder -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -5.447727448431680878699555714796E-770 +subx3073 subtract -5447727448431680878699555714796E-800 5487207.142687001607026665515349E-362 -> -5.487207142687001607026665515349E-356 Inexact Rounded +addx3074 add 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 418359224750.4711631202083513795 Inexact Rounded +comx3074 compare 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 1 +divx3074 divide 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 42602.13713335803513874339309132 Inexact Rounded +dvix3074 divideint 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 42602 +mulx3074 multiply 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 4108155982352814348.343441299082 Inexact Rounded +powx3074 power 0418349404834.547110239542290134 9819916 -> Infinity Overflow Inexact Rounded +remx3074 remainder 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 1346638.04628810400110728063718 +subx3074 subtract 0418349404834.547110239542290134 09819915.92405288066606124554841 -> 418339584918.6230573588762288885 Inexact Rounded +addx3075 add -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> -7.983992600094836304387324162042E+420 Inexact Rounded +comx3075 compare -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 1 +divx3075 divide -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 3.281838669494274896180376328433E-416 Inexact Rounded +dvix3075 divideint -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 0 +mulx3075 multiply -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 2.091979765115329268275803385534E+426 Inexact Rounded +powx3075 power -262021.7565194737396448014286436 -8 -> 4.500918721033033032706782304195E-44 Inexact Rounded +remx3075 remainder -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> -262021.7565194737396448014286436 +subx3075 subtract -262021.7565194737396448014286436 -7983992600094836304387324162042E+390 -> 7.983992600094836304387324162042E+420 Inexact Rounded +addx3076 add 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> -3.386875233985057267609967806187E+831 Inexact Rounded +comx3076 compare 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> 1 +divx3076 divide 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> -1.437786964892976582009952172420E-1326 Inexact Rounded +dvix3076 divideint 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> -0 +mulx3076 multiply 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> -1.649274478764579569246425611629E+337 Inexact Rounded +powx3076 power 48696050631.42565380301204592392E-505 -3 -> 8.660017688773759463020340778853E+1482 Inexact Rounded +remx3076 remainder 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> 4.869605063142565380301204592392E-495 +subx3076 subtract 48696050631.42565380301204592392E-505 -33868752339.85057267609967806187E+821 -> 3.386875233985057267609967806187E+831 Inexact Rounded +addx3077 add 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> 95256207.85635086953625240702318 Inexact Rounded +comx3077 compare 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> 1 +divx3077 divide 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> -1567.937180706641856870286122623 Inexact Rounded +dvix3077 divideint 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> -1567 +mulx3077 multiply 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> -5794447919993.150493301061195714 Inexact Rounded +powx3077 power 95316999.19440144356471126680708 -60791 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3077 remainder 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> 56972.46915194096967798542896355 +subx3077 subtract 95316999.19440144356471126680708 -60791.33805057402845885978390435 -> 95377790.53245201759317012659098 Inexact Rounded +addx3078 add -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> 8032459.450998820205916538543258 Inexact Rounded +comx3078 compare -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -1 +divx3078 divide -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -6.631471131473117487839243582873E-113 Inexact Rounded +dvix3078 divideint -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -0 +mulx3078 multiply -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -4.278652020339705265013632757349E-99 Inexact Rounded +powx3078 power -5326702296402708234722215224979E-136 8032459 -> -0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3078 remainder -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -5.326702296402708234722215224979E-106 +subx3078 subtract -5326702296402708234722215224979E-136 8032459.450998820205916538543258 -> -8032459.450998820205916538543258 Inexact Rounded +addx3079 add 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 6.718750684079501575335482615780E-280 Inexact Rounded +comx3079 compare 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 1 +divx3079 divide 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 9.152153872187460598958616592442E+571 Inexact Rounded +dvix3079 divideint 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> NaN Division_impossible +mulx3079 multiply 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 4.932348317700372401849231767007E-1131 Inexact Rounded +powx3079 power 67.18750684079501575335482615780E-281 7 -> 6.180444071023111300817518409550E-1955 Inexact Rounded +remx3079 remainder 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> NaN Division_impossible +subx3079 subtract 67.18750684079501575335482615780E-281 734.1168841683438410314843011541E-854 -> 6.718750684079501575335482615780E-280 Inexact Rounded +addx3080 add -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -8738791762039.358125211204773930 Inexact Rounded +comx3080 compare -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -1 +divx3080 divide -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -17216.56012577673731612130068130 Inexact Rounded +dvix3080 divideint -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -17216 +mulx3080 multiply -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -4436156407404759833857.580707024 Inexact Rounded +powx3080 power -8739299372114.092482914139281669 507610075 -> -Infinity Overflow Inexact Rounded +remx3080 remainder -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -284325487.3902691936540542102992 +subx3080 subtract -8739299372114.092482914139281669 507610074.7343577029345077385838 -> -8739806982188.826840617073789408 Inexact Rounded +addx3081 add 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 2454.002078468928665008217727731 Inexact Rounded +comx3081 compare 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 1 +divx3081 divide 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 4.205327278123112611006652533618E+141 Inexact Rounded +dvix3081 divideint 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> NaN Division_impossible +mulx3081 multiply 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 1.432023194118096842806010293027E-135 Inexact Rounded +powx3081 power 2454.002078468928665008217727731 6 -> 218398452792293853786.9263054420 Inexact Rounded +remx3081 remainder 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> NaN Division_impossible +subx3081 subtract 2454.002078468928665008217727731 583546039.6233842869119950982009E-147 -> 2454.002078468928665008217727731 Inexact Rounded +addx3082 add 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 829181.6561975853393326976860680 Inexact Rounded +comx3082 compare 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 1 +divx3082 divide 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 11.83500633601553578851124281417 Inexact Rounded +dvix3082 divideint 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 11 +mulx3082 multiply 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 49394169921.82458094138096628957 Inexact Rounded +powx3082 power 764578.5204849936912066033177429 64603 -> Infinity Overflow Inexact Rounded +remx3082 remainder 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 53944.02764648556181956526616724 +subx3082 subtract 764578.5204849936912066033177429 64603.13571259164812609436832506 -> 699975.3847724020430805089494178 Inexact Rounded +addx3083 add 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 846389013551.3654139910676568223 Inexact Rounded +comx3083 compare 079203.7330103777716903518367560 846388934347.6324036132959664705 -> -1 +divx3083 divide 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 9.357841270860339858146471876044E-8 Inexact Rounded +dvix3083 divideint 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 0 +mulx3083 multiply 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 67037163179008037.19983564789203 Inexact Rounded +powx3083 power 079203.7330103777716903518367560 8 -> 1.548692549503356788115682996756E+39 Inexact Rounded +remx3083 remainder 079203.7330103777716903518367560 846388934347.6324036132959664705 -> 79203.7330103777716903518367560 +subx3083 subtract 079203.7330103777716903518367560 846388934347.6324036132959664705 -> -846388855143.8993932355242761187 Inexact Rounded +addx3084 add -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> 5.474973992953902631890208360829 Inexact Rounded +comx3084 compare -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -1 +divx3084 divide -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -7.814797878848469282033896969532E-327 Inexact Rounded +dvix3084 divideint -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -0 +mulx3084 multiply -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -2.342512251965378028433584538870E-325 Inexact Rounded +powx3084 power -4278.581514688669249247007127899E-329 5 -> -1.433834587801771244104676682986E-1627 Inexact Rounded +remx3084 remainder -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -4.278581514688669249247007127899E-326 +subx3084 subtract -4278.581514688669249247007127899E-329 5.474973992953902631890208360829 -> -5.474973992953902631890208360829 Inexact Rounded +addx3085 add 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 6.149612565404080501157093851895E+817 Inexact Rounded +comx3085 compare 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> -1 +divx3085 divide 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 9.897699923417617920996187420968E-160 Inexact Rounded +dvix3085 divideint 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 0 +mulx3085 multiply 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 3.743085898893072544197564013497E+1476 Inexact Rounded +powx3085 power 60867019.81764798845468445196869E+651 6 -> 5.085014897388871736767602086646E+3952 Inexact Rounded +remx3085 remainder 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> 6.086701981764798845468445196869E+658 +subx3085 subtract 60867019.81764798845468445196869E+651 6.149612565404080501157093851895E+817 -> -6.149612565404080501157093851895E+817 Inexact Rounded +addx3086 add 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> -8.945059095290523784746184357820E+538 Inexact Rounded +comx3086 compare 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> 1 +divx3086 divide 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> -2.074264411286709228674841672954E-908 Inexact Rounded +dvix3086 divideint 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> -0 +mulx3086 multiply 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> -1.659703631470633700884136887614E+170 Inexact Rounded +powx3086 power 18554417738217.62218590965803605E-382 -9 -> 3.836842998295531899082688721531E+3318 Inexact Rounded +remx3086 remainder 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> 1.855441773821762218590965803605E-369 +subx3086 subtract 18554417738217.62218590965803605E-382 -0894505909529.052378474618435782E+527 -> 8.945059095290523784746184357820E+538 Inexact Rounded +addx3087 add 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 9.977847825356104634823627327033E+127 Inexact Rounded +comx3087 compare 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> -1 +divx3087 divide 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 6.922670772910807388395384866884E-115 Inexact Rounded +dvix3087 divideint 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 0 +mulx3087 multiply 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 6.892034301367879802693422066425E+141 Inexact Rounded +powx3087 power 69073355517144.36356688642213839 10 -> 2.472324890841334302628435461516E+138 Inexact Rounded +remx3087 remainder 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> 69073355517144.36356688642213839 +subx3087 subtract 69073355517144.36356688642213839 997784782535.6104634823627327033E+116 -> -9.977847825356104634823627327033E+127 Inexact Rounded +addx3088 add 450282259072.8657099359104277477 -1791307965314309175477911369824 -> -1791307965314309175027629110751 Inexact Rounded +comx3088 compare 450282259072.8657099359104277477 -1791307965314309175477911369824 -> 1 +divx3088 divide 450282259072.8657099359104277477 -1791307965314309175477911369824 -> -2.513706564096350714213771006483E-19 Inexact Rounded +dvix3088 divideint 450282259072.8657099359104277477 -1791307965314309175477911369824 -> -0 +mulx3088 multiply 450282259072.8657099359104277477 -1791307965314309175477911369824 -> -8.065941973169457071650996861677E+41 Inexact Rounded +powx3088 power 450282259072.8657099359104277477 -2 -> 4.932082442194544671633570348838E-24 Inexact Rounded +remx3088 remainder 450282259072.8657099359104277477 -1791307965314309175477911369824 -> 450282259072.8657099359104277477 +subx3088 subtract 450282259072.8657099359104277477 -1791307965314309175477911369824 -> 1791307965314309175928193628897 Inexact Rounded +addx3089 add 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 954821400.4934353520984462184316 Inexact Rounded +comx3089 compare 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 1 +divx3089 divide 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 6676.599951968811589335427770046 Inexact Rounded +dvix3089 divideint 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 6676 +mulx3089 multiply 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 136508234203444.8694879431412375 Inexact Rounded +powx3089 power 954678411.7838149266455177850037 142989 -> Infinity Overflow Inexact Rounded +remx3089 remainder 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 85786.3578546028952962204808256 +subx3089 subtract 954678411.7838149266455177850037 142988.7096204254529284334278794 -> 954535423.0741945011925893515758 Inexact Rounded +addx3090 add -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -9.244530976220812127155852389807E+566 Inexact Rounded +comx3090 compare -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -1 +divx3090 divide -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -1.708503207395591002370649848757E+561 Inexact Rounded +dvix3090 divideint -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> NaN Division_impossible +mulx3090 multiply -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -5.002118380601798392363043558941E+572 Inexact Rounded +powx3090 power -9244530976.220812127155852389807E+557 541089 -> -Infinity Overflow Inexact Rounded +remx3090 remainder -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> NaN Division_impossible +subx3090 subtract -9244530976.220812127155852389807E+557 541089.4715446858896619078627941 -> -9.244530976220812127155852389807E+566 Inexact Rounded +addx3091 add -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> -14760496803372.56259241638975169 Inexact Rounded +comx3091 compare -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 1 +divx3091 divide -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 0.000005114489797920668836278344635108 Inexact Rounded +dvix3091 divideint -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 0 +mulx3091 multiply -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 1114294082984662825831.464787487 Inexact Rounded +powx3091 power -75492024.20990197005974241975449 -1 -> -1.324643246046162082348970735576E-8 Inexact Rounded +remx3091 remainder -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> -75492024.20990197005974241975449 +subx3091 subtract -75492024.20990197005974241975449 -14760421311348.35269044633000927 -> 14760345819324.14278847627026685 Inexact Rounded +addx3092 add 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 2.475976333144824613591228097330E+99 Inexact Rounded +comx3092 compare 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> -1 +divx3092 divide 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 1.283322837007852247594216151634E-546 Inexact Rounded +dvix3092 divideint 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 0 +mulx3092 multiply 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 7.867357782318786860404997647513E-348 Inexact Rounded +powx3092 power 317747.6972215715434186596178036E-452 2 -> 1.009635990896115043331231496209E-893 Inexact Rounded +remx3092 remainder 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> 3.177476972215715434186596178036E-447 +subx3092 subtract 317747.6972215715434186596178036E-452 24759763.33144824613591228097330E+092 -> -2.475976333144824613591228097330E+99 Inexact Rounded +addx3093 add -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> -17.87120645617324368279740020695 Inexact Rounded +comx3093 compare -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 1 +divx3093 divide -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 0.8390040956188859972044344532019 Inexact Rounded +dvix3093 divideint -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 0 +mulx3093 multiply -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 79.23306057789328578902960605222 Inexact Rounded +powx3093 power -8.153334430358647134334545353427 -10 -> 7.702778966876727056635952801162E-10 Inexact Rounded +remx3093 remainder -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> -8.153334430358647134334545353427 +subx3093 subtract -8.153334430358647134334545353427 -9.717872025814596548462854853522 -> 1.564537595455949414128309500095 +addx3094 add 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 5054015481833.263541189916208065 Inexact Rounded +comx3094 compare 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> -1 +divx3094 divide 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 1.437934890309606594895299558654E-490 Inexact Rounded +dvix3094 divideint 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 0 +mulx3094 multiply 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 3.672927513995607308048737751972E-465 Inexact Rounded +powx3094 power 7.267345197492967332320456062961E-478 5 -> 2.027117616846668568108096583897E-2386 Inexact Rounded +remx3094 remainder 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> 7.267345197492967332320456062961E-478 +subx3094 subtract 7.267345197492967332320456062961E-478 5054015481833.263541189916208065 -> -5054015481833.263541189916208065 Inexact Rounded +addx3095 add -1223354029.862567054230912271171 8135774223401322785475014855625 -> 8135774223401322785473791501595 Inexact Rounded +comx3095 compare -1223354029.862567054230912271171 8135774223401322785475014855625 -> -1 +divx3095 divide -1223354029.862567054230912271171 8135774223401322785475014855625 -> -1.503672540892020337688277553692E-22 Inexact Rounded +dvix3095 divideint -1223354029.862567054230912271171 8135774223401322785475014855625 -> -0 +mulx3095 multiply -1223354029.862567054230912271171 8135774223401322785475014855625 -> -9.952932182250005119307429060894E+39 Inexact Rounded +powx3095 power -1223354029.862567054230912271171 8 -> 5.016689887192830666848068841227E+72 Inexact Rounded +remx3095 remainder -1223354029.862567054230912271171 8135774223401322785475014855625 -> -1223354029.862567054230912271171 +subx3095 subtract -1223354029.862567054230912271171 8135774223401322785475014855625 -> -8135774223401322785476238209655 Inexact Rounded +addx3096 add 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> 2.853976441115655679961211349982E+656 Inexact Rounded +comx3096 compare 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> 1 +divx3096 divide 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> -1.151029280076495626421134733122E+626 Inexact Rounded +dvix3096 divideint 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> NaN Division_impossible +mulx3096 multiply 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> -7.076432952167704614138411740001E+686 Inexact Rounded +powx3096 power 285397644111.5655679961211349982E+645 -2 -> 1.227719722087860401233030479451E-1313 Inexact Rounded +remx3096 remainder 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> NaN Division_impossible +subx3096 subtract 285397644111.5655679961211349982E+645 -2479499427613157519359627280704 -> 2.853976441115655679961211349982E+656 Inexact Rounded +addx3097 add -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> -4676542.661845508839813784891890 Inexact Rounded +comx3097 compare -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> -1 +divx3097 divide -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> 1362.424151323477505064686589716 Inexact Rounded +dvix3097 divideint -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> 1362 +mulx3097 multiply -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> 16028768973.31252639476148371361 Inexact Rounded +powx3097 power -4673112.663442366293812346653429 -3430 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3097 remainder -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> -1454.838362218639853465869604204 +subx3097 subtract -4673112.663442366293812346653429 -3429.998403142546001438238460958 -> -4669682.665039223747810908414968 Inexact Rounded +addx3098 add 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 3.869394621006514751889096510923E+144 Inexact Rounded +comx3098 compare 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> -1 +divx3098 divide 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 2.299194926095985647821385937618E-143 Inexact Rounded +dvix3098 divideint 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 0 +mulx3098 multiply 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 3.442404014670364763780946297856E+146 Inexact Rounded +powx3098 power 88.96492479681278079861456051103 4 -> 62643391.73078290226474758858970 Inexact Rounded +remx3098 remainder 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> 88.96492479681278079861456051103 +subx3098 subtract 88.96492479681278079861456051103 386939.4621006514751889096510923E+139 -> -3.869394621006514751889096510923E+144 Inexact Rounded +addx3099 add 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 92.23649942010862087149015091350 Inexact Rounded +comx3099 compare 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> -1 +divx3099 divide 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 6.974120530708230229344349531719E-937 Inexact Rounded +dvix3099 divideint 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 0 +mulx3099 multiply 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 5.933283133313013755814405436342E-933 Inexact Rounded +powx3099 power 064326846.4286437304788069444326E-942 92 -> 0E-10029 Underflow Subnormal Inexact Rounded Clamped +remx3099 remainder 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> 6.43268464286437304788069444326E-935 +subx3099 subtract 064326846.4286437304788069444326E-942 92.23649942010862087149015091350 -> -92.23649942010862087149015091350 Inexact Rounded +addx3100 add 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 1109894.721947227977782971677146 Inexact Rounded +comx3100 compare 504507.0043949324433170405699360 605387.7175522955344659311072099 -> -1 +divx3100 divide 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 0.8333618105678718895216067463832 Inexact Rounded +dvix3100 divideint 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 0 +mulx3100 multiply 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 305422343879.7940838630401656585 Inexact Rounded +powx3100 power 504507.0043949324433170405699360 605388 -> Infinity Overflow Inexact Rounded +remx3100 remainder 504507.0043949324433170405699360 605387.7175522955344659311072099 -> 504507.0043949324433170405699360 +subx3100 subtract 504507.0043949324433170405699360 605387.7175522955344659311072099 -> -100880.7131573630911488905372739 + +-- randomly generated testcases [26 Sep 2001] +precision: 32 +rounding: half_up +maxExponent: 9999 + +addx3201 add 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> -0.1294608320983180201262861125848 +comx3201 compare 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> 1 +divx3201 divide 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> -0.92190879812324313630282980110280 Inexact Rounded +dvix3201 divideint 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> -0 +mulx3201 multiply 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> -2.5337311682687808926633910761614 Inexact Rounded +powx3201 power 1.5283550163839789319142430253644 -2 -> 0.42810618916584924451466691603128 Inexact Rounded +remx3201 remainder 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> 1.5283550163839789319142430253644 +subx3201 subtract 1.5283550163839789319142430253644 -1.6578158484822969520405291379492 -> 3.1861708648662758839547721633136 +addx3202 add -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -616383641998.15356482333651785302 Inexact Rounded +comx3202 compare -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -1 +divx3202 divide -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -95.546234185785110491676894153510 Inexact Rounded +dvix3202 divideint -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -95 +mulx3202 multiply -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -4060946921076840449949.6988828486 Inexact Rounded +powx3202 power -622903030605.2867503937836507326 7 -> -3.6386736597702404352813308064300E+82 Inexact Rounded +remx3202 remainder -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -3561112927.6341212013060271723005 +subx3202 subtract -622903030605.2867503937836507326 6519388607.1331855704471328795821 -> -629422419212.41993596423078361218 Inexact Rounded +addx3203 add -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> 73908233965.134822146441861002895 Inexact Rounded +comx3203 compare -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -1 +divx3203 divide -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -0.000076790894376056827552388054657082 Inexact Rounded +dvix3203 divideint -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -0 +mulx3203 multiply -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -419529088021865067.23307352973589 Inexact Rounded +powx3203 power -5675915.2465457487632250245209054 7 -> -1.8978038060207777231389234721908E+47 Inexact Rounded +remx3203 remainder -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -5675915.2465457487632250245209054 +subx3203 subtract -5675915.2465457487632250245209054 73913909880.381367895205086027416 -> -73919585795.627913643968311051937 Inexact Rounded +addx3204 add 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 102.50941233130989977580658947572 Inexact Rounded +comx3204 compare 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 1 +divx3204 divide 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 20.083399916665466374741708949621 Inexact Rounded +dvix3204 divideint 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 20 +mulx3204 multiply 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 474.77017694916635398652276042175 Inexact Rounded +powx3204 power 97.647321172555144900685605318635 5 -> 8877724578.7935312939231828719842 Inexact Rounded +remx3204 remainder 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 0.4054979974600473982659221768650 +subx3204 subtract 97.647321172555144900685605318635 4.8620911587547548751209841570885 -> 92.785230013800390025564621161547 Inexact Rounded +addx3205 add -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> -2.6692539695193820424002013488480E+366 Inexact Rounded +comx3205 compare -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 1 +divx3205 divide -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 3.6404378818903462695633337631098E-354 Inexact Rounded +dvix3205 divideint -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 0 +mulx3205 multiply -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 2.5937816855830431899123217912144E+379 Inexact Rounded +powx3205 power -9717253267024.5380651435435603552 -3 -> -1.0898567880085337780041328661330E-39 Inexact Rounded +remx3205 remainder -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> -9717253267024.5380651435435603552 +subx3205 subtract -9717253267024.5380651435435603552 -2669.2539695193820424002013488480E+363 -> 2.6692539695193820424002013488480E+366 Inexact Rounded +addx3206 add -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> 12772.807105920712660991033689206 Inexact Rounded +comx3206 compare -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -1 +divx3206 divide -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -3.1956477052150593175206769891434E-771 Inexact Rounded +dvix3206 divideint -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -0 +mulx3206 multiply -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -5.2135267097047531336100750110314E-763 Inexact Rounded +powx3206 power -4.0817391717190128506083001702335E-767 12773 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3206 remainder -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -4.0817391717190128506083001702335E-767 +subx3206 subtract -4.0817391717190128506083001702335E-767 12772.807105920712660991033689206 -> -12772.807105920712660991033689206 Inexact Rounded +addx3207 add 68625322655934146845003028928647 -59.634169944840280159782488098700 -> 68625322655934146845003028928587 Inexact Rounded +comx3207 compare 68625322655934146845003028928647 -59.634169944840280159782488098700 -> 1 +divx3207 divide 68625322655934146845003028928647 -59.634169944840280159782488098700 -> -1150771826276954946844322988192.5 Inexact Rounded +dvix3207 divideint 68625322655934146845003028928647 -59.634169944840280159782488098700 -> -1150771826276954946844322988192 +mulx3207 multiply 68625322655934146845003028928647 -59.634169944840280159782488098700 -> -4.0924141537834748501140151997778E+33 Inexact Rounded +powx3207 power 68625322655934146845003028928647 -60 -> 6.4704731111943370171711131942603E-1911 Inexact Rounded +remx3207 remainder 68625322655934146845003028928647 -59.634169944840280159782488098700 -> 28.201254004897257552939369449600 +subx3207 subtract 68625322655934146845003028928647 -59.634169944840280159782488098700 -> 68625322655934146845003028928707 Inexact Rounded +addx3208 add 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> -92134479103305.554299334115573170 Inexact Rounded +comx3208 compare 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> 1 +divx3208 divide 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> -7.9505063318943846655593887991914E-9 Inexact Rounded +dvix3208 divideint 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> -0 +mulx3208 multiply 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> -67489959009342175728.710494356322 Inexact Rounded +powx3208 power 732515.76532049290815665856727641 -9 -> 1.6468241050443471359358016585877E-53 Inexact Rounded +remx3208 remainder 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> 732515.76532049290815665856727641 +subx3208 subtract 732515.76532049290815665856727641 -92134479835821.319619827023729829 -> 92134480568337.084940319931886488 Inexact Rounded +addx3209 add -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> -5.0233720245976651023364304104030E+861 Inexact Rounded +comx3209 compare -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 1 +divx3209 divide -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 6.0632602550311410821483001305010E-861 Inexact Rounded +dvix3209 divideint -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 0 +mulx3209 multiply -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 1.5300192511921895929031818638961E+863 Inexact Rounded +powx3209 power -30.458011942978338421676454778733 -5 -> -3.8149797481405136042487643253109E-8 Inexact Rounded +remx3209 remainder -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> -30.458011942978338421676454778733 +subx3209 subtract -30.458011942978338421676454778733 -5023372024597665102336430410403E+831 -> 5.0233720245976651023364304104030E+861 Inexact Rounded +addx3210 add -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> -58703509398.895039317872169695760 Inexact Rounded +comx3210 compare -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 1 +divx3210 divide -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 0.0000015269995260536025237167199970238 Inexact Rounded +dvix3210 divideint -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 0 +mulx3210 multiply -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 5262180074071519.7018252171579753 Inexact Rounded +powx3210 power -89640.094149414644660480286430462 -6 -> 1.9274635591165405888724595165741E-30 Inexact Rounded +remx3210 remainder -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> -89640.094149414644660480286430462 +subx3210 subtract -89640.094149414644660480286430462 -58703419758.800889903227509215474 -> 58703330118.706740488582848735188 Inexact Rounded +addx3211 add 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 458653.15678700818100529177142590 Inexact Rounded +comx3211 compare 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 1 +divx3211 divide 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 2.4990492117594160215641311760498E+33 Inexact Rounded +dvix3211 divideint 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> NaN Division_impossible +mulx3211 multiply 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 8.4177101131428047497998594379593E-23 Inexact Rounded +powx3211 power 458653.1567870081810052917714259 2 -> 210362718230.68790865117452429990 Inexact Rounded +remx3211 remainder 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> NaN Division_impossible +subx3211 subtract 458653.1567870081810052917714259 18353106238.516235116080449814053E-038 -> 458653.15678700818100529177142590 Inexact Rounded +addx3212 add 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> -2.1051638816432817393202262710630E+439 Inexact Rounded +comx3212 compare 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> 1 +divx3212 divide 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> -4.3388138824102151127273259092613E-434 Inexact Rounded +dvix3212 divideint 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> -0 +mulx3212 multiply 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> -1.9228386428540135340600836707270E+445 Inexact Rounded +powx3212 power 913391.42744224458216174967853722 -2 -> 1.1986327439971532470297300128074E-12 Inexact Rounded +remx3212 remainder 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> 913391.42744224458216174967853722 +subx3212 subtract 913391.42744224458216174967853722 -21051638.816432817393202262710630E+432 -> 2.1051638816432817393202262710630E+439 Inexact Rounded +addx3213 add -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> -2.8892177726858026955513438843371E+739 Inexact Rounded +comx3213 compare -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 1 +divx3213 divide -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 3.1759165595057674196644927106447E-728 Inexact Rounded +dvix3213 divideint -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 0 +mulx3213 multiply -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 2.6511215451353541156703914721725E+751 Inexact Rounded +powx3213 power -917591456829.12109027484399536567 -3 -> -1.2943505591853739240003453341911E-36 Inexact Rounded +remx3213 remainder -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> -917591456829.12109027484399536567 +subx3213 subtract -917591456829.12109027484399536567 -28892177726858026955513438843371E+708 -> 2.8892177726858026955513438843371E+739 Inexact Rounded +addx3214 add 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 34938410840676.731620092461631064 Inexact Rounded +comx3214 compare 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 1 +divx3214 divide 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 1133693327999.7879503260098666966 Inexact Rounded +dvix3214 divideint 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 1133693327999 +mulx3214 multiply 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 1076739645476675.3318519289128961 Inexact Rounded +powx3214 power 34938410840645.913399699219228218 31 -> 6.9566085958798732786509909683267E+419 Inexact Rounded +remx3214 remainder 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 24.283226805899273551376371736548 +subx3214 subtract 34938410840645.913399699219228218 30.818220393242402846077755480548 -> 34938410840615.095179305976825372 Inexact Rounded +addx3215 add 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 29771833428054709077850588904653 Inexact Rounded +comx3215 compare 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> -1 +divx3215 divide 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 2.0269955680376683526099444523691E-545 Inexact Rounded +dvix3215 divideint 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 0 +mulx3215 multiply 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 1.7966519787854159464382359411642E-482 Inexact Rounded +powx3215 power 6034.7374411022598081745006769023E-517 3 -> 2.1977340597301840681528507640032E-1540 Inexact Rounded +remx3215 remainder 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> 6.0347374411022598081745006769023E-514 +subx3215 subtract 6034.7374411022598081745006769023E-517 29771833428054709077850588904653 -> -29771833428054709077850588904653 Inexact Rounded +addx3216 add -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> -5565747672224.4775959193681631431 Inexact Rounded +comx3216 compare -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> -1 +divx3216 divide -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> 11351510433.365074871574519756245 Inexact Rounded +dvix3216 divideint -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> 11351510433 +mulx3216 multiply -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> 2728936147066663.4580064428639745 Inexact Rounded +powx3216 power -5565747671734.1686009705574503152 -490 -> 4.9371745297619526113991728953197E-6246 Inexact Rounded +remx3216 remainder -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> -178.99949336276892685183308348801 +subx3216 subtract -5565747671734.1686009705574503152 -490.30899494881071282787487030303 -> -5565747671243.8596060217467374873 Inexact Rounded +addx3217 add 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> 3.1954551189203199952335879232538E+44 Inexact Rounded +comx3217 compare 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> 1 +divx3217 divide 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> -108102711781422.68663084859902931 Inexact Rounded +dvix3217 divideint 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> -108102711781422 +mulx3217 multiply 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> -9.4455848967786959996525702197139E+74 Inexact Rounded +powx3217 power 319545511.89203495546689273564728E+036 -3 -> 3.0647978448946294457985223953472E-134 Inexact Rounded +remx3217 remainder 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> 2029642017122316721531728309258 +subx3217 subtract 319545511.89203495546689273564728E+036 -2955943533943321899150310192061 -> 3.1954551189203791141042667896918E+44 Inexact Rounded +addx3218 add -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> -42682764.676651465089307430325104 Rounded +comx3218 compare -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> -1 +divx3218 divide -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> 6.3204380807318655475459047410160 Inexact Rounded +dvix3218 divideint -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> 6 +mulx3218 multiply -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> 214871156882133.34437417534873098 Inexact Rounded +powx3218 power -36852134.84194296250843579428931 -5830630 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3218 remainder -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> -1868355.8336919470232059780745460 +subx3218 subtract -36852134.84194296250843579428931 -5830629.8347085025808716360357940 -> -31021505.007234459927564158253516 Rounded +addx3219 add 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> -39505285344943.729681835377530908 Inexact Rounded +comx3219 compare 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> 1 +divx3219 divide 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> -2.1774783867700502002511486885272E-387 Inexact Rounded +dvix3219 divideint 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> -0 +mulx3219 multiply 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> -3.3983199030116951081865430362053E-360 Inexact Rounded +powx3219 power 8.6021905001798578659275880018221E-374 -4 -> 1.8262649155820433126240754123257E+1492 Inexact Rounded +remx3219 remainder 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> 8.6021905001798578659275880018221E-374 +subx3219 subtract 8.6021905001798578659275880018221E-374 -39505285344943.729681835377530908 -> 39505285344943.729681835377530908 Inexact Rounded +addx3220 add -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -54862429.012326453703398777272191 Inexact Rounded +comx3220 compare -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -1 +divx3220 divide -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -74528.182826764384088602813142847 Inexact Rounded +dvix3220 divideint -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -74528 +mulx3220 multiply -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -40386962037.048345148338122539405 Inexact Rounded +powx3220 power -54863165.152174109720312887805017 736 -> 1.2903643981679111625370174573639E+5696 Inexact Rounded +remx3220 remainder -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -134.5860664811454830973740198416 +subx3220 subtract -54863165.152174109720312887805017 736.1398476560169141105328256628 -> -54863901.292021765737226998337843 Inexact Rounded +addx3221 add -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -3263743464517851012531706353100.8 Inexact Rounded +comx3221 compare -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -1 +divx3221 divide -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -1328233422952076975055082.5768082 Inexact Rounded +dvix3221 divideint -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -1328233422952076975055082 +mulx3221 multiply -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -8.0196908300261262548565838031943E+36 Inexact Rounded +powx3221 power -3263743464517851012531708810307 2457206 -> Infinity Overflow Inexact Rounded +remx3221 remainder -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -1417336.7573398366062994535940062 +subx3221 subtract -3263743464517851012531708810307 2457206.2471248382136273643208109 -> -3263743464517851012531711267513.2 Inexact Rounded +addx3222 add 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 9.5354563764657694835860339582821E+91 Inexact Rounded +comx3222 compare 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> -1 +divx3222 divide 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 2.9957525170007980008712828968300E-978 Inexact Rounded +dvix3222 divideint 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 0 +mulx3222 multiply 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 2.7238858283525541854826594343954E-794 Inexact Rounded +powx3222 power 2856586744.0548637797291151154902E-895 10 -> 3.6180466753307072256807593988336E-8856 Inexact Rounded +remx3222 remainder 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> 2.8565867440548637797291151154902E-886 +subx3222 subtract 2856586744.0548637797291151154902E-895 953545637646.57694835860339582821E+080 -> -9.5354563764657694835860339582821E+91 Inexact Rounded +addx3223 add 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 631722566499.28075196842125460014 Inexact Rounded +comx3223 compare 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> -1 +divx3223 divide 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 0.0089828645946207580492752544218316 Inexact Rounded +dvix3223 divideint 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 0 +mulx3223 multiply 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 3521275897257796938833.8975037909 Inexact Rounded +powx3223 power 5624157233.3433661009203529937625 6 -> 3.1647887196303262540158328459030E+58 Inexact Rounded +remx3223 remainder 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> 5624157233.3433661009203529937625 +subx3223 subtract 5624157233.3433661009203529937625 626098409265.93738586750090160638 -> -620474252032.59401976658054861262 Inexact Rounded +addx3224 add -213499362.91476998701834067092611 419272438.02555757699863022643444 -> 205773075.11078758998028955550833 +comx3224 compare -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -1 +divx3224 divide -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -0.50921392286166855779828061147786 Inexact Rounded +dvix3224 divideint -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -0 +mulx3224 multiply -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -89514398406178925.073260776410672 Inexact Rounded +powx3224 power -213499362.91476998701834067092611 419272438 -> Infinity Overflow Inexact Rounded +remx3224 remainder -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -213499362.91476998701834067092611 +subx3224 subtract -213499362.91476998701834067092611 419272438.02555757699863022643444 -> -632771800.94032756401697089736055 +addx3225 add 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 30274.392356614101238316845401518 Inexact Rounded +comx3225 compare 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 1 +divx3225 divide 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 6300.1252178837655359831527173832 Inexact Rounded +dvix3225 divideint 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 6300 +mulx3225 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.29080119336967191651199283 Inexact Rounded +powx3225 power 30269.587755640502150977251770554 5 -> 25411630481547464128383.220368208 Inexact Rounded +remx3225 remainder 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 0.6016219662519115373766970119100 +subx3225 subtract 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 30264.783154666903063637658139590 Inexact Rounded +addx3226 add 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> 4.7525676459351505682005359699680E+705 Inexact Rounded +comx3226 compare 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> 1 +divx3226 divide 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> -8.1057651538555854520994438038537E+673 Inexact Rounded +dvix3226 divideint 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> NaN Division_impossible +mulx3226 multiply 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> -2.7865227773649353769876975366506E+737 Inexact Rounded +powx3226 power 47.525676459351505682005359699680E+704 -6 -> 8.6782100393941226535150385475464E-4235 Inexact Rounded +remx3226 remainder 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> NaN Division_impossible +subx3226 subtract 47.525676459351505682005359699680E+704 -58631943508436657383369760970210 -> 4.7525676459351505682005359699680E+705 Inexact Rounded +addx3227 add -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> -74396977890406.153948943614775470 Inexact Rounded +comx3227 compare -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> -1 +divx3227 divide -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> 643479.03948459716424778005613112 Inexact Rounded +dvix3227 divideint -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> 643479 +mulx3227 multiply -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> 8601512678051025297297.7169654467 Inexact Rounded +powx3227 power -74396862273800.625679130772935550 -115616606 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3227 remainder -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> -4565075.09478147646296920746797 +subx3227 subtract -74396862273800.625679130772935550 -115616605.52826981284183992013157 -> -74396746657195.097409317931095630 Inexact Rounded +addx3228 add 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 67586387.525464115583388327481014 Inexact Rounded +comx3228 compare 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 1 +divx3228 divide 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 81727.439437354248789852715586510 Inexact Rounded +dvix3228 divideint 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 81727 +mulx3228 multiply 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 55890751355.998983433895910295596 Inexact Rounded +powx3228 power 67585560.562561229497720955705979 827 -> 1.9462204583352191108781197788255E+6475 Inexact Rounded +remx3228 remainder 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 363.39839010616042789746007924349 +subx3228 subtract 67585560.562561229497720955705979 826.96290288608566737177503451613 -> 67584733.599658343412053583930944 Inexact Rounded +addx3229 add 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 390.31542898606435093937697545510 Inexact Rounded +comx3229 compare 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> -1 +divx3229 divide 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 1.7620074325054038174571564409871E-225 Inexact Rounded +dvix3229 divideint 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 0 +mulx3229 multiply 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 2.6843502060572691408091663822732E-220 Inexact Rounded +powx3229 power 6877386868.9498051860742298735156E-232 390 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3229 remainder 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> 6.8773868689498051860742298735156E-223 +subx3229 subtract 6877386868.9498051860742298735156E-232 390.3154289860643509393769754551 -> -390.31542898606435093937697545510 Inexact Rounded +addx3230 add -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> -186656471117.70574263160637723440 Inexact Rounded +comx3230 compare -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 1 +divx3230 divide -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 0.0000088255699357876233458660331146583 Inexact Rounded +dvix3230 divideint -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 0 +mulx3230 multiply -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 307483061680363807.48775619333285 Inexact Rounded +powx3230 power -1647335.201144609256134925838937 -2 -> 3.6849876990439502152784389237891E-13 Inexact Rounded +remx3230 remainder -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> -1647335.201144609256134925838937 +subx3230 subtract -1647335.201144609256134925838937 -186654823782.50459802235024230856 -> 186653176447.30345341309410738272 Inexact Rounded +addx3231 add 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> 41407818140948.866630923934138155 Inexact Rounded +comx3231 compare 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> 1 +divx3231 divide 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> -8.0298091128179204076796507697517E+972 Inexact Rounded +dvix3231 divideint 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> NaN Division_impossible +mulx3231 multiply 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> -2.1353028186646179369220834691156E-946 Inexact Rounded +powx3231 power 41407818140948.866630923934138155 -5 -> 8.2146348556648547525693528004081E-69 Inexact Rounded +remx3231 remainder 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> NaN Division_impossible +subx3231 subtract 41407818140948.866630923934138155 -5156.7624534000311342310106671627E-963 -> 41407818140948.866630923934138155 Inexact Rounded +addx3232 add -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> -574454585586.71690214265053093061 Inexact Rounded +comx3232 compare -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 1 +divx3232 divide -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 1.1584453442097568745411568037078E-11 Inexact Rounded +dvix3232 divideint -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 0 +mulx3232 multiply -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 3822847288253.1035559206691532826 Inexact Rounded +powx3232 power -6.6547424012516834662011706165297 -6 -> 0.000011513636283388791488128239232906 Inexact Rounded +remx3232 remainder -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> -6.6547424012516834662011706165297 +subx3232 subtract -6.6547424012516834662011706165297 -574454585580.06215974139884746441 -> 574454585573.40741734014716399821 Inexact Rounded +addx3233 add -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> -23385972217069.468331815025891947 Inexact Rounded +comx3233 compare -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 1 +divx3233 divide -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 1.1813816642548920194709898111624E-9 Inexact Rounded +dvix3233 divideint -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 0 +mulx3233 multiply -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 646101997676091306.41485393678655 Inexact Rounded +powx3233 power -27627.758745381267780885067447671 -2 -> 1.3101128009560812529198521922269E-9 Inexact Rounded +remx3233 remainder -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> -27627.758745381267780885067447671 +subx3233 subtract -27627.758745381267780885067447671 -23385972189441.709586433758111062 -> 23385972161813.950841052490330177 Inexact Rounded +addx3234 add 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> 2.0981974379099914752963711944307E-223 Inexact Rounded +comx3234 compare 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> 1 +divx3234 divide 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> -4.7661318949867060595545765053187E+731 Inexact Rounded +dvix3234 divideint 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> NaN Division_impossible +mulx3234 multiply 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> -9.2369086409102239573726316593648E-1178 Inexact Rounded +powx3234 power 209819.74379099914752963711944307E-228 -4 -> 5.1595828494111690910650919776705E+890 Inexact Rounded +remx3234 remainder 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> NaN Division_impossible +subx3234 subtract 209819.74379099914752963711944307E-228 -440230.6700989532467831370320266E-960 -> 2.0981974379099914752963711944307E-223 Inexact Rounded +addx3235 add 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 2.3488457600415474270259330865184 Inexact Rounded +comx3235 compare 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 1 +divx3235 divide 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 2.5579771002708402753412266574941E+605 Inexact Rounded +dvix3235 divideint 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> NaN Division_impossible +mulx3235 multiply 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 2.1568122732142531556215204459407E-605 Inexact Rounded +powx3235 power 2.3488457600415474270259330865184 9 -> 2176.1583446147511579113022622255 Inexact Rounded +remx3235 remainder 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> NaN Division_impossible +subx3235 subtract 2.3488457600415474270259330865184 9182434.6660212482500376220508605E-612 -> 2.3488457600415474270259330865184 Inexact Rounded +addx3236 add -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -5107586300197.9703941034404557409 Inexact Rounded +comx3236 compare -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -1 +divx3236 divide -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -9.0225606358909877855326357402242E+775 Inexact Rounded +dvix3236 divideint -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> NaN Division_impossible +mulx3236 multiply -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -2.8913563307290346152596212593532E-751 Inexact Rounded +powx3236 power -5107586300197.9703941034404557409 6 -> 1.7753920894188022125919559565029E+76 Inexact Rounded +remx3236 remainder -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> NaN Division_impossible +subx3236 subtract -5107586300197.9703941034404557409 56609.05486055057838678039496686E-768 -> -5107586300197.9703941034404557409 Inexact Rounded +addx3237 add -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> -70454076296048.077427972135182788 Inexact Rounded +comx3237 compare -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> -1 +divx3237 divide -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> 11363232.779549422490548997517194 Inexact Rounded +dvix3237 divideint -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> 11363232 +mulx3237 multiply -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> 436827801504436566945.76663687924 Inexact Rounded +powx3237 power -70454070095869.70717871212601390 -6200178 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3237 remainder -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> -4833345.467866203920028883583808 +subx3237 subtract -70454070095869.70717871212601390 -6200178.370249260009168888392406 -> -70454063895691.336929452116845012 Inexact Rounded +addx3238 add 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 29119.220621511046558757900645228 Inexact Rounded +comx3238 compare 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 1 +divx3238 divide 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 8.2781197380089684063239752337467E+219 Inexact Rounded +dvix3238 divideint 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> NaN Division_impossible +mulx3238 multiply 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 1.0243014554512542440592768088600E-211 Inexact Rounded +powx3238 power 29119.220621511046558757900645228 4 -> 718983605328417461.32835984217255 Inexact Rounded +remx3238 remainder 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> NaN Division_impossible +subx3238 subtract 29119.220621511046558757900645228 3517612.8810761470018676311863010E-222 -> 29119.220621511046558757900645228 Inexact Rounded +addx3239 add -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> -5695442.3185284567660037344669935 Inexact Rounded +comx3239 compare -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 1 +divx3239 divide -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 0.00090825526554639915580539316714451 Inexact Rounded +dvix3239 divideint -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 0 +mulx3239 multiply -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 29408596423.801454053855793898323 Inexact Rounded +powx3239 power -5168.2214111091132913776042214525 -5690274 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3239 remainder -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> -5168.2214111091132913776042214525 +subx3239 subtract -5168.2214111091132913776042214525 -5690274.0971173476527123568627720 -> 5685105.8757062385394209792585505 Inexact Rounded +addx3240 add 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> 31712.980161250558571611312236423 Inexact Rounded +comx3240 compare 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> 1 +divx3240 divide 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> -16.319683055519892881394358449220 Inexact Rounded +dvix3240 divideint 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> -16 +mulx3240 multiply 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> -69933662.130469766080574235843448 Inexact Rounded +powx3240 power 33783.060857197067391462144517964 -2070 -> 3.9181336001803008597293818984406E-9375 Inexact Rounded +remx3240 remainder 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> 661.7697220529262738488280133144 +subx3240 subtract 33783.060857197067391462144517964 -2070.0806959465088198508322815406 -> 35853.141553143576211312976799505 Inexact Rounded +addx3241 add 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 7.3330633078828216018536326743325E+986 Inexact Rounded +comx3241 compare 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> -1 +divx3241 divide 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 5.7557712676064206636178247554056E-1879 Inexact Rounded +dvix3241 divideint 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 0 +mulx3241 multiply 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 3.0950979358603075650592433398939E+95 Inexact Rounded +powx3241 power 42207435091050.840296353874733169E-905 7 -> 2.3862872940615283599573082966642E-6240 Inexact Rounded +remx3241 remainder 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> 4.2207435091050840296353874733169E-892 +subx3241 subtract 42207435091050.840296353874733169E-905 73330633078.828216018536326743325E+976 -> -7.3330633078828216018536326743325E+986 Inexact Rounded +addx3242 add -71800.806700868784841045406679641 -39617456964250697902519150526701 -> -39617456964250697902519150598502 Inexact Rounded +comx3242 compare -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 1 +divx3242 divide -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 1.8123527405017220178579049964126E-27 Inexact Rounded +dvix3242 divideint -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 0 +mulx3242 multiply -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 2.8445653694701522164901827524538E+36 Inexact Rounded +powx3242 power -71800.806700868784841045406679641 -4 -> 3.7625536850895480882178599428774E-20 Inexact Rounded +remx3242 remainder -71800.806700868784841045406679641 -39617456964250697902519150526701 -> -71800.806700868784841045406679641 +subx3242 subtract -71800.806700868784841045406679641 -39617456964250697902519150526701 -> 39617456964250697902519150454900 Inexact Rounded +addx3243 add 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 53627809061.200981502803149181991 Inexact Rounded +comx3243 compare 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 1 +divx3243 divide 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 163369.13159039717901500465109839 Inexact Rounded +dvix3243 divideint 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 163369 +mulx3243 multiply 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 17603733760058752.363123585224369 Inexact Rounded +powx3243 power 53627480801.631504892310016062160 328260 -> Infinity Overflow Inexact Rounded +remx3243 remainder 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 43195.80712523964536237599604393 +subx3243 subtract 53627480801.631504892310016062160 328259.56947661049313311983109503 -> 53627152542.062028281816882942329 Inexact Rounded +addx3244 add -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> -5150456970.7802587986281516264289 Inexact Rounded +comx3244 compare -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> -1 +divx3244 divide -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> 51.633359351732432283879274192947 Inexact Rounded +dvix3244 divideint -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> 51 +mulx3244 multiply -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> 494424210127893893.12581512954787 Inexact Rounded +powx3244 power -5052601598.5559371338428368438728 -97855372 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3244 remainder -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> -61977615.115532229791782933513536 +subx3244 subtract -5052601598.5559371338428368438728 -97855372.224321664785314782556064 -> -4954746226.3316154690575220613167 Inexact Rounded +addx3245 add 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 4.2708691760149477598920960628392E+477 Inexact Rounded +comx3245 compare 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> -1 +divx3245 divide 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 9.8531098643021951048744078027283E-320 Inexact Rounded +dvix3245 divideint 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 0 +mulx3245 multiply 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 1.7972391158952189002169082753183E+636 Inexact Rounded +powx3245 power 4208134320733.7069742988228068191E+146 4 -> 3.1358723439830872127129821963857E+634 Inexact Rounded +remx3245 remainder 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> 4.2081343207337069742988228068191E+158 +subx3245 subtract 4208134320733.7069742988228068191E+146 4270869.1760149477598920960628392E+471 -> -4.2708691760149477598920960628392E+477 Inexact Rounded +addx3246 add -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -8.5077009657942581515590471189084E+308 Inexact Rounded +comx3246 compare -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -1 +divx3246 divide -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -8.8143110457236089978070419047970E+548 Inexact Rounded +dvix3246 divideint -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> NaN Division_impossible +mulx3246 multiply -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -8.2117564660363596283732942091852E+68 Inexact Rounded +powx3246 power -8.5077009657942581515590471189084E+308 10 -> 1.9866536812573207868350640760678E+3089 Inexact Rounded +remx3246 remainder -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> NaN Division_impossible +subx3246 subtract -8.5077009657942581515590471189084E+308 9652145155.374217047842114042376E-250 -> -8.5077009657942581515590471189084E+308 Inexact Rounded +addx3247 add -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> -9.5049703032286960790904181078063E+622 Inexact Rounded +comx3247 compare -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> -1 +divx3247 divide -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> 1.1020772033225707125391212519421E+621 Inexact Rounded +dvix3247 divideint -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> NaN Division_impossible +mulx3247 multiply -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> 8.1976525957425311427858087117655E+624 Inexact Rounded +powx3247 power -9504.9703032286960790904181078063E+619 -86 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3247 remainder -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> NaN Division_impossible +subx3247 subtract -9504.9703032286960790904181078063E+619 -86.245956949049186533469206485003 -> -9.5049703032286960790904181078063E+622 Inexact Rounded +addx3248 add -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> -440323641.68311120898457496019108 Inexact Rounded +comx3248 compare -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> -1 +divx3248 divide -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> 4285.4305022264473269770246126234 Inexact Rounded +dvix3248 divideint -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> 4285 +mulx3248 multiply -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> 45221700683419.655596771711603505 Inexact Rounded +powx3248 power -440220916.66716743026896931194749 -102725 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3248 remainder -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> -44223.34807563389876658817398125 +subx3248 subtract -440220916.66716743026896931194749 -102725.01594377871560564824358775 -> -440118191.65122365155336366370390 Inexact Rounded +addx3249 add -46.250735086006350517943464758019 14656357555174.263295266074908024 -> 14656357555128.012560180068557506 Inexact Rounded +comx3249 compare -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -1 +divx3249 divide -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -3.1556773169523313932207725522866E-12 Inexact Rounded +dvix3249 divideint -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -0 +mulx3249 multiply -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -677867310610152.55569620459788530 Inexact Rounded +powx3249 power -46.250735086006350517943464758019 1 -> -46.250735086006350517943464758019 +remx3249 remainder -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -46.250735086006350517943464758019 +subx3249 subtract -46.250735086006350517943464758019 14656357555174.263295266074908024 -> -14656357555220.514030352081258542 Inexact Rounded +addx3250 add -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> -6.1641121299391316420647102699627E+776 Inexact Rounded +comx3250 compare -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> -1 +divx3250 divide -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> 6.7076702065897819604716946852581E+291 Inexact Rounded +dvix3250 divideint -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> NaN Division_impossible +mulx3250 multiply -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> 5.6646014458394584921579417504939E+1261 Inexact Rounded +powx3250 power -61641121299391.316420647102699627E+763 -9 -> -7.7833261179975532508748150708605E-6992 Inexact Rounded +remx3250 remainder -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> NaN Division_impossible +subx3250 subtract -61641121299391.316420647102699627E+763 -91896469863.461006903590004188187E+474 -> -6.1641121299391316420647102699627E+776 Inexact Rounded +addx3251 add 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> -1.9498732131365824921639467044927E-511 Inexact Rounded +comx3251 compare 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> 1 +divx3251 divide 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> -4.9576772044192514715453215933704E-314 Inexact Rounded +dvix3251 divideint 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> -0 +mulx3251 multiply 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> -1.8849116232962331617140676274611E-1335 Inexact Rounded +powx3251 power 96668419802749.555738010239087449E-838 -2 -> 1.0701157625268896323611633350003E+1648 Inexact Rounded +remx3251 remainder 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> 9.6668419802749555738010239087449E-825 +subx3251 subtract 96668419802749.555738010239087449E-838 -19498732131365824921639467044927E-542 -> 1.9498732131365824921639467044927E-511 Inexact Rounded +addx3252 add -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -8.5345439111979959060312457195190E+154 Inexact Rounded +comx3252 compare -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -1 +divx3252 divide -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -5.1764925822381062287959523371316E+141 Inexact Rounded +dvix3252 divideint -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> NaN Division_impossible +mulx3252 multiply -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -1.4071002443255581217471698731240E+168 Inexact Rounded +powx3252 power -8534543911197995906031245719519E+124 2 -> 7.2838439772166785429482995041337E+309 Inexact Rounded +remx3252 remainder -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> NaN Division_impossible +subx3252 subtract -8534543911197995906031245719519E+124 16487117050031.594886541650897974 -> -8.5345439111979959060312457195190E+154 Inexact Rounded +addx3253 add -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> 9.2570938837239134052589184917186E+916 Inexact Rounded +comx3253 compare -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -1 +divx3253 divide -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -6.7692307720384142592597124956951E-907 Inexact Rounded +dvix3253 divideint -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -0 +mulx3253 multiply -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -5.8008102109774576654709018012876E+927 Inexact Rounded +powx3253 power -62663404777.352508979582846931050 9 -> -1.4897928814133059615670462753825E+97 Inexact Rounded +remx3253 remainder -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -62663404777.352508979582846931050 +subx3253 subtract -62663404777.352508979582846931050 9.2570938837239134052589184917186E+916 -> -9.2570938837239134052589184917186E+916 Inexact Rounded +addx3254 add 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> -1.7353669504253419489494030651507E-630 Inexact Rounded +comx3254 compare 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> 1 +divx3254 divide 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> -1.0053212169604565230497117966004E-197 Inexact Rounded +dvix3254 divideint 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> -0 +mulx3254 multiply 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> -3.0275232892710668432895049546233E-1457 Inexact Rounded +powx3254 power 1.744601214474560992754529320172E-827 -2 -> 3.2855468099615282394992542515980E+1653 Inexact Rounded +remx3254 remainder 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> 1.744601214474560992754529320172E-827 +subx3254 subtract 1.744601214474560992754529320172E-827 -17.353669504253419489494030651507E-631 -> 1.7353669504253419489494030651507E-630 Inexact Rounded +addx3255 add 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 4.4103206624152665337631438377420E+751 Inexact Rounded +comx3255 compare 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> -1 +divx3255 divide 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 8.3257335949720619093963917942525E-723 Inexact Rounded +dvix3255 divideint 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 0 +mulx3255 multiply 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 1.6194324757808363802947192054966E+781 Inexact Rounded +powx3255 power 0367191549036702224827734853471 4 -> 1.8179030119354318182493703269258E+118 Inexact Rounded +remx3255 remainder 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> 367191549036702224827734853471 +subx3255 subtract 0367191549036702224827734853471 4410320662415266533763143837742E+721 -> -4.4103206624152665337631438377420E+751 Inexact Rounded +addx3256 add 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> 97607380.048316862763014969003011 Inexact Rounded +comx3256 compare 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> 1 +divx3256 divide 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> -1010.0036335861757252324592571874 Inexact Rounded +dvix3256 divideint 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> -1010 +mulx3256 multiply 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> -9451544582305.1234805483449772252 Inexact Rounded +powx3256 power 097704116.4492566721965710365073 -96736 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3256 remainder 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> 351.500049144304942857175263550 +subx3256 subtract 097704116.4492566721965710365073 -96736.400939809433556067504289145 -> 97800852.850196481630127104011589 Inexact Rounded +addx3257 add 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 19533298.147150158931958733807878 Inexact Rounded +comx3257 compare 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 1 +divx3257 divide 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 2.4373460837728485395672882395171E+646 Inexact Rounded +dvix3257 divideint 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> NaN Division_impossible +mulx3257 multiply 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 1.5654311016630284502459158971272E-632 Inexact Rounded +powx3257 power 19533298.147150158931958733807878 8 -> 2.1193595047638230427530063654613E+58 Inexact Rounded +remx3257 remainder 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> NaN Division_impossible +subx3257 subtract 19533298.147150158931958733807878 80.141668338350708476637377647025E-641 -> 19533298.147150158931958733807878 Inexact Rounded +addx3258 add -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> -23765003221220177430797028997378 Inexact Rounded +comx3258 compare -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> -1 +divx3258 divide -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> 1.5631405336020930064824135669541E+966 Inexact Rounded +dvix3258 divideint -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> NaN Division_impossible +mulx3258 multiply -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> 3.6130812678955994625210007005216E-904 Inexact Rounded +powx3258 power -23765003221220177430797028997378 -2 -> 1.7706154318483481190364979209436E-63 Inexact Rounded +remx3258 remainder -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> NaN Division_impossible +subx3258 subtract -23765003221220177430797028997378 -15203369569.373411506379096871224E-945 -> -23765003221220177430797028997378 Inexact Rounded +addx3259 add 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> 1.2925541937932433359193338910552E+937 Inexact Rounded +comx3259 compare 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> 1 +divx3259 divide 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> -4.5956836453828213050223260551064E+928 Inexact Rounded +dvix3259 divideint 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> NaN Division_impossible +mulx3259 multiply 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> -3.6353597697504958096931088780367E+945 Inexact Rounded +powx3259 power 129255.41937932433359193338910552E+932 -281253953 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3259 remainder 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> NaN Division_impossible +subx3259 subtract 129255.41937932433359193338910552E+932 -281253953.38990382799508873560320 -> 1.2925541937932433359193338910552E+937 Inexact Rounded +addx3260 add -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -86331.770222938687407130786425993 Inexact Rounded +comx3260 compare -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -1 +divx3260 divide -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -163.42858201815891408475902229649 Inexact Rounded +dvix3260 divideint -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -163 +mulx3260 multiply -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -46168354.810498682140456143534524 Inexact Rounded +powx3260 power -86863.276249466008289214762980838 532 -> 2.8897579184173839519859710217510E+2627 Inexact Rounded +remx3260 remainder -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -227.79392551270450952658454114212 +subx3260 subtract -86863.276249466008289214762980838 531.50602652732088208397655484476 -> -87394.782275993329171298739535683 Inexact Rounded +addx3261 add -40707.169006771111855573524157083 -68795521421321853333274411827749 -> -68795521421321853333274411868456 Inexact Rounded +comx3261 compare -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 1 +divx3261 divide -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 5.9171248601300236694386185513139E-28 Inexact Rounded +dvix3261 divideint -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 0 +mulx3261 multiply -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 2.8004709174066910577370895499575E+36 Inexact Rounded +powx3261 power -40707.169006771111855573524157083 -7 -> -5.3988802915897595722440392884051E-33 Inexact Rounded +remx3261 remainder -40707.169006771111855573524157083 -68795521421321853333274411827749 -> -40707.169006771111855573524157083 +subx3261 subtract -40707.169006771111855573524157083 -68795521421321853333274411827749 -> 68795521421321853333274411787042 Inexact Rounded +addx3262 add -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> -9.0838752568673728630494658778003E+108 Inexact Rounded +comx3262 compare -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> -1 +divx3262 divide -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> 1.2308545518588430875268553851424E+106 Inexact Rounded +dvix3262 divideint -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> NaN Division_impossible +mulx3262 multiply -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> 6.7040244160213718891633678248127E+111 Inexact Rounded +powx3262 power -90838752568673.728630494658778003E+095 -738 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3262 remainder -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> NaN Division_impossible +subx3262 subtract -90838752568673.728630494658778003E+095 -738.01370301217606577533107981431 -> -9.0838752568673728630494658778003E+108 Inexact Rounded +addx3263 add -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> -3.1196062390425302071032035080570 Inexact Rounded +comx3263 compare -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 1 +divx3263 divide -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 1.3608643662980066356437236081969E-670 Inexact Rounded +dvix3263 divideint -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 0 +mulx3263 multiply -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 1.3243854561493627844105290415330E-669 Inexact Rounded +powx3263 power -4245360967593.9206771555839718158E-682 -3 -> -1.3069414504933253288042820429894E+2008 Inexact Rounded +remx3263 remainder -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> -4.2453609675939206771555839718158E-670 +subx3263 subtract -4245360967593.9206771555839718158E-682 -3.119606239042530207103203508057 -> 3.1196062390425302071032035080570 Inexact Rounded +addx3264 add -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> -60810.964656409685060465379447110 Inexact Rounded +comx3264 compare -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 1 +divx3264 divide -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 5.6275137635287882875914124742650E-16 Inexact Rounded +dvix3264 divideint -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 0 +mulx3264 multiply -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 0.0000020810396331962224323288744910607 Inexact Rounded +powx3264 power -3422145405774.0800213000547612240E-023 -60811 -> -Infinity Overflow Inexact Rounded +remx3264 remainder -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> -3.4221454057740800213000547612240E-11 +subx3264 subtract -3422145405774.0800213000547612240E-023 -60810.964656409650839011321706310 -> 60810.964656409616617557263965510 Inexact Rounded +addx3265 add -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> -94860846133404815410816234000694 Inexact Rounded +comx3265 compare -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 1 +divx3265 divide -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 2.5850297647576657819483988845904E-686 Inexact Rounded +dvix3265 divideint -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 0 +mulx3265 multiply -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 2.3261597474398006215017751785104E-622 Inexact Rounded +powx3265 power -24521811.07649485796598387627478E-661 -9 -> -3.1190843559949184618590264246586E+5882 Inexact Rounded +remx3265 remainder -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> -2.452181107649485796598387627478E-654 +subx3265 subtract -24521811.07649485796598387627478E-661 -94860846133404815410816234000694 -> 94860846133404815410816234000694 Inexact Rounded +addx3266 add -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -5038638032824.4395321279731805825 Inexact Rounded +comx3266 compare -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -1 +divx3266 divide -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -1295.6457979549894351378127413283 Inexact Rounded +dvix3266 divideint -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -1295 +mulx3266 multiply -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -19625045834830808256871.952659048 Inexact Rounded +powx3266 power -5042529937498.8944492248538951438 4 -> 6.4653782991800009492580180960839E+50 Inexact Rounded +remx3266 remainder -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -2513384079.7768087643285383187045 +subx3266 subtract -5042529937498.8944492248538951438 3891904674.4549170968807145612549 -> -5046421842173.3493663217346097051 Inexact Rounded +addx3267 add -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> 2732988.5891363639325008206099712 Inexact Rounded +comx3267 compare -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -1 +divx3267 divide -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -1.9605795855687791246611683328346E-663 Inexact Rounded +dvix3267 divideint -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -0 +mulx3267 multiply -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -1.4644013247528895376254850705597E-650 Inexact Rounded +powx3267 power -535824163.54531747646293693868651E-665 2732989 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3267 remainder -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -5.3582416354531747646293693868651E-657 +subx3267 subtract -535824163.54531747646293693868651E-665 2732988.5891363639325008206099712 -> -2732988.5891363639325008206099712 Inexact Rounded +addx3268 add 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 52864854.899420632375589206704068 Inexact Rounded +comx3268 compare 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> -1 +divx3268 divide 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 4.5460641203455697917573431961511E-513 Inexact Rounded +dvix3268 divideint 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 0 +mulx3268 multiply 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 1.2704853045231735885074945710576E-497 Inexact Rounded +powx3268 power 24032.702008553084252925140858134E-509 52864855 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3268 remainder 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> 2.4032702008553084252925140858134E-505 +subx3268 subtract 24032.702008553084252925140858134E-509 52864854.899420632375589206704068 -> -52864854.899420632375589206704068 Inexact Rounded +addx3269 add 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 754.44220417415325444943566016062 Inexact Rounded +comx3269 compare 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> -1 +divx3269 divide 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 9.4842547068617879794218050008353E-489 Inexact Rounded +dvix3269 divideint 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 0 +mulx3269 multiply 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 5.3982769208667021044675146787248E-483 Inexact Rounded +powx3269 power 71553220259.938950698030519906727E-496 754 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3269 remainder 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> 7.1553220259938950698030519906727E-486 +subx3269 subtract 71553220259.938950698030519906727E-496 754.44220417415325444943566016062 -> -754.44220417415325444943566016062 Inexact Rounded +addx3270 add 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 35572.960284795962697740953932508 Inexact Rounded +comx3270 compare 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 1 +divx3270 divide 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 6.8357605153869556504869061469852E+732 Inexact Rounded +dvix3270 divideint 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> NaN Division_impossible +mulx3270 multiply 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 1.8511992931514185102474609686066E-724 Inexact Rounded +powx3270 power 35572.960284795962697740953932508 5 -> 56963942247985404337401.149353169 Inexact Rounded +remx3270 remainder 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> NaN Division_impossible +subx3270 subtract 35572.960284795962697740953932508 520.39506364687594082725754878910E-731 -> 35572.960284795962697740953932508 Inexact Rounded +addx3271 add 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> 5.3035405018123760598334895413057E+849 Inexact Rounded +comx3271 compare 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> 1 +divx3271 divide 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> -5.5485278436266802470202487233285E+836 Inexact Rounded +dvix3271 divideint 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> NaN Division_impossible +mulx3271 multiply 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> -5.0693702270365259274203181894613E+862 Inexact Rounded +powx3271 power 53035405018123760598334895413057E+818 -10 -> 5.6799053935427267944455848135618E-8498 Inexact Rounded +remx3271 remainder 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> NaN Division_impossible +subx3271 subtract 53035405018123760598334895413057E+818 -9558464247240.4476790042911379151 -> 5.3035405018123760598334895413057E+849 Inexact Rounded +addx3272 add 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 9.8701498316307365714167410690192E+135 Inexact Rounded +comx3272 compare 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> -1 +divx3272 divide 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 9.6747012716293341927566515915016E-135 Inexact Rounded +dvix3272 divideint 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 0 +mulx3272 multiply 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 9.4250802116091862185764800227004E+137 Inexact Rounded +powx3272 power 95.490751127249945886828257312118 10 -> 63039548646186864162.847491534337 Inexact Rounded +remx3272 remainder 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> 95.490751127249945886828257312118 +subx3272 subtract 95.490751127249945886828257312118 987.01498316307365714167410690192E+133 -> -9.8701498316307365714167410690192E+135 Inexact Rounded +addx3273 add 69434850287.460788550936730296153 -35119136549015044241569827542264 -> -35119136549015044241500392691977 Inexact Rounded +comx3273 compare 69434850287.460788550936730296153 -35119136549015044241569827542264 -> 1 +divx3273 divide 69434850287.460788550936730296153 -35119136549015044241569827542264 -> -1.9771229338327273644129394734299E-21 Inexact Rounded +dvix3273 divideint 69434850287.460788550936730296153 -35119136549015044241569827542264 -> -0 +mulx3273 multiply 69434850287.460788550936730296153 -35119136549015044241569827542264 -> -2.4384919885057519302646522425980E+42 Inexact Rounded +powx3273 power 69434850287.460788550936730296153 -4 -> 4.3021939605842038995370443743844E-44 Inexact Rounded +remx3273 remainder 69434850287.460788550936730296153 -35119136549015044241569827542264 -> 69434850287.460788550936730296153 +subx3273 subtract 69434850287.460788550936730296153 -35119136549015044241569827542264 -> 35119136549015044241639262392551 Inexact Rounded +addx3274 add -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> -65551667.214560244414938327003123 Inexact Rounded +comx3274 compare -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 1 +divx3274 divide -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 0.0000059835205237890809449684317245033 Inexact Rounded +dvix3274 divideint -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 0 +mulx3274 multiply -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 25711006105.487929108329637701882 Inexact Rounded +powx3274 power -392.22739924621965621739098725407 -65551275 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3274 remainder -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> -392.22739924621965621739098725407 +subx3274 subtract -392.22739924621965621739098725407 -65551274.987160998195282109612136 -> 65550882.759761751975625892221149 Inexact Rounded +addx3275 add 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 6437779.6650608333186472347196668 Inexact Rounded +comx3275 compare 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 1 +divx3275 divide 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 261.61406460270241498757868681883 Inexact Rounded +dvix3275 divideint 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 261 +mulx3275 multiply 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 157216217318.36494525300694583138 Inexact Rounded +powx3275 power 6413265.4423561191792972085539457 24514 -> Infinity Overflow Inexact Rounded +remx3275 remainder 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 15053.316425728808940379300726594 +subx3275 subtract 6413265.4423561191792972085539457 24514.222704714139350026165721146 -> 6388751.2196514050399471823882246 Inexact Rounded +addx3276 add -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -6.9667706389122107760046184064057E+487 Inexact Rounded +comx3276 compare -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -1 +divx3276 divide -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -2.1498522911689997341347293419761E+486 Inexact Rounded +dvix3276 divideint -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> NaN Division_impossible +mulx3276 multiply -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -2.2576385054257595259511556258470E+489 Inexact Rounded +powx3276 power -6.9667706389122107760046184064057E+487 32 -> Infinity Overflow Inexact Rounded +remx3276 remainder -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> NaN Division_impossible +subx3276 subtract -6.9667706389122107760046184064057E+487 32.405810703971538278419625527234 -> -6.9667706389122107760046184064057E+487 Inexact Rounded +addx3277 add 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> 77986002255.07800973642274406015 +comx3277 compare 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> 1 +divx3277 divide 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> -1.2597639604731753284599748820876 Inexact Rounded +dvix3277 divideint 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> -1 +mulx3277 multiply 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> -113544133799497082075557.21180430 Inexact Rounded +powx3277 power 378204716633.40024100602896057615 -3 -> 1.8484988212401886887562779996737E-35 Inexact Rounded +remx3277 remainder 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> 77986002255.07800973642274406015 +subx3277 subtract 378204716633.40024100602896057615 -0300218714378.322231269606216516 -> 678423431011.72247227563517709215 +addx3278 add -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -4.4234512012457148027685282969235E+505 Inexact Rounded +comx3278 compare -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -1 +divx3278 divide -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -2.0742325477916347193181603963257E+499 Inexact Rounded +dvix3278 divideint -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> NaN Division_impossible +mulx3278 multiply -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -9.4333301975395170465982968019915E+511 Inexact Rounded +powx3278 power -44234.512012457148027685282969235E+501 2132572 -> Infinity Overflow Inexact Rounded +remx3278 remainder -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> NaN Division_impossible +subx3278 subtract -44234.512012457148027685282969235E+501 2132572.4571987908375002100894927 -> -4.4234512012457148027685282969235E+505 Inexact Rounded +addx3279 add -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> 9.7520428746722497621936998533848E+519 Inexact Rounded +comx3279 compare -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -1 +divx3279 divide -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -3.6449692061227100572768330912162E-590 Inexact Rounded +dvix3279 divideint -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -0 +mulx3279 multiply -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -3.4664510156653491769901435777060E+450 Inexact Rounded +powx3279 power -3554.5895974968741465654022772100E-073 10 -> 3.2202875716019266933215387456197E-695 Inexact Rounded +remx3279 remainder -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -3.5545895974968741465654022772100E-70 +subx3279 subtract -3554.5895974968741465654022772100E-073 9752.0428746722497621936998533848E+516 -> -9.7520428746722497621936998533848E+519 Inexact Rounded +addx3280 add 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 4633944440549.3093886865008969464 Inexact Rounded +comx3280 compare 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> -1 +divx3280 divide 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 0.00016191587157664541463871807382759 Inexact Rounded +dvix3280 divideint 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 0 +mulx3280 multiply 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 3475765273659325895012.7612107556 Inexact Rounded +powx3280 power 750187685.63632608923397234391668 5 -> 2.3760176068829529745152188798557E+44 Inexact Rounded +remx3280 remainder 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> 750187685.63632608923397234391668 +subx3280 subtract 750187685.63632608923397234391668 4633194252863.6730625972669246025 -> -4632444065178.0367365080329522586 Inexact Rounded +addx3281 add 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 8038885676320423832297608779.9751 Inexact Rounded +comx3281 compare 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> -1 +divx3281 divide 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 3.7554998862319807295903348960280E-43 Inexact Rounded +dvix3281 divideint 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 0 +mulx3281 multiply 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 24269423384249.611263728854793731 Inexact Rounded +powx3281 power 30190034242853.251165951457589386E-028 8 -> 6.9009494305612589578332690692113E-117 Inexact Rounded +remx3281 remainder 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> 3.0190034242853251165951457589386E-15 +subx3281 subtract 30190034242853.251165951457589386E-028 8038885676.3204238322976087799751E+018 -> -8038885676320423832297608779.9751 Inexact Rounded +addx3282 add 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 125946917326.41330773874663377538 Inexact Rounded +comx3282 compare 65.537942676774715953400768803539 125946917260.87536506197191782198 -> -1 +divx3282 divide 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 5.2036162616846894920389414735878E-10 Inexact Rounded +dvix3282 divideint 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 0 +mulx3282 multiply 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 8254301843759.7376990957355411370 Inexact Rounded +powx3282 power 65.537942676774715953400768803539 1 -> 65.537942676774715953400768803539 +remx3282 remainder 65.537942676774715953400768803539 125946917260.87536506197191782198 -> 65.537942676774715953400768803539 +subx3282 subtract 65.537942676774715953400768803539 125946917260.87536506197191782198 -> -125946917195.33742238519720186858 Inexact Rounded +addx3283 add 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 8015272349626.7792105333859739528 Inexact Rounded +comx3283 compare 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 1 +divx3283 divide 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 8443970438.5560107978790084430110 Inexact Rounded +dvix3283 divideint 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 8443970438 +mulx3283 multiply 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 7608339144595734.8984281431471741 Inexact Rounded +powx3283 power 8015272348677.5489394183881813700 949 -> Infinity Overflow Inexact Rounded +remx3283 remainder 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 527.78228041355742397895303690364 +subx3283 subtract 8015272348677.5489394183881813700 949.23027111499779258284877920022 -> 8015272347728.3186683033903887872 Inexact Rounded +addx3284 add -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -32595333982.670686221204518042250 Inexact Rounded +comx3284 compare -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -1 +divx3284 divide -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -4.7150744038935574574681609457727E+867 Inexact Rounded +dvix3284 divideint -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> NaN Division_impossible +mulx3284 multiply -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -2.2533171407952851885446213697715E-847 Inexact Rounded +powx3284 power -32595333982.67068622120451804225 7 -> -3.9092014148031739666525606093306E+73 Inexact Rounded +remx3284 remainder -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> NaN Division_impossible +subx3284 subtract -32595333982.67068622120451804225 69130.052233649808750113141502465E-862 -> -32595333982.670686221204518042250 Inexact Rounded +addx3285 add -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> 292178000.06450804618299520094843 Inexact Rounded +comx3285 compare -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -1 +divx3285 divide -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -6.0046235559392715334668277026896E-533 Inexact Rounded +dvix3285 divideint -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -0 +mulx3285 multiply -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -5.1260260597833406461110136952456E-516 Inexact Rounded +powx3285 power -17544189017145.710117633021800426E-537 292178000 -> 0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3285 remainder -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -1.7544189017145710117633021800426E-524 +subx3285 subtract -17544189017145.710117633021800426E-537 292178000.06450804618299520094843 -> -292178000.06450804618299520094843 Inexact Rounded +addx3286 add -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -506639.97552899703974189156234893 Inexact Rounded +comx3286 compare -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -1 +divx3286 divide -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -45982.150707356329027698717189104 Inexact Rounded +dvix3286 divideint -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -45982 +mulx3286 multiply -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -5582497.2457419607392940234271222 Inexact Rounded +powx3286 power -506650.99395649907139204052441630 11 -> -5.6467412678809885333313818078829E+62 Inexact Rounded +remx3286 remainder -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -1.660558079734242466742739640844 +subx3286 subtract -506650.99395649907139204052441630 11.018427502031650148962067367158 -> -506662.01238400110304218948648367 Inexact Rounded +addx3287 add 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> -84.001893040865864590122330800768 Inexact Rounded +comx3287 compare 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> 1 +divx3287 divide 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> -5.7699118247660357814641813260524E-234 Inexact Rounded +dvix3287 divideint 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> -0 +mulx3287 multiply 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> -4.0714332866277514481192856925775E-230 Inexact Rounded +powx3287 power 4846835159.5922372307656000769395E-241 -84 -> Infinity Overflow Inexact Rounded +remx3287 remainder 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> 4.8468351595922372307656000769395E-232 +subx3287 subtract 4846835159.5922372307656000769395E-241 -84.001893040865864590122330800768 -> 84.001893040865864590122330800768 Inexact Rounded +addx3288 add -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> -3994308913.2287755451637127790293 Inexact Rounded +comx3288 compare -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 1 +divx3288 divide -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 8.7698052609323004543538163061774E-9 Inexact Rounded +dvix3288 divideint -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 0 +mulx3288 multiply -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 139917887979.72053637272961120639 Inexact Rounded +powx3288 power -35.029311013822259358116556164908 -4 -> 6.6416138040522124693495178218096E-7 Inexact Rounded +remx3288 remainder -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> -35.029311013822259358116556164908 +subx3288 subtract -35.029311013822259358116556164908 -3994308878.1994645313414534209127 -> 3994308843.1701535175191940627961 Inexact Rounded +addx3289 add 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> -5.4918146394484565418284686127552E+374 Inexact Rounded +comx3289 compare 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> 1 +divx3289 divide 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> -1.3850911310869487895947733090204E-199 Inexact Rounded +dvix3289 divideint 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> -0 +mulx3289 multiply 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> -4.1774387343310777190917128006589E+550 Inexact Rounded +powx3289 power 7606663750.6735265233044420887018E+166 -5 -> 3.9267106978887346373957314818178E-880 Inexact Rounded +remx3289 remainder 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> 7.6066637506735265233044420887018E+175 +subx3289 subtract 7606663750.6735265233044420887018E+166 -5491814639.4484565418284686127552E+365 -> 5.4918146394484565418284686127552E+374 Inexact Rounded +addx3290 add -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> -2.5677829660831741274207326697052E-159 Inexact Rounded +comx3290 compare -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> -1 +divx3290 divide -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> 2.7277550199853009708493167299838E+671 Inexact Rounded +dvix3290 divideint -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> NaN Division_impossible +mulx3290 multiply -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> 2.4171926410541199393728294762559E-989 Inexact Rounded +powx3290 power -25677.829660831741274207326697052E-163 -9 -> -2.0605121420682764897867221992174E+1427 Inexact Rounded +remx3290 remainder -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> NaN Division_impossible +subx3290 subtract -25677.829660831741274207326697052E-163 -94135395124193048560172705082029E-862 -> -2.5677829660831741274207326697052E-159 Inexact Rounded +addx3291 add 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> -1.5412563837540810793697955063295E+554 Inexact Rounded +comx3291 compare 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> 1 +divx3291 divide 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> -6.3111872313890646144473652645030E-544 Inexact Rounded +dvix3291 divideint 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> -0 +mulx3291 multiply 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> -1.4992043761340180288065959300090E+565 Inexact Rounded +powx3291 power 97271576094.456406729671729224827 -2 -> 1.0568858765852073181352309401343E-22 Inexact Rounded +remx3291 remainder 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> 97271576094.456406729671729224827 +subx3291 subtract 97271576094.456406729671729224827 -1.5412563837540810793697955063295E+554 -> 1.5412563837540810793697955063295E+554 Inexact Rounded +addx3292 add 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> 41139789894.401826915757391777544 Inexact Rounded +comx3292 compare 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> 1 +divx3292 divide 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> -2196474369511625389289506461551.0 Inexact Rounded +dvix3292 divideint 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> -2196474369511625389289506461551 +mulx3292 multiply 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> -7.7054498611419776714291080928601E-10 Inexact Rounded +powx3292 power 41139789894.401826915757391777563 -2 -> 5.9084812442741091550891451069919E-22 Inexact Rounded +remx3292 remainder 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> 6.98141022640544018935102953527E-22 +subx3292 subtract 41139789894.401826915757391777563 -1.8729920305671057957156159690823E-020 -> 41139789894.401826915757391777582 Inexact Rounded +addx3293 add -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> -83310831287241.777598696853498149 Inexact Rounded +comx3293 compare -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> -1 +divx3293 divide -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> 1.5202754978845438636605170857478E+333 Inexact Rounded +dvix3293 divideint -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> NaN Division_impossible +mulx3293 multiply -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> 4.5654189779610386760330527839588E-306 Inexact Rounded +powx3293 power -83310831287241.777598696853498149 -5 -> -2.4916822606682624827900581728387E-70 Inexact Rounded +remx3293 remainder -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> NaN Division_impossible +subx3293 subtract -83310831287241.777598696853498149 -54799825033.797100418162985103519E-330 -> -83310831287241.777598696853498149 Inexact Rounded +addx3294 add 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> 4506653461.4414974233678331771169 Inexact Rounded +comx3294 compare 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> 1 +divx3294 divide 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> -6.0124409901781490054438220048629E+888 Inexact Rounded +dvix3294 divideint 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> NaN Division_impossible +mulx3294 multiply 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> -3.3779833273541776470902903512949E-870 Inexact Rounded +powx3294 power 4506653461.4414974233678331771169 -7 -> 2.6486272911486461102735412463189E-68 Inexact Rounded +remx3294 remainder 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> NaN Division_impossible +subx3294 subtract 4506653461.4414974233678331771169 -74955470.977653038010031457181957E-887 -> 4506653461.4414974233678331771169 Inexact Rounded +addx3295 add 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 744537.89692255653780778146167691 Inexact Rounded +comx3295 compare 23777.857951114967684767609401626 720760.03897144157012301385227528 -> -1 +divx3295 divide 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 0.032989978169498808275308039034795 Inexact Rounded +dvix3295 divideint 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 0 +mulx3295 multiply 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 17138129823.503025913034987537096 Inexact Rounded +powx3295 power 23777.857951114967684767609401626 720760 -> Infinity Overflow Inexact Rounded +remx3295 remainder 23777.857951114967684767609401626 720760.03897144157012301385227528 -> 23777.857951114967684767609401626 +subx3295 subtract 23777.857951114967684767609401626 720760.03897144157012301385227528 -> -696982.18102032660243824624287365 Inexact Rounded +addx3296 add -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> 6.0802728403071490445256786982100E+541 Inexact Rounded +comx3296 compare -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -1 +divx3296 divide -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -3.5093578667274020123788514069885E-511 Inexact Rounded +dvix3296 divideint -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -0 +mulx3296 multiply -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -1.2973997003625843317417981902198E+573 Inexact Rounded +powx3296 power -21337853323980858055292469611948 6 -> 9.4385298321304970306180652097874E+187 Inexact Rounded +remx3296 remainder -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -21337853323980858055292469611948 +subx3296 subtract -21337853323980858055292469611948 6080272840.3071490445256786982100E+532 -> -6.0802728403071490445256786982100E+541 Inexact Rounded +addx3297 add -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -818408481.65082668425744179302401 Inexact Rounded +comx3297 compare -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -1 +divx3297 divide -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -1081991.4954690752676494129493403 Inexact Rounded +dvix3297 divideint -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -1081991 +mulx3297 multiply -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -619037842458.03980537370328252817 Inexact Rounded +powx3297 power -818409238.0423893439849743856947 756 -> 1.6058883946373232750995543573461E+6738 Inexact Rounded +remx3297 remainder -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -374.76862809126749803143314108840 +subx3297 subtract -818409238.0423893439849743856947 756.39156265972753259267069158760 -> -818409994.43395200371250697836539 Inexact Rounded +addx3298 add 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 47567380385008.954845377769826287 Inexact Rounded +comx3298 compare 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 1 +divx3298 divide 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 730853388480.86247690474303493972 Inexact Rounded +dvix3298 divideint 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 730853388480 +mulx3298 multiply 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 3095909128079784.3348591472999468 Inexact Rounded +powx3298 power 47567380384943.87013600286155046 65 -> 1.0594982876763214301042437482634E+889 Inexact Rounded +remx3298 remainder 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 56.134058687770878126430844955520 +subx3298 subtract 47567380384943.87013600286155046 65.084709374908275826942076480326 -> 47567380384878.785426627953274633 Inexact Rounded +addx3299 add -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> -302031659.49048519905267279799984 Inexact Rounded +comx3299 compare -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> -1 +divx3299 divide -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> 54.765366028496664530688259272591 Inexact Rounded +dvix3299 divideint -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> 54 +mulx3299 multiply -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> 1606504025402196.8484885386501478 Inexact Rounded +powx3299 power -296615544.05897984545127115290251 -5416115 -> -0E-10030 Underflow Subnormal Inexact Rounded Clamped +remx3299 remainder -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> -4145310.7576907509755823176468844 +subx3299 subtract -296615544.05897984545127115290251 -5416115.4315053536014016450973264 -> -291199428.62747449184986950780518 Inexact Rounded +addx3300 add 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> 6.1391705914046707180652185247584E+749 Inexact Rounded +comx3300 compare 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> 1 +divx3300 divide 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> -9.0818539468906248593699700040068E+737 Inexact Rounded +dvix3300 divideint 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> NaN Division_impossible +mulx3300 multiply 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> -4.1499693532587347944890300176290E+761 Inexact Rounded +powx3300 power 61391705914.046707180652185247584E+739 -7 -> 3.0425105291210947473420999890124E-5249 Inexact Rounded +remx3300 remainder 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> NaN Division_impossible +subx3300 subtract 61391705914.046707180652185247584E+739 -675982087721.91856456125242297346 -> 6.1391705914046707180652185247584E+749 Inexact Rounded + +-- randomly generated testcases [26 Sep 2001] +precision: 33 +rounding: half_up +maxExponent: 9999 + +addx3401 add 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> -1364112374596.82605557115996067822 Inexact Rounded +comx3401 compare 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> 1 +divx3401 divide 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> -3.12789896373176963160811150593867E-11 Inexact Rounded +dvix3401 divideint 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> -0 +mulx3401 multiply 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> -58204024324286.5595453066065234923 Inexact Rounded +powx3401 power 042.668056830485571428877212944418 -1 -> 0.0234367363850869744523417227148909 Inexact Rounded +remx3401 remainder 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> 42.668056830485571428877212944418 +subx3401 subtract 042.668056830485571428877212944418 -01364112374639.4941124016455321071 -> 1364112374682.16216923213110353598 Inexact Rounded +addx3402 add -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -3.27179426341653256363531809227344E+455 Inexact Rounded +comx3402 compare -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -1 +divx3402 divide -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -4.31028129684803083255704680611589E+446 Inexact Rounded +dvix3402 divideint -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> NaN Division_impossible +mulx3402 multiply -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -2.48351255171055445110558613627379E+464 Inexact Rounded +powx3402 power -327.179426341653256363531809227344E+453 759067457 -> -Infinity Overflow Inexact Rounded +remx3402 remainder -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> NaN Division_impossible +subx3402 subtract -327.179426341653256363531809227344E+453 759067457.107518663444899356760793 -> -3.27179426341653256363531809227344E+455 Inexact Rounded +addx3403 add 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 900181194.826119246619069527471177 Inexact Rounded +comx3403 compare 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> -1 +divx3403 divide 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 0.0000907917210693679220610511319812826 Inexact Rounded +dvix3403 divideint 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 0 +mulx3403 multiply 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 73557551389502.7779979042453102926 Inexact Rounded +powx3403 power 81721.5803096185422787702538493471 900099473 -> Infinity Overflow Inexact Rounded +remx3403 remainder 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> 81721.5803096185422787702538493471 +subx3403 subtract 81721.5803096185422787702538493471 900099473.245809628076790757217328 -> -900017751.665500009534511986963479 Inexact Rounded +addx3404 add 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 72.3239822255871305731314565069132 Inexact Rounded +comx3404 compare 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> -1 +divx3404 divide 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 5.51900935695390664984598248115290E-806 Inexact Rounded +dvix3404 divideint 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 0 +mulx3404 multiply 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 2.88686045809784034794803928177854E-802 Inexact Rounded +powx3404 power 3991.56734635183403814636354392163E-807 72 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3404 remainder 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> 3.99156734635183403814636354392163E-804 +subx3404 subtract 3991.56734635183403814636354392163E-807 72.3239822255871305731314565069132 -> -72.3239822255871305731314565069132 Inexact Rounded +addx3405 add -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -61.2544651290911805069948520197050 Inexact Rounded +comx3405 compare -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -1 +divx3405 divide -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -13.0464272560079276694749924915850 Inexact Rounded +dvix3405 divideint -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -13 +mulx3405 multiply -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -337.326590072564290813539036280205 Inexact Rounded +powx3405 power -66.3393308595957726456416979163306 5 -> -1284858888.27285822259184896667990 Inexact Rounded +remx3405 remainder -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -0.23607636303607484323270126019793 +subx3405 subtract -66.3393308595957726456416979163306 5.08486573050459213864684589662559 -> -71.4241965901003647842885438129562 Inexact Rounded +addx3406 add -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> -3.93606873703567753255097095208112E+116 Inexact Rounded +comx3406 compare -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> -1 +divx3406 divide -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> 1.85284350396137075010428736564737E+107 Inexact Rounded +dvix3406 divideint -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> NaN Division_impossible +mulx3406 multiply -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> 8.36154649302353269818801263275941E+125 Inexact Rounded +powx3406 power -393606.873703567753255097095208112E+111 -2 -> 6.45467904123103560528919747688443E-234 Inexact Rounded +remx3406 remainder -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> NaN Division_impossible +subx3406 subtract -393606.873703567753255097095208112E+111 -2124339550.86891093200758095660557 -> -3.93606873703567753255097095208112E+116 Inexact Rounded +addx3407 add -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> -877573445.238180259264773343614397 +comx3407 compare -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 1 +divx3407 divide -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 0.0222888053076312565797460650311070 Inexact Rounded +dvix3407 divideint -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 0 +mulx3407 multiply -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 16425043456056213.7395191514029288 Inexact Rounded +powx3407 power -019133598.609812524622150421584346 -858439847 -> -0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3407 remainder -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> -19133598.609812524622150421584346 +subx3407 subtract -019133598.609812524622150421584346 -858439846.628367734642622922030051 -> 839306248.018555210020472500445705 +addx3408 add 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 240910.327926825971183391888394542 Inexact Rounded +comx3408 compare 465.351982159046525762715549761814 240444.975944666924657629172844780 -> -1 +divx3408 divide 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 0.00193537827243326122782974132829095 Inexact Rounded +dvix3408 divideint 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 0 +mulx3408 multiply 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 111891546.156035013780371395668674 Inexact Rounded +powx3408 power 465.351982159046525762715549761814 240445 -> Infinity Overflow Inexact Rounded +remx3408 remainder 465.351982159046525762715549761814 240444.975944666924657629172844780 -> 465.351982159046525762715549761814 +subx3408 subtract 465.351982159046525762715549761814 240444.975944666924657629172844780 -> -239979.623962507878131866457295018 Inexact Rounded +addx3409 add 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 28066955004783.1076824222873384828 Inexact Rounded +comx3409 compare 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 1 +divx3409 divide 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 4.90938543219432390013656968123815E+722 Inexact Rounded +dvix3409 divideint 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> NaN Division_impossible +mulx3409 multiply 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 1.60458773123547770690452195569223E-696 Inexact Rounded +powx3409 power 28066955004783.1076824222873384828 6 -> 4.88845689938951583020171325568218E+80 Inexact Rounded +remx3409 remainder 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> NaN Division_impossible +subx3409 subtract 28066955004783.1076824222873384828 571699969.220753535758504907561016E-718 -> 28066955004783.1076824222873384828 Inexact Rounded +addx3410 add 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 2.82120384825243127096613158419270E+429 Inexact Rounded +comx3410 compare 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> -1 +divx3410 divide 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 1.00224012330435927467559203688861E-416 Inexact Rounded +dvix3410 divideint 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 0 +mulx3410 multiply 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 7.97702072298089605706798770013561E+442 Inexact Rounded +powx3410 power 28275236927392.4960902824105246047 3 -> 2.26057415546622161347322061281516E+40 Inexact Rounded +remx3410 remainder 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> 28275236927392.4960902824105246047 +subx3410 subtract 28275236927392.4960902824105246047 28212038.4825243127096613158419270E+422 -> -2.82120384825243127096613158419270E+429 Inexact Rounded +addx3411 add 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> 11783.4098484281593848173575655680 Inexact Rounded +comx3411 compare 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> 1 +divx3411 divide 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> -1394.73214754836418731335761858151 Inexact Rounded +dvix3411 divideint 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> -1394 +mulx3411 multiply 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> -99695.1757167732926302533138186716 Inexact Rounded +powx3411 power 11791.8644211874630234271801789996 -8 -> 2.67510099318723516565332928253711E-33 Inexact Rounded +remx3411 remainder 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> 6.18999471819080133445705535281046 +subx3411 subtract 11791.8644211874630234271801789996 -8.45457275930363860982261343159741 -> 11800.3189939467666620370027924312 Inexact Rounded +addx3412 add 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> -9292.34554725628103950730533220061 Inexact Rounded +comx3412 compare 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> 1 +divx3412 divide 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> -0.00478829121953512281527242631775613 Inexact Rounded +dvix3412 divideint 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> -0 +mulx3412 multiply 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> -417446.000545543168866158913077419 Inexact Rounded +powx3412 power 44.7085340739581668975502342787578 -9337 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3412 remainder 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> 44.7085340739581668975502342787578 +subx3412 subtract 44.7085340739581668975502342787578 -9337.05408133023920640485556647937 -> 9381.76261540419737330240580075813 Inexact Rounded +addx3413 add 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> 9.33545274288045458053295581965867E+589 Inexact Rounded +comx3413 compare 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> 1 +divx3413 divide 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> -1.08992064752484400353231056271614E+578 Inexact Rounded +dvix3413 divideint 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> NaN Division_impossible +mulx3413 multiply 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> -7.99605715447900642683774360731254E+601 Inexact Rounded +powx3413 power 93354527428804.5458053295581965867E+576 -9 -> 1.85687015691763406448005521221518E-5310 Inexact Rounded +remx3413 remainder 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> NaN Division_impossible +subx3413 subtract 93354527428804.5458053295581965867E+576 -856525909852.318790321300941615314 -> 9.33545274288045458053295581965867E+589 Inexact Rounded +addx3414 add -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> -367399415798804503177950095289166 Inexact Rounded +comx3414 compare -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> -1 +divx3414 divide -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> 6698784465980529140072174.30474769 Inexact Rounded +dvix3414 divideint -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> 6698784465980529140072174 +mulx3414 multiply -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> 2.01502722493617222018040789291414E+40 Inexact Rounded +powx3414 power -367399415798804503177950040443482 -54845684 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3414 remainder -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> -16714095.6549657189177857892292804 +subx3414 subtract -367399415798804503177950040443482 -54845683.9691776397285506712812754 -> -367399415798804503177949985597798 Inexact Rounded +addx3415 add -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> 89529730127.7712289354674386343440 Inexact Rounded +comx3415 compare -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -1 +divx3415 divide -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -3.20738060264454013174835928754430E-11 Inexact Rounded +dvix3415 divideint -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -0 +mulx3415 multiply -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -257089920034.115975469931085527642 Inexact Rounded +powx3415 power -2.87155919781024108503670175443740 9 -> -13275.7774683251354527310820885737 Inexact Rounded +remx3415 remainder -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -2.87155919781024108503670175443740 +subx3415 subtract -2.87155919781024108503670175443740 89529730130.6427881332776797193807 -> -89529730133.5143473310879208044174 Inexact Rounded +addx3416 add -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -1.06939343381794796521780572792040E+189 Inexact Rounded +comx3416 compare -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -1 +divx3416 divide -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -4.03774938598259547575707503087638E+184 Inexact Rounded +dvix3416 divideint -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> NaN Division_impossible +mulx3416 multiply -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -2.83227661494558963558481633880647E+193 Inexact Rounded +powx3416 power -010.693934338179479652178057279204E+188 26485 -> -Infinity Overflow Inexact Rounded +remx3416 remainder -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> NaN Division_impossible +subx3416 subtract -010.693934338179479652178057279204E+188 26484.8887731973153745666514260684 -> -1.06939343381794796521780572792040E+189 Inexact Rounded +addx3417 add 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 621838312788.308537943268041906168 +comx3417 compare 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 1 +divx3417 divide 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 60.0678575886074367081836436812959 Inexact Rounded +dvix3417 divideint 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 60 +mulx3417 multiply 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 6228331603681663511826.60450280350 Inexact Rounded +powx3417 power 611655569568.832698912762075889186 1 -> 611655569568.832698912762075889186 +remx3417 remainder 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 690976400.282357082404114870266 +subx3417 subtract 611655569568.832698912762075889186 010182743219.475839030505966016982 -> 601472826349.356859882256109872204 +addx3418 add 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> 3457945.39110674985794181949638944 Inexact Rounded +comx3418 compare 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> 1 +divx3418 divide 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> -1729387.11663991852426428263230475 Inexact Rounded +dvix3418 divideint 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> -1729387 +mulx3418 multiply 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> -6914241.49127918361259252956576654 Inexact Rounded +powx3418 power 3457947.39062863674882672518304442 -2 -> 8.36302195229701913376802373659526E-14 Inexact Rounded +remx3418 remainder 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> 0.2332240699744359979851713353525 +subx3418 subtract 3457947.39062863674882672518304442 -01.9995218868908849056866549811425 -> 3457949.39015052363971163086969940 Inexact Rounded +addx3419 add -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> -53308666960535.7393391289364591513 Inexact Rounded +comx3419 compare -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> -1 +divx3419 divide -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> 8.16740037282731870883136714441204E+451 Inexact Rounded +dvix3419 divideint -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> NaN Division_impossible +mulx3419 multiply -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> 3.47945961185390084641156250100085E-425 Inexact Rounded +powx3419 power -53308666960535.7393391289364591513 -7 -> -8.17363502380497033342380498988958E-97 Inexact Rounded +remx3419 remainder -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> NaN Division_impossible +subx3419 subtract -53308666960535.7393391289364591513 -6527.00547629475578694521436764596E-442 -> -53308666960535.7393391289364591513 Inexact Rounded +addx3420 add -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> -413474500.320043571235254629529038 Inexact Rounded +comx3420 compare -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 1 +divx3420 divide -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 0.0136503290701197094953429018013146 Inexact Rounded +dvix3420 divideint -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 0 +mulx3420 multiply -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 2271246398971702.91169807728132089 Inexact Rounded +powx3420 power -5568057.17870139549478277980540034 -407906443 -> -0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3420 remainder -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> -5568057.17870139549478277980540034 +subx3420 subtract -5568057.17870139549478277980540034 -407906443.141342175740471849723638 -> 402338385.962640780245689069918238 Inexact Rounded +addx3421 add 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 9804385357.63872821851861785530505 Inexact Rounded +comx3421 compare 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 1 +divx3421 divide 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 116519965.821719977402398190558439 Inexact Rounded +dvix3421 divideint 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 116519965 +mulx3421 multiply 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 824974242939.691780798621180901714 Inexact Rounded +powx3421 power 9804385273.49533524416415189990857 84 -> 1.90244010779692739037080418507909E+839 Inexact Rounded +remx3421 remainder 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 69.1423069734476624350435642749915 +subx3421 subtract 9804385273.49533524416415189990857 84.1433929743544659553964804646569 -> 9804385189.35194226980968594451209 Inexact Rounded +addx3422 add -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> -5874220715892.91440069210512515154 Inexact Rounded +comx3422 compare -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 1 +divx3422 divide -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 8.91166886601477021757439826903776E-548 Inexact Rounded +dvix3422 divideint -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 0 +mulx3422 multiply -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 3.07510225632952455144944282925583E-522 Inexact Rounded +powx3422 power -5234910986592.18801727046580014273E-547 -6 -> 4.85896970703117149235935037271084E+3205 Inexact Rounded +remx3422 remainder -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> -5.23491098659218801727046580014273E-535 +subx3422 subtract -5234910986592.18801727046580014273E-547 -5874220715892.91440069210512515154 -> 5874220715892.91440069210512515154 Inexact Rounded +addx3423 add 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 5.17546816784872628933218985216916E-259 Inexact Rounded +comx3423 compare 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> -1 +divx3423 divide 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 1.34947513442491971488363250398908E-204 Inexact Rounded +dvix3423 divideint 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 0 +mulx3423 multiply 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 3.61463267496484976064271305679796E-721 Inexact Rounded +powx3423 power 698416560151955285929747633786867E-495 5 -> 1.66177661007189430761396979787413E-2311 Inexact Rounded +remx3423 remainder 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> 6.98416560151955285929747633786867E-463 +subx3423 subtract 698416560151955285929747633786867E-495 51754681.6784872628933218985216916E-266 -> -5.17546816784872628933218985216916E-259 Inexact Rounded +addx3424 add 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> 107635.497735316515080720330536027 Inexact Rounded +comx3424 compare 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> 1 +divx3424 divide 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> -2.70980469844599888443309571235597E+603 Inexact Rounded +dvix3424 divideint 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> NaN Division_impossible +mulx3424 multiply 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> -4.27536360069537352698066408021773E-594 Inexact Rounded +powx3424 power 107635.497735316515080720330536027 -4 -> 7.45037111502910487803432806334714E-21 Inexact Rounded +remx3424 remainder 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> NaN Division_impossible +subx3424 subtract 107635.497735316515080720330536027 -3972075.83989512668362609609006425E-605 -> 107635.497735316515080720330536027 Inexact Rounded +addx3425 add -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> 7.95188637593855925052747867099091E+421 Inexact Rounded +comx3425 compare -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -1 +divx3425 divide -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -4.04612060894658007715621807881076E-409 Inexact Rounded +dvix3425 divideint -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -0 +mulx3425 multiply -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -2.55846309007242668513226814043593E+435 Inexact Rounded +powx3425 power -32174291345686.5371446616670961807 8 -> 1.14834377656109143210058690590666E+108 Inexact Rounded +remx3425 remainder -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -32174291345686.5371446616670961807 +subx3425 subtract -32174291345686.5371446616670961807 79518863759385.5925052747867099091E+408 -> -7.95188637593855925052747867099091E+421 Inexact Rounded +addx3426 add -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> -9.31730631474527142307644239919480E+904 Inexact Rounded +comx3426 compare -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 1 +divx3426 divide -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 8.74902060655796717043678441884283E-208 Inexact Rounded +dvix3426 divideint -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 0 +mulx3426 multiply -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 7.59521700128037149179751467730962E+1602 Inexact Rounded +powx3426 power -8151730494.53190523620899410544099E+688 -9 -> -6.29146352774842448375275282183700E-6282 Inexact Rounded +remx3426 remainder -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> -8.15173049453190523620899410544099E+697 +subx3426 subtract -8151730494.53190523620899410544099E+688 -93173.0631474527142307644239919480E+900 -> 9.31730631474527142307644239919480E+904 Inexact Rounded +addx3427 add 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> -5.66230530039528969825480755159562E+463 Inexact Rounded +comx3427 compare 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> 1 +divx3427 divide 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> -2.36034255052700900395787131334608E-464 Inexact Rounded +dvix3427 divideint 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> -0 +mulx3427 multiply 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> -7.56765978558098558928268129700052E+463 Inexact Rounded +powx3427 power 1.33649801345976199708341799505220 -6 -> 0.175464835912284900180305028965188 Inexact Rounded +remx3427 remainder 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> 1.33649801345976199708341799505220 +subx3427 subtract 1.33649801345976199708341799505220 -56623.0530039528969825480755159562E+459 -> 5.66230530039528969825480755159562E+463 Inexact Rounded +addx3428 add 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> 67762238162788.6551061476018185196 Inexact Rounded +comx3428 compare 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> 1 +divx3428 divide 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> -1.10348321777294157014941951870409E+832 Inexact Rounded +dvix3428 divideint 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> NaN Division_impossible +mulx3428 multiply 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> -4.16111531818085838717201828773857E-805 Inexact Rounded +powx3428 power 67762238162788.6551061476018185196 -6 -> 1.03293631708006509074972764670281E-83 Inexact Rounded +remx3428 remainder 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> NaN Division_impossible +subx3428 subtract 67762238162788.6551061476018185196 -6140.75837959248100352788853809376E-822 -> 67762238162788.6551061476018185196 Inexact Rounded +addx3429 add 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 6.28677291578497580015557979349893E+823 Inexact Rounded +comx3429 compare 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> -1 +divx3429 divide 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 6.81838333133660025740681459349372E-818 Inexact Rounded +dvix3429 divideint 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 0 +mulx3429 multiply 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 2.69486466971438542975159893306219E+830 Inexact Rounded +powx3429 power 4286562.76568866751577306056498271 6 -> 6.20376193064412081058181881805108E+39 Inexact Rounded +remx3429 remainder 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> 4286562.76568866751577306056498271 +subx3429 subtract 4286562.76568866751577306056498271 6286.77291578497580015557979349893E+820 -> -6.28677291578497580015557979349893E+823 Inexact Rounded +addx3430 add -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -765715.663995796739622174820554104 Inexact Rounded +comx3430 compare -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -1 +divx3430 divide -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -11401.7814363639478774761697650867 Inexact Rounded +dvix3430 divideint -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -11401 +mulx3430 multiply -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -51432606.5679912088468256122315944 Inexact Rounded +powx3430 power -765782.827432642697305644096365566 67 -> -1.71821200770749773595473594136582E+394 Inexact Rounded +remx3430 remainder -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -52.4839518791480724305698888408548 +subx3430 subtract -765782.827432642697305644096365566 67.1634368459576834692758114618652 -> -765849.990869488654989113372177028 Inexact Rounded +addx3431 add 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 105.582516975019937108929234216907 Inexact Rounded +comx3431 compare 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> -1 +divx3431 divide 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 0.780513207299722975882416995140701 Inexact Rounded +dvix3431 divideint 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 0 +mulx3431 multiply 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 2744.56726509164060561370653286614 Inexact Rounded +powx3431 power 46.2835931916106252756465724211276 59 -> 1.82052645780601002671007943923993E+98 Inexact Rounded +remx3431 remainder 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> 46.2835931916106252756465724211276 +subx3431 subtract 46.2835931916106252756465724211276 59.2989237834093118332826617957791 -> -13.0153305917986865576360893746515 +addx3432 add -3029555.82298840234029474459694644 857535844655004737373089601128532 -> 857535844655004737373089598098976 Inexact Rounded +comx3432 compare -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -1 +divx3432 divide -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -3.53286202771759704502126811323937E-27 Inexact Rounded +dvix3432 divideint -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -0 +mulx3432 multiply -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -2.59795271159584761928986181925721E+39 Inexact Rounded +powx3432 power -3029555.82298840234029474459694644 9 -> -2.14986224790431302561340100746360E+58 Inexact Rounded +remx3432 remainder -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -3029555.82298840234029474459694644 +subx3432 subtract -3029555.82298840234029474459694644 857535844655004737373089601128532 -> -857535844655004737373089604158088 Inexact Rounded +addx3433 add -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> 481026979918882487383654367924619 Inexact Rounded +comx3433 compare -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -1 +divx3433 divide -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -2.87856597038397207797777811199804E-970 Inexact Rounded +dvix3433 divideint -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -0 +mulx3433 multiply -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -6.66062615833636908683785283687416E-905 Inexact Rounded +powx3433 power -0138466789523.10694176543700501945E-948 5 -> -5.09012109092637525843636056746667E-4685 Inexact Rounded +remx3433 remainder -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -1.3846678952310694176543700501945E-937 +subx3433 subtract -0138466789523.10694176543700501945E-948 481026979918882487383654367924619 -> -481026979918882487383654367924619 Inexact Rounded +addx3434 add -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> -8.76320343474845477961976776833770E+779 Inexact Rounded +comx3434 compare -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 1 +divx3434 divide -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 1.09475564939253134070730299863765E-770 Inexact Rounded +dvix3434 divideint -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 0 +mulx3434 multiply -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 8.40703746148119867711463485065336E+789 Inexact Rounded +powx3434 power -9593566466.96690575714244442109870 -9 -> -1.45271091841882960010964421066745E-90 Inexact Rounded +remx3434 remainder -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> -9593566466.96690575714244442109870 +subx3434 subtract -9593566466.96690575714244442109870 -87632034347.4845477961976776833770E+769 -> 8.76320343474845477961976776833770E+779 Inexact Rounded +addx3435 add -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> 5.65688889355241946154894311253202E-458 Inexact Rounded +comx3435 compare -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -1 +divx3435 divide -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -5.63791814686655486612569970629128E-438 Inexact Rounded +dvix3435 divideint -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -0 +mulx3435 multiply -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -1.80415590504280580443565448126548E-1352 Inexact Rounded +powx3435 power -3189.30765477670526823106100241863E-898 6 -> 1.05239431027683904514311527228736E-5367 Inexact Rounded +remx3435 remainder -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -3.18930765477670526823106100241863E-895 +subx3435 subtract -3189.30765477670526823106100241863E-898 565688889.355241946154894311253202E-466 -> -5.65688889355241946154894311253202E-458 Inexact Rounded +addx3436 add -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> -6.31925802672685034379197328370812E+538 Inexact Rounded +comx3436 compare -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 1 +divx3436 divide -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 2.70356936263934622050341328519534E-529 Inexact Rounded +dvix3436 divideint -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 0 +mulx3436 multiply -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 1.07961694859382462346866817306769E+549 Inexact Rounded +powx3436 power -17084552395.6714834680088150543965 -6 -> 4.02141014977177984123011868387622E-62 Inexact Rounded +remx3436 remainder -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> -17084552395.6714834680088150543965 +subx3436 subtract -17084552395.6714834680088150543965 -631925802672.685034379197328370812E+527 -> 6.31925802672685034379197328370812E+538 Inexact Rounded +addx3437 add 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> 34956830.3498233068159118874697600 Inexact Rounded +comx3437 compare 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> 1 +divx3437 divide 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> -5.67473494371787737607169979602343E+666 Inexact Rounded +dvix3437 divideint 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> NaN Division_impossible +mulx3437 multiply 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> -2.15336927667273841617128781173293E-652 Inexact Rounded +powx3437 power 034956830.349823306815911887469760 -6 -> 5.48034272566098493462169431762597E-46 Inexact Rounded +remx3437 remainder 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> NaN Division_impossible +subx3437 subtract 034956830.349823306815911887469760 -61600816.0672274126966042956781665E-667 -> 34956830.3498233068159118874697600 Inexact Rounded +addx3438 add -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -743.513686646195531912469919819067 Inexact Rounded +comx3438 compare -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -1 +divx3438 divide -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -38.3130314835722766807703585435688 Inexact Rounded +dvix3438 divideint -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -38 +mulx3438 multiply -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -15212.5977643862002585039364868883 Inexact Rounded +powx3438 power -763.440067781256632695791981893608 20 -> 4.52375407727336769552481661250924E+57 Inexact Rounded +remx3438 remainder -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -6.2375846489348029295536230610386 +subx3438 subtract -763.440067781256632695791981893608 19.9263811350611007833220620745413 -> -783.366448916317733479114043968149 Inexact Rounded +addx3439 add -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -5.10472027868440667684575147556654E+821 Inexact Rounded +comx3439 compare -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -1 +divx3439 divide -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -6.11437198047603754107526874071737E+788 Inexact Rounded +dvix3439 divideint -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> NaN Division_impossible +mulx3439 multiply -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -4.26178996090176289115594057419892E+854 Inexact Rounded +powx3439 power -510472027868440667684575147556654E+789 8 -> 4.61079266619522147262600755274182E+6573 Inexact Rounded +remx3439 remainder -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> NaN Division_impossible +subx3439 subtract -510472027868440667684575147556654E+789 834872378550801889983927148587909 -> -5.10472027868440667684575147556654E+821 Inexact Rounded +addx3440 add 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> 7.03047615605170866769935030348280E-87 Inexact Rounded +comx3440 compare 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> 1 +divx3440 divide 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> -3.95554019499502537743883483402608E+670 Inexact Rounded +dvix3440 divideint 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> NaN Division_impossible +mulx3440 multiply 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> -1.24957888288817581538108991453732E-843 Inexact Rounded +powx3440 power 070304761.560517086676993503034828E-094 -2 -> 2.02316135427631488479902919959627E+172 Inexact Rounded +remx3440 remainder 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> NaN Division_impossible +subx3440 subtract 070304761.560517086676993503034828E-094 -17773.7446959771077104057845273992E-761 -> 7.03047615605170866769935030348280E-87 Inexact Rounded +addx3441 add -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> -970725702203.695030010334183533769 Inexact Rounded +comx3441 compare -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> -1 +divx3441 divide -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> 213749425.654447811698884007553614 Inexact Rounded +dvix3441 divideint -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> 213749425 +mulx3441 multiply -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> 4408472103336875.21161867891724392 Inexact Rounded +powx3441 power -0970725697662.27605454336231195463 -4541 -> -0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3441 remainder -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> -2972.12171050214753770792631747550 +subx3441 subtract -0970725697662.27605454336231195463 -4541.41897546697187157913886433474 -> -970725693120.857079076390440375491 Inexact Rounded +addx3442 add -808178238631844268316111259558675 -598400.265108644514211244980426520 -> -808178238631844268316111260157075 Inexact Rounded +comx3442 compare -808178238631844268316111259558675 -598400.265108644514211244980426520 -> -1 +divx3442 divide -808178238631844268316111259558675 -598400.265108644514211244980426520 -> 1350564640015847635178945884.97836 Inexact Rounded +dvix3442 divideint -808178238631844268316111259558675 -598400.265108644514211244980426520 -> 1350564640015847635178945884 +mulx3442 multiply -808178238631844268316111259558675 -598400.265108644514211244980426520 -> 4.83614072252332979731348423145208E+38 Inexact Rounded +powx3442 power -808178238631844268316111259558675 -598400 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3442 remainder -808178238631844268316111259558675 -598400.265108644514211244980426520 -> -585452.097764536570956813681556320 +subx3442 subtract -808178238631844268316111259558675 -598400.265108644514211244980426520 -> -808178238631844268316111258960275 Inexact Rounded +addx3443 add -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> -41.5341827319983835079860474697980 Rounded +comx3443 compare -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 1 +divx3443 divide -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 0.313295770023233218639213140599856 Inexact Rounded +dvix3443 divideint -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 0 +mulx3443 multiply -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 313.357994403604968250936036978086 Inexact Rounded +powx3443 power -9.90826595069053564311371766315200 -32 -> 1.34299698259038003011439568004625E-32 Inexact Rounded +remx3443 remainder -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> -9.90826595069053564311371766315200 +subx3443 subtract -9.90826595069053564311371766315200 -031.625916781307847864872329806646 -> 21.7176508306173122217586121434940 Rounded +addx3444 add -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> -238194.467436351098567470879626885 Inexact Rounded +comx3444 compare -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> -1 +divx3444 divide -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> 4.77175317088274715226553516820589 Inexact Rounded +dvix3444 divideint -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> 4 +mulx3444 multiply -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> 8126916733.40905487026003135987472 Inexact Rounded +powx3444 power -196925.469891897719160698483752907 -41269 -> -0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3444 remainder -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> -31849.4797140842015336089002569958 +subx3444 subtract -196925.469891897719160698483752907 -41268.9975444533794067723958739778 -> -155656.472347444339753926087878929 Inexact Rounded +addx3445 add 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 421071135212152225162086005824310 Inexact Rounded +comx3445 compare 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 1 +divx3445 divide 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 3.15333426537349744281860005497304E+627 Inexact Rounded +dvix3445 divideint 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> NaN Division_impossible +mulx3445 multiply 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 5.62264847262712040027311932121460E-563 Inexact Rounded +powx3445 power 421071135212152225162086005824310 1 -> 421071135212152225162086005824310 +remx3445 remainder 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> NaN Division_impossible +subx3445 subtract 421071135212152225162086005824310 1335320330.08964354845796510145246E-604 -> 421071135212152225162086005824310 Inexact Rounded +addx3446 add 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> 1249441.46421514282301182772247227 Inexact Rounded +comx3446 compare 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> 1 +divx3446 divide 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> -4.31066764178328992440635387255816E+676 Inexact Rounded +dvix3446 divideint 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> NaN Division_impossible +mulx3446 multiply 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> -3.62148999233506984566620611700349E-665 Inexact Rounded +powx3446 power 1249441.46421514282301182772247227 -3 -> 5.12686942572191282348415024932322E-19 Inexact Rounded +remx3446 remainder 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> NaN Division_impossible +subx3446 subtract 1249441.46421514282301182772247227 -0289848.71208912281976374705180836E-676 -> 1249441.46421514282301182772247227 Inexact Rounded +addx3447 add 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> -6.90425401708167622194241915195001E+923 Inexact Rounded +comx3447 compare 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> 1 +divx3447 divide 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> -1.08360729901578455109968388309079E-916 Inexact Rounded +dvix3447 divideint 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> -0 +mulx3447 multiply 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> -5.16541767544616308732028810026275E+931 Inexact Rounded +powx3447 power 74815000.4716875558358937279052903 -7 -> 7.62218032252683815537906972439985E-56 Inexact Rounded +remx3447 remainder 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> 74815000.4716875558358937279052903 +subx3447 subtract 74815000.4716875558358937279052903 -690425401708167622194241915195001E+891 -> 6.90425401708167622194241915195001E+923 Inexact Rounded +addx3448 add -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> -72394386611338.3523609383834372430 Inexact Rounded +comx3448 compare -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 1 +divx3448 divide -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 2.32613829621244113284301004158794E-8 Inexact Rounded +dvix3448 divideint -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 0 +mulx3448 multiply -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 121911674530293613615.441384822381 Inexact Rounded +powx3448 power -1683993.51210241555668790556759021 -7 -> -2.60385683509956889000676113860292E-44 Inexact Rounded +remx3448 remainder -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> -1683993.51210241555668790556759021 +subx3448 subtract -1683993.51210241555668790556759021 -72394384927344.8402585228267493374 -> 72394383243351.3281561072700614318 Inexact Rounded +addx3449 add -763.148530974741766171756970448158 517370.808956957601473642272664647 -> 516607.660425982859707470515694199 Inexact Rounded +comx3449 compare -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -1 +divx3449 divide -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -0.00147505139014951946381155525173867 Inexact Rounded +dvix3449 divideint -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -0 +mulx3449 multiply -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -394830772.824715962925351447322187 Inexact Rounded +powx3449 power -763.148530974741766171756970448158 517371 -> -Infinity Overflow Inexact Rounded +remx3449 remainder -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -763.148530974741766171756970448158 +subx3449 subtract -763.148530974741766171756970448158 517370.808956957601473642272664647 -> -518133.957487932343239814029635095 Inexact Rounded +addx3450 add -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> -9.27540422641025050968830154578151E+532 Inexact Rounded +comx3450 compare -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 1 +divx3450 divide -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 8.36450164191471769978415758342237E-532 Inexact Rounded +dvix3450 divideint -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 0 +mulx3450 multiply -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 7.19624203304351070562409746475943E+534 Inexact Rounded +powx3450 power -77.5841338812312523460591226178754 -9 -> -9.81846856873938549466341693997829E-18 Inexact Rounded +remx3450 remainder -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> -77.5841338812312523460591226178754 +subx3450 subtract -77.5841338812312523460591226178754 -927540422.641025050968830154578151E+524 -> 9.27540422641025050968830154578151E+532 Inexact Rounded +addx3451 add 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> 5176165576.79580866488385418967956 Inexact Rounded +comx3451 compare 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> 1 +divx3451 divide 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> -39899.5720067736855444089432524094 Inexact Rounded +dvix3451 divideint 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> -39899 +mulx3451 multiply 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> -671536855852442.071887385512001794 Inexact Rounded +powx3451 power 5176295309.89943746236102209837813 -129733 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3451 remainder 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> 74208.214046920838632934314641965 +subx3451 subtract 5176295309.89943746236102209837813 -129733.103628797477167908698565465 -> 5176425043.00306625983819000707670 Inexact Rounded +addx3452 add 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 4.47163484116690197229286530307326E+184 Inexact Rounded +comx3452 compare 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 1 +divx3452 divide 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 1.41906636616314987705536737025932E+1129 Inexact Rounded +dvix3452 divideint 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> NaN Division_impossible +mulx3452 multiply 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 1.40906152309150441010046222214810E-760 Inexact Rounded +powx3452 power 4471634841166.90197229286530307326E+172 3 -> 8.94126556389673498386397569249516E+553 Inexact Rounded +remx3452 remainder 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> NaN Division_impossible +subx3452 subtract 4471634841166.90197229286530307326E+172 31511104397.8671727003201890825879E-955 -> 4.47163484116690197229286530307326E+184 Inexact Rounded +addx3453 add -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -8189130.15945231049670285726774317 Inexact Rounded +comx3453 compare -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -1 +divx3453 divide -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -3.17515949922556778343526099830093E+372 Inexact Rounded +dvix3453 divideint -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> NaN Division_impossible +mulx3453 multiply -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -2.11207823685103185039979144161848E-359 Inexact Rounded +powx3453 power -8189130.15945231049670285726774317 3 -> -549178241054875982731.000937875885 Inexact Rounded +remx3453 remainder -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> NaN Division_impossible +subx3453 subtract -8189130.15945231049670285726774317 2.57912402871404325831670923864936E-366 -> -8189130.15945231049670285726774317 Inexact Rounded +addx3454 add -254346232981353293392888785643245 -764.416902486152093758287929678445 -> -254346232981353293392888785644009 Inexact Rounded +comx3454 compare -254346232981353293392888785643245 -764.416902486152093758287929678445 -> -1 +divx3454 divide -254346232981353293392888785643245 -764.416902486152093758287929678445 -> 332732350833857889204406356900.665 Inexact Rounded +dvix3454 divideint -254346232981353293392888785643245 -764.416902486152093758287929678445 -> 332732350833857889204406356900 +mulx3454 multiply -254346232981353293392888785643245 -764.416902486152093758287929678445 -> 1.94426559574627262006307326336289E+35 Inexact Rounded +powx3454 power -254346232981353293392888785643245 -764 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3454 remainder -254346232981353293392888785643245 -764.416902486152093758287929678445 -> -508.299323962538610580669092979500 +subx3454 subtract -254346232981353293392888785643245 -764.416902486152093758287929678445 -> -254346232981353293392888785642481 Inexact Rounded +addx3455 add -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> -16063.2166595009220002171676000611 Inexact Rounded +comx3455 compare -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 1 +divx3455 divide -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 0.218031569091122520391599541575615 Inexact Rounded +dvix3455 divideint -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 0 +mulx3455 multiply -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 37919912.4040225840727281633024665 Inexact Rounded +powx3455 power -2875.36745499544177964804277329726 -13188 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3455 remainder -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> -2875.36745499544177964804277329726 +subx3455 subtract -2875.36745499544177964804277329726 -13187.8492045054802205691248267638 -> 10312.4817495100384409210820534665 Inexact Rounded +addx3456 add -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -7.26927570984219944693602140223103 Inexact Rounded +comx3456 compare -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -1 +divx3456 divide -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -4.51836100553039917574557235275173E+427 Inexact Rounded +dvix3456 divideint -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> NaN Division_impossible +mulx3456 multiply -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -1.16950304061635681891361504442479E-426 Inexact Rounded +powx3456 power -7.26927570984219944693602140223103 2 -> 52.8423693457018126451998096211036 Inexact Rounded +remx3456 remainder -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> NaN Division_impossible +subx3456 subtract -7.26927570984219944693602140223103 0160883021541.32275286769110003971E-438 -> -7.26927570984219944693602140223103 Inexact Rounded +addx3457 add -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> -2.85671516868762752241056540028515E+505 Inexact Rounded +comx3457 compare -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> -1 +divx3457 divide -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> 6.39064071690455919792707589054106E+501 Inexact Rounded +dvix3457 divideint -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> NaN Division_impossible +mulx3457 multiply -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> 1.27699583132923253605397736797000E+509 Inexact Rounded +powx3457 power -28567151.6868762752241056540028515E+498 -4470 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3457 remainder -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> NaN Division_impossible +subx3457 subtract -28567151.6868762752241056540028515E+498 -4470.15455137546427645290210989675 -> -2.85671516868762752241056540028515E+505 Inexact Rounded +addx3458 add 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 7191835.18758398207642347765831492 Inexact Rounded +comx3458 compare 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 1 +divx3458 divide 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 88363.9812586188186733935569874100 Inexact Rounded +dvix3458 divideint 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 88363 +mulx3458 multiply 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 585321326.397904638863485891524555 Inexact Rounded +powx3458 power 7191753.79974136447257468282073718 81 -> 2.53290983138561482612557404148760E+555 Inexact Rounded +remx3458 remainder 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 79.8625220355815164499390351500273 +subx3458 subtract 7191753.79974136447257468282073718 81.3878426176038487948375777384429 -> 7191672.41189874686872588798315944 Inexact Rounded +addx3459 add 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 502976488.859892968179149660674285 Inexact Rounded +comx3459 compare 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 1 +divx3459 divide 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 734496.390406706323899801641278933 Inexact Rounded +dvix3459 divideint 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 734496 +mulx3459 multiply 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 344432815169.648082754214631086270 Inexact Rounded +powx3459 power 502975804.069864536104621700404770 685 -> 3.62876716573623552761739177592677E+5960 Inexact Rounded +remx3459 remainder 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 267.346619523615915582548420925472 +subx3459 subtract 502975804.069864536104621700404770 684.790028432074527960269515227243 -> 502975119.279836104030093740135255 Inexact Rounded +addx3460 add 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> 1040125.74219736715313697451377660 Inexact Rounded +comx3460 compare 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> 1 +divx3460 divide 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> -3.23566278503319947059213001405065 Inexact Rounded +dvix3460 divideint 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> -3 +mulx3460 multiply 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> -700361636056.225618266296899048765 Inexact Rounded +powx3460 power 1505368.42063731861590460453659570 -465243 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3460 remainder 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> 109640.385317464227601714468138385 +subx3460 subtract 1505368.42063731861590460453659570 -465242.678439951462767630022819105 -> 1970611.09907727007867223455941481 Inexact Rounded +addx3461 add 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 77809073.3514961963946898136677398 Inexact Rounded +comx3461 compare 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 1 +divx3461 divide 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 8.06437785764050431295652411163382 Inexact Rounded +dvix3461 divideint 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 8 +mulx3461 multiply 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 594231065731939.137329770485497261 Inexact Rounded +powx3461 power 69225023.2850142784063416137144829 8584050 -> Infinity Overflow Inexact Rounded +remx3461 remainder 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 552622.75315893449955601408842746 +subx3461 subtract 69225023.2850142784063416137144829 8584050.06648191798834819995325693 -> 60640973.2185323604179934137612260 Inexact Rounded +addx3462 add -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -5.56695018537751006841940471339310E+624 Inexact Rounded +comx3462 compare -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -1 +divx3462 divide -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -9.06661464189378059067792554300676E+616 Inexact Rounded +dvix3462 divideint -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> NaN Division_impossible +mulx3462 multiply -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -3.41813737437080390787865389703565E+632 Inexact Rounded +powx3462 power -55669501853.7751006841940471339310E+614 61400538 -> Infinity Overflow Inexact Rounded +remx3462 remainder -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> NaN Division_impossible +subx3462 subtract -55669501853.7751006841940471339310E+614 061400538.186044693233816566977189 -> -5.56695018537751006841940471339310E+624 Inexact Rounded +addx3463 add -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> -834662.599983953345718523807123972 Inexact Rounded +comx3463 compare -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 1 +divx3463 divide -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 6.32071595497552015656909892339226E-409 Inexact Rounded +dvix3463 divideint -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 0 +mulx3463 multiply -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 4.40340044311040151960763108019957E-397 Inexact Rounded +powx3463 power -527566.521273992424649346837337602E-408 -834663 -> -Infinity Overflow Inexact Rounded +remx3463 remainder -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> -5.27566521273992424649346837337602E-403 +subx3463 subtract -527566.521273992424649346837337602E-408 -834662.599983953345718523807123972 -> 834662.599983953345718523807123972 Inexact Rounded +addx3464 add 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 69065510.0459653699418083455335366 Inexact Rounded +comx3464 compare 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 1 +divx3464 divide 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 9.93964810285396646889830919492683E+827 Inexact Rounded +dvix3464 divideint 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> NaN Division_impossible +mulx3464 multiply 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 4.79900759921241352562381181332720E-813 Inexact Rounded +powx3464 power 69065510.0459653699418083455335366 7 -> 7.49598249763416483824919118973567E+54 Inexact Rounded +remx3464 remainder 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> NaN Division_impossible +subx3464 subtract 69065510.0459653699418083455335366 694848643848212520086960886818157E-853 -> 69065510.0459653699418083455335366 Inexact Rounded +addx3465 add -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> -2921982.82411285505229122890041841 Inexact Rounded +comx3465 compare -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> -1 +divx3465 divide -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> 4.00300943792444663467732029501716E+764 Inexact Rounded +dvix3465 divideint -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> NaN Division_impossible +mulx3465 multiply -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> 2.13289120518223547921212412642411E-752 Inexact Rounded +powx3465 power -2921982.82411285505229122890041841 -7 -> -5.49865394870631248479668782154131E-46 Inexact Rounded +remx3465 remainder -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> NaN Division_impossible +subx3465 subtract -2921982.82411285505229122890041841 -72994.6523840298017471962569778803E-763 -> -2921982.82411285505229122890041841 Inexact Rounded +addx3466 add 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 3873389.71099271106554595739922987 Inexact Rounded +comx3466 compare 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> -1 +divx3466 divide 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 0.00000116465942888322776753062580106351 Inexact Rounded +dvix3466 divideint 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 0 +mulx3466 multiply 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 17473516.9087705701652062546164705 Inexact Rounded +powx3466 power 4.51117459466491451401835756593793 3873385 -> Infinity Overflow Inexact Rounded +remx3466 remainder 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> 4.51117459466491451401835756593793 +subx3466 subtract 4.51117459466491451401835756593793 3873385.19981811640063144338087230 -> -3873380.68864352173571692936251473 Inexact Rounded +addx3467 add 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 3.61713861293896216593840817950781E+411 Inexact Rounded +comx3467 compare 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> -1 +divx3467 divide 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 1.36997137177543416190811827685231E-398 Inexact Rounded +dvix3467 divideint 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 0 +mulx3467 multiply 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 1.79242831280777466554271332425735E+425 Inexact Rounded +powx3467 power 49553763474698.8118661758811091120 4 -> 6.02985091099730236635954801474802E+54 Inexact Rounded +remx3467 remainder 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> 49553763474698.8118661758811091120 +subx3467 subtract 49553763474698.8118661758811091120 36.1713861293896216593840817950781E+410 -> -3.61713861293896216593840817950781E+411 Inexact Rounded +addx3468 add 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 7.55985583344379951506071499170749E+967 Inexact Rounded +comx3468 compare 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 1 +divx3468 divide 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 1.01213580367212873025671916758669E+935 Inexact Rounded +dvix3468 divideint 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> NaN Division_impossible +mulx3468 multiply 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 5.64661580146688255286933753616580E+1000 Inexact Rounded +powx3468 power 755985583344.379951506071499170749E+956 7 -> 1.41121958516547725677142981375469E+6775 Inexact Rounded +remx3468 remainder 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> NaN Division_impossible +subx3468 subtract 755985583344.379951506071499170749E+956 746921095569971477373643487285780 -> 7.55985583344379951506071499170749E+967 Inexact Rounded +addx3469 add -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> -20497230690.0922299809209551116556 Inexact Rounded +comx3469 compare -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> -1 +divx3469 divide -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> 50.8179779735012053661447873666816 Inexact Rounded +dvix3469 divideint -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> 50 +mulx3469 multiply -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> 7951459193692715079.09328760016914 Inexact Rounded +powx3469 power -20101668541.7472260497594230105456 -395562148 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3469 remainder -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> -323561124.497029491682817955047400 +subx3469 subtract -20101668541.7472260497594230105456 -395562148.345003931161532101109964 -> -19706106393.4022221185978909094356 Inexact Rounded +addx3470 add 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 460874498597.269108074612032613370 Inexact Rounded +comx3470 compare 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> -1 +divx3470 divide 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 0.0000121160334374633240168068405467307 Inexact Rounded +dvix3470 divideint 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 0 +mulx3470 multiply 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 2573447398655758659.39475672905225 Inexact Rounded +powx3470 power 5583903.18072100716072011264668631 5 -> 5.42861943589418603298670454702901E+33 Inexact Rounded +remx3470 remainder 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> 5583903.18072100716072011264668631 +subx3470 subtract 5583903.18072100716072011264668631 460868914694.088387067451312500723 -> -460863330790.907666060290592388076 Inexact Rounded +addx3471 add -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> -5.08580148958769104511751975720470E+667 Inexact Rounded +comx3471 compare -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 1 +divx3471 divide -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 1.87903204624039476408191264564568E-615 Inexact Rounded +dvix3471 divideint -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 0 +mulx3471 multiply -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 4.86018718792967378985838739820108E+720 Inexact Rounded +powx3471 power -955638397975240685017992436116257E+020 -5 -> -1.25467730420304189161768408462414E-265 Inexact Rounded +remx3471 remainder -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> -9.55638397975240685017992436116257E+52 +subx3471 subtract -955638397975240685017992436116257E+020 -508580.148958769104511751975720470E+662 -> 5.08580148958769104511751975720470E+667 Inexact Rounded +addx3472 add -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -1.36243796098020983814115584402407E+828 Inexact Rounded +comx3472 compare -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -1 +divx3472 divide -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -2.06771226638255600634939371365920E+818 Inexact Rounded +dvix3472 divideint -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> NaN Division_impossible +mulx3472 multiply -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -8.97725098263977535966921696143011E+837 Inexact Rounded +powx3472 power -136243796098020983814115584402407E+796 7 -> -8.71399185551742199752832286984005E+5796 Inexact Rounded +remx3472 remainder -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> NaN Division_impossible +subx3472 subtract -136243796098020983814115584402407E+796 6589108083.99750311651581032447390 -> -1.36243796098020983814115584402407E+828 Inexact Rounded +addx3473 add -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -8.08498482718304598213092937543934E+526 Inexact Rounded +comx3473 compare -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -1 +divx3473 divide -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -1.68419126177106468565397017107736E+522 Inexact Rounded +dvix3473 divideint -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> NaN Division_impossible +mulx3473 multiply -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -3.88120881158362912220132691803539E+531 Inexact Rounded +powx3473 power -808498.482718304598213092937543934E+521 48005 -> -Infinity Overflow Inexact Rounded +remx3473 remainder -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> NaN Division_impossible +subx3473 subtract -808498.482718304598213092937543934E+521 48005.1465097914355096301483788905 -> -8.08498482718304598213092937543934E+526 Inexact Rounded +addx3474 add -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> -3.19563111559114001594257448970812E+989 Inexact Rounded +comx3474 compare -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 1 +divx3474 divide -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 2.54180257724779721448484781056040E-591 Inexact Rounded +dvix3474 divideint -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 0 +mulx3474 multiply -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 2.59570359202261082537505332325404E+1388 Inexact Rounded +powx3474 power -812.266340554281305985524813074211E+396 -3 -> -1.86596988030914616216741808216469E-1197 Inexact Rounded +remx3474 remainder -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> -8.12266340554281305985524813074211E+398 +subx3474 subtract -812.266340554281305985524813074211E+396 -3195.63111559114001594257448970812E+986 -> 3.19563111559114001594257448970812E+989 Inexact Rounded +addx3475 add -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> -9.29889720905183397678866648217793E+139 Inexact Rounded +comx3475 compare -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> -1 +divx3475 divide -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> 3.31747801646964399331556971055197E+128 Inexact Rounded +dvix3475 divideint -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> NaN Division_impossible +mulx3475 multiply -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> 2.60648266168558079957349074609920E+151 Inexact Rounded +powx3475 power -929889.720905183397678866648217793E+134 -3 -> -1.24367143370300189518778505830181E-420 Inexact Rounded +remx3475 remainder -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> NaN Division_impossible +subx3475 subtract -929889.720905183397678866648217793E+134 -280300190774.057595671079264841349 -> -9.29889720905183397678866648217793E+139 Inexact Rounded +addx3476 add 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 492754319.251171861122327008214092 Inexact Rounded +comx3476 compare 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> -1 +divx3476 divide 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 0.000170389819117633485695890041185782 Inexact Rounded +dvix3476 divideint 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 0 +mulx3476 multiply 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 41357714926052.9282985560380064649 Inexact Rounded +powx3476 power 83946.0157801953636255078996185540 492670373 -> Infinity Overflow Inexact Rounded +remx3476 remainder 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> 83946.0157801953636255078996185540 +subx3476 subtract 83946.0157801953636255078996185540 492670373.235391665758701500314473 -> -492586427.219611470395075992414854 Inexact Rounded +addx3477 add 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 7812758113817.99135851825223122508 Inexact Rounded +comx3477 compare 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 1 +divx3477 divide 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 2.57210790001590171809512871857381E+163 Inexact Rounded +dvix3477 divideint 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> NaN Division_impossible +mulx3477 multiply 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 2.37311931372130583136091717093935E-138 Inexact Rounded +powx3477 power 7812758113817.99135851825223122508 3 -> 4.76884421816246896090414314934253E+38 Inexact Rounded +remx3477 remainder 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> NaN Division_impossible +subx3477 subtract 7812758113817.99135851825223122508 3037492.36716301443309571918002123E-157 -> 7812758113817.99135851825223122508 Inexact Rounded +addx3478 add 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 490328689.266902084767070133475071 Inexact Rounded +comx3478 compare 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 1 +divx3478 divide 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 430.269702657525223124148258641358 Inexact Rounded +dvix3478 divideint 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 430 +mulx3478 multiply 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 556182701222751.588454129518830550 Inexact Rounded +powx3478 power 489191747.148674326757767356626016 1136942 -> Infinity Overflow Inexact Rounded +remx3478 remainder 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 306636.3107383827575733115325810 +subx3478 subtract 489191747.148674326757767356626016 01136942.1182277580093027768490545 -> 488054805.030446568748464579776962 Inexact Rounded +addx3479 add -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> -5.99369540373174482335865567937853E+297 Inexact Rounded +comx3479 compare -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> -1 +divx3479 divide -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> 1.56540833065089684132688143737586E+287 Inexact Rounded +dvix3479 divideint -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> NaN Division_impossible +mulx3479 multiply -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> 2.29488906436173641324091638963715E+308 Inexact Rounded +powx3479 power -599369540.373174482335865567937853E+289 -4 -> 7.74856580646291366270329165540958E-1192 Inexact Rounded +remx3479 remainder -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> NaN Division_impossible +subx3479 subtract -599369540.373174482335865567937853E+289 -38288383205.6749439588707955585209 -> -5.99369540373174482335865567937853E+297 Inexact Rounded +addx3480 add -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> -68624373320.5930758945974232604298 Inexact Rounded +comx3480 compare -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 1 +divx3480 divide -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 0.0517550008335747813596332404664731 Inexact Rounded +dvix3480 divideint -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 0 +mulx3480 multiply -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 220333194736887939420.719579906257 Inexact Rounded +powx3480 power -3376883870.85961692148022521960139 -7 -> -1.99704163718361153125735756179280E-67 Inexact Rounded +remx3480 remainder -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> -3376883870.85961692148022521960139 +subx3480 subtract -3376883870.85961692148022521960139 -65247489449.7334589731171980408284 -> 61870605578.8738420516369728212270 Inexact Rounded +addx3481 add 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 60.2702299236537409084931002396185 +comx3481 compare 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 1 +divx3481 divide 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 36.8450651616286048437498576613622 Inexact Rounded +dvix3481 divideint 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 36 +mulx3481 multiply 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 93.4472468622373769590900258060029 Inexact Rounded +powx3481 power 58.6776780370008364590621772421025 2 -> 3443.06989981393033632008313505230 Inexact Rounded +remx3481 remainder 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 1.3458101174962762795489493315265 +subx3481 subtract 58.6776780370008364590621772421025 01.5925518866529044494309229975160 -> 57.0851261503479320096312542445865 +addx3482 add 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 4099616630.75768235660057557396732 Inexact Rounded +comx3482 compare 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 1 +divx3482 divide 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 14097951.1289920788134209002390834 Inexact Rounded +dvix3482 divideint 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 14097951 +mulx3482 multiply 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 1192148701687.90798437501397900174 Inexact Rounded +powx3482 power 4099616339.96249499552808575717579 291 -> 2.03364757877800497409765979877258E+2797 Inexact Rounded +remx3482 remainder 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 37.510275726642959858538282144855 +subx3482 subtract 4099616339.96249499552808575717579 290.795187361072489816791525139895 -> 4099616049.16730763445559594038426 Inexact Rounded +addx3483 add 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> -2140306990376.46573014981378406578 Inexact Rounded +comx3483 compare 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> 1 +divx3483 divide 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> -0.0000401191663393971853092748263233128 Inexact Rounded +dvix3483 divideint 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> -0 +mulx3483 multiply 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> -183797198561136797328.508878254848 Inexact Rounded +powx3483 power 85870777.2282833141709970713739108 -2 -> 1.35615463448707573424578785973269E-16 Inexact Rounded +remx3483 remainder 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> 85870777.2282833141709970713739108 +subx3483 subtract 85870777.2282833141709970713739108 -2140392861153.69401346398478113715 -> 2140478731930.92229677815577820852 Inexact Rounded +addx3484 add 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> 20862.2147613905641948547078989489 Inexact Rounded +comx3484 compare 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> 1 +divx3484 divide 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> -539.315627388386430188627412639767 Inexact Rounded +dvix3484 divideint 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> -539 +mulx3484 multiply 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> -810009.016386974103738622793670566 Inexact Rounded +powx3484 power 20900.9693761555165742010339929779 -39 -> 3.26219014701526335296044439989665E-169 Inexact Rounded +remx3484 remainder 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> 12.2320178461841065312693113692685 +subx3484 subtract 20900.9693761555165742010339929779 -38.7546147649523793463260940289585 -> 20939.7239909204689535473600870069 Inexact Rounded +addx3485 add 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 379130602.210390198240885543797232 Inexact Rounded +comx3485 compare 448.827596155587910947511170319456 379130153.382794042652974596286062 -> -1 +divx3485 divide 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 0.00000118383513458615061394140895596979 Inexact Rounded +dvix3485 divideint 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 0 +mulx3485 multiply 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 170164075372.898786469094460692097 Inexact Rounded +powx3485 power 448.827596155587910947511170319456 379130153 -> Infinity Overflow Inexact Rounded +remx3485 remainder 448.827596155587910947511170319456 379130153.382794042652974596286062 -> 448.827596155587910947511170319456 +subx3485 subtract 448.827596155587910947511170319456 379130153.382794042652974596286062 -> -379129704.555197887065063648774892 Inexact Rounded +addx3486 add 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 3404725642.18381024654682525116780 Inexact Rounded +comx3486 compare 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> -1 +divx3486 divide 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 2.89049673833970863420201979291523E-8 Inexact Rounded +dvix3486 divideint 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 0 +mulx3486 multiply 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 335070891904.214504811798212040413 Inexact Rounded +powx3486 power 98.4134807921002817357000140482039 3 -> 953155.543384739667965055839894682 Inexact Rounded +remx3486 remainder 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> 98.4134807921002817357000140482039 +subx3486 subtract 98.4134807921002817357000140482039 3404725543.77032945444654351546779 -> -3404725445.35684866234626177976778 Inexact Rounded +addx3487 add 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> -5.14995709970912830072802043560650E-425 Inexact Rounded +comx3487 compare 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> 1 +divx3487 divide 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> -1.05971064046375011086850722752614E-354 Inexact Rounded +dvix3487 divideint 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> -0 +mulx3487 multiply 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> -2.81057072061345688074304873033317E-1203 Inexact Rounded +powx3487 power 545746433.649359734136476718176330E-787 -5 -> 2.06559640092667166976186801348662E+3891 Inexact Rounded +remx3487 remainder 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> 5.45746433649359734136476718176330E-779 +subx3487 subtract 545746433.649359734136476718176330E-787 -5149957099709.12830072802043560650E-437 -> 5.14995709970912830072802043560650E-425 Inexact Rounded +addx3488 add 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 741304513547.273820525801608231737 Inexact Rounded +comx3488 compare 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 1 +divx3488 divide 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 1.87090281565101612623398174727653E+839 Inexact Rounded +dvix3488 divideint 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> NaN Division_impossible +mulx3488 multiply 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 2.93725776244737788947443361076095E-816 Inexact Rounded +powx3488 power 741304513547.273820525801608231737 4 -> 3.01985838652892073903194846668712E+47 Inexact Rounded +remx3488 remainder 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> NaN Division_impossible +subx3488 subtract 741304513547.273820525801608231737 0396.22823128272584928019323186355E-830 -> 741304513547.273820525801608231737 Inexact Rounded +addx3489 add -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> 4033.67985686310526747345220908179 Inexact Rounded +comx3489 compare -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -1 +divx3489 divide -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -0.148981244172527671907534117771626 Inexact Rounded +dvix3489 divideint -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -0 +mulx3489 multiply -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -3347003.65129295988793454267973464 Inexact Rounded +powx3489 power -706.145005094292315613907254240553 4740 -> Infinity Overflow Inexact Rounded +remx3489 remainder -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -706.145005094292315613907254240553 +subx3489 subtract -706.145005094292315613907254240553 4739.82486195739758308735946332234 -> -5445.96986705168989870126671756289 Inexact Rounded +addx3490 add -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> -769956988.821146059252782194757952 Inexact Rounded +comx3490 compare -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> -1 +divx3490 divide -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> 24675.5283319978698932292028650803 Inexact Rounded +dvix3490 divideint -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> 24675 +mulx3490 multiply -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> 24023222896770.8161787236737395477 Inexact Rounded +powx3490 power -769925786.823099083228795187975893 -31202 -> 0E-10031 Underflow Subnormal Inexact Rounded Clamped +remx3490 remainder -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> -16485.0139656913494028406582486750 +subx3490 subtract -769925786.823099083228795187975893 -31201.9980469760239870067820594790 -> -769894584.825052107204808181193834 Inexact Rounded +addx3491 add 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 8.44386105460497256507419289692857E+919 Inexact Rounded +comx3491 compare 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 1 +divx3491 divide 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 1.60516736512701978695559003341922E+888 Inexact Rounded +dvix3491 divideint 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> NaN Division_impossible +mulx3491 multiply 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 4.44182899917309231779837668210610E+951 Inexact Rounded +powx3491 power 84438610546049.7256507419289692857E+906 5 -> 4.29245144719689283247342866988213E+4599 Inexact Rounded +remx3491 remainder 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> NaN Division_impossible +subx3491 subtract 84438610546049.7256507419289692857E+906 052604240766736461898844111790311 -> 8.44386105460497256507419289692857E+919 Inexact Rounded +addx3492 add 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 549926.071394341400088797374170467 Inexact Rounded +comx3492 compare 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 1 +divx3492 divide 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 3328.65471667062107598395714348089 Inexact Rounded +dvix3492 divideint 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 3328 +mulx3492 multiply 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 90798561.3782451425861113694732484 Inexact Rounded +powx3492 power 549760.911304725795164589619286514 165 -> 1.34488925442386544028875603347654E+947 Inexact Rounded +remx3492 remainder 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 108.133063992607401181365489319248 +subx3492 subtract 549760.911304725795164589619286514 165.160089615604924207754883953484 -> 549595.751215110190240381864402561 Inexact Rounded +addx3493 add 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 11737235.5901860743933857728701908 Inexact Rounded +comx3493 compare 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> -1 +divx3493 divide 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 0.451420792712387250865423208234291 Inexact Rounded +dvix3493 divideint 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 0 +mulx3493 multiply 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 29520691206417.5831886752808745421 Inexact Rounded +powx3493 power 3650514.18649737956855828939662794 8086721 -> Infinity Overflow Inexact Rounded +remx3493 remainder 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> 3650514.18649737956855828939662794 +subx3493 subtract 3650514.18649737956855828939662794 08086721.4036886948248274834735629 -> -4436207.21719131525626919407693496 +addx3494 add 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> 55067723881941.2298810010885806451 Inexact Rounded +comx3494 compare 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> 1 +divx3494 divide 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> -6184039198391.19853088419484117054 Inexact Rounded +dvix3494 divideint 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> -6184039198391 +mulx3494 multiply 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> -490367883555396.250365158593373279 Inexact Rounded +powx3494 power 55067723881950.1346958179604099594 -9 -> 2.14746386538529270173788457887121E-124 Inexact Rounded +remx3494 remainder 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> 1.76788075918488693086347720461547 +subx3494 subtract 55067723881950.1346958179604099594 -8.90481481687182931431054785192083 -> 55067723881959.0395106348322392737 Inexact Rounded +addx3495 add 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 5.57966504537858308541154858567656E+140 Inexact Rounded +comx3495 compare 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> -1 +divx3495 divide 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 1.55609900657590706155251902725027E-113 Inexact Rounded +dvix3495 divideint 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 0 +mulx3495 multiply 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 4.84455044392374106106966779322483E+168 Inexact Rounded +powx3495 power 868251123.413992653362860637541060E+019 6 -> 4.28422354304291884802690733853227E+167 Inexact Rounded +remx3495 remainder 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> 8682511234139926533628606375.41060 +subx3495 subtract 868251123.413992653362860637541060E+019 5579665045.37858308541154858567656E+131 -> -5.57966504537858308541154858567656E+140 Inexact Rounded +addx3496 add -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> -646.464431574014407536004990059069 Inexact Rounded +comx3496 compare -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> -1 +divx3496 divide -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> 8.09416521887063886613527228353543E+36 Inexact Rounded +dvix3496 divideint -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> NaN Division_impossible +mulx3496 multiply -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> 5.16317927778381197995451363439626E-32 Inexact Rounded +powx3496 power -646.464431574014407536004990059069 -8 -> 3.27825641569860861774700548035691E-23 Inexact Rounded +remx3496 remainder -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> NaN Division_impossible +subx3496 subtract -646.464431574014407536004990059069 -798.679560020414523841321724649594E-037 -> -646.464431574014407536004990059069 Inexact Rounded +addx3497 add 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> 354.546679975219753598558273421556 Inexact Rounded +comx3497 compare 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> 1 +divx3497 divide 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> -5.03655799102477192579414523352028E+446 Inexact Rounded +dvix3497 divideint 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> NaN Division_impossible +mulx3497 multiply 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> -2.49581854324831161267369292071408E-442 Inexact Rounded +powx3497 power 354.546679975219753598558273421556 -7 -> 1.41999246365875617298270414304233E-18 Inexact Rounded +remx3497 remainder 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> NaN Division_impossible +subx3497 subtract 354.546679975219753598558273421556 -7039.46386812239015144581761752927E-448 -> 354.546679975219753598558273421556 Inexact Rounded +addx3498 add 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> 91936087917435.5974889495278215874 Inexact Rounded +comx3498 compare 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> 1 +divx3498 divide 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> -1.37052712434303366569304688993783E+760 Inexact Rounded +dvix3498 divideint 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> NaN Division_impossible +mulx3498 multiply 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> -6.16714847260980448099292763939423E-733 Inexact Rounded +powx3498 power 91936087917435.5974889495278215874 -7 -> 1.80134899939035708719659065082630E-98 Inexact Rounded +remx3498 remainder 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> NaN Division_impossible +subx3498 subtract 91936087917435.5974889495278215874 -67080823344.8903392584327136082486E-757 -> 91936087917435.5974889495278215874 Inexact Rounded +addx3499 add -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -7.34564225185285561365214172598110E-597 Inexact Rounded +comx3499 compare -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -1 +divx3499 divide -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -1.78342822299163842247184303878022E+159 Inexact Rounded +dvix3499 divideint -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> NaN Division_impossible +mulx3499 multiply -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -3.02554705575380338274126867655676E-1352 Inexact Rounded +powx3499 power -07345.6422518528556136521417259811E-600 4 -> 2.91151541552217582082937236255996E-2385 Inexact Rounded +remx3499 remainder -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> NaN Division_impossible +subx3499 subtract -07345.6422518528556136521417259811E-600 41188325.7041362608934957584583381E-763 -> -7.34564225185285561365214172598110E-597 Inexact Rounded +addx3500 add -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> 6.16988426425908872398170896375634E+401 Inexact Rounded +comx3500 compare -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -1 +divx3500 divide -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -4.10511306357337753351655511866170E-394 Inexact Rounded +dvix3500 divideint -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -0 +mulx3500 multiply -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -1.56271275924409657991913620522315E+410 Inexact Rounded +powx3500 power -253280724.939458021588167965038184 6 -> 2.64005420221406808782284459794424E+50 Inexact Rounded +remx3500 remainder -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -253280724.939458021588167965038184 +subx3500 subtract -253280724.939458021588167965038184 616988.426425908872398170896375634E+396 -> -6.16988426425908872398170896375634E+401 Inexact Rounded Added: sandbox/trunk/decimal-c/new_dt/randoms.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/randoms.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,4030 @@ +------------------------------------------------------------------------ +-- randoms.decTest -- decimal random testcases -- +-- Copyright (c) IBM Corporation, 1981, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +extended: 1 +maxexponent: 999999999 +minexponent: -999999999 +precision: 9 +rounding: half_up + +-- Randomly generated testcases [31 Dec 2000, with results defined for +-- all cases [27 Oct 2001], and no trim/finish [9 Jun 2002] +xadd001 add 905.67402 -202896611.E-780472620 -> 905.674020 Inexact Rounded +xcom001 compare 905.67402 -202896611.E-780472620 -> 1 +xdiv001 divide 905.67402 -202896611.E-780472620 -> -4.46372177E+780472614 Inexact Rounded +xdvi001 divideint 905.67402 -202896611.E-780472620 -> NaN Division_impossible +xmul001 multiply 905.67402 -202896611.E-780472620 -> -1.83758189E-780472609 Inexact Rounded +xpow001 power 905.67402 -2 -> 0.00000121914730 Inexact Rounded +xrem001 remainder 905.67402 -202896611.E-780472620 -> NaN Division_impossible +xsub001 subtract 905.67402 -202896611.E-780472620 -> 905.674020 Inexact Rounded +xadd002 add 3915134.7 -597164907. -> -593249772 Inexact Rounded +xcom002 compare 3915134.7 -597164907. -> 1 +xdiv002 divide 3915134.7 -597164907. -> -0.00655620358 Inexact Rounded +xdvi002 divideint 3915134.7 -597164907. -> -0 +xmul002 multiply 3915134.7 -597164907. -> -2.33798105E+15 Inexact Rounded +xpow002 power 3915134.7 -597164907 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem002 remainder 3915134.7 -597164907. -> 3915134.7 +xsub002 subtract 3915134.7 -597164907. -> 601080042 Inexact Rounded +xadd003 add 309759261 62663.487 -> 309821924 Inexact Rounded +xcom003 compare 309759261 62663.487 -> 1 +xdiv003 divide 309759261 62663.487 -> 4943.21775 Inexact Rounded +xdvi003 divideint 309759261 62663.487 -> 4943 +xmul003 multiply 309759261 62663.487 -> 1.94105954E+13 Inexact Rounded +xpow003 power 309759261 62663 -> 1.13679199E+532073 Inexact Rounded +xrem003 remainder 309759261 62663.487 -> 13644.759 +xsub003 subtract 309759261 62663.487 -> 309696598 Inexact Rounded +xadd004 add 3.93591888E-236595626 7242375.00 -> 7242375.00 Inexact Rounded +xcom004 compare 3.93591888E-236595626 7242375.00 -> -1 +xdiv004 divide 3.93591888E-236595626 7242375.00 -> 5.43456930E-236595633 Inexact Rounded +xdvi004 divideint 3.93591888E-236595626 7242375.00 -> 0 +xmul004 multiply 3.93591888E-236595626 7242375.00 -> 2.85054005E-236595619 Inexact Rounded +xpow004 power 3.93591888E-236595626 7242375 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem004 remainder 3.93591888E-236595626 7242375.00 -> 3.93591888E-236595626 +xsub004 subtract 3.93591888E-236595626 7242375.00 -> -7242375.00 Inexact Rounded +xadd005 add 323902.714 -608669.607E-657060568 -> 323902.714 Inexact Rounded +xcom005 compare 323902.714 -608669.607E-657060568 -> 1 +xdiv005 divide 323902.714 -608669.607E-657060568 -> -5.32148657E+657060567 Inexact Rounded +xdvi005 divideint 323902.714 -608669.607E-657060568 -> NaN Division_impossible +xmul005 multiply 323902.714 -608669.607E-657060568 -> -1.97149738E-657060557 Inexact Rounded +xpow005 power 323902.714 -6 -> 8.65989204E-34 Inexact Rounded +xrem005 remainder 323902.714 -608669.607E-657060568 -> NaN Division_impossible +xsub005 subtract 323902.714 -608669.607E-657060568 -> 323902.714 Inexact Rounded +xadd006 add 5.11970092 -8807.22036 -> -8802.10066 Inexact Rounded +xcom006 compare 5.11970092 -8807.22036 -> 1 +xdiv006 divide 5.11970092 -8807.22036 -> -0.000581307236 Inexact Rounded +xdvi006 divideint 5.11970092 -8807.22036 -> -0 +xmul006 multiply 5.11970092 -8807.22036 -> -45090.3342 Inexact Rounded +xpow006 power 5.11970092 -8807 -> 4.81819262E-6247 Inexact Rounded +xrem006 remainder 5.11970092 -8807.22036 -> 5.11970092 +xsub006 subtract 5.11970092 -8807.22036 -> 8812.34006 Inexact Rounded +xadd007 add -7.99874516 4561.83758 -> 4553.83883 Inexact Rounded +xcom007 compare -7.99874516 4561.83758 -> -1 +xdiv007 divide -7.99874516 4561.83758 -> -0.00175340420 Inexact Rounded +xdvi007 divideint -7.99874516 4561.83758 -> -0 +xmul007 multiply -7.99874516 4561.83758 -> -36488.9763 Inexact Rounded +xpow007 power -7.99874516 4562 -> 3.85236199E+4119 Inexact Rounded +xrem007 remainder -7.99874516 4561.83758 -> -7.99874516 +xsub007 subtract -7.99874516 4561.83758 -> -4569.83633 Inexact Rounded +xadd008 add 297802878 -927206.324 -> 296875672 Inexact Rounded +xcom008 compare 297802878 -927206.324 -> 1 +xdiv008 divide 297802878 -927206.324 -> -321.182967 Inexact Rounded +xdvi008 divideint 297802878 -927206.324 -> -321 +xmul008 multiply 297802878 -927206.324 -> -2.76124712E+14 Inexact Rounded +xpow008 power 297802878 -927206 -> 1.94602810E-7857078 Inexact Rounded +xrem008 remainder 297802878 -927206.324 -> 169647.996 +xsub008 subtract 297802878 -927206.324 -> 298730084 Inexact Rounded +xadd009 add -766.651824 31300.3619 -> 30533.7101 Inexact Rounded +xcom009 compare -766.651824 31300.3619 -> -1 +xdiv009 divide -766.651824 31300.3619 -> -0.0244933853 Inexact Rounded +xdvi009 divideint -766.651824 31300.3619 -> -0 +xmul009 multiply -766.651824 31300.3619 -> -23996479.5 Inexact Rounded +xpow009 power -766.651824 31300 -> 8.37189011E+90287 Inexact Rounded +xrem009 remainder -766.651824 31300.3619 -> -766.651824 +xsub009 subtract -766.651824 31300.3619 -> -32067.0137 Inexact Rounded +xadd010 add -56746.8689E+934981942 471002521. -> -5.67468689E+934981946 Inexact Rounded +xcom010 compare -56746.8689E+934981942 471002521. -> -1 +xdiv010 divide -56746.8689E+934981942 471002521. -> -1.20481030E+934981938 Inexact Rounded +xdvi010 divideint -56746.8689E+934981942 471002521. -> NaN Division_impossible +xmul010 multiply -56746.8689E+934981942 471002521. -> -2.67279183E+934981955 Inexact Rounded +xpow010 power -56746.8689E+934981942 471002521 -> -Infinity Overflow Inexact Rounded +xrem010 remainder -56746.8689E+934981942 471002521. -> NaN Division_impossible +xsub010 subtract -56746.8689E+934981942 471002521. -> -5.67468689E+934981946 Inexact Rounded +xadd011 add 456417160 -41346.1024 -> 456375814 Inexact Rounded +xcom011 compare 456417160 -41346.1024 -> 1 +xdiv011 divide 456417160 -41346.1024 -> -11038.9404 Inexact Rounded +xdvi011 divideint 456417160 -41346.1024 -> -11038 +xmul011 multiply 456417160 -41346.1024 -> -1.88710706E+13 Inexact Rounded +xpow011 power 456417160 -41346 -> 1.04766863E-358030 Inexact Rounded +xrem011 remainder 456417160 -41346.1024 -> 38881.7088 +xsub011 subtract 456417160 -41346.1024 -> 456458506 Inexact Rounded +xadd012 add 102895.722 -2.62214826 -> 102893.100 Inexact Rounded +xcom012 compare 102895.722 -2.62214826 -> 1 +xdiv012 divide 102895.722 -2.62214826 -> -39241.0008 Inexact Rounded +xdvi012 divideint 102895.722 -2.62214826 -> -39241 +xmul012 multiply 102895.722 -2.62214826 -> -269807.838 Inexact Rounded +xpow012 power 102895.722 -3 -> 9.17926786E-16 Inexact Rounded +xrem012 remainder 102895.722 -2.62214826 -> 0.00212934 +xsub012 subtract 102895.722 -2.62214826 -> 102898.344 Inexact Rounded +xadd013 add 61.3033331E+157644141 -567740.918E-893439456 -> 6.13033331E+157644142 Inexact Rounded +xcom013 compare 61.3033331E+157644141 -567740.918E-893439456 -> 1 +xdiv013 divide 61.3033331E+157644141 -567740.918E-893439456 -> -Infinity Inexact Overflow Rounded +xdvi013 divideint 61.3033331E+157644141 -567740.918E-893439456 -> NaN Division_impossible +xmul013 multiply 61.3033331E+157644141 -567740.918E-893439456 -> -3.48044106E-735795308 Inexact Rounded +xpow013 power 61.3033331E+157644141 -6 -> 1.88406322E-945864857 Inexact Rounded +xrem013 remainder 61.3033331E+157644141 -567740.918E-893439456 -> NaN Division_impossible +xsub013 subtract 61.3033331E+157644141 -567740.918E-893439456 -> 6.13033331E+157644142 Inexact Rounded +xadd014 add 80223.3897 73921.0383E-467772675 -> 80223.3897 Inexact Rounded +xcom014 compare 80223.3897 73921.0383E-467772675 -> 1 +xdiv014 divide 80223.3897 73921.0383E-467772675 -> 1.08525789E+467772675 Inexact Rounded +xdvi014 divideint 80223.3897 73921.0383E-467772675 -> NaN Division_impossible +xmul014 multiply 80223.3897 73921.0383E-467772675 -> 5.93019626E-467772666 Inexact Rounded +xpow014 power 80223.3897 7 -> 2.13848919E+34 Inexact Rounded +xrem014 remainder 80223.3897 73921.0383E-467772675 -> NaN Division_impossible +xsub014 subtract 80223.3897 73921.0383E-467772675 -> 80223.3897 Inexact Rounded +xadd015 add -654645.954 -9.12535752 -> -654655.079 Inexact Rounded +xcom015 compare -654645.954 -9.12535752 -> -1 +xdiv015 divide -654645.954 -9.12535752 -> 71739.2116 Inexact Rounded +xdvi015 divideint -654645.954 -9.12535752 -> 71739 +xmul015 multiply -654645.954 -9.12535752 -> 5973878.38 Inexact Rounded +xpow015 power -654645.954 -9 -> -4.52836690E-53 Inexact Rounded +xrem015 remainder -654645.954 -9.12535752 -> -1.93087272 +xsub015 subtract -654645.954 -9.12535752 -> -654636.829 Inexact Rounded +xadd016 add 63.1917772E-706014634 -7.56253257E-138579234 -> -7.56253257E-138579234 Inexact Rounded +xcom016 compare 63.1917772E-706014634 -7.56253257E-138579234 -> 1 +xdiv016 divide 63.1917772E-706014634 -7.56253257E-138579234 -> -8.35590149E-567435400 Inexact Rounded +xdvi016 divideint 63.1917772E-706014634 -7.56253257E-138579234 -> -0 +xmul016 multiply 63.1917772E-706014634 -7.56253257E-138579234 -> -4.77889873E-844593866 Inexact Rounded +xpow016 power 63.1917772E-706014634 -8 -> Infinity Overflow Inexact Rounded +xrem016 remainder 63.1917772E-706014634 -7.56253257E-138579234 -> 6.31917772E-706014633 +xsub016 subtract 63.1917772E-706014634 -7.56253257E-138579234 -> 7.56253257E-138579234 Inexact Rounded +xadd017 add -39674.7190 2490607.78 -> 2450933.06 Inexact Rounded +xcom017 compare -39674.7190 2490607.78 -> -1 +xdiv017 divide -39674.7190 2490607.78 -> -0.0159297338 Inexact Rounded +xdvi017 divideint -39674.7190 2490607.78 -> -0 +xmul017 multiply -39674.7190 2490607.78 -> -9.88141638E+10 Inexact Rounded +xpow017 power -39674.7190 2490608 -> 2.55032329E+11453095 Inexact Rounded +xrem017 remainder -39674.7190 2490607.78 -> -39674.7190 +xsub017 subtract -39674.7190 2490607.78 -> -2530282.50 Inexact Rounded +xadd018 add -3364.59737E-600363681 896487.451 -> 896487.451 Inexact Rounded +xcom018 compare -3364.59737E-600363681 896487.451 -> -1 +xdiv018 divide -3364.59737E-600363681 896487.451 -> -3.75308920E-600363684 Inexact Rounded +xdvi018 divideint -3364.59737E-600363681 896487.451 -> -0 +xmul018 multiply -3364.59737E-600363681 896487.451 -> -3.01631932E-600363672 Inexact Rounded +xpow018 power -3364.59737E-600363681 896487 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem018 remainder -3364.59737E-600363681 896487.451 -> -3.36459737E-600363678 +xsub018 subtract -3364.59737E-600363681 896487.451 -> -896487.451 Inexact Rounded +xadd019 add -64138.0578 31759011.3E+697488342 -> 3.17590113E+697488349 Inexact Rounded +xcom019 compare -64138.0578 31759011.3E+697488342 -> -1 +xdiv019 divide -64138.0578 31759011.3E+697488342 -> -2.01952313E-697488345 Inexact Rounded +xdvi019 divideint -64138.0578 31759011.3E+697488342 -> -0 +xmul019 multiply -64138.0578 31759011.3E+697488342 -> -2.03696130E+697488354 Inexact Rounded +xpow019 power -64138.0578 3 -> -2.63844116E+14 Inexact Rounded +xrem019 remainder -64138.0578 31759011.3E+697488342 -> -64138.0578 +xsub019 subtract -64138.0578 31759011.3E+697488342 -> -3.17590113E+697488349 Inexact Rounded +xadd020 add 61399.8527 -64344484.5 -> -64283084.6 Inexact Rounded +xcom020 compare 61399.8527 -64344484.5 -> 1 +xdiv020 divide 61399.8527 -64344484.5 -> -0.000954236454 Inexact Rounded +xdvi020 divideint 61399.8527 -64344484.5 -> -0 +xmul020 multiply 61399.8527 -64344484.5 -> -3.95074187E+12 Inexact Rounded +xpow020 power 61399.8527 -64344485 -> 1.27378842E-308092161 Inexact Rounded +xrem020 remainder 61399.8527 -64344484.5 -> 61399.8527 +xsub020 subtract 61399.8527 -64344484.5 -> 64405884.4 Inexact Rounded +xadd021 add -722960.204 -26154599.8 -> -26877560.0 Inexact Rounded +xcom021 compare -722960.204 -26154599.8 -> 1 +xdiv021 divide -722960.204 -26154599.8 -> 0.0276417995 Inexact Rounded +xdvi021 divideint -722960.204 -26154599.8 -> 0 +xmul021 multiply -722960.204 -26154599.8 -> 1.89087348E+13 Inexact Rounded +xpow021 power -722960.204 -26154600 -> 5.34236139E-153242794 Inexact Rounded +xrem021 remainder -722960.204 -26154599.8 -> -722960.204 +xsub021 subtract -722960.204 -26154599.8 -> 25431639.6 Inexact Rounded +xadd022 add 9.47109959E+230565093 73354723.2 -> 9.47109959E+230565093 Inexact Rounded +xcom022 compare 9.47109959E+230565093 73354723.2 -> 1 +xdiv022 divide 9.47109959E+230565093 73354723.2 -> 1.29113698E+230565086 Inexact Rounded +xdvi022 divideint 9.47109959E+230565093 73354723.2 -> NaN Division_impossible +xmul022 multiply 9.47109959E+230565093 73354723.2 -> 6.94749889E+230565101 Inexact Rounded +xpow022 power 9.47109959E+230565093 73354723 -> Infinity Overflow Inexact Rounded +xrem022 remainder 9.47109959E+230565093 73354723.2 -> NaN Division_impossible +xsub022 subtract 9.47109959E+230565093 73354723.2 -> 9.47109959E+230565093 Inexact Rounded +xadd023 add 43.7456245 547441956. -> 547442000 Inexact Rounded +xcom023 compare 43.7456245 547441956. -> -1 +xdiv023 divide 43.7456245 547441956. -> 7.99091557E-8 Inexact Rounded +xdvi023 divideint 43.7456245 547441956. -> 0 +xmul023 multiply 43.7456245 547441956. -> 2.39481902E+10 Inexact Rounded +xpow023 power 43.7456245 547441956 -> 2.91742391E+898316458 Inexact Rounded +xrem023 remainder 43.7456245 547441956. -> 43.7456245 +xsub023 subtract 43.7456245 547441956. -> -547441912 Inexact Rounded +xadd024 add -73150542E-242017390 -8.15869954 -> -8.15869954 Inexact Rounded +xcom024 compare -73150542E-242017390 -8.15869954 -> 1 +xdiv024 divide -73150542E-242017390 -8.15869954 -> 8.96595611E-242017384 Inexact Rounded +xdvi024 divideint -73150542E-242017390 -8.15869954 -> 0 +xmul024 multiply -73150542E-242017390 -8.15869954 -> 5.96813293E-242017382 Inexact Rounded +xpow024 power -73150542E-242017390 -8 -> Infinity Overflow Inexact Rounded +xrem024 remainder -73150542E-242017390 -8.15869954 -> -7.3150542E-242017383 +xsub024 subtract -73150542E-242017390 -8.15869954 -> 8.15869954 Inexact Rounded +xadd025 add 2015.62109E+299897596 -11788916.1 -> 2.01562109E+299897599 Inexact Rounded +xcom025 compare 2015.62109E+299897596 -11788916.1 -> 1 +xdiv025 divide 2015.62109E+299897596 -11788916.1 -> -1.70975947E+299897592 Inexact Rounded +xdvi025 divideint 2015.62109E+299897596 -11788916.1 -> NaN Division_impossible +xmul025 multiply 2015.62109E+299897596 -11788916.1 -> -2.37619879E+299897606 Inexact Rounded +xpow025 power 2015.62109E+299897596 -11788916 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem025 remainder 2015.62109E+299897596 -11788916.1 -> NaN Division_impossible +xsub025 subtract 2015.62109E+299897596 -11788916.1 -> 2.01562109E+299897599 Inexact Rounded +xadd026 add 29.498114 -26486451 -> -26486421.5 Inexact Rounded +xcom026 compare 29.498114 -26486451 -> 1 +xdiv026 divide 29.498114 -26486451 -> -0.00000111370580 Inexact Rounded +xdvi026 divideint 29.498114 -26486451 -> -0 +xmul026 multiply 29.498114 -26486451 -> -781300351 Inexact Rounded +xpow026 power 29.498114 -26486451 -> 4.22252513E-38929634 Inexact Rounded +xrem026 remainder 29.498114 -26486451 -> 29.498114 +xsub026 subtract 29.498114 -26486451 -> 26486480.5 Inexact Rounded +xadd027 add 244375043.E+130840878 -9.44522029 -> 2.44375043E+130840886 Inexact Rounded +xcom027 compare 244375043.E+130840878 -9.44522029 -> 1 +xdiv027 divide 244375043.E+130840878 -9.44522029 -> -2.58728791E+130840885 Inexact Rounded +xdvi027 divideint 244375043.E+130840878 -9.44522029 -> NaN Division_impossible +xmul027 multiply 244375043.E+130840878 -9.44522029 -> -2.30817611E+130840887 Inexact Rounded +xpow027 power 244375043.E+130840878 -9 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem027 remainder 244375043.E+130840878 -9.44522029 -> NaN Division_impossible +xsub027 subtract 244375043.E+130840878 -9.44522029 -> 2.44375043E+130840886 Inexact Rounded +xadd028 add -349388.759 -196215.776 -> -545604.535 +xcom028 compare -349388.759 -196215.776 -> -1 +xdiv028 divide -349388.759 -196215.776 -> 1.78063541 Inexact Rounded +xdvi028 divideint -349388.759 -196215.776 -> 1 +xmul028 multiply -349388.759 -196215.776 -> 6.85555865E+10 Inexact Rounded +xpow028 power -349388.759 -196216 -> 1.24551752E-1087686 Inexact Rounded +xrem028 remainder -349388.759 -196215.776 -> -153172.983 +xsub028 subtract -349388.759 -196215.776 -> -153172.983 +xadd029 add -70905112.4 -91353968.8 -> -162259081 Inexact Rounded +xcom029 compare -70905112.4 -91353968.8 -> 1 +xdiv029 divide -70905112.4 -91353968.8 -> 0.776157986 Inexact Rounded +xdvi029 divideint -70905112.4 -91353968.8 -> 0 +xmul029 multiply -70905112.4 -91353968.8 -> 6.47746343E+15 Inexact Rounded +xpow029 power -70905112.4 -91353969 -> -3.05944741E-717190554 Inexact Rounded +xrem029 remainder -70905112.4 -91353968.8 -> -70905112.4 +xsub029 subtract -70905112.4 -91353968.8 -> 20448856.4 +xadd030 add -225094.28 -88.7723542 -> -225183.052 Inexact Rounded +xcom030 compare -225094.28 -88.7723542 -> -1 +xdiv030 divide -225094.28 -88.7723542 -> 2535.63491 Inexact Rounded +xdvi030 divideint -225094.28 -88.7723542 -> 2535 +xmul030 multiply -225094.28 -88.7723542 -> 19982149.2 Inexact Rounded +xpow030 power -225094.28 -89 -> -4.36076965E-477 Inexact Rounded +xrem030 remainder -225094.28 -88.7723542 -> -56.3621030 +xsub030 subtract -225094.28 -88.7723542 -> -225005.508 Inexact Rounded +xadd031 add 50.4442340 82.7952169E+880120759 -> 8.27952169E+880120760 Inexact Rounded +xcom031 compare 50.4442340 82.7952169E+880120759 -> -1 +xdiv031 divide 50.4442340 82.7952169E+880120759 -> 6.09265075E-880120760 Inexact Rounded +xdvi031 divideint 50.4442340 82.7952169E+880120759 -> 0 +xmul031 multiply 50.4442340 82.7952169E+880120759 -> 4.17654130E+880120762 Inexact Rounded +xpow031 power 50.4442340 8 -> 4.19268518E+13 Inexact Rounded +xrem031 remainder 50.4442340 82.7952169E+880120759 -> 50.4442340 +xsub031 subtract 50.4442340 82.7952169E+880120759 -> -8.27952169E+880120760 Inexact Rounded +xadd032 add -32311.9037 8.36379449 -> -32303.5399 Inexact Rounded +xcom032 compare -32311.9037 8.36379449 -> -1 +xdiv032 divide -32311.9037 8.36379449 -> -3863.30675 Inexact Rounded +xdvi032 divideint -32311.9037 8.36379449 -> -3863 +xmul032 multiply -32311.9037 8.36379449 -> -270250.122 Inexact Rounded +xpow032 power -32311.9037 8 -> 1.18822960E+36 Inexact Rounded +xrem032 remainder -32311.9037 8.36379449 -> -2.56558513 +xsub032 subtract -32311.9037 8.36379449 -> -32320.2675 Inexact Rounded +xadd033 add 615396156.E+549895291 -29530247.4 -> 6.15396156E+549895299 Inexact Rounded +xcom033 compare 615396156.E+549895291 -29530247.4 -> 1 +xdiv033 divide 615396156.E+549895291 -29530247.4 -> -2.08395191E+549895292 Inexact Rounded +xdvi033 divideint 615396156.E+549895291 -29530247.4 -> NaN Division_impossible +xmul033 multiply 615396156.E+549895291 -29530247.4 -> -1.81728007E+549895307 Inexact Rounded +xpow033 power 615396156.E+549895291 -29530247 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem033 remainder 615396156.E+549895291 -29530247.4 -> NaN Division_impossible +xsub033 subtract 615396156.E+549895291 -29530247.4 -> 6.15396156E+549895299 Inexact Rounded +xadd034 add 592.142173E-419941416 -3.46079109E-844011845 -> 5.92142173E-419941414 Inexact Rounded +xcom034 compare 592.142173E-419941416 -3.46079109E-844011845 -> 1 +xdiv034 divide 592.142173E-419941416 -3.46079109E-844011845 -> -1.71100236E+424070431 Inexact Rounded +xdvi034 divideint 592.142173E-419941416 -3.46079109E-844011845 -> NaN Division_impossible +xmul034 multiply 592.142173E-419941416 -3.46079109E-844011845 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow034 power 592.142173E-419941416 -3 -> Infinity Overflow Inexact Rounded +xrem034 remainder 592.142173E-419941416 -3.46079109E-844011845 -> NaN Division_impossible +xsub034 subtract 592.142173E-419941416 -3.46079109E-844011845 -> 5.92142173E-419941414 Inexact Rounded +xadd035 add 849.515993E-878446473 -1039.08778 -> -1039.08778 Inexact Rounded +xcom035 compare 849.515993E-878446473 -1039.08778 -> 1 +xdiv035 divide 849.515993E-878446473 -1039.08778 -> -8.17559411E-878446474 Inexact Rounded +xdvi035 divideint 849.515993E-878446473 -1039.08778 -> -0 +xmul035 multiply 849.515993E-878446473 -1039.08778 -> -8.82721687E-878446468 Inexact Rounded +xpow035 power 849.515993E-878446473 -1039 -> Infinity Overflow Inexact Rounded +xrem035 remainder 849.515993E-878446473 -1039.08778 -> 8.49515993E-878446471 +xsub035 subtract 849.515993E-878446473 -1039.08778 -> 1039.08778 Inexact Rounded +xadd036 add 213361789 -599.644851 -> 213361189 Inexact Rounded +xcom036 compare 213361789 -599.644851 -> 1 +xdiv036 divide 213361789 -599.644851 -> -355813.593 Inexact Rounded +xdvi036 divideint 213361789 -599.644851 -> -355813 +xmul036 multiply 213361789 -599.644851 -> -1.27941298E+11 Inexact Rounded +xpow036 power 213361789 -600 -> 3.38854684E-4998 Inexact Rounded +xrem036 remainder 213361789 -599.644851 -> 355.631137 +xsub036 subtract 213361789 -599.644851 -> 213362389 Inexact Rounded +xadd037 add -795522555. -298.037702 -> -795522853 Inexact Rounded +xcom037 compare -795522555. -298.037702 -> -1 +xdiv037 divide -795522555. -298.037702 -> 2669201.08 Inexact Rounded +xdvi037 divideint -795522555. -298.037702 -> 2669201 +xmul037 multiply -795522555. -298.037702 -> 2.37095714E+11 Inexact Rounded +xpow037 power -795522555. -298 -> 4.03232712E-2653 Inexact Rounded +xrem037 remainder -795522555. -298.037702 -> -22.783898 +xsub037 subtract -795522555. -298.037702 -> -795522257 Inexact Rounded +xadd038 add -501260651. -8761893.0E-689281479 -> -501260651 Inexact Rounded +xcom038 compare -501260651. -8761893.0E-689281479 -> -1 +xdiv038 divide -501260651. -8761893.0E-689281479 -> 5.72091728E+689281480 Inexact Rounded +xdvi038 divideint -501260651. -8761893.0E-689281479 -> NaN Division_impossible +xmul038 multiply -501260651. -8761893.0E-689281479 -> 4.39199219E-689281464 Inexact Rounded +xpow038 power -501260651. -9 -> -5.00526961E-79 Inexact Rounded +xrem038 remainder -501260651. -8761893.0E-689281479 -> NaN Division_impossible +xsub038 subtract -501260651. -8761893.0E-689281479 -> -501260651 Inexact Rounded +xadd039 add -1.70781105E-848889023 36504769.4 -> 36504769.4 Inexact Rounded +xcom039 compare -1.70781105E-848889023 36504769.4 -> -1 +xdiv039 divide -1.70781105E-848889023 36504769.4 -> -4.67832307E-848889031 Inexact Rounded +xdvi039 divideint -1.70781105E-848889023 36504769.4 -> -0 +xmul039 multiply -1.70781105E-848889023 36504769.4 -> -6.23432486E-848889016 Inexact Rounded +xpow039 power -1.70781105E-848889023 36504769 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem039 remainder -1.70781105E-848889023 36504769.4 -> -1.70781105E-848889023 +xsub039 subtract -1.70781105E-848889023 36504769.4 -> -36504769.4 Inexact Rounded +xadd040 add -5290.54984E-490626676 842535254 -> 842535254 Inexact Rounded +xcom040 compare -5290.54984E-490626676 842535254 -> -1 +xdiv040 divide -5290.54984E-490626676 842535254 -> -6.27932162E-490626682 Inexact Rounded +xdvi040 divideint -5290.54984E-490626676 842535254 -> -0 +xmul040 multiply -5290.54984E-490626676 842535254 -> -4.45747475E-490626664 Inexact Rounded +xpow040 power -5290.54984E-490626676 842535254 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem040 remainder -5290.54984E-490626676 842535254 -> -5.29054984E-490626673 +xsub040 subtract -5290.54984E-490626676 842535254 -> -842535254 Inexact Rounded +xadd041 add 608.31825E+535268120 -59609.0993 -> 6.08318250E+535268122 Inexact Rounded +xcom041 compare 608.31825E+535268120 -59609.0993 -> 1 +xdiv041 divide 608.31825E+535268120 -59609.0993 -> -1.02051240E+535268118 Inexact Rounded +xdvi041 divideint 608.31825E+535268120 -59609.0993 -> NaN Division_impossible +xmul041 multiply 608.31825E+535268120 -59609.0993 -> -3.62613030E+535268127 Inexact Rounded +xpow041 power 608.31825E+535268120 -59609 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem041 remainder 608.31825E+535268120 -59609.0993 -> NaN Division_impossible +xsub041 subtract 608.31825E+535268120 -59609.0993 -> 6.08318250E+535268122 Inexact Rounded +xadd042 add -4629035.31 -167.884398 -> -4629203.19 Inexact Rounded +xcom042 compare -4629035.31 -167.884398 -> -1 +xdiv042 divide -4629035.31 -167.884398 -> 27572.7546 Inexact Rounded +xdvi042 divideint -4629035.31 -167.884398 -> 27572 +xmul042 multiply -4629035.31 -167.884398 -> 777142806 Inexact Rounded +xpow042 power -4629035.31 -168 -> 1.57614831E-1120 Inexact Rounded +xrem042 remainder -4629035.31 -167.884398 -> -126.688344 +xsub042 subtract -4629035.31 -167.884398 -> -4628867.43 Inexact Rounded +xadd043 add -66527378. -706400268. -> -772927646 +xcom043 compare -66527378. -706400268. -> 1 +xdiv043 divide -66527378. -706400268. -> 0.0941780192 Inexact Rounded +xdvi043 divideint -66527378. -706400268. -> 0 +xmul043 multiply -66527378. -706400268. -> 4.69949576E+16 Inexact Rounded +xpow043 power -66527378. -706400268 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem043 remainder -66527378. -706400268. -> -66527378 +xsub043 subtract -66527378. -706400268. -> 639872890 +xadd044 add -2510497.53 372882462. -> 370371964 Inexact Rounded +xcom044 compare -2510497.53 372882462. -> -1 +xdiv044 divide -2510497.53 372882462. -> -0.00673267795 Inexact Rounded +xdvi044 divideint -2510497.53 372882462. -> -0 +xmul044 multiply -2510497.53 372882462. -> -9.36120500E+14 Inexact Rounded +xpow044 power -2510497.53 372882462 -> Infinity Overflow Inexact Rounded +xrem044 remainder -2510497.53 372882462. -> -2510497.53 +xsub044 subtract -2510497.53 372882462. -> -375392960 Inexact Rounded +xadd045 add 136.255393E+53329961 -53494.7201E+720058060 -> -5.34947201E+720058064 Inexact Rounded +xcom045 compare 136.255393E+53329961 -53494.7201E+720058060 -> 1 +xdiv045 divide 136.255393E+53329961 -53494.7201E+720058060 -> -2.54708115E-666728102 Inexact Rounded +xdvi045 divideint 136.255393E+53329961 -53494.7201E+720058060 -> -0 +xmul045 multiply 136.255393E+53329961 -53494.7201E+720058060 -> -7.28894411E+773388027 Inexact Rounded +xpow045 power 136.255393E+53329961 -5 -> 2.12927373E-266649816 Inexact Rounded +xrem045 remainder 136.255393E+53329961 -53494.7201E+720058060 -> 1.36255393E+53329963 +xsub045 subtract 136.255393E+53329961 -53494.7201E+720058060 -> 5.34947201E+720058064 Inexact Rounded +xadd046 add -876673.100 -6150.92266 -> -882824.023 Inexact Rounded +xcom046 compare -876673.100 -6150.92266 -> -1 +xdiv046 divide -876673.100 -6150.92266 -> 142.527089 Inexact Rounded +xdvi046 divideint -876673.100 -6150.92266 -> 142 +xmul046 multiply -876673.100 -6150.92266 -> 5.39234844E+9 Inexact Rounded +xpow046 power -876673.100 -6151 -> -4.03111774E-36555 Inexact Rounded +xrem046 remainder -876673.100 -6150.92266 -> -3242.08228 +xsub046 subtract -876673.100 -6150.92266 -> -870522.177 Inexact Rounded +xadd047 add -2.45151797E+911306117 27235771 -> -2.45151797E+911306117 Inexact Rounded +xcom047 compare -2.45151797E+911306117 27235771 -> -1 +xdiv047 divide -2.45151797E+911306117 27235771 -> -9.00109628E+911306109 Inexact Rounded +xdvi047 divideint -2.45151797E+911306117 27235771 -> NaN Division_impossible +xmul047 multiply -2.45151797E+911306117 27235771 -> -6.67689820E+911306124 Inexact Rounded +xpow047 power -2.45151797E+911306117 27235771 -> -Infinity Overflow Inexact Rounded +xrem047 remainder -2.45151797E+911306117 27235771 -> NaN Division_impossible +xsub047 subtract -2.45151797E+911306117 27235771 -> -2.45151797E+911306117 Inexact Rounded +xadd048 add -9.15117551 -4.95100733E-314511326 -> -9.15117551 Inexact Rounded +xcom048 compare -9.15117551 -4.95100733E-314511326 -> -1 +xdiv048 divide -9.15117551 -4.95100733E-314511326 -> 1.84834618E+314511326 Inexact Rounded +xdvi048 divideint -9.15117551 -4.95100733E-314511326 -> NaN Division_impossible +xmul048 multiply -9.15117551 -4.95100733E-314511326 -> 4.53075370E-314511325 Inexact Rounded +xpow048 power -9.15117551 -5 -> -0.0000155817265 Inexact Rounded +xrem048 remainder -9.15117551 -4.95100733E-314511326 -> NaN Division_impossible +xsub048 subtract -9.15117551 -4.95100733E-314511326 -> -9.15117551 Inexact Rounded +xadd049 add 3.61890453E-985606128 30664416. -> 30664416.0 Inexact Rounded +xcom049 compare 3.61890453E-985606128 30664416. -> -1 +xdiv049 divide 3.61890453E-985606128 30664416. -> 1.18016418E-985606135 Inexact Rounded +xdvi049 divideint 3.61890453E-985606128 30664416. -> 0 +xmul049 multiply 3.61890453E-985606128 30664416. -> 1.10971594E-985606120 Inexact Rounded +xpow049 power 3.61890453E-985606128 30664416 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem049 remainder 3.61890453E-985606128 30664416. -> 3.61890453E-985606128 +xsub049 subtract 3.61890453E-985606128 30664416. -> -30664416.0 Inexact Rounded +xadd050 add -257674602E+216723382 -70820959.4 -> -2.57674602E+216723390 Inexact Rounded +xcom050 compare -257674602E+216723382 -70820959.4 -> -1 +xdiv050 divide -257674602E+216723382 -70820959.4 -> 3.63839468E+216723382 Inexact Rounded +xdvi050 divideint -257674602E+216723382 -70820959.4 -> NaN Division_impossible +xmul050 multiply -257674602E+216723382 -70820959.4 -> 1.82487625E+216723398 Inexact Rounded +xpow050 power -257674602E+216723382 -70820959 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem050 remainder -257674602E+216723382 -70820959.4 -> NaN Division_impossible +xsub050 subtract -257674602E+216723382 -70820959.4 -> -2.57674602E+216723390 Inexact Rounded +xadd051 add 218699.206 556944241. -> 557162940 Inexact Rounded +xcom051 compare 218699.206 556944241. -> -1 +xdiv051 divide 218699.206 556944241. -> 0.000392677022 Inexact Rounded +xdvi051 divideint 218699.206 556944241. -> 0 +xmul051 multiply 218699.206 556944241. -> 1.21803263E+14 Inexact Rounded +xpow051 power 218699.206 556944241 -> Infinity Overflow Inexact Rounded +xrem051 remainder 218699.206 556944241. -> 218699.206 +xsub051 subtract 218699.206 556944241. -> -556725542 Inexact Rounded +xadd052 add 106211716. -3456793.74 -> 102754922 Inexact Rounded +xcom052 compare 106211716. -3456793.74 -> 1 +xdiv052 divide 106211716. -3456793.74 -> -30.7255000 Inexact Rounded +xdvi052 divideint 106211716. -3456793.74 -> -30 +xmul052 multiply 106211716. -3456793.74 -> -3.67151995E+14 Inexact Rounded +xpow052 power 106211716. -3456794 -> 2.07225581E-27744825 Inexact Rounded +xrem052 remainder 106211716. -3456793.74 -> 2507903.80 +xsub052 subtract 106211716. -3456793.74 -> 109668510 Inexact Rounded +xadd053 add 1.25018078 399856.763E-726816740 -> 1.25018078 Inexact Rounded +xcom053 compare 1.25018078 399856.763E-726816740 -> 1 +xdiv053 divide 1.25018078 399856.763E-726816740 -> 3.12657155E+726816734 Inexact Rounded +xdvi053 divideint 1.25018078 399856.763E-726816740 -> NaN Division_impossible +xmul053 multiply 1.25018078 399856.763E-726816740 -> 4.99893240E-726816735 Inexact Rounded +xpow053 power 1.25018078 4 -> 2.44281890 Inexact Rounded +xrem053 remainder 1.25018078 399856.763E-726816740 -> NaN Division_impossible +xsub053 subtract 1.25018078 399856.763E-726816740 -> 1.25018078 Inexact Rounded +xadd054 add 364.99811 -46222.0505 -> -45857.0524 Inexact Rounded +xcom054 compare 364.99811 -46222.0505 -> 1 +xdiv054 divide 364.99811 -46222.0505 -> -0.00789662306 Inexact Rounded +xdvi054 divideint 364.99811 -46222.0505 -> -0 +xmul054 multiply 364.99811 -46222.0505 -> -16870961.1 Inexact Rounded +xpow054 power 364.99811 -46222 -> 6.35570856E-118435 Inexact Rounded +xrem054 remainder 364.99811 -46222.0505 -> 364.99811 +xsub054 subtract 364.99811 -46222.0505 -> 46587.0486 Inexact Rounded +xadd055 add -392217576. -958364096 -> -1.35058167E+9 Inexact Rounded +xcom055 compare -392217576. -958364096 -> 1 +xdiv055 divide -392217576. -958364096 -> 0.409257377 Inexact Rounded +xdvi055 divideint -392217576. -958364096 -> 0 +xmul055 multiply -392217576. -958364096 -> 3.75887243E+17 Inexact Rounded +xpow055 power -392217576. -958364096 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem055 remainder -392217576. -958364096 -> -392217576 +xsub055 subtract -392217576. -958364096 -> 566146520 +xadd056 add 169601285 714526.639 -> 170315812 Inexact Rounded +xcom056 compare 169601285 714526.639 -> 1 +xdiv056 divide 169601285 714526.639 -> 237.361738 Inexact Rounded +xdvi056 divideint 169601285 714526.639 -> 237 +xmul056 multiply 169601285 714526.639 -> 1.21184636E+14 Inexact Rounded +xpow056 power 169601285 714527 -> 2.06052444E+5880149 Inexact Rounded +xrem056 remainder 169601285 714526.639 -> 258471.557 +xsub056 subtract 169601285 714526.639 -> 168886758 Inexact Rounded +xadd057 add -674.094552E+586944319 6354.2668E+589657266 -> 6.35426680E+589657269 Inexact Rounded +xcom057 compare -674.094552E+586944319 6354.2668E+589657266 -> -1 +xdiv057 divide -674.094552E+586944319 6354.2668E+589657266 -> -1.06085340E-2712948 Inexact Rounded +xdvi057 divideint -674.094552E+586944319 6354.2668E+589657266 -> -0 +xmul057 multiply -674.094552E+586944319 6354.2668E+589657266 -> -Infinity Inexact Overflow Rounded +xpow057 power -674.094552E+586944319 6 -> Infinity Overflow Inexact Rounded +xrem057 remainder -674.094552E+586944319 6354.2668E+589657266 -> -6.74094552E+586944321 +xsub057 subtract -674.094552E+586944319 6354.2668E+589657266 -> -6.35426680E+589657269 Inexact Rounded +xadd058 add 151795163E-371727182 -488.09788E-738852245 -> 1.51795163E-371727174 Inexact Rounded +xcom058 compare 151795163E-371727182 -488.09788E-738852245 -> 1 +xdiv058 divide 151795163E-371727182 -488.09788E-738852245 -> -3.10993285E+367125068 Inexact Rounded +xdvi058 divideint 151795163E-371727182 -488.09788E-738852245 -> NaN Division_impossible +xmul058 multiply 151795163E-371727182 -488.09788E-738852245 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow058 power 151795163E-371727182 -5 -> Infinity Overflow Inexact Rounded +xrem058 remainder 151795163E-371727182 -488.09788E-738852245 -> NaN Division_impossible +xsub058 subtract 151795163E-371727182 -488.09788E-738852245 -> 1.51795163E-371727174 Inexact Rounded +xadd059 add -746.293386 927749.647 -> 927003.354 Inexact Rounded +xcom059 compare -746.293386 927749.647 -> -1 +xdiv059 divide -746.293386 927749.647 -> -0.000804412471 Inexact Rounded +xdvi059 divideint -746.293386 927749.647 -> -0 +xmul059 multiply -746.293386 927749.647 -> -692373425 Inexact Rounded +xpow059 power -746.293386 927750 -> 7.49278741E+2665341 Inexact Rounded +xrem059 remainder -746.293386 927749.647 -> -746.293386 +xsub059 subtract -746.293386 927749.647 -> -928495.940 Inexact Rounded +xadd060 add 888946471E+241331592 -235739.595 -> 8.88946471E+241331600 Inexact Rounded +xcom060 compare 888946471E+241331592 -235739.595 -> 1 +xdiv060 divide 888946471E+241331592 -235739.595 -> -3.77088317E+241331595 Inexact Rounded +xdvi060 divideint 888946471E+241331592 -235739.595 -> NaN Division_impossible +xmul060 multiply 888946471E+241331592 -235739.595 -> -2.09559881E+241331606 Inexact Rounded +xpow060 power 888946471E+241331592 -235740 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem060 remainder 888946471E+241331592 -235739.595 -> NaN Division_impossible +xsub060 subtract 888946471E+241331592 -235739.595 -> 8.88946471E+241331600 Inexact Rounded +xadd061 add 6.64377249 79161.1070E+619453776 -> 7.91611070E+619453780 Inexact Rounded +xcom061 compare 6.64377249 79161.1070E+619453776 -> -1 +xdiv061 divide 6.64377249 79161.1070E+619453776 -> 8.39272307E-619453781 Inexact Rounded +xdvi061 divideint 6.64377249 79161.1070E+619453776 -> 0 +xmul061 multiply 6.64377249 79161.1070E+619453776 -> 5.25928385E+619453781 Inexact Rounded +xpow061 power 6.64377249 8 -> 3795928.44 Inexact Rounded +xrem061 remainder 6.64377249 79161.1070E+619453776 -> 6.64377249 +xsub061 subtract 6.64377249 79161.1070E+619453776 -> -7.91611070E+619453780 Inexact Rounded +xadd062 add 3146.66571E-313373366 88.5282010 -> 88.5282010 Inexact Rounded +xcom062 compare 3146.66571E-313373366 88.5282010 -> -1 +xdiv062 divide 3146.66571E-313373366 88.5282010 -> 3.55442184E-313373365 Inexact Rounded +xdvi062 divideint 3146.66571E-313373366 88.5282010 -> 0 +xmul062 multiply 3146.66571E-313373366 88.5282010 -> 2.78568654E-313373361 Inexact Rounded +xpow062 power 3146.66571E-313373366 89 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem062 remainder 3146.66571E-313373366 88.5282010 -> 3.14666571E-313373363 +xsub062 subtract 3146.66571E-313373366 88.5282010 -> -88.5282010 Inexact Rounded +xadd063 add 6.44693097 -87195.8711 -> -87189.4242 Inexact Rounded +xcom063 compare 6.44693097 -87195.8711 -> 1 +xdiv063 divide 6.44693097 -87195.8711 -> -0.0000739361955 Inexact Rounded +xdvi063 divideint 6.44693097 -87195.8711 -> -0 +xmul063 multiply 6.44693097 -87195.8711 -> -562145.762 Inexact Rounded +xpow063 power 6.44693097 -87196 -> 4.50881730E-70573 Inexact Rounded +xrem063 remainder 6.44693097 -87195.8711 -> 6.44693097 +xsub063 subtract 6.44693097 -87195.8711 -> 87202.3180 Inexact Rounded +xadd064 add -2113132.56E+577957840 981125821 -> -2.11313256E+577957846 Inexact Rounded +xcom064 compare -2113132.56E+577957840 981125821 -> -1 +xdiv064 divide -2113132.56E+577957840 981125821 -> -2.15378345E+577957837 Inexact Rounded +xdvi064 divideint -2113132.56E+577957840 981125821 -> NaN Division_impossible +xmul064 multiply -2113132.56E+577957840 981125821 -> -2.07324892E+577957855 Inexact Rounded +xpow064 power -2113132.56E+577957840 981125821 -> -Infinity Overflow Inexact Rounded +xrem064 remainder -2113132.56E+577957840 981125821 -> NaN Division_impossible +xsub064 subtract -2113132.56E+577957840 981125821 -> -2.11313256E+577957846 Inexact Rounded +xadd065 add -7701.42814 72667.5181 -> 64966.0900 Inexact Rounded +xcom065 compare -7701.42814 72667.5181 -> -1 +xdiv065 divide -7701.42814 72667.5181 -> -0.105981714 Inexact Rounded +xdvi065 divideint -7701.42814 72667.5181 -> -0 +xmul065 multiply -7701.42814 72667.5181 -> -559643669 Inexact Rounded +xpow065 power -7701.42814 72668 -> 2.29543837E+282429 Inexact Rounded +xrem065 remainder -7701.42814 72667.5181 -> -7701.42814 +xsub065 subtract -7701.42814 72667.5181 -> -80368.9462 Inexact Rounded +xadd066 add -851.754789 -582659.149 -> -583510.904 Inexact Rounded +xcom066 compare -851.754789 -582659.149 -> 1 +xdiv066 divide -851.754789 -582659.149 -> 0.00146184058 Inexact Rounded +xdvi066 divideint -851.754789 -582659.149 -> 0 +xmul066 multiply -851.754789 -582659.149 -> 496282721 Inexact Rounded +xpow066 power -851.754789 -582659 -> -6.83532593E-1707375 Inexact Rounded +xrem066 remainder -851.754789 -582659.149 -> -851.754789 +xsub066 subtract -851.754789 -582659.149 -> 581807.394 Inexact Rounded +xadd067 add -5.01992943 7852.16531 -> 7847.14538 Inexact Rounded +xcom067 compare -5.01992943 7852.16531 -> -1 +xdiv067 divide -5.01992943 7852.16531 -> -0.000639305113 Inexact Rounded +xdvi067 divideint -5.01992943 7852.16531 -> -0 +xmul067 multiply -5.01992943 7852.16531 -> -39417.3157 Inexact Rounded +xpow067 power -5.01992943 7852 -> 7.54481448E+5501 Inexact Rounded +xrem067 remainder -5.01992943 7852.16531 -> -5.01992943 +xsub067 subtract -5.01992943 7852.16531 -> -7857.18524 Inexact Rounded +xadd068 add -12393257.2 76803689E+949125770 -> 7.68036890E+949125777 Inexact Rounded +xcom068 compare -12393257.2 76803689E+949125770 -> -1 +xdiv068 divide -12393257.2 76803689E+949125770 -> -1.61362786E-949125771 Inexact Rounded +xdvi068 divideint -12393257.2 76803689E+949125770 -> -0 +xmul068 multiply -12393257.2 76803689E+949125770 -> -9.51847872E+949125784 Inexact Rounded +xpow068 power -12393257.2 8 -> 5.56523749E+56 Inexact Rounded +xrem068 remainder -12393257.2 76803689E+949125770 -> -12393257.2 +xsub068 subtract -12393257.2 76803689E+949125770 -> -7.68036890E+949125777 Inexact Rounded +xadd069 add -754771634.E+716555026 -292336.311 -> -7.54771634E+716555034 Inexact Rounded +xcom069 compare -754771634.E+716555026 -292336.311 -> -1 +xdiv069 divide -754771634.E+716555026 -292336.311 -> 2.58186070E+716555029 Inexact Rounded +xdvi069 divideint -754771634.E+716555026 -292336.311 -> NaN Division_impossible +xmul069 multiply -754771634.E+716555026 -292336.311 -> 2.20647155E+716555040 Inexact Rounded +xpow069 power -754771634.E+716555026 -292336 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem069 remainder -754771634.E+716555026 -292336.311 -> NaN Division_impossible +xsub069 subtract -754771634.E+716555026 -292336.311 -> -7.54771634E+716555034 Inexact Rounded +xadd070 add -915006.171E+614548652 -314086965. -> -9.15006171E+614548657 Inexact Rounded +xcom070 compare -915006.171E+614548652 -314086965. -> -1 +xdiv070 divide -915006.171E+614548652 -314086965. -> 2.91322555E+614548649 Inexact Rounded +xdvi070 divideint -915006.171E+614548652 -314086965. -> NaN Division_impossible +xmul070 multiply -915006.171E+614548652 -314086965. -> 2.87391511E+614548666 Inexact Rounded +xpow070 power -915006.171E+614548652 -314086965 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem070 remainder -915006.171E+614548652 -314086965. -> NaN Division_impossible +xsub070 subtract -915006.171E+614548652 -314086965. -> -9.15006171E+614548657 Inexact Rounded +xadd071 add -296590035 -481734529 -> -778324564 +xcom071 compare -296590035 -481734529 -> 1 +xdiv071 divide -296590035 -481734529 -> 0.615671116 Inexact Rounded +xdvi071 divideint -296590035 -481734529 -> 0 +xmul071 multiply -296590035 -481734529 -> 1.42877661E+17 Inexact Rounded +xpow071 power -296590035 -481734529 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem071 remainder -296590035 -481734529 -> -296590035 +xsub071 subtract -296590035 -481734529 -> 185144494 +xadd072 add 8.27822605 9241557.19 -> 9241565.47 Inexact Rounded +xcom072 compare 8.27822605 9241557.19 -> -1 +xdiv072 divide 8.27822605 9241557.19 -> 8.95760950E-7 Inexact Rounded +xdvi072 divideint 8.27822605 9241557.19 -> 0 +xmul072 multiply 8.27822605 9241557.19 -> 76503699.5 Inexact Rounded +xpow072 power 8.27822605 9241557 -> 5.10219969E+8483169 Inexact Rounded +xrem072 remainder 8.27822605 9241557.19 -> 8.27822605 +xsub072 subtract 8.27822605 9241557.19 -> -9241548.91 Inexact Rounded +xadd073 add -1.43581098 7286313.54 -> 7286312.10 Inexact Rounded +xcom073 compare -1.43581098 7286313.54 -> -1 +xdiv073 divide -1.43581098 7286313.54 -> -1.97055887E-7 Inexact Rounded +xdvi073 divideint -1.43581098 7286313.54 -> -0 +xmul073 multiply -1.43581098 7286313.54 -> -10461769.0 Inexact Rounded +xpow073 power -1.43581098 7286314 -> 1.09389741E+1144660 Inexact Rounded +xrem073 remainder -1.43581098 7286313.54 -> -1.43581098 +xsub073 subtract -1.43581098 7286313.54 -> -7286314.98 Inexact Rounded +xadd074 add -699036193. 759263.509E+533543625 -> 7.59263509E+533543630 Inexact Rounded +xcom074 compare -699036193. 759263.509E+533543625 -> -1 +xdiv074 divide -699036193. 759263.509E+533543625 -> -9.20676662E-533543623 Inexact Rounded +xdvi074 divideint -699036193. 759263.509E+533543625 -> -0 +xmul074 multiply -699036193. 759263.509E+533543625 -> -5.30752673E+533543639 Inexact Rounded +xpow074 power -699036193. 8 -> 5.70160724E+70 Inexact Rounded +xrem074 remainder -699036193. 759263.509E+533543625 -> -699036193 +xsub074 subtract -699036193. 759263.509E+533543625 -> -7.59263509E+533543630 Inexact Rounded +xadd075 add -83.7273615E-305281957 -287779593.E+458777774 -> -2.87779593E+458777782 Inexact Rounded +xcom075 compare -83.7273615E-305281957 -287779593.E+458777774 -> 1 +xdiv075 divide -83.7273615E-305281957 -287779593.E+458777774 -> 2.90942664E-764059738 Inexact Rounded +xdvi075 divideint -83.7273615E-305281957 -287779593.E+458777774 -> 0 +xmul075 multiply -83.7273615E-305281957 -287779593.E+458777774 -> 2.40950260E+153495827 Inexact Rounded +xpow075 power -83.7273615E-305281957 -3 -> -1.70371828E+915845865 Inexact Rounded +xrem075 remainder -83.7273615E-305281957 -287779593.E+458777774 -> -8.37273615E-305281956 +xsub075 subtract -83.7273615E-305281957 -287779593.E+458777774 -> 2.87779593E+458777782 Inexact Rounded +xadd076 add 8.48503224 6522.03316 -> 6530.51819 Inexact Rounded +xcom076 compare 8.48503224 6522.03316 -> -1 +xdiv076 divide 8.48503224 6522.03316 -> 0.00130097962 Inexact Rounded +xdvi076 divideint 8.48503224 6522.03316 -> 0 +xmul076 multiply 8.48503224 6522.03316 -> 55339.6616 Inexact Rounded +xpow076 power 8.48503224 6522 -> 4.76547542E+6056 Inexact Rounded +xrem076 remainder 8.48503224 6522.03316 -> 8.48503224 +xsub076 subtract 8.48503224 6522.03316 -> -6513.54813 Inexact Rounded +xadd077 add 527916091 -809.054070 -> 527915282 Inexact Rounded +xcom077 compare 527916091 -809.054070 -> 1 +xdiv077 divide 527916091 -809.054070 -> -652510.272 Inexact Rounded +xdvi077 divideint 527916091 -809.054070 -> -652510 +xmul077 multiply 527916091 -809.054070 -> -4.27112662E+11 Inexact Rounded +xpow077 power 527916091 -809 -> 2.78609697E-7057 Inexact Rounded +xrem077 remainder 527916091 -809.054070 -> 219.784300 +xsub077 subtract 527916091 -809.054070 -> 527916900 Inexact Rounded +xadd078 add 3857058.60 5792997.58E+881077409 -> 5.79299758E+881077415 Inexact Rounded +xcom078 compare 3857058.60 5792997.58E+881077409 -> -1 +xdiv078 divide 3857058.60 5792997.58E+881077409 -> 6.65813950E-881077410 Inexact Rounded +xdvi078 divideint 3857058.60 5792997.58E+881077409 -> 0 +xmul078 multiply 3857058.60 5792997.58E+881077409 -> 2.23439311E+881077422 Inexact Rounded +xpow078 power 3857058.60 6 -> 3.29258824E+39 Inexact Rounded +xrem078 remainder 3857058.60 5792997.58E+881077409 -> 3857058.60 +xsub078 subtract 3857058.60 5792997.58E+881077409 -> -5.79299758E+881077415 Inexact Rounded +xadd079 add -66587363.E+556538173 -551902402E+357309146 -> -6.65873630E+556538180 Inexact Rounded +xcom079 compare -66587363.E+556538173 -551902402E+357309146 -> -1 +xdiv079 divide -66587363.E+556538173 -551902402E+357309146 -> 1.20650613E+199229026 Inexact Rounded +xdvi079 divideint -66587363.E+556538173 -551902402E+357309146 -> NaN Division_impossible +xmul079 multiply -66587363.E+556538173 -551902402E+357309146 -> 3.67497256E+913847335 Inexact Rounded +xpow079 power -66587363.E+556538173 -6 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem079 remainder -66587363.E+556538173 -551902402E+357309146 -> NaN Division_impossible +xsub079 subtract -66587363.E+556538173 -551902402E+357309146 -> -6.65873630E+556538180 Inexact Rounded +xadd080 add -580.502955 38125521.7 -> 38124941.2 Inexact Rounded +xcom080 compare -580.502955 38125521.7 -> -1 +xdiv080 divide -580.502955 38125521.7 -> -0.0000152260987 Inexact Rounded +xdvi080 divideint -580.502955 38125521.7 -> -0 +xmul080 multiply -580.502955 38125521.7 -> -2.21319780E+10 Inexact Rounded +xpow080 power -580.502955 38125522 -> 6.07262078E+105371486 Inexact Rounded +xrem080 remainder -580.502955 38125521.7 -> -580.502955 +xsub080 subtract -580.502955 38125521.7 -> -38126102.2 Inexact Rounded +xadd081 add -9627363.00 -80616885E-749891394 -> -9627363.00 Inexact Rounded +xcom081 compare -9627363.00 -80616885E-749891394 -> -1 +xdiv081 divide -9627363.00 -80616885E-749891394 -> 1.19421173E+749891393 Inexact Rounded +xdvi081 divideint -9627363.00 -80616885E-749891394 -> NaN Division_impossible +xmul081 multiply -9627363.00 -80616885E-749891394 -> 7.76128016E-749891380 Inexact Rounded +xpow081 power -9627363.00 -8 -> 1.35500601E-56 Inexact Rounded +xrem081 remainder -9627363.00 -80616885E-749891394 -> NaN Division_impossible +xsub081 subtract -9627363.00 -80616885E-749891394 -> -9627363.00 Inexact Rounded +xadd082 add -526.594855E+803110107 -64.5451639 -> -5.26594855E+803110109 Inexact Rounded +xcom082 compare -526.594855E+803110107 -64.5451639 -> -1 +xdiv082 divide -526.594855E+803110107 -64.5451639 -> 8.15854858E+803110107 Inexact Rounded +xdvi082 divideint -526.594855E+803110107 -64.5451639 -> NaN Division_impossible +xmul082 multiply -526.594855E+803110107 -64.5451639 -> 3.39891512E+803110111 Inexact Rounded +xpow082 power -526.594855E+803110107 -65 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem082 remainder -526.594855E+803110107 -64.5451639 -> NaN Division_impossible +xsub082 subtract -526.594855E+803110107 -64.5451639 -> -5.26594855E+803110109 Inexact Rounded +xadd083 add -8378.55499 760.131257 -> -7618.42373 Inexact Rounded +xcom083 compare -8378.55499 760.131257 -> -1 +xdiv083 divide -8378.55499 760.131257 -> -11.0225108 Inexact Rounded +xdvi083 divideint -8378.55499 760.131257 -> -11 +xmul083 multiply -8378.55499 760.131257 -> -6368801.54 Inexact Rounded +xpow083 power -8378.55499 760 -> 4.06007928E+2981 Inexact Rounded +xrem083 remainder -8378.55499 760.131257 -> -17.111163 +xsub083 subtract -8378.55499 760.131257 -> -9138.68625 Inexact Rounded +xadd084 add -717.697718 984304413 -> 984303695 Inexact Rounded +xcom084 compare -717.697718 984304413 -> -1 +xdiv084 divide -717.697718 984304413 -> -7.29142030E-7 Inexact Rounded +xdvi084 divideint -717.697718 984304413 -> -0 +xmul084 multiply -717.697718 984304413 -> -7.06433031E+11 Inexact Rounded +xpow084 power -717.697718 984304413 -> -Infinity Overflow Inexact Rounded +xrem084 remainder -717.697718 984304413 -> -717.697718 +xsub084 subtract -717.697718 984304413 -> -984305131 Inexact Rounded +xadd085 add -76762243.4E-741100094 -273.706674 -> -273.706674 Inexact Rounded +xcom085 compare -76762243.4E-741100094 -273.706674 -> 1 +xdiv085 divide -76762243.4E-741100094 -273.706674 -> 2.80454409E-741100089 Inexact Rounded +xdvi085 divideint -76762243.4E-741100094 -273.706674 -> 0 +xmul085 multiply -76762243.4E-741100094 -273.706674 -> 2.10103383E-741100084 Inexact Rounded +xpow085 power -76762243.4E-741100094 -274 -> Infinity Overflow Inexact Rounded +xrem085 remainder -76762243.4E-741100094 -273.706674 -> -7.67622434E-741100087 +xsub085 subtract -76762243.4E-741100094 -273.706674 -> 273.706674 Inexact Rounded +xadd086 add -701.518354E+786274918 8822750.68E+243052107 -> -7.01518354E+786274920 Inexact Rounded +xcom086 compare -701.518354E+786274918 8822750.68E+243052107 -> -1 +xdiv086 divide -701.518354E+786274918 8822750.68E+243052107 -> -7.95124309E+543222806 Inexact Rounded +xdvi086 divideint -701.518354E+786274918 8822750.68E+243052107 -> NaN Division_impossible +xmul086 multiply -701.518354E+786274918 8822750.68E+243052107 -> -Infinity Inexact Overflow Rounded +xpow086 power -701.518354E+786274918 9 -> -Infinity Overflow Inexact Rounded +xrem086 remainder -701.518354E+786274918 8822750.68E+243052107 -> NaN Division_impossible +xsub086 subtract -701.518354E+786274918 8822750.68E+243052107 -> -7.01518354E+786274920 Inexact Rounded +xadd087 add -359866845. -4.57434117 -> -359866850 Inexact Rounded +xcom087 compare -359866845. -4.57434117 -> -1 +xdiv087 divide -359866845. -4.57434117 -> 78670748.8 Inexact Rounded +xdvi087 divideint -359866845. -4.57434117 -> 78670748 +xmul087 multiply -359866845. -4.57434117 -> 1.64615372E+9 Inexact Rounded +xpow087 power -359866845. -5 -> -1.65687909E-43 Inexact Rounded +xrem087 remainder -359866845. -4.57434117 -> -3.54890484 +xsub087 subtract -359866845. -4.57434117 -> -359866840 Inexact Rounded +xadd088 add 779934536. -76562645.7 -> 703371890 Inexact Rounded +xcom088 compare 779934536. -76562645.7 -> 1 +xdiv088 divide 779934536. -76562645.7 -> -10.1868807 Inexact Rounded +xdvi088 divideint 779934536. -76562645.7 -> -10 +xmul088 multiply 779934536. -76562645.7 -> -5.97138515E+16 Inexact Rounded +xpow088 power 779934536. -76562646 -> 3.36739063E-680799501 Inexact Rounded +xrem088 remainder 779934536. -76562645.7 -> 14308079.0 +xsub088 subtract 779934536. -76562645.7 -> 856497182 Inexact Rounded +xadd089 add -4820.95451 3516234.99E+303303176 -> 3.51623499E+303303182 Inexact Rounded +xcom089 compare -4820.95451 3516234.99E+303303176 -> -1 +xdiv089 divide -4820.95451 3516234.99E+303303176 -> -1.37105584E-303303179 Inexact Rounded +xdvi089 divideint -4820.95451 3516234.99E+303303176 -> -0 +xmul089 multiply -4820.95451 3516234.99E+303303176 -> -1.69516089E+303303186 Inexact Rounded +xpow089 power -4820.95451 4 -> 5.40172082E+14 Inexact Rounded +xrem089 remainder -4820.95451 3516234.99E+303303176 -> -4820.95451 +xsub089 subtract -4820.95451 3516234.99E+303303176 -> -3.51623499E+303303182 Inexact Rounded +xadd090 add 69355976.9 -9.57838562E+758804984 -> -9.57838562E+758804984 Inexact Rounded +xcom090 compare 69355976.9 -9.57838562E+758804984 -> 1 +xdiv090 divide 69355976.9 -9.57838562E+758804984 -> -7.24088376E-758804978 Inexact Rounded +xdvi090 divideint 69355976.9 -9.57838562E+758804984 -> -0 +xmul090 multiply 69355976.9 -9.57838562E+758804984 -> -6.64318292E+758804992 Inexact Rounded +xpow090 power 69355976.9 -10 -> 3.88294346E-79 Inexact Rounded +xrem090 remainder 69355976.9 -9.57838562E+758804984 -> 69355976.9 +xsub090 subtract 69355976.9 -9.57838562E+758804984 -> 9.57838562E+758804984 Inexact Rounded +xadd091 add -12672093.1 8569.78255E-382866025 -> -12672093.1 Inexact Rounded +xcom091 compare -12672093.1 8569.78255E-382866025 -> -1 +xdiv091 divide -12672093.1 8569.78255E-382866025 -> -1.47869482E+382866028 Inexact Rounded +xdvi091 divideint -12672093.1 8569.78255E-382866025 -> NaN Division_impossible +xmul091 multiply -12672093.1 8569.78255E-382866025 -> -1.08597082E-382866014 Inexact Rounded +xpow091 power -12672093.1 9 -> -8.42626658E+63 Inexact Rounded +xrem091 remainder -12672093.1 8569.78255E-382866025 -> NaN Division_impossible +xsub091 subtract -12672093.1 8569.78255E-382866025 -> -12672093.1 Inexact Rounded +xadd092 add -5910750.2 66150383E-662459241 -> -5910750.20 Inexact Rounded +xcom092 compare -5910750.2 66150383E-662459241 -> -1 +xdiv092 divide -5910750.2 66150383E-662459241 -> -8.93532272E+662459239 Inexact Rounded +xdvi092 divideint -5910750.2 66150383E-662459241 -> NaN Division_impossible +xmul092 multiply -5910750.2 66150383E-662459241 -> -3.90998390E-662459227 Inexact Rounded +xpow092 power -5910750.2 7 -> -2.52056696E+47 Inexact Rounded +xrem092 remainder -5910750.2 66150383E-662459241 -> NaN Division_impossible +xsub092 subtract -5910750.2 66150383E-662459241 -> -5910750.20 Inexact Rounded +xadd093 add -532577268.E-163806629 -240650398E-650110558 -> -5.32577268E-163806621 Inexact Rounded +xcom093 compare -532577268.E-163806629 -240650398E-650110558 -> -1 +xdiv093 divide -532577268.E-163806629 -240650398E-650110558 -> 2.21307454E+486303929 Inexact Rounded +xdvi093 divideint -532577268.E-163806629 -240650398E-650110558 -> NaN Division_impossible +xmul093 multiply -532577268.E-163806629 -240650398E-650110558 -> 1.28164932E-813917170 Inexact Rounded +xpow093 power -532577268.E-163806629 -2 -> 3.52561389E+327613240 Inexact Rounded +xrem093 remainder -532577268.E-163806629 -240650398E-650110558 -> NaN Division_impossible +xsub093 subtract -532577268.E-163806629 -240650398E-650110558 -> -5.32577268E-163806621 Inexact Rounded +xadd094 add -671.507198E-908587890 3057429.32E-555230623 -> 3.05742932E-555230617 Inexact Rounded +xcom094 compare -671.507198E-908587890 3057429.32E-555230623 -> -1 +xdiv094 divide -671.507198E-908587890 3057429.32E-555230623 -> -2.19631307E-353357271 Inexact Rounded +xdvi094 divideint -671.507198E-908587890 3057429.32E-555230623 -> -0 +xmul094 multiply -671.507198E-908587890 3057429.32E-555230623 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow094 power -671.507198E-908587890 3 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem094 remainder -671.507198E-908587890 3057429.32E-555230623 -> -6.71507198E-908587888 +xsub094 subtract -671.507198E-908587890 3057429.32E-555230623 -> -3.05742932E-555230617 Inexact Rounded +xadd095 add -294.994352E+346452027 -6061853.0 -> -2.94994352E+346452029 Inexact Rounded +xcom095 compare -294.994352E+346452027 -6061853.0 -> -1 +xdiv095 divide -294.994352E+346452027 -6061853.0 -> 4.86640557E+346452022 Inexact Rounded +xdvi095 divideint -294.994352E+346452027 -6061853.0 -> NaN Division_impossible +xmul095 multiply -294.994352E+346452027 -6061853.0 -> 1.78821240E+346452036 Inexact Rounded +xpow095 power -294.994352E+346452027 -6061853 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem095 remainder -294.994352E+346452027 -6061853.0 -> NaN Division_impossible +xsub095 subtract -294.994352E+346452027 -6061853.0 -> -2.94994352E+346452029 Inexact Rounded +xadd096 add 329579114 146780548. -> 476359662 +xcom096 compare 329579114 146780548. -> 1 +xdiv096 divide 329579114 146780548. -> 2.24538686 Inexact Rounded +xdvi096 divideint 329579114 146780548. -> 2 +xmul096 multiply 329579114 146780548. -> 4.83758030E+16 Inexact Rounded +xpow096 power 329579114 146780548 -> Infinity Overflow Inexact Rounded +xrem096 remainder 329579114 146780548. -> 36018018 +xsub096 subtract 329579114 146780548. -> 182798566 +xadd097 add -789904.686E-217225000 -1991.07181E-84080059 -> -1.99107181E-84080056 Inexact Rounded +xcom097 compare -789904.686E-217225000 -1991.07181E-84080059 -> 1 +xdiv097 divide -789904.686E-217225000 -1991.07181E-84080059 -> 3.96723354E-133144939 Inexact Rounded +xdvi097 divideint -789904.686E-217225000 -1991.07181E-84080059 -> 0 +xmul097 multiply -789904.686E-217225000 -1991.07181E-84080059 -> 1.57275695E-301305050 Inexact Rounded +xpow097 power -789904.686E-217225000 -2 -> 1.60269403E+434449988 Inexact Rounded +xrem097 remainder -789904.686E-217225000 -1991.07181E-84080059 -> -7.89904686E-217224995 +xsub097 subtract -789904.686E-217225000 -1991.07181E-84080059 -> 1.99107181E-84080056 Inexact Rounded +xadd098 add 59893.3544 -408595868 -> -408535975 Inexact Rounded +xcom098 compare 59893.3544 -408595868 -> 1 +xdiv098 divide 59893.3544 -408595868 -> -0.000146583358 Inexact Rounded +xdvi098 divideint 59893.3544 -408595868 -> -0 +xmul098 multiply 59893.3544 -408595868 -> -2.44721771E+13 Inexact Rounded +xpow098 power 59893.3544 -408595868 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem098 remainder 59893.3544 -408595868 -> 59893.3544 +xsub098 subtract 59893.3544 -408595868 -> 408655761 Inexact Rounded +xadd099 add 129.878613 -54652.7288E-963564940 -> 129.878613 Inexact Rounded +xcom099 compare 129.878613 -54652.7288E-963564940 -> 1 +xdiv099 divide 129.878613 -54652.7288E-963564940 -> -2.37643418E+963564937 Inexact Rounded +xdvi099 divideint 129.878613 -54652.7288E-963564940 -> NaN Division_impossible +xmul099 multiply 129.878613 -54652.7288E-963564940 -> -7.09822061E-963564934 Inexact Rounded +xpow099 power 129.878613 -5 -> 2.70590029E-11 Inexact Rounded +xrem099 remainder 129.878613 -54652.7288E-963564940 -> NaN Division_impossible +xsub099 subtract 129.878613 -54652.7288E-963564940 -> 129.878613 Inexact Rounded +xadd100 add 9866.99208 708756501. -> 708766368 Inexact Rounded +xcom100 compare 9866.99208 708756501. -> -1 +xdiv100 divide 9866.99208 708756501. -> 0.0000139215543 Inexact Rounded +xdvi100 divideint 9866.99208 708756501. -> 0 +xmul100 multiply 9866.99208 708756501. -> 6.99329478E+12 Inexact Rounded +xpow100 power 9866.99208 708756501 -> Infinity Overflow Inexact Rounded +xrem100 remainder 9866.99208 708756501. -> 9866.99208 +xsub100 subtract 9866.99208 708756501. -> -708746634 Inexact Rounded +xadd101 add -78810.6297 -399884.68 -> -478695.310 Inexact Rounded +xcom101 compare -78810.6297 -399884.68 -> 1 +xdiv101 divide -78810.6297 -399884.68 -> 0.197083393 Inexact Rounded +xdvi101 divideint -78810.6297 -399884.68 -> 0 +xmul101 multiply -78810.6297 -399884.68 -> 3.15151634E+10 Inexact Rounded +xpow101 power -78810.6297 -399885 -> -1.54252408E-1958071 Inexact Rounded +xrem101 remainder -78810.6297 -399884.68 -> -78810.6297 +xsub101 subtract -78810.6297 -399884.68 -> 321074.050 Inexact Rounded +xadd102 add 409189761 -771.471460 -> 409188990 Inexact Rounded +xcom102 compare 409189761 -771.471460 -> 1 +xdiv102 divide 409189761 -771.471460 -> -530401.683 Inexact Rounded +xdvi102 divideint 409189761 -771.471460 -> -530401 +xmul102 multiply 409189761 -771.471460 -> -3.15678222E+11 Inexact Rounded +xpow102 power 409189761 -771 -> 1.60698414E-6640 Inexact Rounded +xrem102 remainder 409189761 -771.471460 -> 527.144540 +xsub102 subtract 409189761 -771.471460 -> 409190532 Inexact Rounded +xadd103 add -1.68748838 460.46924 -> 458.781752 Inexact Rounded +xcom103 compare -1.68748838 460.46924 -> -1 +xdiv103 divide -1.68748838 460.46924 -> -0.00366471467 Inexact Rounded +xdvi103 divideint -1.68748838 460.46924 -> -0 +xmul103 multiply -1.68748838 460.46924 -> -777.036492 Inexact Rounded +xpow103 power -1.68748838 460 -> 3.39440648E+104 Inexact Rounded +xrem103 remainder -1.68748838 460.46924 -> -1.68748838 +xsub103 subtract -1.68748838 460.46924 -> -462.156728 Inexact Rounded +xadd104 add 553527296. -7924.40185 -> 553519372 Inexact Rounded +xcom104 compare 553527296. -7924.40185 -> 1 +xdiv104 divide 553527296. -7924.40185 -> -69850.9877 Inexact Rounded +xdvi104 divideint 553527296. -7924.40185 -> -69850 +xmul104 multiply 553527296. -7924.40185 -> -4.38637273E+12 Inexact Rounded +xpow104 power 553527296. -7924 -> 2.32397214E-69281 Inexact Rounded +xrem104 remainder 553527296. -7924.40185 -> 7826.77750 +xsub104 subtract 553527296. -7924.40185 -> 553535220 Inexact Rounded +xadd105 add -38.7465207 64936.2942 -> 64897.5477 Inexact Rounded +xcom105 compare -38.7465207 64936.2942 -> -1 +xdiv105 divide -38.7465207 64936.2942 -> -0.000596685123 Inexact Rounded +xdvi105 divideint -38.7465207 64936.2942 -> -0 +xmul105 multiply -38.7465207 64936.2942 -> -2516055.47 Inexact Rounded +xpow105 power -38.7465207 64936 -> 3.01500762E+103133 Inexact Rounded +xrem105 remainder -38.7465207 64936.2942 -> -38.7465207 +xsub105 subtract -38.7465207 64936.2942 -> -64975.0407 Inexact Rounded +xadd106 add -201075.248 845.663928 -> -200229.584 Inexact Rounded +xcom106 compare -201075.248 845.663928 -> -1 +xdiv106 divide -201075.248 845.663928 -> -237.772053 Inexact Rounded +xdvi106 divideint -201075.248 845.663928 -> -237 +xmul106 multiply -201075.248 845.663928 -> -170042084 Inexact Rounded +xpow106 power -201075.248 846 -> 4.37911767E+4486 Inexact Rounded +xrem106 remainder -201075.248 845.663928 -> -652.897064 +xsub106 subtract -201075.248 845.663928 -> -201920.912 Inexact Rounded +xadd107 add 91048.4559 75953609.3 -> 76044657.8 Inexact Rounded +xcom107 compare 91048.4559 75953609.3 -> -1 +xdiv107 divide 91048.4559 75953609.3 -> 0.00119873771 Inexact Rounded +xdvi107 divideint 91048.4559 75953609.3 -> 0 +xmul107 multiply 91048.4559 75953609.3 -> 6.91545885E+12 Inexact Rounded +xpow107 power 91048.4559 75953609 -> 6.94467746E+376674650 Inexact Rounded +xrem107 remainder 91048.4559 75953609.3 -> 91048.4559 +xsub107 subtract 91048.4559 75953609.3 -> -75862560.8 Inexact Rounded +xadd108 add 6898273.86E-252097460 15.3456196 -> 15.3456196 Inexact Rounded +xcom108 compare 6898273.86E-252097460 15.3456196 -> -1 +xdiv108 divide 6898273.86E-252097460 15.3456196 -> 4.49527229E-252097455 Inexact Rounded +xdvi108 divideint 6898273.86E-252097460 15.3456196 -> 0 +xmul108 multiply 6898273.86E-252097460 15.3456196 -> 1.05858287E-252097452 Inexact Rounded +xpow108 power 6898273.86E-252097460 15 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem108 remainder 6898273.86E-252097460 15.3456196 -> 6.89827386E-252097454 +xsub108 subtract 6898273.86E-252097460 15.3456196 -> -15.3456196 Inexact Rounded +xadd109 add 88.4370343 -980709105E-869899289 -> 88.4370343 Inexact Rounded +xcom109 compare 88.4370343 -980709105E-869899289 -> 1 +xdiv109 divide 88.4370343 -980709105E-869899289 -> -9.01766220E+869899281 Inexact Rounded +xdvi109 divideint 88.4370343 -980709105E-869899289 -> NaN Division_impossible +xmul109 multiply 88.4370343 -980709105E-869899289 -> -8.67310048E-869899279 Inexact Rounded +xpow109 power 88.4370343 -10 -> 3.41710479E-20 Inexact Rounded +xrem109 remainder 88.4370343 -980709105E-869899289 -> NaN Division_impossible +xsub109 subtract 88.4370343 -980709105E-869899289 -> 88.4370343 Inexact Rounded +xadd110 add -17643.39 2.0352568E+304871331 -> 2.03525680E+304871331 Inexact Rounded +xcom110 compare -17643.39 2.0352568E+304871331 -> -1 +xdiv110 divide -17643.39 2.0352568E+304871331 -> -8.66887658E-304871328 Inexact Rounded +xdvi110 divideint -17643.39 2.0352568E+304871331 -> -0 +xmul110 multiply -17643.39 2.0352568E+304871331 -> -3.59088295E+304871335 Inexact Rounded +xpow110 power -17643.39 2 -> 311289211 Inexact Rounded +xrem110 remainder -17643.39 2.0352568E+304871331 -> -17643.39 +xsub110 subtract -17643.39 2.0352568E+304871331 -> -2.03525680E+304871331 Inexact Rounded +xadd111 add 4589785.16 7459.04237 -> 4597244.20 Inexact Rounded +xcom111 compare 4589785.16 7459.04237 -> 1 +xdiv111 divide 4589785.16 7459.04237 -> 615.331692 Inexact Rounded +xdvi111 divideint 4589785.16 7459.04237 -> 615 +xmul111 multiply 4589785.16 7459.04237 -> 3.42354020E+10 Inexact Rounded +xpow111 power 4589785.16 7459 -> 2.03795258E+49690 Inexact Rounded +xrem111 remainder 4589785.16 7459.04237 -> 2474.10245 +xsub111 subtract 4589785.16 7459.04237 -> 4582326.12 Inexact Rounded +xadd112 add -51.1632090E-753968082 8.96207471E-585797887 -> 8.96207471E-585797887 Inexact Rounded +xcom112 compare -51.1632090E-753968082 8.96207471E-585797887 -> -1 +xdiv112 divide -51.1632090E-753968082 8.96207471E-585797887 -> -5.70885768E-168170195 Inexact Rounded +xdvi112 divideint -51.1632090E-753968082 8.96207471E-585797887 -> -0 +xmul112 multiply -51.1632090E-753968082 8.96207471E-585797887 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow112 power -51.1632090E-753968082 9 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem112 remainder -51.1632090E-753968082 8.96207471E-585797887 -> -5.11632090E-753968081 +xsub112 subtract -51.1632090E-753968082 8.96207471E-585797887 -> -8.96207471E-585797887 Inexact Rounded +xadd113 add 982.217817 7224909.4E-45243816 -> 982.217817 Inexact Rounded +xcom113 compare 982.217817 7224909.4E-45243816 -> 1 +xdiv113 divide 982.217817 7224909.4E-45243816 -> 1.35948807E+45243812 Inexact Rounded +xdvi113 divideint 982.217817 7224909.4E-45243816 -> NaN Division_impossible +xmul113 multiply 982.217817 7224909.4E-45243816 -> 7.09643474E-45243807 Inexact Rounded +xpow113 power 982.217817 7 -> 8.81971709E+20 Inexact Rounded +xrem113 remainder 982.217817 7224909.4E-45243816 -> NaN Division_impossible +xsub113 subtract 982.217817 7224909.4E-45243816 -> 982.217817 Inexact Rounded +xadd114 add 503712056. -57490703.5E+924890183 -> -5.74907035E+924890190 Inexact Rounded +xcom114 compare 503712056. -57490703.5E+924890183 -> 1 +xdiv114 divide 503712056. -57490703.5E+924890183 -> -8.76162623E-924890183 Inexact Rounded +xdvi114 divideint 503712056. -57490703.5E+924890183 -> -0 +xmul114 multiply 503712056. -57490703.5E+924890183 -> -2.89587605E+924890199 Inexact Rounded +xpow114 power 503712056. -6 -> 6.12217764E-53 Inexact Rounded +xrem114 remainder 503712056. -57490703.5E+924890183 -> 503712056 +xsub114 subtract 503712056. -57490703.5E+924890183 -> 5.74907035E+924890190 Inexact Rounded +xadd115 add 883.849223 249259171 -> 249260055 Inexact Rounded +xcom115 compare 883.849223 249259171 -> -1 +xdiv115 divide 883.849223 249259171 -> 0.00000354590453 Inexact Rounded +xdvi115 divideint 883.849223 249259171 -> 0 +xmul115 multiply 883.849223 249259171 -> 2.20307525E+11 Inexact Rounded +xpow115 power 883.849223 249259171 -> 5.15642844E+734411783 Inexact Rounded +xrem115 remainder 883.849223 249259171 -> 883.849223 +xsub115 subtract 883.849223 249259171 -> -249258287 Inexact Rounded +xadd116 add 245.092853E+872642874 828195.152E+419771532 -> 2.45092853E+872642876 Inexact Rounded +xcom116 compare 245.092853E+872642874 828195.152E+419771532 -> 1 +xdiv116 divide 245.092853E+872642874 828195.152E+419771532 -> 2.95936112E+452871338 Inexact Rounded +xdvi116 divideint 245.092853E+872642874 828195.152E+419771532 -> NaN Division_impossible +xmul116 multiply 245.092853E+872642874 828195.152E+419771532 -> Infinity Inexact Overflow Rounded +xpow116 power 245.092853E+872642874 8 -> Infinity Overflow Inexact Rounded +xrem116 remainder 245.092853E+872642874 828195.152E+419771532 -> NaN Division_impossible +xsub116 subtract 245.092853E+872642874 828195.152E+419771532 -> 2.45092853E+872642876 Inexact Rounded +xadd117 add -83658638.6E+728551928 2952478.42 -> -8.36586386E+728551935 Inexact Rounded +xcom117 compare -83658638.6E+728551928 2952478.42 -> -1 +xdiv117 divide -83658638.6E+728551928 2952478.42 -> -2.83350551E+728551929 Inexact Rounded +xdvi117 divideint -83658638.6E+728551928 2952478.42 -> NaN Division_impossible +xmul117 multiply -83658638.6E+728551928 2952478.42 -> -2.47000325E+728551942 Inexact Rounded +xpow117 power -83658638.6E+728551928 2952478 -> Infinity Overflow Inexact Rounded +xrem117 remainder -83658638.6E+728551928 2952478.42 -> NaN Division_impossible +xsub117 subtract -83658638.6E+728551928 2952478.42 -> -8.36586386E+728551935 Inexact Rounded +xadd118 add -6291780.97 269967.394E-22000817 -> -6291780.97 Inexact Rounded +xcom118 compare -6291780.97 269967.394E-22000817 -> -1 +xdiv118 divide -6291780.97 269967.394E-22000817 -> -2.33057069E+22000818 Inexact Rounded +xdvi118 divideint -6291780.97 269967.394E-22000817 -> NaN Division_impossible +xmul118 multiply -6291780.97 269967.394E-22000817 -> -1.69857571E-22000805 Inexact Rounded +xpow118 power -6291780.97 3 -> -2.49069636E+20 Inexact Rounded +xrem118 remainder -6291780.97 269967.394E-22000817 -> NaN Division_impossible +xsub118 subtract -6291780.97 269967.394E-22000817 -> -6291780.97 Inexact Rounded +xadd119 add 978571348.E+222382547 6006.19370 -> 9.78571348E+222382555 Inexact Rounded +xcom119 compare 978571348.E+222382547 6006.19370 -> 1 +xdiv119 divide 978571348.E+222382547 6006.19370 -> 1.62927038E+222382552 Inexact Rounded +xdvi119 divideint 978571348.E+222382547 6006.19370 -> NaN Division_impossible +xmul119 multiply 978571348.E+222382547 6006.19370 -> 5.87748907E+222382559 Inexact Rounded +xpow119 power 978571348.E+222382547 6006 -> Infinity Overflow Inexact Rounded +xrem119 remainder 978571348.E+222382547 6006.19370 -> NaN Division_impossible +xsub119 subtract 978571348.E+222382547 6006.19370 -> 9.78571348E+222382555 Inexact Rounded +xadd120 add 14239029. -36527.2221 -> 14202501.8 Inexact Rounded +xcom120 compare 14239029. -36527.2221 -> 1 +xdiv120 divide 14239029. -36527.2221 -> -389.819652 Inexact Rounded +xdvi120 divideint 14239029. -36527.2221 -> -389 +xmul120 multiply 14239029. -36527.2221 -> -5.20112175E+11 Inexact Rounded +xpow120 power 14239029. -36527 -> 6.64292731E-261296 Inexact Rounded +xrem120 remainder 14239029. -36527.2221 -> 29939.6031 +xsub120 subtract 14239029. -36527.2221 -> 14275556.2 Inexact Rounded +xadd121 add 72333.2654E-544425548 -690.664836E+662155120 -> -6.90664836E+662155122 Inexact Rounded +xcom121 compare 72333.2654E-544425548 -690.664836E+662155120 -> 1 +xdiv121 divide 72333.2654E-544425548 -690.664836E+662155120 -> -0E-1000000007 Inexact Rounded Underflow Subnormal Clamped +xdvi121 divideint 72333.2654E-544425548 -690.664836E+662155120 -> -0 +xmul121 multiply 72333.2654E-544425548 -690.664836E+662155120 -> -4.99580429E+117729579 Inexact Rounded +xpow121 power 72333.2654E-544425548 -7 -> Infinity Overflow Inexact Rounded +xrem121 remainder 72333.2654E-544425548 -690.664836E+662155120 -> 7.23332654E-544425544 +xsub121 subtract 72333.2654E-544425548 -690.664836E+662155120 -> 6.90664836E+662155122 Inexact Rounded +xadd122 add -37721.1567E-115787341 -828949864E-76251747 -> -8.28949864E-76251739 Inexact Rounded +xcom122 compare -37721.1567E-115787341 -828949864E-76251747 -> 1 +xdiv122 divide -37721.1567E-115787341 -828949864E-76251747 -> 4.55047505E-39535599 Inexact Rounded +xdvi122 divideint -37721.1567E-115787341 -828949864E-76251747 -> 0 +xmul122 multiply -37721.1567E-115787341 -828949864E-76251747 -> 3.12689477E-192039075 Inexact Rounded +xpow122 power -37721.1567E-115787341 -8 -> 2.43960765E+926298691 Inexact Rounded +xrem122 remainder -37721.1567E-115787341 -828949864E-76251747 -> -3.77211567E-115787337 +xsub122 subtract -37721.1567E-115787341 -828949864E-76251747 -> 8.28949864E-76251739 Inexact Rounded +xadd123 add -2078852.83E-647080089 -119779858.E+734665461 -> -1.19779858E+734665469 Inexact Rounded +xcom123 compare -2078852.83E-647080089 -119779858.E+734665461 -> 1 +xdiv123 divide -2078852.83E-647080089 -119779858.E+734665461 -> 0E-1000000007 Inexact Rounded Underflow Subnormal Clamped +xdvi123 divideint -2078852.83E-647080089 -119779858.E+734665461 -> 0 +xmul123 multiply -2078852.83E-647080089 -119779858.E+734665461 -> 2.49004697E+87585386 Inexact Rounded +xpow123 power -2078852.83E-647080089 -1 -> -4.81034533E+647080082 Inexact Rounded +xrem123 remainder -2078852.83E-647080089 -119779858.E+734665461 -> -2.07885283E-647080083 +xsub123 subtract -2078852.83E-647080089 -119779858.E+734665461 -> 1.19779858E+734665469 Inexact Rounded +xadd124 add -79145.3625 -7718.57307 -> -86863.9356 Inexact Rounded +xcom124 compare -79145.3625 -7718.57307 -> -1 +xdiv124 divide -79145.3625 -7718.57307 -> 10.2538852 Inexact Rounded +xdvi124 divideint -79145.3625 -7718.57307 -> 10 +xmul124 multiply -79145.3625 -7718.57307 -> 610889264 Inexact Rounded +xpow124 power -79145.3625 -7719 -> -1.13181941E-37811 Inexact Rounded +xrem124 remainder -79145.3625 -7718.57307 -> -1959.63180 +xsub124 subtract -79145.3625 -7718.57307 -> -71426.7894 Inexact Rounded +xadd125 add 2103890.49E+959247237 20024.3017 -> 2.10389049E+959247243 Inexact Rounded +xcom125 compare 2103890.49E+959247237 20024.3017 -> 1 +xdiv125 divide 2103890.49E+959247237 20024.3017 -> 1.05066859E+959247239 Inexact Rounded +xdvi125 divideint 2103890.49E+959247237 20024.3017 -> NaN Division_impossible +xmul125 multiply 2103890.49E+959247237 20024.3017 -> 4.21289379E+959247247 Inexact Rounded +xpow125 power 2103890.49E+959247237 20024 -> Infinity Overflow Inexact Rounded +xrem125 remainder 2103890.49E+959247237 20024.3017 -> NaN Division_impossible +xsub125 subtract 2103890.49E+959247237 20024.3017 -> 2.10389049E+959247243 Inexact Rounded +xadd126 add 911249557 79810804.9 -> 991060362 Inexact Rounded +xcom126 compare 911249557 79810804.9 -> 1 +xdiv126 divide 911249557 79810804.9 -> 11.4176214 Inexact Rounded +xdvi126 divideint 911249557 79810804.9 -> 11 +xmul126 multiply 911249557 79810804.9 -> 7.27275606E+16 Inexact Rounded +xpow126 power 911249557 79810805 -> 6.77595741E+715075867 Inexact Rounded +xrem126 remainder 911249557 79810804.9 -> 33330703.1 +xsub126 subtract 911249557 79810804.9 -> 831438752 Inexact Rounded +xadd127 add 341134.994 3.37486292 -> 341138.369 Inexact Rounded +xcom127 compare 341134.994 3.37486292 -> 1 +xdiv127 divide 341134.994 3.37486292 -> 101081.141 Inexact Rounded +xdvi127 divideint 341134.994 3.37486292 -> 101081 +xmul127 multiply 341134.994 3.37486292 -> 1151283.84 Inexact Rounded +xpow127 power 341134.994 3 -> 3.96989314E+16 Inexact Rounded +xrem127 remainder 341134.994 3.37486292 -> 0.47518348 +xsub127 subtract 341134.994 3.37486292 -> 341131.619 Inexact Rounded +xadd128 add 244.23634 512706190E-341459836 -> 244.236340 Inexact Rounded +xcom128 compare 244.23634 512706190E-341459836 -> 1 +xdiv128 divide 244.23634 512706190E-341459836 -> 4.76367059E+341459829 Inexact Rounded +xdvi128 divideint 244.23634 512706190E-341459836 -> NaN Division_impossible +xmul128 multiply 244.23634 512706190E-341459836 -> 1.25221483E-341459825 Inexact Rounded +xpow128 power 244.23634 5 -> 8.69063312E+11 Inexact Rounded +xrem128 remainder 244.23634 512706190E-341459836 -> NaN Division_impossible +xsub128 subtract 244.23634 512706190E-341459836 -> 244.236340 Inexact Rounded +xadd129 add -9.22783849E+171585954 -99.0946800 -> -9.22783849E+171585954 Inexact Rounded +xcom129 compare -9.22783849E+171585954 -99.0946800 -> -1 +xdiv129 divide -9.22783849E+171585954 -99.0946800 -> 9.31214318E+171585952 Inexact Rounded +xdvi129 divideint -9.22783849E+171585954 -99.0946800 -> NaN Division_impossible +xmul129 multiply -9.22783849E+171585954 -99.0946800 -> 9.14429702E+171585956 Inexact Rounded +xpow129 power -9.22783849E+171585954 -99 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem129 remainder -9.22783849E+171585954 -99.0946800 -> NaN Division_impossible +xsub129 subtract -9.22783849E+171585954 -99.0946800 -> -9.22783849E+171585954 Inexact Rounded +xadd130 add 699631.893 -226.423958 -> 699405.469 Inexact Rounded +xcom130 compare 699631.893 -226.423958 -> 1 +xdiv130 divide 699631.893 -226.423958 -> -3089.91990 Inexact Rounded +xdvi130 divideint 699631.893 -226.423958 -> -3089 +xmul130 multiply 699631.893 -226.423958 -> -158413422 Inexact Rounded +xpow130 power 699631.893 -226 -> 1.14675511E-1321 Inexact Rounded +xrem130 remainder 699631.893 -226.423958 -> 208.286738 +xsub130 subtract 699631.893 -226.423958 -> 699858.317 Inexact Rounded +xadd131 add -249350139.E-571793673 775732428. -> 775732428 Inexact Rounded +xcom131 compare -249350139.E-571793673 775732428. -> -1 +xdiv131 divide -249350139.E-571793673 775732428. -> -3.21438334E-571793674 Inexact Rounded +xdvi131 divideint -249350139.E-571793673 775732428. -> -0 +xmul131 multiply -249350139.E-571793673 775732428. -> -1.93428989E-571793656 Inexact Rounded +xpow131 power -249350139.E-571793673 775732428 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem131 remainder -249350139.E-571793673 775732428. -> -2.49350139E-571793665 +xsub131 subtract -249350139.E-571793673 775732428. -> -775732428 Inexact Rounded +xadd132 add 5.11629020 -480.53194 -> -475.415650 Inexact Rounded +xcom132 compare 5.11629020 -480.53194 -> 1 +xdiv132 divide 5.11629020 -480.53194 -> -0.0106471387 Inexact Rounded +xdvi132 divideint 5.11629020 -480.53194 -> -0 +xmul132 multiply 5.11629020 -480.53194 -> -2458.54086 Inexact Rounded +xpow132 power 5.11629020 -481 -> 9.83021951E-342 Inexact Rounded +xrem132 remainder 5.11629020 -480.53194 -> 5.11629020 +xsub132 subtract 5.11629020 -480.53194 -> 485.648230 Inexact Rounded +xadd133 add -8.23352673E-446723147 -530710.866 -> -530710.866 Inexact Rounded +xcom133 compare -8.23352673E-446723147 -530710.866 -> 1 +xdiv133 divide -8.23352673E-446723147 -530710.866 -> 1.55141476E-446723152 Inexact Rounded +xdvi133 divideint -8.23352673E-446723147 -530710.866 -> 0 +xmul133 multiply -8.23352673E-446723147 -530710.866 -> 4.36962210E-446723141 Inexact Rounded +xpow133 power -8.23352673E-446723147 -530711 -> -Infinity Overflow Inexact Rounded +xrem133 remainder -8.23352673E-446723147 -530710.866 -> -8.23352673E-446723147 +xsub133 subtract -8.23352673E-446723147 -530710.866 -> 530710.866 Inexact Rounded +xadd134 add 7.0598608 -95908.35 -> -95901.2901 Inexact Rounded +xcom134 compare 7.0598608 -95908.35 -> 1 +xdiv134 divide 7.0598608 -95908.35 -> -0.0000736104917 Inexact Rounded +xdvi134 divideint 7.0598608 -95908.35 -> -0 +xmul134 multiply 7.0598608 -95908.35 -> -677099.601 Inexact Rounded +xpow134 power 7.0598608 -95908 -> 4.57073877E-81407 Inexact Rounded +xrem134 remainder 7.0598608 -95908.35 -> 7.0598608 +xsub134 subtract 7.0598608 -95908.35 -> 95915.4099 Inexact Rounded +xadd135 add -7.91189845E+207202706 1532.71847E+509944335 -> 1.53271847E+509944338 Inexact Rounded +xcom135 compare -7.91189845E+207202706 1532.71847E+509944335 -> -1 +xdiv135 divide -7.91189845E+207202706 1532.71847E+509944335 -> -5.16200372E-302741632 Inexact Rounded +xdvi135 divideint -7.91189845E+207202706 1532.71847E+509944335 -> -0 +xmul135 multiply -7.91189845E+207202706 1532.71847E+509944335 -> -1.21267129E+717147045 Inexact Rounded +xpow135 power -7.91189845E+207202706 2 -> 6.25981371E+414405413 Inexact Rounded +xrem135 remainder -7.91189845E+207202706 1532.71847E+509944335 -> -7.91189845E+207202706 +xsub135 subtract -7.91189845E+207202706 1532.71847E+509944335 -> -1.53271847E+509944338 Inexact Rounded +xadd136 add 208839370.E-215147432 -75.9420559 -> -75.9420559 Inexact Rounded +xcom136 compare 208839370.E-215147432 -75.9420559 -> 1 +xdiv136 divide 208839370.E-215147432 -75.9420559 -> -2.74998310E-215147426 Inexact Rounded +xdvi136 divideint 208839370.E-215147432 -75.9420559 -> -0 +xmul136 multiply 208839370.E-215147432 -75.9420559 -> -1.58596911E-215147422 Inexact Rounded +xpow136 power 208839370.E-215147432 -76 -> Infinity Overflow Inexact Rounded +xrem136 remainder 208839370.E-215147432 -75.9420559 -> 2.08839370E-215147424 +xsub136 subtract 208839370.E-215147432 -75.9420559 -> 75.9420559 Inexact Rounded +xadd137 add 427.754244E-353328369 4705.0796 -> 4705.07960 Inexact Rounded +xcom137 compare 427.754244E-353328369 4705.0796 -> -1 +xdiv137 divide 427.754244E-353328369 4705.0796 -> 9.09132853E-353328371 Inexact Rounded +xdvi137 divideint 427.754244E-353328369 4705.0796 -> 0 +xmul137 multiply 427.754244E-353328369 4705.0796 -> 2.01261777E-353328363 Inexact Rounded +xpow137 power 427.754244E-353328369 4705 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem137 remainder 427.754244E-353328369 4705.0796 -> 4.27754244E-353328367 +xsub137 subtract 427.754244E-353328369 4705.0796 -> -4705.07960 Inexact Rounded +xadd138 add 44911.089 -95.1733605E-313081848 -> 44911.0890 Inexact Rounded +xcom138 compare 44911.089 -95.1733605E-313081848 -> 1 +xdiv138 divide 44911.089 -95.1733605E-313081848 -> -4.71887183E+313081850 Inexact Rounded +xdvi138 divideint 44911.089 -95.1733605E-313081848 -> NaN Division_impossible +xmul138 multiply 44911.089 -95.1733605E-313081848 -> -4.27433926E-313081842 Inexact Rounded +xpow138 power 44911.089 -10 -> 2.99546425E-47 Inexact Rounded +xrem138 remainder 44911.089 -95.1733605E-313081848 -> NaN Division_impossible +xsub138 subtract 44911.089 -95.1733605E-313081848 -> 44911.0890 Inexact Rounded +xadd139 add 452371821. -4109709.19 -> 448262112 Inexact Rounded +xcom139 compare 452371821. -4109709.19 -> 1 +xdiv139 divide 452371821. -4109709.19 -> -110.073925 Inexact Rounded +xdvi139 divideint 452371821. -4109709.19 -> -110 +xmul139 multiply 452371821. -4109709.19 -> -1.85911663E+15 Inexact Rounded +xpow139 power 452371821. -4109709 -> 1.15528807E-35571568 Inexact Rounded +xrem139 remainder 452371821. -4109709.19 -> 303810.10 +xsub139 subtract 452371821. -4109709.19 -> 456481530 Inexact Rounded +xadd140 add 94007.4392 -9467725.5E+681898234 -> -9.46772550E+681898240 Inexact Rounded +xcom140 compare 94007.4392 -9467725.5E+681898234 -> 1 +xdiv140 divide 94007.4392 -9467725.5E+681898234 -> -9.92925272E-681898237 Inexact Rounded +xdvi140 divideint 94007.4392 -9467725.5E+681898234 -> -0 +xmul140 multiply 94007.4392 -9467725.5E+681898234 -> -8.90036629E+681898245 Inexact Rounded +xpow140 power 94007.4392 -9 -> 1.74397397E-45 Inexact Rounded +xrem140 remainder 94007.4392 -9467725.5E+681898234 -> 94007.4392 +xsub140 subtract 94007.4392 -9467725.5E+681898234 -> 9.46772550E+681898240 Inexact Rounded +xadd141 add 99147554.0E-751410586 38313.6423 -> 38313.6423 Inexact Rounded +xcom141 compare 99147554.0E-751410586 38313.6423 -> -1 +xdiv141 divide 99147554.0E-751410586 38313.6423 -> 2.58778722E-751410583 Inexact Rounded +xdvi141 divideint 99147554.0E-751410586 38313.6423 -> 0 +xmul141 multiply 99147554.0E-751410586 38313.6423 -> 3.79870392E-751410574 Inexact Rounded +xpow141 power 99147554.0E-751410586 38314 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem141 remainder 99147554.0E-751410586 38313.6423 -> 9.91475540E-751410579 +xsub141 subtract 99147554.0E-751410586 38313.6423 -> -38313.6423 Inexact Rounded +xadd142 add -7919.30254 -669.607854 -> -8588.91039 Inexact Rounded +xcom142 compare -7919.30254 -669.607854 -> -1 +xdiv142 divide -7919.30254 -669.607854 -> 11.8267767 Inexact Rounded +xdvi142 divideint -7919.30254 -669.607854 -> 11 +xmul142 multiply -7919.30254 -669.607854 -> 5302827.18 Inexact Rounded +xpow142 power -7919.30254 -670 -> 7.58147724E-2613 Inexact Rounded +xrem142 remainder -7919.30254 -669.607854 -> -553.616146 +xsub142 subtract -7919.30254 -669.607854 -> -7249.69469 Inexact Rounded +xadd143 add 461.58280E+136110821 710666052.E-383754231 -> 4.61582800E+136110823 Inexact Rounded +xcom143 compare 461.58280E+136110821 710666052.E-383754231 -> 1 +xdiv143 divide 461.58280E+136110821 710666052.E-383754231 -> 6.49507316E+519865045 Inexact Rounded +xdvi143 divideint 461.58280E+136110821 710666052.E-383754231 -> NaN Division_impossible +xmul143 multiply 461.58280E+136110821 710666052.E-383754231 -> 3.28031226E-247643399 Inexact Rounded +xpow143 power 461.58280E+136110821 7 -> 4.46423781E+952775765 Inexact Rounded +xrem143 remainder 461.58280E+136110821 710666052.E-383754231 -> NaN Division_impossible +xsub143 subtract 461.58280E+136110821 710666052.E-383754231 -> 4.61582800E+136110823 Inexact Rounded +xadd144 add 3455755.47E-112465506 771.674306 -> 771.674306 Inexact Rounded +xcom144 compare 3455755.47E-112465506 771.674306 -> -1 +xdiv144 divide 3455755.47E-112465506 771.674306 -> 4.47825649E-112465503 Inexact Rounded +xdvi144 divideint 3455755.47E-112465506 771.674306 -> 0 +xmul144 multiply 3455755.47E-112465506 771.674306 -> 2.66671770E-112465497 Inexact Rounded +xpow144 power 3455755.47E-112465506 772 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem144 remainder 3455755.47E-112465506 771.674306 -> 3.45575547E-112465500 +xsub144 subtract 3455755.47E-112465506 771.674306 -> -771.674306 Inexact Rounded +xadd145 add -477067757.E-961684940 7.70122608E-741072245 -> 7.70122608E-741072245 Inexact Rounded +xcom145 compare -477067757.E-961684940 7.70122608E-741072245 -> -1 +xdiv145 divide -477067757.E-961684940 7.70122608E-741072245 -> -6.19469877E-220612688 Inexact Rounded +xdvi145 divideint -477067757.E-961684940 7.70122608E-741072245 -> -0 +xmul145 multiply -477067757.E-961684940 7.70122608E-741072245 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow145 power -477067757.E-961684940 8 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem145 remainder -477067757.E-961684940 7.70122608E-741072245 -> -4.77067757E-961684932 +xsub145 subtract -477067757.E-961684940 7.70122608E-741072245 -> -7.70122608E-741072245 Inexact Rounded +xadd146 add 76482.352 8237806.8 -> 8314289.15 Inexact Rounded +xcom146 compare 76482.352 8237806.8 -> -1 +xdiv146 divide 76482.352 8237806.8 -> 0.00928430999 Inexact Rounded +xdvi146 divideint 76482.352 8237806.8 -> 0 +xmul146 multiply 76482.352 8237806.8 -> 6.30046839E+11 Inexact Rounded +xpow146 power 76482.352 8237807 -> 8.44216559E+40229834 Inexact Rounded +xrem146 remainder 76482.352 8237806.8 -> 76482.352 +xsub146 subtract 76482.352 8237806.8 -> -8161324.45 Inexact Rounded +xadd147 add 1.21505164E-565556504 9.26146573 -> 9.26146573 Inexact Rounded +xcom147 compare 1.21505164E-565556504 9.26146573 -> -1 +xdiv147 divide 1.21505164E-565556504 9.26146573 -> 1.31194314E-565556505 Inexact Rounded +xdvi147 divideint 1.21505164E-565556504 9.26146573 -> 0 +xmul147 multiply 1.21505164E-565556504 9.26146573 -> 1.12531591E-565556503 Inexact Rounded +xpow147 power 1.21505164E-565556504 9 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem147 remainder 1.21505164E-565556504 9.26146573 -> 1.21505164E-565556504 +xsub147 subtract 1.21505164E-565556504 9.26146573 -> -9.26146573 Inexact Rounded +xadd148 add -8303060.25E-169894883 901561.985 -> 901561.985 Inexact Rounded +xcom148 compare -8303060.25E-169894883 901561.985 -> -1 +xdiv148 divide -8303060.25E-169894883 901561.985 -> -9.20963881E-169894883 Inexact Rounded +xdvi148 divideint -8303060.25E-169894883 901561.985 -> -0 +xmul148 multiply -8303060.25E-169894883 901561.985 -> -7.48572348E-169894871 Inexact Rounded +xpow148 power -8303060.25E-169894883 901562 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem148 remainder -8303060.25E-169894883 901561.985 -> -8.30306025E-169894877 +xsub148 subtract -8303060.25E-169894883 901561.985 -> -901561.985 Inexact Rounded +xadd149 add -592464.92 71445510.7 -> 70853045.8 Inexact Rounded +xcom149 compare -592464.92 71445510.7 -> -1 +xdiv149 divide -592464.92 71445510.7 -> -0.00829254231 Inexact Rounded +xdvi149 divideint -592464.92 71445510.7 -> -0 +xmul149 multiply -592464.92 71445510.7 -> -4.23289588E+13 Inexact Rounded +xpow149 power -592464.92 71445511 -> -1.58269108E+412430832 Inexact Rounded +xrem149 remainder -592464.92 71445510.7 -> -592464.92 +xsub149 subtract -592464.92 71445510.7 -> -72037975.6 Inexact Rounded +xadd150 add -73774.4165 -39.8243027 -> -73814.2408 Inexact Rounded +xcom150 compare -73774.4165 -39.8243027 -> -1 +xdiv150 divide -73774.4165 -39.8243027 -> 1852.49738 Inexact Rounded +xdvi150 divideint -73774.4165 -39.8243027 -> 1852 +xmul150 multiply -73774.4165 -39.8243027 -> 2938014.69 Inexact Rounded +xpow150 power -73774.4165 -40 -> 1.92206765E-195 Inexact Rounded +xrem150 remainder -73774.4165 -39.8243027 -> -19.8078996 +xsub150 subtract -73774.4165 -39.8243027 -> -73734.5922 Inexact Rounded +xadd151 add -524724715. -55763.7937 -> -524780479 Inexact Rounded +xcom151 compare -524724715. -55763.7937 -> -1 +xdiv151 divide -524724715. -55763.7937 -> 9409.77434 Inexact Rounded +xdvi151 divideint -524724715. -55763.7937 -> 9409 +xmul151 multiply -524724715. -55763.7937 -> 2.92606408E+13 Inexact Rounded +xpow151 power -524724715. -55764 -> 5.47898351E-486259 Inexact Rounded +xrem151 remainder -524724715. -55763.7937 -> -43180.0767 +xsub151 subtract -524724715. -55763.7937 -> -524668951 Inexact Rounded +xadd152 add 7.53800427 784873768E-9981146 -> 7.53800427 Inexact Rounded +xcom152 compare 7.53800427 784873768E-9981146 -> 1 +xdiv152 divide 7.53800427 784873768E-9981146 -> 9.60409760E+9981137 Inexact Rounded +xdvi152 divideint 7.53800427 784873768E-9981146 -> NaN Division_impossible +xmul152 multiply 7.53800427 784873768E-9981146 -> 5.91638181E-9981137 Inexact Rounded +xpow152 power 7.53800427 8 -> 10424399.2 Inexact Rounded +xrem152 remainder 7.53800427 784873768E-9981146 -> NaN Division_impossible +xsub152 subtract 7.53800427 784873768E-9981146 -> 7.53800427 Inexact Rounded +xadd153 add 37.6027452 7.22454233 -> 44.8272875 Inexact Rounded +xcom153 compare 37.6027452 7.22454233 -> 1 +xdiv153 divide 37.6027452 7.22454233 -> 5.20486191 Inexact Rounded +xdvi153 divideint 37.6027452 7.22454233 -> 5 +xmul153 multiply 37.6027452 7.22454233 -> 271.662624 Inexact Rounded +xpow153 power 37.6027452 7 -> 1.06300881E+11 Inexact Rounded +xrem153 remainder 37.6027452 7.22454233 -> 1.48003355 +xsub153 subtract 37.6027452 7.22454233 -> 30.3782029 Inexact Rounded +xadd154 add 2447660.39 -36981.4253 -> 2410678.96 Inexact Rounded +xcom154 compare 2447660.39 -36981.4253 -> 1 +xdiv154 divide 2447660.39 -36981.4253 -> -66.1862102 Inexact Rounded +xdvi154 divideint 2447660.39 -36981.4253 -> -66 +xmul154 multiply 2447660.39 -36981.4253 -> -9.05179699E+10 Inexact Rounded +xpow154 power 2447660.39 -36981 -> 3.92066064E-236263 Inexact Rounded +xrem154 remainder 2447660.39 -36981.4253 -> 6886.3202 +xsub154 subtract 2447660.39 -36981.4253 -> 2484641.82 Inexact Rounded +xadd155 add 2160.36419 1418.33574E+656265382 -> 1.41833574E+656265385 Inexact Rounded +xcom155 compare 2160.36419 1418.33574E+656265382 -> -1 +xdiv155 divide 2160.36419 1418.33574E+656265382 -> 1.52316841E-656265382 Inexact Rounded +xdvi155 divideint 2160.36419 1418.33574E+656265382 -> 0 +xmul155 multiply 2160.36419 1418.33574E+656265382 -> 3.06412174E+656265388 Inexact Rounded +xpow155 power 2160.36419 1 -> 2160.36419 +xrem155 remainder 2160.36419 1418.33574E+656265382 -> 2160.36419 +xsub155 subtract 2160.36419 1418.33574E+656265382 -> -1.41833574E+656265385 Inexact Rounded +xadd156 add 8926.44939 54.9430027 -> 8981.39239 Inexact Rounded +xcom156 compare 8926.44939 54.9430027 -> 1 +xdiv156 divide 8926.44939 54.9430027 -> 162.467447 Inexact Rounded +xdvi156 divideint 8926.44939 54.9430027 -> 162 +xmul156 multiply 8926.44939 54.9430027 -> 490445.933 Inexact Rounded +xpow156 power 8926.44939 55 -> 1.93789877E+217 Inexact Rounded +xrem156 remainder 8926.44939 54.9430027 -> 25.6829526 +xsub156 subtract 8926.44939 54.9430027 -> 8871.50639 Inexact Rounded +xadd157 add 861588029 -41657398E+77955925 -> -4.16573980E+77955932 Inexact Rounded +xcom157 compare 861588029 -41657398E+77955925 -> 1 +xdiv157 divide 861588029 -41657398E+77955925 -> -2.06827135E-77955924 Inexact Rounded +xdvi157 divideint 861588029 -41657398E+77955925 -> -0 +xmul157 multiply 861588029 -41657398E+77955925 -> -3.58915154E+77955941 Inexact Rounded +xpow157 power 861588029 -4 -> 1.81468553E-36 Inexact Rounded +xrem157 remainder 861588029 -41657398E+77955925 -> 861588029 +xsub157 subtract 861588029 -41657398E+77955925 -> 4.16573980E+77955932 Inexact Rounded +xadd158 add -34.5253062 52.6722019 -> 18.1468957 +xcom158 compare -34.5253062 52.6722019 -> -1 +xdiv158 divide -34.5253062 52.6722019 -> -0.655474899 Inexact Rounded +xdvi158 divideint -34.5253062 52.6722019 -> -0 +xmul158 multiply -34.5253062 52.6722019 -> -1818.52390 Inexact Rounded +xpow158 power -34.5253062 53 -> -3.32115821E+81 Inexact Rounded +xrem158 remainder -34.5253062 52.6722019 -> -34.5253062 +xsub158 subtract -34.5253062 52.6722019 -> -87.1975081 +xadd159 add -18861647. 99794586.7 -> 80932939.7 +xcom159 compare -18861647. 99794586.7 -> -1 +xdiv159 divide -18861647. 99794586.7 -> -0.189004711 Inexact Rounded +xdvi159 divideint -18861647. 99794586.7 -> -0 +xmul159 multiply -18861647. 99794586.7 -> -1.88229027E+15 Inexact Rounded +xpow159 power -18861647. 99794587 -> -4.28957459E+726063462 Inexact Rounded +xrem159 remainder -18861647. 99794586.7 -> -18861647.0 +xsub159 subtract -18861647. 99794586.7 -> -118656234 Inexact Rounded +xadd160 add 322192.407 461.67044 -> 322654.077 Inexact Rounded +xcom160 compare 322192.407 461.67044 -> 1 +xdiv160 divide 322192.407 461.67044 -> 697.883986 Inexact Rounded +xdvi160 divideint 322192.407 461.67044 -> 697 +xmul160 multiply 322192.407 461.67044 -> 148746710 Inexact Rounded +xpow160 power 322192.407 462 -> 5.61395873E+2544 Inexact Rounded +xrem160 remainder 322192.407 461.67044 -> 408.11032 +xsub160 subtract 322192.407 461.67044 -> 321730.737 Inexact Rounded +xadd161 add -896298518E+61412314 78873.8049 -> -8.96298518E+61412322 Inexact Rounded +xcom161 compare -896298518E+61412314 78873.8049 -> -1 +xdiv161 divide -896298518E+61412314 78873.8049 -> -1.13637033E+61412318 Inexact Rounded +xdvi161 divideint -896298518E+61412314 78873.8049 -> NaN Division_impossible +xmul161 multiply -896298518E+61412314 78873.8049 -> -7.06944744E+61412327 Inexact Rounded +xpow161 power -896298518E+61412314 78874 -> Infinity Overflow Inexact Rounded +xrem161 remainder -896298518E+61412314 78873.8049 -> NaN Division_impossible +xsub161 subtract -896298518E+61412314 78873.8049 -> -8.96298518E+61412322 Inexact Rounded +xadd162 add 293.773732 479899052E+789950177 -> 4.79899052E+789950185 Inexact Rounded +xcom162 compare 293.773732 479899052E+789950177 -> -1 +xdiv162 divide 293.773732 479899052E+789950177 -> 6.12157350E-789950184 Inexact Rounded +xdvi162 divideint 293.773732 479899052E+789950177 -> 0 +xmul162 multiply 293.773732 479899052E+789950177 -> 1.40981735E+789950188 Inexact Rounded +xpow162 power 293.773732 5 -> 2.18808809E+12 Inexact Rounded +xrem162 remainder 293.773732 479899052E+789950177 -> 293.773732 +xsub162 subtract 293.773732 479899052E+789950177 -> -4.79899052E+789950185 Inexact Rounded +xadd163 add -103519362 51897955.3 -> -51621406.7 +xcom163 compare -103519362 51897955.3 -> -1 +xdiv163 divide -103519362 51897955.3 -> -1.99467130 Inexact Rounded +xdvi163 divideint -103519362 51897955.3 -> -1 +xmul163 multiply -103519362 51897955.3 -> -5.37244322E+15 Inexact Rounded +xpow163 power -103519362 51897955 -> -4.28858229E+415963229 Inexact Rounded +xrem163 remainder -103519362 51897955.3 -> -51621406.7 +xsub163 subtract -103519362 51897955.3 -> -155417317 Inexact Rounded +xadd164 add 37380.7802 -277719788. -> -277682407 Inexact Rounded +xcom164 compare 37380.7802 -277719788. -> 1 +xdiv164 divide 37380.7802 -277719788. -> -0.000134598908 Inexact Rounded +xdvi164 divideint 37380.7802 -277719788. -> -0 +xmul164 multiply 37380.7802 -277719788. -> -1.03813824E+13 Inexact Rounded +xpow164 power 37380.7802 -277719788 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem164 remainder 37380.7802 -277719788. -> 37380.7802 +xsub164 subtract 37380.7802 -277719788. -> 277757169 Inexact Rounded +xadd165 add 320133844. -977517477 -> -657383633 +xcom165 compare 320133844. -977517477 -> 1 +xdiv165 divide 320133844. -977517477 -> -0.327496798 Inexact Rounded +xdvi165 divideint 320133844. -977517477 -> -0 +xmul165 multiply 320133844. -977517477 -> -3.12936427E+17 Inexact Rounded +xpow165 power 320133844. -977517477 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem165 remainder 320133844. -977517477 -> 320133844 +xsub165 subtract 320133844. -977517477 -> 1.29765132E+9 Inexact Rounded +xadd166 add 721776701E+933646161 -5689279.64E+669903645 -> 7.21776701E+933646169 Inexact Rounded +xcom166 compare 721776701E+933646161 -5689279.64E+669903645 -> 1 +xdiv166 divide 721776701E+933646161 -5689279.64E+669903645 -> -1.26866097E+263742518 Inexact Rounded +xdvi166 divideint 721776701E+933646161 -5689279.64E+669903645 -> NaN Division_impossible +xmul166 multiply 721776701E+933646161 -5689279.64E+669903645 -> -Infinity Inexact Overflow Rounded +xpow166 power 721776701E+933646161 -6 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem166 remainder 721776701E+933646161 -5689279.64E+669903645 -> NaN Division_impossible +xsub166 subtract 721776701E+933646161 -5689279.64E+669903645 -> 7.21776701E+933646169 Inexact Rounded +xadd167 add -5409.00482 -2.16149386 -> -5411.16631 Inexact Rounded +xcom167 compare -5409.00482 -2.16149386 -> -1 +xdiv167 divide -5409.00482 -2.16149386 -> 2502.43821 Inexact Rounded +xdvi167 divideint -5409.00482 -2.16149386 -> 2502 +xmul167 multiply -5409.00482 -2.16149386 -> 11691.5307 Inexact Rounded +xpow167 power -5409.00482 -2 -> 3.41794652E-8 Inexact Rounded +xrem167 remainder -5409.00482 -2.16149386 -> -0.94718228 +xsub167 subtract -5409.00482 -2.16149386 -> -5406.84333 Inexact Rounded +xadd168 add -957960.367 322.858170 -> -957637.509 Inexact Rounded +xcom168 compare -957960.367 322.858170 -> -1 +xdiv168 divide -957960.367 322.858170 -> -2967.12444 Inexact Rounded +xdvi168 divideint -957960.367 322.858170 -> -2967 +xmul168 multiply -957960.367 322.858170 -> -309285331 Inexact Rounded +xpow168 power -957960.367 323 -> -9.44617460E+1931 Inexact Rounded +xrem168 remainder -957960.367 322.858170 -> -40.176610 +xsub168 subtract -957960.367 322.858170 -> -958283.225 Inexact Rounded +xadd169 add -11817.8754E+613893442 -3.84735082E+888333249 -> -3.84735082E+888333249 Inexact Rounded +xcom169 compare -11817.8754E+613893442 -3.84735082E+888333249 -> 1 +xdiv169 divide -11817.8754E+613893442 -3.84735082E+888333249 -> 3.07169165E-274439804 Inexact Rounded +xdvi169 divideint -11817.8754E+613893442 -3.84735082E+888333249 -> 0 +xmul169 multiply -11817.8754E+613893442 -3.84735082E+888333249 -> Infinity Inexact Overflow Rounded +xpow169 power -11817.8754E+613893442 -4 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem169 remainder -11817.8754E+613893442 -3.84735082E+888333249 -> -1.18178754E+613893446 +xsub169 subtract -11817.8754E+613893442 -3.84735082E+888333249 -> 3.84735082E+888333249 Inexact Rounded +xadd170 add 840258203 58363.980E-906584723 -> 840258203 Inexact Rounded +xcom170 compare 840258203 58363.980E-906584723 -> 1 +xdiv170 divide 840258203 58363.980E-906584723 -> 1.43968626E+906584727 Inexact Rounded +xdvi170 divideint 840258203 58363.980E-906584723 -> NaN Division_impossible +xmul170 multiply 840258203 58363.980E-906584723 -> 4.90408130E-906584710 Inexact Rounded +xpow170 power 840258203 6 -> 3.51946431E+53 Inexact Rounded +xrem170 remainder 840258203 58363.980E-906584723 -> NaN Division_impossible +xsub170 subtract 840258203 58363.980E-906584723 -> 840258203 Inexact Rounded +xadd171 add -205842096. -191342.721 -> -206033439 Inexact Rounded +xcom171 compare -205842096. -191342.721 -> -1 +xdiv171 divide -205842096. -191342.721 -> 1075.77699 Inexact Rounded +xdvi171 divideint -205842096. -191342.721 -> 1075 +xmul171 multiply -205842096. -191342.721 -> 3.93863867E+13 Inexact Rounded +xpow171 power -205842096. -191343 -> -2.66955553E-1590737 Inexact Rounded +xrem171 remainder -205842096. -191342.721 -> -148670.925 +xsub171 subtract -205842096. -191342.721 -> -205650753 Inexact Rounded +xadd172 add 42501124. 884.938498E+123341480 -> 8.84938498E+123341482 Inexact Rounded +xcom172 compare 42501124. 884.938498E+123341480 -> -1 +xdiv172 divide 42501124. 884.938498E+123341480 -> 4.80272065E-123341476 Inexact Rounded +xdvi172 divideint 42501124. 884.938498E+123341480 -> 0 +xmul172 multiply 42501124. 884.938498E+123341480 -> 3.76108808E+123341490 Inexact Rounded +xpow172 power 42501124. 9 -> 4.52484536E+68 Inexact Rounded +xrem172 remainder 42501124. 884.938498E+123341480 -> 42501124 +xsub172 subtract 42501124. 884.938498E+123341480 -> -8.84938498E+123341482 Inexact Rounded +xadd173 add -57809452. -620380746 -> -678190198 +xcom173 compare -57809452. -620380746 -> 1 +xdiv173 divide -57809452. -620380746 -> 0.0931838268 Inexact Rounded +xdvi173 divideint -57809452. -620380746 -> 0 +xmul173 multiply -57809452. -620380746 -> 3.58638710E+16 Inexact Rounded +xpow173 power -57809452. -620380746 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem173 remainder -57809452. -620380746 -> -57809452 +xsub173 subtract -57809452. -620380746 -> 562571294 +xadd174 add -8022370.31 9858581.6 -> 1836211.29 +xcom174 compare -8022370.31 9858581.6 -> -1 +xdiv174 divide -8022370.31 9858581.6 -> -0.813744881 Inexact Rounded +xdvi174 divideint -8022370.31 9858581.6 -> -0 +xmul174 multiply -8022370.31 9858581.6 -> -7.90891923E+13 Inexact Rounded +xpow174 power -8022370.31 9858582 -> 2.34458249E+68066634 Inexact Rounded +xrem174 remainder -8022370.31 9858581.6 -> -8022370.31 +xsub174 subtract -8022370.31 9858581.6 -> -17880951.9 Inexact Rounded +xadd175 add 2.49065060E+592139141 -5432.72014E-419965357 -> 2.49065060E+592139141 Inexact Rounded +xcom175 compare 2.49065060E+592139141 -5432.72014E-419965357 -> 1 +xdiv175 divide 2.49065060E+592139141 -5432.72014E-419965357 -> -Infinity Inexact Overflow Rounded +xdvi175 divideint 2.49065060E+592139141 -5432.72014E-419965357 -> NaN Division_impossible +xmul175 multiply 2.49065060E+592139141 -5432.72014E-419965357 -> -1.35310077E+172173788 Inexact Rounded +xpow175 power 2.49065060E+592139141 -5 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem175 remainder 2.49065060E+592139141 -5432.72014E-419965357 -> NaN Division_impossible +xsub175 subtract 2.49065060E+592139141 -5432.72014E-419965357 -> 2.49065060E+592139141 Inexact Rounded +xadd176 add -697273715E-242824870 -3.81757506 -> -3.81757506 Inexact Rounded +xcom176 compare -697273715E-242824870 -3.81757506 -> 1 +xdiv176 divide -697273715E-242824870 -3.81757506 -> 1.82648331E-242824862 Inexact Rounded +xdvi176 divideint -697273715E-242824870 -3.81757506 -> 0 +xmul176 multiply -697273715E-242824870 -3.81757506 -> 2.66189474E-242824861 Inexact Rounded +xpow176 power -697273715E-242824870 -4 -> 4.23045251E+971299444 Inexact Rounded +xrem176 remainder -697273715E-242824870 -3.81757506 -> -6.97273715E-242824862 +xsub176 subtract -697273715E-242824870 -3.81757506 -> 3.81757506 Inexact Rounded +xadd177 add -7.42204403E-315716280 -8156111.67E+283261636 -> -8.15611167E+283261642 Inexact Rounded +xcom177 compare -7.42204403E-315716280 -8156111.67E+283261636 -> 1 +xdiv177 divide -7.42204403E-315716280 -8156111.67E+283261636 -> 9.09997843E-598977923 Inexact Rounded +xdvi177 divideint -7.42204403E-315716280 -8156111.67E+283261636 -> 0 +xmul177 multiply -7.42204403E-315716280 -8156111.67E+283261636 -> 6.05350199E-32454637 Inexact Rounded +xpow177 power -7.42204403E-315716280 -8 -> Infinity Overflow Inexact Rounded +xrem177 remainder -7.42204403E-315716280 -8156111.67E+283261636 -> -7.42204403E-315716280 +xsub177 subtract -7.42204403E-315716280 -8156111.67E+283261636 -> 8.15611167E+283261642 Inexact Rounded +xadd178 add 738063892 89900467.8 -> 827964360 Inexact Rounded +xcom178 compare 738063892 89900467.8 -> 1 +xdiv178 divide 738063892 89900467.8 -> 8.20978923 Inexact Rounded +xdvi178 divideint 738063892 89900467.8 -> 8 +xmul178 multiply 738063892 89900467.8 -> 6.63522892E+16 Inexact Rounded +xpow178 power 738063892 89900468 -> 1.53166723E+797245797 Inexact Rounded +xrem178 remainder 738063892 89900467.8 -> 18860149.6 +xsub178 subtract 738063892 89900467.8 -> 648163424 Inexact Rounded +xadd179 add -630309366 -884783.338E-21595410 -> -630309366 Inexact Rounded +xcom179 compare -630309366 -884783.338E-21595410 -> -1 +xdiv179 divide -630309366 -884783.338E-21595410 -> 7.12388377E+21595412 Inexact Rounded +xdvi179 divideint -630309366 -884783.338E-21595410 -> NaN Division_impossible +xmul179 multiply -630309366 -884783.338E-21595410 -> 5.57687225E-21595396 Inexact Rounded +xpow179 power -630309366 -9 -> -6.36819210E-80 Inexact Rounded +xrem179 remainder -630309366 -884783.338E-21595410 -> NaN Division_impossible +xsub179 subtract -630309366 -884783.338E-21595410 -> -630309366 Inexact Rounded +xadd180 add 613.207774 -3007.78608 -> -2394.57831 Inexact Rounded +xcom180 compare 613.207774 -3007.78608 -> 1 +xdiv180 divide 613.207774 -3007.78608 -> -0.203873466 Inexact Rounded +xdvi180 divideint 613.207774 -3007.78608 -> -0 +xmul180 multiply 613.207774 -3007.78608 -> -1844397.81 Inexact Rounded +xpow180 power 613.207774 -3008 -> 7.51939160E-8386 Inexact Rounded +xrem180 remainder 613.207774 -3007.78608 -> 613.207774 +xsub180 subtract 613.207774 -3007.78608 -> 3620.99385 Inexact Rounded +xadd181 add -93006222.3 -3.08964619 -> -93006225.4 Inexact Rounded +xcom181 compare -93006222.3 -3.08964619 -> -1 +xdiv181 divide -93006222.3 -3.08964619 -> 30102547.9 Inexact Rounded +xdvi181 divideint -93006222.3 -3.08964619 -> 30102547 +xmul181 multiply -93006222.3 -3.08964619 -> 287356320 Inexact Rounded +xpow181 power -93006222.3 -3 -> -1.24297956E-24 Inexact Rounded +xrem181 remainder -93006222.3 -3.08964619 -> -2.65215407 +xsub181 subtract -93006222.3 -3.08964619 -> -93006219.2 Inexact Rounded +xadd182 add -18116.0621 34096.306E-270347092 -> -18116.0621 Inexact Rounded +xcom182 compare -18116.0621 34096.306E-270347092 -> -1 +xdiv182 divide -18116.0621 34096.306E-270347092 -> -5.31320375E+270347091 Inexact Rounded +xdvi182 divideint -18116.0621 34096.306E-270347092 -> NaN Division_impossible +xmul182 multiply -18116.0621 34096.306E-270347092 -> -6.17690797E-270347084 Inexact Rounded +xpow182 power -18116.0621 3 -> -5.94554133E+12 Inexact Rounded +xrem182 remainder -18116.0621 34096.306E-270347092 -> NaN Division_impossible +xsub182 subtract -18116.0621 34096.306E-270347092 -> -18116.0621 Inexact Rounded +xadd183 add 19272386.9 -410442379. -> -391169992 Inexact Rounded +xcom183 compare 19272386.9 -410442379. -> 1 +xdiv183 divide 19272386.9 -410442379. -> -0.0469551584 Inexact Rounded +xdvi183 divideint 19272386.9 -410442379. -> -0 +xmul183 multiply 19272386.9 -410442379. -> -7.91020433E+15 Inexact Rounded +xpow183 power 19272386.9 -410442379 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem183 remainder 19272386.9 -410442379. -> 19272386.9 +xsub183 subtract 19272386.9 -410442379. -> 429714766 Inexact Rounded +xadd184 add 4180.30821 -1.6439543E-624759104 -> 4180.30821 Inexact Rounded +xcom184 compare 4180.30821 -1.6439543E-624759104 -> 1 +xdiv184 divide 4180.30821 -1.6439543E-624759104 -> -2.54283724E+624759107 Inexact Rounded +xdvi184 divideint 4180.30821 -1.6439543E-624759104 -> NaN Division_impossible +xmul184 multiply 4180.30821 -1.6439543E-624759104 -> -6.87223566E-624759101 Inexact Rounded +xpow184 power 4180.30821 -2 -> 5.72246828E-8 Inexact Rounded +xrem184 remainder 4180.30821 -1.6439543E-624759104 -> NaN Division_impossible +xsub184 subtract 4180.30821 -1.6439543E-624759104 -> 4180.30821 Inexact Rounded +xadd185 add 571.536725 389.899220 -> 961.435945 +xcom185 compare 571.536725 389.899220 -> 1 +xdiv185 divide 571.536725 389.899220 -> 1.46585757 Inexact Rounded +xdvi185 divideint 571.536725 389.899220 -> 1 +xmul185 multiply 571.536725 389.899220 -> 222841.723 Inexact Rounded +xpow185 power 571.536725 390 -> 1.76691373E+1075 Inexact Rounded +xrem185 remainder 571.536725 389.899220 -> 181.637505 +xsub185 subtract 571.536725 389.899220 -> 181.637505 +xadd186 add -622007306.E+159924886 -126.971745 -> -6.22007306E+159924894 Inexact Rounded +xcom186 compare -622007306.E+159924886 -126.971745 -> -1 +xdiv186 divide -622007306.E+159924886 -126.971745 -> 4.89878521E+159924892 Inexact Rounded +xdvi186 divideint -622007306.E+159924886 -126.971745 -> NaN Division_impossible +xmul186 multiply -622007306.E+159924886 -126.971745 -> 7.89773530E+159924896 Inexact Rounded +xpow186 power -622007306.E+159924886 -127 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem186 remainder -622007306.E+159924886 -126.971745 -> NaN Division_impossible +xsub186 subtract -622007306.E+159924886 -126.971745 -> -6.22007306E+159924894 Inexact Rounded +xadd187 add -29.356551E-282816139 37141748E-903397821 -> -2.93565510E-282816138 Inexact Rounded +xcom187 compare -29.356551E-282816139 37141748E-903397821 -> -1 +xdiv187 divide -29.356551E-282816139 37141748E-903397821 -> -7.90392283E+620581675 Inexact Rounded +xdvi187 divideint -29.356551E-282816139 37141748E-903397821 -> NaN Division_impossible +xmul187 multiply -29.356551E-282816139 37141748E-903397821 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow187 power -29.356551E-282816139 4 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem187 remainder -29.356551E-282816139 37141748E-903397821 -> NaN Division_impossible +xsub187 subtract -29.356551E-282816139 37141748E-903397821 -> -2.93565510E-282816138 Inexact Rounded +xadd188 add 92427442.4 674334898. -> 766762340 Inexact Rounded +xcom188 compare 92427442.4 674334898. -> -1 +xdiv188 divide 92427442.4 674334898. -> 0.137064599 Inexact Rounded +xdvi188 divideint 92427442.4 674334898. -> 0 +xmul188 multiply 92427442.4 674334898. -> 6.23270499E+16 Inexact Rounded +xpow188 power 92427442.4 674334898 -> Infinity Overflow Inexact Rounded +xrem188 remainder 92427442.4 674334898. -> 92427442.4 +xsub188 subtract 92427442.4 674334898. -> -581907456 Inexact Rounded +xadd189 add 44651895.7 -910508.438 -> 43741387.3 Inexact Rounded +xcom189 compare 44651895.7 -910508.438 -> 1 +xdiv189 divide 44651895.7 -910508.438 -> -49.0406171 Inexact Rounded +xdvi189 divideint 44651895.7 -910508.438 -> -49 +xmul189 multiply 44651895.7 -910508.438 -> -4.06559278E+13 Inexact Rounded +xpow189 power 44651895.7 -910508 -> 3.72264277E-6965241 Inexact Rounded +xrem189 remainder 44651895.7 -910508.438 -> 36982.238 +xsub189 subtract 44651895.7 -910508.438 -> 45562404.1 Inexact Rounded +xadd190 add 647897872.E+374021790 -467.423029 -> 6.47897872E+374021798 Inexact Rounded +xcom190 compare 647897872.E+374021790 -467.423029 -> 1 +xdiv190 divide 647897872.E+374021790 -467.423029 -> -1.38610601E+374021796 Inexact Rounded +xdvi190 divideint 647897872.E+374021790 -467.423029 -> NaN Division_impossible +xmul190 multiply 647897872.E+374021790 -467.423029 -> -3.02842386E+374021801 Inexact Rounded +xpow190 power 647897872.E+374021790 -467 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem190 remainder 647897872.E+374021790 -467.423029 -> NaN Division_impossible +xsub190 subtract 647897872.E+374021790 -467.423029 -> 6.47897872E+374021798 Inexact Rounded +xadd191 add 25.2592149 59.0436981 -> 84.3029130 +xcom191 compare 25.2592149 59.0436981 -> -1 +xdiv191 divide 25.2592149 59.0436981 -> 0.427805434 Inexact Rounded +xdvi191 divideint 25.2592149 59.0436981 -> 0 +xmul191 multiply 25.2592149 59.0436981 -> 1491.39746 Inexact Rounded +xpow191 power 25.2592149 59 -> 5.53058435E+82 Inexact Rounded +xrem191 remainder 25.2592149 59.0436981 -> 25.2592149 +xsub191 subtract 25.2592149 59.0436981 -> -33.7844832 +xadd192 add -6.850835 -1273.48240 -> -1280.33324 Inexact Rounded +xcom192 compare -6.850835 -1273.48240 -> 1 +xdiv192 divide -6.850835 -1273.48240 -> 0.00537960713 Inexact Rounded +xdvi192 divideint -6.850835 -1273.48240 -> 0 +xmul192 multiply -6.850835 -1273.48240 -> 8724.41780 Inexact Rounded +xpow192 power -6.850835 -1273 -> -1.25462678E-1064 Inexact Rounded +xrem192 remainder -6.850835 -1273.48240 -> -6.850835 +xsub192 subtract -6.850835 -1273.48240 -> 1266.63157 Inexact Rounded +xadd193 add 174.272325 5638.16229 -> 5812.43462 Inexact Rounded +xcom193 compare 174.272325 5638.16229 -> -1 +xdiv193 divide 174.272325 5638.16229 -> 0.0309094198 Inexact Rounded +xdvi193 divideint 174.272325 5638.16229 -> 0 +xmul193 multiply 174.272325 5638.16229 -> 982575.651 Inexact Rounded +xpow193 power 174.272325 5638 -> 1.11137724E+12636 Inexact Rounded +xrem193 remainder 174.272325 5638.16229 -> 174.272325 +xsub193 subtract 174.272325 5638.16229 -> -5463.88997 Inexact Rounded +xadd194 add 3455629.76 -8.27332322 -> 3455621.49 Inexact Rounded +xcom194 compare 3455629.76 -8.27332322 -> 1 +xdiv194 divide 3455629.76 -8.27332322 -> -417683.399 Inexact Rounded +xdvi194 divideint 3455629.76 -8.27332322 -> -417683 +xmul194 multiply 3455629.76 -8.27332322 -> -28589541.9 Inexact Rounded +xpow194 power 3455629.76 -8 -> 4.91793015E-53 Inexact Rounded +xrem194 remainder 3455629.76 -8.27332322 -> 3.29750074 +xsub194 subtract 3455629.76 -8.27332322 -> 3455638.03 Inexact Rounded +xadd195 add -924337723E-640771235 86639377.1 -> 86639377.1 Inexact Rounded +xcom195 compare -924337723E-640771235 86639377.1 -> -1 +xdiv195 divide -924337723E-640771235 86639377.1 -> -1.06687947E-640771234 Inexact Rounded +xdvi195 divideint -924337723E-640771235 86639377.1 -> -0 +xmul195 multiply -924337723E-640771235 86639377.1 -> -8.00840446E-640771219 Inexact Rounded +xpow195 power -924337723E-640771235 86639377 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem195 remainder -924337723E-640771235 86639377.1 -> -9.24337723E-640771227 +xsub195 subtract -924337723E-640771235 86639377.1 -> -86639377.1 Inexact Rounded +xadd196 add -620236932.E+656823969 3364722.73 -> -6.20236932E+656823977 Inexact Rounded +xcom196 compare -620236932.E+656823969 3364722.73 -> -1 +xdiv196 divide -620236932.E+656823969 3364722.73 -> -1.84335228E+656823971 Inexact Rounded +xdvi196 divideint -620236932.E+656823969 3364722.73 -> NaN Division_impossible +xmul196 multiply -620236932.E+656823969 3364722.73 -> -2.08692530E+656823984 Inexact Rounded +xpow196 power -620236932.E+656823969 3364723 -> -Infinity Overflow Inexact Rounded +xrem196 remainder -620236932.E+656823969 3364722.73 -> NaN Division_impossible +xsub196 subtract -620236932.E+656823969 3364722.73 -> -6.20236932E+656823977 Inexact Rounded +xadd197 add 9.10025079 702777882E-8192234 -> 9.10025079 Inexact Rounded +xcom197 compare 9.10025079 702777882E-8192234 -> 1 +xdiv197 divide 9.10025079 702777882E-8192234 -> 1.29489715E+8192226 Inexact Rounded +xdvi197 divideint 9.10025079 702777882E-8192234 -> NaN Division_impossible +xmul197 multiply 9.10025079 702777882E-8192234 -> 6.39545498E-8192225 Inexact Rounded +xpow197 power 9.10025079 7 -> 5168607.19 Inexact Rounded +xrem197 remainder 9.10025079 702777882E-8192234 -> NaN Division_impossible +xsub197 subtract 9.10025079 702777882E-8192234 -> 9.10025079 Inexact Rounded +xadd198 add -18857539.9 813013129. -> 794155589 Inexact Rounded +xcom198 compare -18857539.9 813013129. -> -1 +xdiv198 divide -18857539.9 813013129. -> -0.0231946315 Inexact Rounded +xdvi198 divideint -18857539.9 813013129. -> -0 +xmul198 multiply -18857539.9 813013129. -> -1.53314275E+16 Inexact Rounded +xpow198 power -18857539.9 813013129 -> -Infinity Overflow Inexact Rounded +xrem198 remainder -18857539.9 813013129. -> -18857539.9 +xsub198 subtract -18857539.9 813013129. -> -831870669 Inexact Rounded +xadd199 add -8.29530327 3243419.57E+35688332 -> 3.24341957E+35688338 Inexact Rounded +xcom199 compare -8.29530327 3243419.57E+35688332 -> -1 +xdiv199 divide -8.29530327 3243419.57E+35688332 -> -2.55757946E-35688338 Inexact Rounded +xdvi199 divideint -8.29530327 3243419.57E+35688332 -> -0 +xmul199 multiply -8.29530327 3243419.57E+35688332 -> -2.69051490E+35688339 Inexact Rounded +xpow199 power -8.29530327 3 -> -570.816876 Inexact Rounded +xrem199 remainder -8.29530327 3243419.57E+35688332 -> -8.29530327 +xsub199 subtract -8.29530327 3243419.57E+35688332 -> -3.24341957E+35688338 Inexact Rounded +xadd200 add -57101683.5 763551341E+991491712 -> 7.63551341E+991491720 Inexact Rounded +xcom200 compare -57101683.5 763551341E+991491712 -> -1 +xdiv200 divide -57101683.5 763551341E+991491712 -> -7.47843405E-991491714 Inexact Rounded +xdvi200 divideint -57101683.5 763551341E+991491712 -> -0 +xmul200 multiply -57101683.5 763551341E+991491712 -> -4.36000670E+991491728 Inexact Rounded +xpow200 power -57101683.5 8 -> 1.13029368E+62 Inexact Rounded +xrem200 remainder -57101683.5 763551341E+991491712 -> -57101683.5 +xsub200 subtract -57101683.5 763551341E+991491712 -> -7.63551341E+991491720 Inexact Rounded +xadd201 add -603326.740 1710.95183 -> -601615.788 Inexact Rounded +xcom201 compare -603326.740 1710.95183 -> -1 +xdiv201 divide -603326.740 1710.95183 -> -352.626374 Inexact Rounded +xdvi201 divideint -603326.740 1710.95183 -> -352 +xmul201 multiply -603326.740 1710.95183 -> -1.03226299E+9 Inexact Rounded +xpow201 power -603326.740 1711 -> -3.35315976E+9890 Inexact Rounded +xrem201 remainder -603326.740 1710.95183 -> -1071.69584 +xsub201 subtract -603326.740 1710.95183 -> -605037.692 Inexact Rounded +xadd202 add -48142763.3 -943434114 -> -991576877 Inexact Rounded +xcom202 compare -48142763.3 -943434114 -> 1 +xdiv202 divide -48142763.3 -943434114 -> 0.0510292797 Inexact Rounded +xdvi202 divideint -48142763.3 -943434114 -> 0 +xmul202 multiply -48142763.3 -943434114 -> 4.54195252E+16 Inexact Rounded +xpow202 power -48142763.3 -943434114 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem202 remainder -48142763.3 -943434114 -> -48142763.3 +xsub202 subtract -48142763.3 -943434114 -> 895291351 Inexact Rounded +xadd203 add -204.586767 -235.531847 -> -440.118614 +xcom203 compare -204.586767 -235.531847 -> 1 +xdiv203 divide -204.586767 -235.531847 -> 0.868616154 Inexact Rounded +xdvi203 divideint -204.586767 -235.531847 -> 0 +xmul203 multiply -204.586767 -235.531847 -> 48186.6991 Inexact Rounded +xpow203 power -204.586767 -236 -> 4.29438222E-546 Inexact Rounded +xrem203 remainder -204.586767 -235.531847 -> -204.586767 +xsub203 subtract -204.586767 -235.531847 -> 30.945080 +xadd204 add -70.3805581 830137.913 -> 830067.532 Inexact Rounded +xcom204 compare -70.3805581 830137.913 -> -1 +xdiv204 divide -70.3805581 830137.913 -> -0.0000847817658 Inexact Rounded +xdvi204 divideint -70.3805581 830137.913 -> -0 +xmul204 multiply -70.3805581 830137.913 -> -58425569.6 Inexact Rounded +xpow204 power -70.3805581 830138 -> 4.95165841E+1533640 Inexact Rounded +xrem204 remainder -70.3805581 830137.913 -> -70.3805581 +xsub204 subtract -70.3805581 830137.913 -> -830208.294 Inexact Rounded +xadd205 add -8818.47606 -60766.4571 -> -69584.9332 Inexact Rounded +xcom205 compare -8818.47606 -60766.4571 -> 1 +xdiv205 divide -8818.47606 -60766.4571 -> 0.145120787 Inexact Rounded +xdvi205 divideint -8818.47606 -60766.4571 -> 0 +xmul205 multiply -8818.47606 -60766.4571 -> 535867547 Inexact Rounded +xpow205 power -8818.47606 -60766 -> 1.64487755E-239746 Inexact Rounded +xrem205 remainder -8818.47606 -60766.4571 -> -8818.47606 +xsub205 subtract -8818.47606 -60766.4571 -> 51947.9810 Inexact Rounded +xadd206 add 37060929.3E-168439509 -79576717.1 -> -79576717.1 Inexact Rounded +xcom206 compare 37060929.3E-168439509 -79576717.1 -> 1 +xdiv206 divide 37060929.3E-168439509 -79576717.1 -> -4.65725788E-168439510 Inexact Rounded +xdvi206 divideint 37060929.3E-168439509 -79576717.1 -> -0 +xmul206 multiply 37060929.3E-168439509 -79576717.1 -> -2.94918709E-168439494 Inexact Rounded +xpow206 power 37060929.3E-168439509 -79576717 -> Infinity Overflow Inexact Rounded +xrem206 remainder 37060929.3E-168439509 -79576717.1 -> 3.70609293E-168439502 +xsub206 subtract 37060929.3E-168439509 -79576717.1 -> 79576717.1 Inexact Rounded +xadd207 add -656285310. -107221462. -> -763506772 +xcom207 compare -656285310. -107221462. -> -1 +xdiv207 divide -656285310. -107221462. -> 6.12083904 Inexact Rounded +xdvi207 divideint -656285310. -107221462. -> 6 +xmul207 multiply -656285310. -107221462. -> 7.03678704E+16 Inexact Rounded +xpow207 power -656285310. -107221462 -> 8.05338080E-945381569 Inexact Rounded +xrem207 remainder -656285310. -107221462. -> -12956538 +xsub207 subtract -656285310. -107221462. -> -549063848 +xadd208 add 653397.125 7195.30990 -> 660592.435 Inexact Rounded +xcom208 compare 653397.125 7195.30990 -> 1 +xdiv208 divide 653397.125 7195.30990 -> 90.8087538 Inexact Rounded +xdvi208 divideint 653397.125 7195.30990 -> 90 +xmul208 multiply 653397.125 7195.30990 -> 4.70139480E+9 Inexact Rounded +xpow208 power 653397.125 7195 -> 1.58522983E+41840 Inexact Rounded +xrem208 remainder 653397.125 7195.30990 -> 5819.23400 +xsub208 subtract 653397.125 7195.30990 -> 646201.815 Inexact Rounded +xadd209 add 56221910.0E+857909374 -58.7247929 -> 5.62219100E+857909381 Inexact Rounded +xcom209 compare 56221910.0E+857909374 -58.7247929 -> 1 +xdiv209 divide 56221910.0E+857909374 -58.7247929 -> -9.57379451E+857909379 Inexact Rounded +xdvi209 divideint 56221910.0E+857909374 -58.7247929 -> NaN Division_impossible +xmul209 multiply 56221910.0E+857909374 -58.7247929 -> -3.30162002E+857909383 Inexact Rounded +xpow209 power 56221910.0E+857909374 -59 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem209 remainder 56221910.0E+857909374 -58.7247929 -> NaN Division_impossible +xsub209 subtract 56221910.0E+857909374 -58.7247929 -> 5.62219100E+857909381 Inexact Rounded +xadd210 add 809862859E+643769974 -5.06784016 -> 8.09862859E+643769982 Inexact Rounded +xcom210 compare 809862859E+643769974 -5.06784016 -> 1 +xdiv210 divide 809862859E+643769974 -5.06784016 -> -1.59804341E+643769982 Inexact Rounded +xdvi210 divideint 809862859E+643769974 -5.06784016 -> NaN Division_impossible +xmul210 multiply 809862859E+643769974 -5.06784016 -> -4.10425552E+643769983 Inexact Rounded +xpow210 power 809862859E+643769974 -5 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem210 remainder 809862859E+643769974 -5.06784016 -> NaN Division_impossible +xsub210 subtract 809862859E+643769974 -5.06784016 -> 8.09862859E+643769982 Inexact Rounded +xadd211 add -62011.4563E-117563240 -57.1731586E+115657204 -> -5.71731586E+115657205 Inexact Rounded +xcom211 compare -62011.4563E-117563240 -57.1731586E+115657204 -> 1 +xdiv211 divide -62011.4563E-117563240 -57.1731586E+115657204 -> 1.08462534E-233220441 Inexact Rounded +xdvi211 divideint -62011.4563E-117563240 -57.1731586E+115657204 -> 0 +xmul211 multiply -62011.4563E-117563240 -57.1731586E+115657204 -> 3.54539083E-1906030 Inexact Rounded +xpow211 power -62011.4563E-117563240 -6 -> 1.75860546E+705379411 Inexact Rounded +xrem211 remainder -62011.4563E-117563240 -57.1731586E+115657204 -> -6.20114563E-117563236 +xsub211 subtract -62011.4563E-117563240 -57.1731586E+115657204 -> 5.71731586E+115657205 Inexact Rounded +xadd212 add 315.33351 91588.837E-536020149 -> 315.333510 Inexact Rounded +xcom212 compare 315.33351 91588.837E-536020149 -> 1 +xdiv212 divide 315.33351 91588.837E-536020149 -> 3.44292515E+536020146 Inexact Rounded +xdvi212 divideint 315.33351 91588.837E-536020149 -> NaN Division_impossible +xmul212 multiply 315.33351 91588.837E-536020149 -> 2.88810294E-536020142 Inexact Rounded +xpow212 power 315.33351 9 -> 3.08269902E+22 Inexact Rounded +xrem212 remainder 315.33351 91588.837E-536020149 -> NaN Division_impossible +xsub212 subtract 315.33351 91588.837E-536020149 -> 315.333510 Inexact Rounded +xadd213 add 739.944710 202949.175 -> 203689.120 Inexact Rounded +xcom213 compare 739.944710 202949.175 -> -1 +xdiv213 divide 739.944710 202949.175 -> 0.00364596067 Inexact Rounded +xdvi213 divideint 739.944710 202949.175 -> 0 +xmul213 multiply 739.944710 202949.175 -> 150171168 Inexact Rounded +xpow213 power 739.944710 202949 -> 1.32611729E+582301 Inexact Rounded +xrem213 remainder 739.944710 202949.175 -> 739.944710 +xsub213 subtract 739.944710 202949.175 -> -202209.230 Inexact Rounded +xadd214 add 87686.8016 4204890.40 -> 4292577.20 Inexact Rounded +xcom214 compare 87686.8016 4204890.40 -> -1 +xdiv214 divide 87686.8016 4204890.40 -> 0.0208535285 Inexact Rounded +xdvi214 divideint 87686.8016 4204890.40 -> 0 +xmul214 multiply 87686.8016 4204890.40 -> 3.68713390E+11 Inexact Rounded +xpow214 power 87686.8016 4204890 -> 5.14846981E+20784494 Inexact Rounded +xrem214 remainder 87686.8016 4204890.40 -> 87686.8016 +xsub214 subtract 87686.8016 4204890.40 -> -4117203.60 Inexact Rounded +xadd215 add 987126721.E-725794834 4874166.23 -> 4874166.23 Inexact Rounded +xcom215 compare 987126721.E-725794834 4874166.23 -> -1 +xdiv215 divide 987126721.E-725794834 4874166.23 -> 2.02522170E-725794832 Inexact Rounded +xdvi215 divideint 987126721.E-725794834 4874166.23 -> 0 +xmul215 multiply 987126721.E-725794834 4874166.23 -> 4.81141973E-725794819 Inexact Rounded +xpow215 power 987126721.E-725794834 4874166 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem215 remainder 987126721.E-725794834 4874166.23 -> 9.87126721E-725794826 +xsub215 subtract 987126721.E-725794834 4874166.23 -> -4874166.23 Inexact Rounded +xadd216 add 728148726.E-661695938 32798.5202 -> 32798.5202 Inexact Rounded +xcom216 compare 728148726.E-661695938 32798.5202 -> -1 +xdiv216 divide 728148726.E-661695938 32798.5202 -> 2.22006579E-661695934 Inexact Rounded +xdvi216 divideint 728148726.E-661695938 32798.5202 -> 0 +xmul216 multiply 728148726.E-661695938 32798.5202 -> 2.38822007E-661695925 Inexact Rounded +xpow216 power 728148726.E-661695938 32799 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem216 remainder 728148726.E-661695938 32798.5202 -> 7.28148726E-661695930 +xsub216 subtract 728148726.E-661695938 32798.5202 -> -32798.5202 Inexact Rounded +xadd217 add 7428219.97 667.326760 -> 7428887.30 Inexact Rounded +xcom217 compare 7428219.97 667.326760 -> 1 +xdiv217 divide 7428219.97 667.326760 -> 11131.3084 Inexact Rounded +xdvi217 divideint 7428219.97 667.326760 -> 11131 +xmul217 multiply 7428219.97 667.326760 -> 4.95704997E+9 Inexact Rounded +xpow217 power 7428219.97 667 -> 7.58808509E+4582 Inexact Rounded +xrem217 remainder 7428219.97 667.326760 -> 205.804440 +xsub217 subtract 7428219.97 667.326760 -> 7427552.64 Inexact Rounded +xadd218 add -7291.19212 209.64966E-588526476 -> -7291.19212 Inexact Rounded +xcom218 compare -7291.19212 209.64966E-588526476 -> -1 +xdiv218 divide -7291.19212 209.64966E-588526476 -> -3.47779821E+588526477 Inexact Rounded +xdvi218 divideint -7291.19212 209.64966E-588526476 -> NaN Division_impossible +xmul218 multiply -7291.19212 209.64966E-588526476 -> -1.52859595E-588526470 Inexact Rounded +xpow218 power -7291.19212 2 -> 53161482.5 Inexact Rounded +xrem218 remainder -7291.19212 209.64966E-588526476 -> NaN Division_impossible +xsub218 subtract -7291.19212 209.64966E-588526476 -> -7291.19212 Inexact Rounded +xadd219 add -358.24550 -4447.78675E+601402509 -> -4.44778675E+601402512 Inexact Rounded +xcom219 compare -358.24550 -4447.78675E+601402509 -> 1 +xdiv219 divide -358.24550 -4447.78675E+601402509 -> 8.05446664E-601402511 Inexact Rounded +xdvi219 divideint -358.24550 -4447.78675E+601402509 -> 0 +xmul219 multiply -358.24550 -4447.78675E+601402509 -> 1.59339959E+601402515 Inexact Rounded +xpow219 power -358.24550 -4 -> 6.07123474E-11 Inexact Rounded +xrem219 remainder -358.24550 -4447.78675E+601402509 -> -358.24550 +xsub219 subtract -358.24550 -4447.78675E+601402509 -> 4.44778675E+601402512 Inexact Rounded +xadd220 add 118.621826 -2.72010038 -> 115.901726 Inexact Rounded +xcom220 compare 118.621826 -2.72010038 -> 1 +xdiv220 divide 118.621826 -2.72010038 -> -43.6093561 Inexact Rounded +xdvi220 divideint 118.621826 -2.72010038 -> -43 +xmul220 multiply 118.621826 -2.72010038 -> -322.663274 Inexact Rounded +xpow220 power 118.621826 -3 -> 5.99109471E-7 Inexact Rounded +xrem220 remainder 118.621826 -2.72010038 -> 1.65750966 +xsub220 subtract 118.621826 -2.72010038 -> 121.341926 Inexact Rounded +xadd221 add 8071961.94 -135533740.E-102451543 -> 8071961.94 Inexact Rounded +xcom221 compare 8071961.94 -135533740.E-102451543 -> 1 +xdiv221 divide 8071961.94 -135533740.E-102451543 -> -5.95568450E+102451541 Inexact Rounded +xdvi221 divideint 8071961.94 -135533740.E-102451543 -> NaN Division_impossible +xmul221 multiply 8071961.94 -135533740.E-102451543 -> -1.09402319E-102451528 Inexact Rounded +xpow221 power 8071961.94 -1 -> 1.23885619E-7 Inexact Rounded +xrem221 remainder 8071961.94 -135533740.E-102451543 -> NaN Division_impossible +xsub221 subtract 8071961.94 -135533740.E-102451543 -> 8071961.94 Inexact Rounded +xadd222 add 64262528.5E+812118682 -8692.94447E-732186947 -> 6.42625285E+812118689 Inexact Rounded +xcom222 compare 64262528.5E+812118682 -8692.94447E-732186947 -> 1 +xdiv222 divide 64262528.5E+812118682 -8692.94447E-732186947 -> -Infinity Inexact Overflow Rounded +xdvi222 divideint 64262528.5E+812118682 -8692.94447E-732186947 -> NaN Division_impossible +xmul222 multiply 64262528.5E+812118682 -8692.94447E-732186947 -> -5.58630592E+79931746 Inexact Rounded +xpow222 power 64262528.5E+812118682 -9 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem222 remainder 64262528.5E+812118682 -8692.94447E-732186947 -> NaN Division_impossible +xsub222 subtract 64262528.5E+812118682 -8692.94447E-732186947 -> 6.42625285E+812118689 Inexact Rounded +xadd223 add -35544.4029 -567830.130 -> -603374.533 Inexact Rounded +xcom223 compare -35544.4029 -567830.130 -> 1 +xdiv223 divide -35544.4029 -567830.130 -> 0.0625968948 Inexact Rounded +xdvi223 divideint -35544.4029 -567830.130 -> 0 +xmul223 multiply -35544.4029 -567830.130 -> 2.01831829E+10 Inexact Rounded +xpow223 power -35544.4029 -567830 -> 3.77069368E-2584065 Inexact Rounded +xrem223 remainder -35544.4029 -567830.130 -> -35544.4029 +xsub223 subtract -35544.4029 -567830.130 -> 532285.727 Inexact Rounded +xadd224 add -7.16513047E+59297103 87767.8211 -> -7.16513047E+59297103 Inexact Rounded +xcom224 compare -7.16513047E+59297103 87767.8211 -> -1 +xdiv224 divide -7.16513047E+59297103 87767.8211 -> -8.16373288E+59297098 Inexact Rounded +xdvi224 divideint -7.16513047E+59297103 87767.8211 -> NaN Division_impossible +xmul224 multiply -7.16513047E+59297103 87767.8211 -> -6.28867889E+59297108 Inexact Rounded +xpow224 power -7.16513047E+59297103 87768 -> Infinity Overflow Inexact Rounded +xrem224 remainder -7.16513047E+59297103 87767.8211 -> NaN Division_impossible +xsub224 subtract -7.16513047E+59297103 87767.8211 -> -7.16513047E+59297103 Inexact Rounded +xadd225 add -509.483395 -147242915. -> -147243424 Inexact Rounded +xcom225 compare -509.483395 -147242915. -> 1 +xdiv225 divide -509.483395 -147242915. -> 0.00000346015559 Inexact Rounded +xdvi225 divideint -509.483395 -147242915. -> 0 +xmul225 multiply -509.483395 -147242915. -> 7.50178202E+10 Inexact Rounded +xpow225 power -509.483395 -147242915 -> -3.10760519E-398605718 Inexact Rounded +xrem225 remainder -509.483395 -147242915. -> -509.483395 +xsub225 subtract -509.483395 -147242915. -> 147242406 Inexact Rounded +xadd226 add -7919047.28E+956041629 -367667329 -> -7.91904728E+956041635 Inexact Rounded +xcom226 compare -7919047.28E+956041629 -367667329 -> -1 +xdiv226 divide -7919047.28E+956041629 -367667329 -> 2.15386211E+956041627 Inexact Rounded +xdvi226 divideint -7919047.28E+956041629 -367667329 -> NaN Division_impossible +xmul226 multiply -7919047.28E+956041629 -367667329 -> 2.91157496E+956041644 Inexact Rounded +xpow226 power -7919047.28E+956041629 -367667329 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem226 remainder -7919047.28E+956041629 -367667329 -> NaN Division_impossible +xsub226 subtract -7919047.28E+956041629 -367667329 -> -7.91904728E+956041635 Inexact Rounded +xadd227 add 895612630. -36.4104040 -> 895612594 Inexact Rounded +xcom227 compare 895612630. -36.4104040 -> 1 +xdiv227 divide 895612630. -36.4104040 -> -24597712.0 Inexact Rounded +xdvi227 divideint 895612630. -36.4104040 -> -24597711 +xmul227 multiply 895612630. -36.4104040 -> -3.26096177E+10 Inexact Rounded +xpow227 power 895612630. -36 -> 5.29264130E-323 Inexact Rounded +xrem227 remainder 895612630. -36.4104040 -> 35.0147560 +xsub227 subtract 895612630. -36.4104040 -> 895612666 Inexact Rounded +xadd228 add 25455.4973 2955.00006E+528196218 -> 2.95500006E+528196221 Inexact Rounded +xcom228 compare 25455.4973 2955.00006E+528196218 -> -1 +xdiv228 divide 25455.4973 2955.00006E+528196218 -> 8.61438131E-528196218 Inexact Rounded +xdvi228 divideint 25455.4973 2955.00006E+528196218 -> 0 +xmul228 multiply 25455.4973 2955.00006E+528196218 -> 7.52209960E+528196225 Inexact Rounded +xpow228 power 25455.4973 3 -> 1.64947128E+13 Inexact Rounded +xrem228 remainder 25455.4973 2955.00006E+528196218 -> 25455.4973 +xsub228 subtract 25455.4973 2955.00006E+528196218 -> -2.95500006E+528196221 Inexact Rounded +xadd229 add -112.294144E+273414172 -71448007.7 -> -1.12294144E+273414174 Inexact Rounded +xcom229 compare -112.294144E+273414172 -71448007.7 -> -1 +xdiv229 divide -112.294144E+273414172 -71448007.7 -> 1.57169035E+273414166 Inexact Rounded +xdvi229 divideint -112.294144E+273414172 -71448007.7 -> NaN Division_impossible +xmul229 multiply -112.294144E+273414172 -71448007.7 -> 8.02319287E+273414181 Inexact Rounded +xpow229 power -112.294144E+273414172 -71448008 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem229 remainder -112.294144E+273414172 -71448007.7 -> NaN Division_impossible +xsub229 subtract -112.294144E+273414172 -71448007.7 -> -1.12294144E+273414174 Inexact Rounded +xadd230 add 62871.2202 2484.0382E+211662557 -> 2.48403820E+211662560 Inexact Rounded +xcom230 compare 62871.2202 2484.0382E+211662557 -> -1 +xdiv230 divide 62871.2202 2484.0382E+211662557 -> 2.53100859E-211662556 Inexact Rounded +xdvi230 divideint 62871.2202 2484.0382E+211662557 -> 0 +xmul230 multiply 62871.2202 2484.0382E+211662557 -> 1.56174513E+211662565 Inexact Rounded +xpow230 power 62871.2202 2 -> 3.95279033E+9 Inexact Rounded +xrem230 remainder 62871.2202 2484.0382E+211662557 -> 62871.2202 +xsub230 subtract 62871.2202 2484.0382E+211662557 -> -2.48403820E+211662560 Inexact Rounded +xadd231 add 71.9281575 -9810012.5 -> -9809940.57 Inexact Rounded +xcom231 compare 71.9281575 -9810012.5 -> 1 +xdiv231 divide 71.9281575 -9810012.5 -> -0.00000733211680 Inexact Rounded +xdvi231 divideint 71.9281575 -9810012.5 -> -0 +xmul231 multiply 71.9281575 -9810012.5 -> -705616124 Inexact Rounded +xpow231 power 71.9281575 -9810013 -> 2.00363798E-18216203 Inexact Rounded +xrem231 remainder 71.9281575 -9810012.5 -> 71.9281575 +xsub231 subtract 71.9281575 -9810012.5 -> 9810084.43 Inexact Rounded +xadd232 add -6388022. -88.042967 -> -6388110.04 Inexact Rounded +xcom232 compare -6388022. -88.042967 -> -1 +xdiv232 divide -6388022. -88.042967 -> 72555.7329 Inexact Rounded +xdvi232 divideint -6388022. -88.042967 -> 72555 +xmul232 multiply -6388022. -88.042967 -> 562420410 Inexact Rounded +xpow232 power -6388022. -88 -> 1.34201238E-599 Inexact Rounded +xrem232 remainder -6388022. -88.042967 -> -64.529315 +xsub232 subtract -6388022. -88.042967 -> -6387933.96 Inexact Rounded +xadd233 add 372567445. 96.0992141 -> 372567541 Inexact Rounded +xcom233 compare 372567445. 96.0992141 -> 1 +xdiv233 divide 372567445. 96.0992141 -> 3876904.18 Inexact Rounded +xdvi233 divideint 372567445. 96.0992141 -> 3876904 +xmul233 multiply 372567445. 96.0992141 -> 3.58034387E+10 Inexact Rounded +xpow233 power 372567445. 96 -> 6.84968715E+822 Inexact Rounded +xrem233 remainder 372567445. 96.0992141 -> 17.4588536 +xsub233 subtract 372567445. 96.0992141 -> 372567349 Inexact Rounded +xadd234 add 802.156517 -174409310.E-255338020 -> 802.156517 Inexact Rounded +xcom234 compare 802.156517 -174409310.E-255338020 -> 1 +xdiv234 divide 802.156517 -174409310.E-255338020 -> -4.59927579E+255338014 Inexact Rounded +xdvi234 divideint 802.156517 -174409310.E-255338020 -> NaN Division_impossible +xmul234 multiply 802.156517 -174409310.E-255338020 -> -1.39903565E-255338009 Inexact Rounded +xpow234 power 802.156517 -2 -> 0.00000155411005 Inexact Rounded +xrem234 remainder 802.156517 -174409310.E-255338020 -> NaN Division_impossible +xsub234 subtract 802.156517 -174409310.E-255338020 -> 802.156517 Inexact Rounded +xadd235 add -3.65207541 74501982.0 -> 74501978.3 Inexact Rounded +xcom235 compare -3.65207541 74501982.0 -> -1 +xdiv235 divide -3.65207541 74501982.0 -> -4.90198423E-8 Inexact Rounded +xdvi235 divideint -3.65207541 74501982.0 -> -0 +xmul235 multiply -3.65207541 74501982.0 -> -272086856 Inexact Rounded +xpow235 power -3.65207541 74501982 -> 2.10339452E+41910325 Inexact Rounded +xrem235 remainder -3.65207541 74501982.0 -> -3.65207541 +xsub235 subtract -3.65207541 74501982.0 -> -74501985.7 Inexact Rounded +xadd236 add -5297.76981 -859.719404 -> -6157.48921 Inexact Rounded +xcom236 compare -5297.76981 -859.719404 -> -1 +xdiv236 divide -5297.76981 -859.719404 -> 6.16220802 Inexact Rounded +xdvi236 divideint -5297.76981 -859.719404 -> 6 +xmul236 multiply -5297.76981 -859.719404 -> 4554595.50 Inexact Rounded +xpow236 power -5297.76981 -860 -> 1.90523108E-3203 Inexact Rounded +xrem236 remainder -5297.76981 -859.719404 -> -139.453386 +xsub236 subtract -5297.76981 -859.719404 -> -4438.05041 Inexact Rounded +xadd237 add -684172.592 766.448597E+288361959 -> 7.66448597E+288361961 Inexact Rounded +xcom237 compare -684172.592 766.448597E+288361959 -> -1 +xdiv237 divide -684172.592 766.448597E+288361959 -> -8.92652938E-288361957 Inexact Rounded +xdvi237 divideint -684172.592 766.448597E+288361959 -> -0 +xmul237 multiply -684172.592 766.448597E+288361959 -> -5.24383123E+288361967 Inexact Rounded +xpow237 power -684172.592 8 -> 4.80093005E+46 Inexact Rounded +xrem237 remainder -684172.592 766.448597E+288361959 -> -684172.592 +xsub237 subtract -684172.592 766.448597E+288361959 -> -7.66448597E+288361961 Inexact Rounded +xadd238 add 626919.219 57469.8727E+13188610 -> 5.74698727E+13188614 Inexact Rounded +xcom238 compare 626919.219 57469.8727E+13188610 -> -1 +xdiv238 divide 626919.219 57469.8727E+13188610 -> 1.09086586E-13188609 Inexact Rounded +xdvi238 divideint 626919.219 57469.8727E+13188610 -> 0 +xmul238 multiply 626919.219 57469.8727E+13188610 -> 3.60289677E+13188620 Inexact Rounded +xpow238 power 626919.219 6 -> 6.07112959E+34 Inexact Rounded +xrem238 remainder 626919.219 57469.8727E+13188610 -> 626919.219 +xsub238 subtract 626919.219 57469.8727E+13188610 -> -5.74698727E+13188614 Inexact Rounded +xadd239 add -77480.5840 893265.594E+287982552 -> 8.93265594E+287982557 Inexact Rounded +xcom239 compare -77480.5840 893265.594E+287982552 -> -1 +xdiv239 divide -77480.5840 893265.594E+287982552 -> -8.67385742E-287982554 Inexact Rounded +xdvi239 divideint -77480.5840 893265.594E+287982552 -> -0 +xmul239 multiply -77480.5840 893265.594E+287982552 -> -6.92107399E+287982562 Inexact Rounded +xpow239 power -77480.5840 9 -> -1.00631969E+44 Inexact Rounded +xrem239 remainder -77480.5840 893265.594E+287982552 -> -77480.5840 +xsub239 subtract -77480.5840 893265.594E+287982552 -> -8.93265594E+287982557 Inexact Rounded +xadd240 add -7177620.29 7786343.83 -> 608723.54 +xcom240 compare -7177620.29 7786343.83 -> -1 +xdiv240 divide -7177620.29 7786343.83 -> -0.921821647 Inexact Rounded +xdvi240 divideint -7177620.29 7786343.83 -> -0 +xmul240 multiply -7177620.29 7786343.83 -> -5.58874195E+13 Inexact Rounded +xpow240 power -7177620.29 7786344 -> 2.96037074E+53383022 Inexact Rounded +xrem240 remainder -7177620.29 7786343.83 -> -7177620.29 +xsub240 subtract -7177620.29 7786343.83 -> -14963964.1 Inexact Rounded +xadd241 add 9.6224130 4.50355112 -> 14.1259641 Inexact Rounded +xcom241 compare 9.6224130 4.50355112 -> 1 +xdiv241 divide 9.6224130 4.50355112 -> 2.13662791 Inexact Rounded +xdvi241 divideint 9.6224130 4.50355112 -> 2 +xmul241 multiply 9.6224130 4.50355112 -> 43.3350288 Inexact Rounded +xpow241 power 9.6224130 5 -> 82493.5448 Inexact Rounded +xrem241 remainder 9.6224130 4.50355112 -> 0.61531076 +xsub241 subtract 9.6224130 4.50355112 -> 5.11886188 +xadd242 add -66.6337347E-597410086 -818812885 -> -818812885 Inexact Rounded +xcom242 compare -66.6337347E-597410086 -818812885 -> 1 +xdiv242 divide -66.6337347E-597410086 -818812885 -> 8.13784638E-597410094 Inexact Rounded +xdvi242 divideint -66.6337347E-597410086 -818812885 -> 0 +xmul242 multiply -66.6337347E-597410086 -818812885 -> 5.45605605E-597410076 Inexact Rounded +xpow242 power -66.6337347E-597410086 -818812885 -> -Infinity Overflow Inexact Rounded +xrem242 remainder -66.6337347E-597410086 -818812885 -> -6.66337347E-597410085 +xsub242 subtract -66.6337347E-597410086 -818812885 -> 818812885 Inexact Rounded +xadd243 add 65587553.7 600574.736 -> 66188128.4 Inexact Rounded +xcom243 compare 65587553.7 600574.736 -> 1 +xdiv243 divide 65587553.7 600574.736 -> 109.207980 Inexact Rounded +xdvi243 divideint 65587553.7 600574.736 -> 109 +xmul243 multiply 65587553.7 600574.736 -> 3.93902277E+13 Inexact Rounded +xpow243 power 65587553.7 600575 -> 3.40404817E+4694587 Inexact Rounded +xrem243 remainder 65587553.7 600574.736 -> 124907.476 +xsub243 subtract 65587553.7 600574.736 -> 64986979.0 Inexact Rounded +xadd244 add -32401.939 -585200217. -> -585232619 Inexact Rounded +xcom244 compare -32401.939 -585200217. -> 1 +xdiv244 divide -32401.939 -585200217. -> 0.0000553689798 Inexact Rounded +xdvi244 divideint -32401.939 -585200217. -> 0 +xmul244 multiply -32401.939 -585200217. -> 1.89616217E+13 Inexact Rounded +xpow244 power -32401.939 -585200217 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem244 remainder -32401.939 -585200217. -> -32401.939 +xsub244 subtract -32401.939 -585200217. -> 585167815 Inexact Rounded +xadd245 add 69573.988 -9.77003465E+740933668 -> -9.77003465E+740933668 Inexact Rounded +xcom245 compare 69573.988 -9.77003465E+740933668 -> 1 +xdiv245 divide 69573.988 -9.77003465E+740933668 -> -7.12116082E-740933665 Inexact Rounded +xdvi245 divideint 69573.988 -9.77003465E+740933668 -> -0 +xmul245 multiply 69573.988 -9.77003465E+740933668 -> -6.79740273E+740933673 Inexact Rounded +xpow245 power 69573.988 -10 -> 3.76297229E-49 Inexact Rounded +xrem245 remainder 69573.988 -9.77003465E+740933668 -> 69573.988 +xsub245 subtract 69573.988 -9.77003465E+740933668 -> 9.77003465E+740933668 Inexact Rounded +xadd246 add 2362.06251 -433149546.E-152643629 -> 2362.06251 Inexact Rounded +xcom246 compare 2362.06251 -433149546.E-152643629 -> 1 +xdiv246 divide 2362.06251 -433149546.E-152643629 -> -5.45322633E+152643623 Inexact Rounded +xdvi246 divideint 2362.06251 -433149546.E-152643629 -> NaN Division_impossible +xmul246 multiply 2362.06251 -433149546.E-152643629 -> -1.02312630E-152643617 Inexact Rounded +xpow246 power 2362.06251 -4 -> 3.21243577E-14 Inexact Rounded +xrem246 remainder 2362.06251 -433149546.E-152643629 -> NaN Division_impossible +xsub246 subtract 2362.06251 -433149546.E-152643629 -> 2362.06251 Inexact Rounded +xadd247 add -615.23488E+249953452 -21437483.7 -> -6.15234880E+249953454 Inexact Rounded +xcom247 compare -615.23488E+249953452 -21437483.7 -> -1 +xdiv247 divide -615.23488E+249953452 -21437483.7 -> 2.86990250E+249953447 Inexact Rounded +xdvi247 divideint -615.23488E+249953452 -21437483.7 -> NaN Division_impossible +xmul247 multiply -615.23488E+249953452 -21437483.7 -> 1.31890877E+249953462 Inexact Rounded +xpow247 power -615.23488E+249953452 -21437484 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem247 remainder -615.23488E+249953452 -21437483.7 -> NaN Division_impossible +xsub247 subtract -615.23488E+249953452 -21437483.7 -> -6.15234880E+249953454 Inexact Rounded +xadd248 add 216741082. 250290244 -> 467031326 +xcom248 compare 216741082. 250290244 -> -1 +xdiv248 divide 216741082. 250290244 -> 0.865958970 Inexact Rounded +xdvi248 divideint 216741082. 250290244 -> 0 +xmul248 multiply 216741082. 250290244 -> 5.42481783E+16 Inexact Rounded +xpow248 power 216741082. 250290244 -> Infinity Overflow Inexact Rounded +xrem248 remainder 216741082. 250290244 -> 216741082 +xsub248 subtract 216741082. 250290244 -> -33549162 +xadd249 add -6364720.49 5539245.64 -> -825474.85 +xcom249 compare -6364720.49 5539245.64 -> -1 +xdiv249 divide -6364720.49 5539245.64 -> -1.14902297 Inexact Rounded +xdvi249 divideint -6364720.49 5539245.64 -> -1 +xmul249 multiply -6364720.49 5539245.64 -> -3.52557502E+13 Inexact Rounded +xpow249 power -6364720.49 5539246 -> 2.96894641E+37687807 Inexact Rounded +xrem249 remainder -6364720.49 5539245.64 -> -825474.85 +xsub249 subtract -6364720.49 5539245.64 -> -11903966.1 Inexact Rounded +xadd250 add -814599.475 -14.5431191 -> -814614.018 Inexact Rounded +xcom250 compare -814599.475 -14.5431191 -> -1 +xdiv250 divide -814599.475 -14.5431191 -> 56012.7074 Inexact Rounded +xdvi250 divideint -814599.475 -14.5431191 -> 56012 +xmul250 multiply -814599.475 -14.5431191 -> 11846817.2 Inexact Rounded +xpow250 power -814599.475 -15 -> -2.16689622E-89 Inexact Rounded +xrem250 remainder -814599.475 -14.5431191 -> -10.2879708 +xsub250 subtract -814599.475 -14.5431191 -> -814584.932 Inexact Rounded +xadd251 add -877498.755 507408724E-168628106 -> -877498.755 Inexact Rounded +xcom251 compare -877498.755 507408724E-168628106 -> -1 +xdiv251 divide -877498.755 507408724E-168628106 -> -1.72937262E+168628103 Inexact Rounded +xdvi251 divideint -877498.755 507408724E-168628106 -> NaN Division_impossible +xmul251 multiply -877498.755 507408724E-168628106 -> -4.45250524E-168628092 Inexact Rounded +xpow251 power -877498.755 5 -> -5.20274505E+29 Inexact Rounded +xrem251 remainder -877498.755 507408724E-168628106 -> NaN Division_impossible +xsub251 subtract -877498.755 507408724E-168628106 -> -877498.755 Inexact Rounded +xadd252 add 10634446.5E+475783861 50.7213056E+17807809 -> 1.06344465E+475783868 Inexact Rounded +xcom252 compare 10634446.5E+475783861 50.7213056E+17807809 -> 1 +xdiv252 divide 10634446.5E+475783861 50.7213056E+17807809 -> 2.09664289E+457976057 Inexact Rounded +xdvi252 divideint 10634446.5E+475783861 50.7213056E+17807809 -> NaN Division_impossible +xmul252 multiply 10634446.5E+475783861 50.7213056E+17807809 -> 5.39393011E+493591678 Inexact Rounded +xpow252 power 10634446.5E+475783861 5 -> Infinity Overflow Inexact Rounded +xrem252 remainder 10634446.5E+475783861 50.7213056E+17807809 -> NaN Division_impossible +xsub252 subtract 10634446.5E+475783861 50.7213056E+17807809 -> 1.06344465E+475783868 Inexact Rounded +xadd253 add -162726.257E-597285918 -4391.54799 -> -4391.54799 Inexact Rounded +xcom253 compare -162726.257E-597285918 -4391.54799 -> 1 +xdiv253 divide -162726.257E-597285918 -4391.54799 -> 3.70544185E-597285917 Inexact Rounded +xdvi253 divideint -162726.257E-597285918 -4391.54799 -> 0 +xmul253 multiply -162726.257E-597285918 -4391.54799 -> 7.14620167E-597285910 Inexact Rounded +xpow253 power -162726.257E-597285918 -4392 -> Infinity Overflow Inexact Rounded +xrem253 remainder -162726.257E-597285918 -4391.54799 -> -1.62726257E-597285913 +xsub253 subtract -162726.257E-597285918 -4391.54799 -> 4391.54799 Inexact Rounded +xadd254 add 700354586.E-99856707 7198.0493E+436250299 -> 7.19804930E+436250302 Inexact Rounded +xcom254 compare 700354586.E-99856707 7198.0493E+436250299 -> -1 +xdiv254 divide 700354586.E-99856707 7198.0493E+436250299 -> 9.72978312E-536107002 Inexact Rounded +xdvi254 divideint 700354586.E-99856707 7198.0493E+436250299 -> 0 +xmul254 multiply 700354586.E-99856707 7198.0493E+436250299 -> 5.04118684E+336393604 Inexact Rounded +xpow254 power 700354586.E-99856707 7 -> 8.26467610E-698996888 Inexact Rounded +xrem254 remainder 700354586.E-99856707 7198.0493E+436250299 -> 7.00354586E-99856699 +xsub254 subtract 700354586.E-99856707 7198.0493E+436250299 -> -7.19804930E+436250302 Inexact Rounded +xadd255 add 39617663E-463704664 -895.290346 -> -895.290346 Inexact Rounded +xcom255 compare 39617663E-463704664 -895.290346 -> 1 +xdiv255 divide 39617663E-463704664 -895.290346 -> -4.42511898E-463704660 Inexact Rounded +xdvi255 divideint 39617663E-463704664 -895.290346 -> -0 +xmul255 multiply 39617663E-463704664 -895.290346 -> -3.54693112E-463704654 Inexact Rounded +xpow255 power 39617663E-463704664 -895 -> Infinity Overflow Inexact Rounded +xrem255 remainder 39617663E-463704664 -895.290346 -> 3.9617663E-463704657 +xsub255 subtract 39617663E-463704664 -895.290346 -> 895.290346 Inexact Rounded +xadd256 add 5350882.59 -36329829 -> -30978946.4 Inexact Rounded +xcom256 compare 5350882.59 -36329829 -> 1 +xdiv256 divide 5350882.59 -36329829 -> -0.147286204 Inexact Rounded +xdvi256 divideint 5350882.59 -36329829 -> -0 +xmul256 multiply 5350882.59 -36329829 -> -1.94396649E+14 Inexact Rounded +xpow256 power 5350882.59 -36329829 -> 9.77006107E-244442546 Inexact Rounded +xrem256 remainder 5350882.59 -36329829 -> 5350882.59 +xsub256 subtract 5350882.59 -36329829 -> 41680711.6 Inexact Rounded +xadd257 add 91966.4084E+210382952 166740.46E-42001390 -> 9.19664084E+210382956 Inexact Rounded +xcom257 compare 91966.4084E+210382952 166740.46E-42001390 -> 1 +xdiv257 divide 91966.4084E+210382952 166740.46E-42001390 -> 5.51554244E+252384341 Inexact Rounded +xdvi257 divideint 91966.4084E+210382952 166740.46E-42001390 -> NaN Division_impossible +xmul257 multiply 91966.4084E+210382952 166740.46E-42001390 -> 1.53345212E+168381572 Inexact Rounded +xpow257 power 91966.4084E+210382952 2 -> 8.45782027E+420765913 Inexact Rounded +xrem257 remainder 91966.4084E+210382952 166740.46E-42001390 -> NaN Division_impossible +xsub257 subtract 91966.4084E+210382952 166740.46E-42001390 -> 9.19664084E+210382956 Inexact Rounded +xadd258 add 231899031.E-481759076 726.337100 -> 726.337100 Inexact Rounded +xcom258 compare 231899031.E-481759076 726.337100 -> -1 +xdiv258 divide 231899031.E-481759076 726.337100 -> 3.19271907E-481759071 Inexact Rounded +xdvi258 divideint 231899031.E-481759076 726.337100 -> 0 +xmul258 multiply 231899031.E-481759076 726.337100 -> 1.68436870E-481759065 Inexact Rounded +xpow258 power 231899031.E-481759076 726 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem258 remainder 231899031.E-481759076 726.337100 -> 2.31899031E-481759068 +xsub258 subtract 231899031.E-481759076 726.337100 -> -726.337100 Inexact Rounded +xadd259 add -9611312.33 22109735.9 -> 12498423.6 Inexact Rounded +xcom259 compare -9611312.33 22109735.9 -> -1 +xdiv259 divide -9611312.33 22109735.9 -> -0.434709504 Inexact Rounded +xdvi259 divideint -9611312.33 22109735.9 -> -0 +xmul259 multiply -9611312.33 22109735.9 -> -2.12503577E+14 Inexact Rounded +xpow259 power -9611312.33 22109736 -> 6.74530828E+154387481 Inexact Rounded +xrem259 remainder -9611312.33 22109735.9 -> -9611312.33 +xsub259 subtract -9611312.33 22109735.9 -> -31721048.2 Inexact Rounded +xadd260 add -5604938.15E-36812542 735937577. -> 735937577 Inexact Rounded +xcom260 compare -5604938.15E-36812542 735937577. -> -1 +xdiv260 divide -5604938.15E-36812542 735937577. -> -7.61605104E-36812545 Inexact Rounded +xdvi260 divideint -5604938.15E-36812542 735937577. -> -0 +xmul260 multiply -5604938.15E-36812542 735937577. -> -4.12488460E-36812527 Inexact Rounded +xpow260 power -5604938.15E-36812542 735937577 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem260 remainder -5604938.15E-36812542 735937577. -> -5.60493815E-36812536 +xsub260 subtract -5604938.15E-36812542 735937577. -> -735937577 Inexact Rounded +xadd261 add 693881413. 260547224E-480281418 -> 693881413 Inexact Rounded +xcom261 compare 693881413. 260547224E-480281418 -> 1 +xdiv261 divide 693881413. 260547224E-480281418 -> 2.66316947E+480281418 Inexact Rounded +xdvi261 divideint 693881413. 260547224E-480281418 -> NaN Division_impossible +xmul261 multiply 693881413. 260547224E-480281418 -> 1.80788876E-480281401 Inexact Rounded +xpow261 power 693881413. 3 -> 3.34084066E+26 Inexact Rounded +xrem261 remainder 693881413. 260547224E-480281418 -> NaN Division_impossible +xsub261 subtract 693881413. 260547224E-480281418 -> 693881413 Inexact Rounded +xadd262 add -34865.7378E-368768024 2297117.88 -> 2297117.88 Inexact Rounded +xcom262 compare -34865.7378E-368768024 2297117.88 -> -1 +xdiv262 divide -34865.7378E-368768024 2297117.88 -> -1.51780360E-368768026 Inexact Rounded +xdvi262 divideint -34865.7378E-368768024 2297117.88 -> -0 +xmul262 multiply -34865.7378E-368768024 2297117.88 -> -8.00907097E-368768014 Inexact Rounded +xpow262 power -34865.7378E-368768024 2297118 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem262 remainder -34865.7378E-368768024 2297117.88 -> -3.48657378E-368768020 +xsub262 subtract -34865.7378E-368768024 2297117.88 -> -2297117.88 Inexact Rounded +xadd263 add 1123.32456 7.86747918E+930888796 -> 7.86747918E+930888796 Inexact Rounded +xcom263 compare 1123.32456 7.86747918E+930888796 -> -1 +xdiv263 divide 1123.32456 7.86747918E+930888796 -> 1.42780748E-930888794 Inexact Rounded +xdvi263 divideint 1123.32456 7.86747918E+930888796 -> 0 +xmul263 multiply 1123.32456 7.86747918E+930888796 -> 8.83773259E+930888799 Inexact Rounded +xpow263 power 1123.32456 8 -> 2.53537401E+24 Inexact Rounded +xrem263 remainder 1123.32456 7.86747918E+930888796 -> 1123.32456 +xsub263 subtract 1123.32456 7.86747918E+930888796 -> -7.86747918E+930888796 Inexact Rounded +xadd264 add 56.6607465E+467812565 909552512E+764516200 -> 9.09552512E+764516208 Inexact Rounded +xcom264 compare 56.6607465E+467812565 909552512E+764516200 -> -1 +xdiv264 divide 56.6607465E+467812565 909552512E+764516200 -> 6.22951899E-296703643 Inexact Rounded +xdvi264 divideint 56.6607465E+467812565 909552512E+764516200 -> 0 +xmul264 multiply 56.6607465E+467812565 909552512E+764516200 -> Infinity Inexact Overflow Rounded +xpow264 power 56.6607465E+467812565 9 -> Infinity Overflow Inexact Rounded +xrem264 remainder 56.6607465E+467812565 909552512E+764516200 -> 5.66607465E+467812566 +xsub264 subtract 56.6607465E+467812565 909552512E+764516200 -> -9.09552512E+764516208 Inexact Rounded +xadd265 add -1.85771840E+365552540 -73028339.7 -> -1.85771840E+365552540 Inexact Rounded +xcom265 compare -1.85771840E+365552540 -73028339.7 -> -1 +xdiv265 divide -1.85771840E+365552540 -73028339.7 -> 2.54383217E+365552532 Inexact Rounded +xdvi265 divideint -1.85771840E+365552540 -73028339.7 -> NaN Division_impossible +xmul265 multiply -1.85771840E+365552540 -73028339.7 -> 1.35666090E+365552548 Inexact Rounded +xpow265 power -1.85771840E+365552540 -73028340 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem265 remainder -1.85771840E+365552540 -73028339.7 -> NaN Division_impossible +xsub265 subtract -1.85771840E+365552540 -73028339.7 -> -1.85771840E+365552540 Inexact Rounded +xadd266 add 34.1935525 -40767.6450 -> -40733.4514 Inexact Rounded +xcom266 compare 34.1935525 -40767.6450 -> 1 +xdiv266 divide 34.1935525 -40767.6450 -> -0.000838742402 Inexact Rounded +xdvi266 divideint 34.1935525 -40767.6450 -> -0 +xmul266 multiply 34.1935525 -40767.6450 -> -1393990.61 Inexact Rounded +xpow266 power 34.1935525 -40768 -> 1.45174210E-62536 Inexact Rounded +xrem266 remainder 34.1935525 -40767.6450 -> 34.1935525 +xsub266 subtract 34.1935525 -40767.6450 -> 40801.8386 Inexact Rounded +xadd267 add 26.0009168E+751618294 -304019.929 -> 2.60009168E+751618295 Inexact Rounded +xcom267 compare 26.0009168E+751618294 -304019.929 -> 1 +xdiv267 divide 26.0009168E+751618294 -304019.929 -> -8.55237250E+751618289 Inexact Rounded +xdvi267 divideint 26.0009168E+751618294 -304019.929 -> NaN Division_impossible +xmul267 multiply 26.0009168E+751618294 -304019.929 -> -7.90479688E+751618300 Inexact Rounded +xpow267 power 26.0009168E+751618294 -304020 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem267 remainder 26.0009168E+751618294 -304019.929 -> NaN Division_impossible +xsub267 subtract 26.0009168E+751618294 -304019.929 -> 2.60009168E+751618295 Inexact Rounded +xadd268 add -58.4853072E+588540055 -4647.3205 -> -5.84853072E+588540056 Inexact Rounded +xcom268 compare -58.4853072E+588540055 -4647.3205 -> -1 +xdiv268 divide -58.4853072E+588540055 -4647.3205 -> 1.25847372E+588540053 Inexact Rounded +xdvi268 divideint -58.4853072E+588540055 -4647.3205 -> NaN Division_impossible +xmul268 multiply -58.4853072E+588540055 -4647.3205 -> 2.71799967E+588540060 Inexact Rounded +xpow268 power -58.4853072E+588540055 -4647 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem268 remainder -58.4853072E+588540055 -4647.3205 -> NaN Division_impossible +xsub268 subtract -58.4853072E+588540055 -4647.3205 -> -5.84853072E+588540056 Inexact Rounded +xadd269 add 51.025101 -4467691.57 -> -4467640.54 Inexact Rounded +xcom269 compare 51.025101 -4467691.57 -> 1 +xdiv269 divide 51.025101 -4467691.57 -> -0.0000114209095 Inexact Rounded +xdvi269 divideint 51.025101 -4467691.57 -> -0 +xmul269 multiply 51.025101 -4467691.57 -> -227964414 Inexact Rounded +xpow269 power 51.025101 -4467692 -> 4.49462589E-7629853 Inexact Rounded +xrem269 remainder 51.025101 -4467691.57 -> 51.025101 +xsub269 subtract 51.025101 -4467691.57 -> 4467742.60 Inexact Rounded +xadd270 add -2214.76582 379785372E+223117572 -> 3.79785372E+223117580 Inexact Rounded +xcom270 compare -2214.76582 379785372E+223117572 -> -1 +xdiv270 divide -2214.76582 379785372E+223117572 -> -5.83162487E-223117578 Inexact Rounded +xdvi270 divideint -2214.76582 379785372E+223117572 -> -0 +xmul270 multiply -2214.76582 379785372E+223117572 -> -8.41135661E+223117583 Inexact Rounded +xpow270 power -2214.76582 4 -> 2.40608658E+13 Inexact Rounded +xrem270 remainder -2214.76582 379785372E+223117572 -> -2214.76582 +xsub270 subtract -2214.76582 379785372E+223117572 -> -3.79785372E+223117580 Inexact Rounded +xadd271 add -2564.75207E-841443929 -653498187 -> -653498187 Inexact Rounded +xcom271 compare -2564.75207E-841443929 -653498187 -> 1 +xdiv271 divide -2564.75207E-841443929 -653498187 -> 3.92465063E-841443935 Inexact Rounded +xdvi271 divideint -2564.75207E-841443929 -653498187 -> 0 +xmul271 multiply -2564.75207E-841443929 -653498187 -> 1.67606083E-841443917 Inexact Rounded +xpow271 power -2564.75207E-841443929 -653498187 -> -Infinity Overflow Inexact Rounded +xrem271 remainder -2564.75207E-841443929 -653498187 -> -2.56475207E-841443926 +xsub271 subtract -2564.75207E-841443929 -653498187 -> 653498187 Inexact Rounded +xadd272 add 513115529. 27775075.6E+217133352 -> 2.77750756E+217133359 Inexact Rounded +xcom272 compare 513115529. 27775075.6E+217133352 -> -1 +xdiv272 divide 513115529. 27775075.6E+217133352 -> 1.84739562E-217133351 Inexact Rounded +xdvi272 divideint 513115529. 27775075.6E+217133352 -> 0 +xmul272 multiply 513115529. 27775075.6E+217133352 -> 1.42518226E+217133368 Inexact Rounded +xpow272 power 513115529. 3 -> 1.35096928E+26 Inexact Rounded +xrem272 remainder 513115529. 27775075.6E+217133352 -> 513115529 +xsub272 subtract 513115529. 27775075.6E+217133352 -> -2.77750756E+217133359 Inexact Rounded +xadd273 add -247157.208 -532990.453 -> -780147.661 +xcom273 compare -247157.208 -532990.453 -> 1 +xdiv273 divide -247157.208 -532990.453 -> 0.463717890 Inexact Rounded +xdvi273 divideint -247157.208 -532990.453 -> 0 +xmul273 multiply -247157.208 -532990.453 -> 1.31732432E+11 Inexact Rounded +xpow273 power -247157.208 -532990 -> 1.48314033E-2874401 Inexact Rounded +xrem273 remainder -247157.208 -532990.453 -> -247157.208 +xsub273 subtract -247157.208 -532990.453 -> 285833.245 +xadd274 add 40.2490764E-339482253 7626.85442E+594264540 -> 7.62685442E+594264543 Inexact Rounded +xcom274 compare 40.2490764E-339482253 7626.85442E+594264540 -> -1 +xdiv274 divide 40.2490764E-339482253 7626.85442E+594264540 -> 5.27728395E-933746796 Inexact Rounded +xdvi274 divideint 40.2490764E-339482253 7626.85442E+594264540 -> 0 +xmul274 multiply 40.2490764E-339482253 7626.85442E+594264540 -> 3.06973846E+254782292 Inexact Rounded +xpow274 power 40.2490764E-339482253 8 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem274 remainder 40.2490764E-339482253 7626.85442E+594264540 -> 4.02490764E-339482252 +xsub274 subtract 40.2490764E-339482253 7626.85442E+594264540 -> -7.62685442E+594264543 Inexact Rounded +xadd275 add -1156008.8 -8870382.36 -> -10026391.2 Inexact Rounded +xcom275 compare -1156008.8 -8870382.36 -> 1 +xdiv275 divide -1156008.8 -8870382.36 -> 0.130322319 Inexact Rounded +xdvi275 divideint -1156008.8 -8870382.36 -> 0 +xmul275 multiply -1156008.8 -8870382.36 -> 1.02542401E+13 Inexact Rounded +xpow275 power -1156008.8 -8870382 -> 4.32494996E-53780782 Inexact Rounded +xrem275 remainder -1156008.8 -8870382.36 -> -1156008.80 +xsub275 subtract -1156008.8 -8870382.36 -> 7714373.56 +xadd276 add 880097928. -52455011.1E+204538218 -> -5.24550111E+204538225 Inexact Rounded +xcom276 compare 880097928. -52455011.1E+204538218 -> 1 +xdiv276 divide 880097928. -52455011.1E+204538218 -> -1.67781478E-204538217 Inexact Rounded +xdvi276 divideint 880097928. -52455011.1E+204538218 -> -0 +xmul276 multiply 880097928. -52455011.1E+204538218 -> -4.61655466E+204538234 Inexact Rounded +xpow276 power 880097928. -5 -> 1.89384751E-45 Inexact Rounded +xrem276 remainder 880097928. -52455011.1E+204538218 -> 880097928 +xsub276 subtract 880097928. -52455011.1E+204538218 -> 5.24550111E+204538225 Inexact Rounded +xadd277 add 5796.2524 34458329.7E+832129426 -> 3.44583297E+832129433 Inexact Rounded +xcom277 compare 5796.2524 34458329.7E+832129426 -> -1 +xdiv277 divide 5796.2524 34458329.7E+832129426 -> 1.68210486E-832129430 Inexact Rounded +xdvi277 divideint 5796.2524 34458329.7E+832129426 -> 0 +xmul277 multiply 5796.2524 34458329.7E+832129426 -> 1.99729176E+832129437 Inexact Rounded +xpow277 power 5796.2524 3 -> 1.94734037E+11 Inexact Rounded +xrem277 remainder 5796.2524 34458329.7E+832129426 -> 5796.2524 +xsub277 subtract 5796.2524 34458329.7E+832129426 -> -3.44583297E+832129433 Inexact Rounded +xadd278 add 27.1000923E-218032223 -45.0198341 -> -45.0198341 Inexact Rounded +xcom278 compare 27.1000923E-218032223 -45.0198341 -> 1 +xdiv278 divide 27.1000923E-218032223 -45.0198341 -> -6.01958955E-218032224 Inexact Rounded +xdvi278 divideint 27.1000923E-218032223 -45.0198341 -> -0 +xmul278 multiply 27.1000923E-218032223 -45.0198341 -> -1.22004166E-218032220 Inexact Rounded +xpow278 power 27.1000923E-218032223 -45 -> Infinity Overflow Inexact Rounded +xrem278 remainder 27.1000923E-218032223 -45.0198341 -> 2.71000923E-218032222 +xsub278 subtract 27.1000923E-218032223 -45.0198341 -> 45.0198341 Inexact Rounded +xadd279 add 42643477.8 26118465E-730390549 -> 42643477.8 Inexact Rounded +xcom279 compare 42643477.8 26118465E-730390549 -> 1 +xdiv279 divide 42643477.8 26118465E-730390549 -> 1.63269464E+730390549 Inexact Rounded +xdvi279 divideint 42643477.8 26118465E-730390549 -> NaN Division_impossible +xmul279 multiply 42643477.8 26118465E-730390549 -> 1.11378218E-730390534 Inexact Rounded +xpow279 power 42643477.8 3 -> 7.75457230E+22 Inexact Rounded +xrem279 remainder 42643477.8 26118465E-730390549 -> NaN Division_impossible +xsub279 subtract 42643477.8 26118465E-730390549 -> 42643477.8 Inexact Rounded +xadd280 add -31918.9176E-163031657 -21.5422824E-807317258 -> -3.19189176E-163031653 Inexact Rounded +xcom280 compare -31918.9176E-163031657 -21.5422824E-807317258 -> -1 +xdiv280 divide -31918.9176E-163031657 -21.5422824E-807317258 -> 1.48168690E+644285604 Inexact Rounded +xdvi280 divideint -31918.9176E-163031657 -21.5422824E-807317258 -> NaN Division_impossible +xmul280 multiply -31918.9176E-163031657 -21.5422824E-807317258 -> 6.87606337E-970348910 Inexact Rounded +xpow280 power -31918.9176E-163031657 -2 -> 9.81530250E+326063304 Inexact Rounded +xrem280 remainder -31918.9176E-163031657 -21.5422824E-807317258 -> NaN Division_impossible +xsub280 subtract -31918.9176E-163031657 -21.5422824E-807317258 -> -3.19189176E-163031653 Inexact Rounded +xadd281 add 84224841.0 2.62548255E+647087608 -> 2.62548255E+647087608 Inexact Rounded +xcom281 compare 84224841.0 2.62548255E+647087608 -> -1 +xdiv281 divide 84224841.0 2.62548255E+647087608 -> 3.20797565E-647087601 Inexact Rounded +xdvi281 divideint 84224841.0 2.62548255E+647087608 -> 0 +xmul281 multiply 84224841.0 2.62548255E+647087608 -> 2.21130850E+647087616 Inexact Rounded +xpow281 power 84224841.0 3 -> 5.97476185E+23 Inexact Rounded +xrem281 remainder 84224841.0 2.62548255E+647087608 -> 84224841.0 +xsub281 subtract 84224841.0 2.62548255E+647087608 -> -2.62548255E+647087608 Inexact Rounded +xadd282 add -64413698.9 -6674.1055E-701047852 -> -64413698.9 Inexact Rounded +xcom282 compare -64413698.9 -6674.1055E-701047852 -> -1 +xdiv282 divide -64413698.9 -6674.1055E-701047852 -> 9.65128569E+701047855 Inexact Rounded +xdvi282 divideint -64413698.9 -6674.1055E-701047852 -> NaN Division_impossible +xmul282 multiply -64413698.9 -6674.1055E-701047852 -> 4.29903822E-701047841 Inexact Rounded +xpow282 power -64413698.9 -7 -> -2.17346338E-55 Inexact Rounded +xrem282 remainder -64413698.9 -6674.1055E-701047852 -> NaN Division_impossible +xsub282 subtract -64413698.9 -6674.1055E-701047852 -> -64413698.9 Inexact Rounded +xadd283 add -62.5059208 9.5795779E-898350012 -> -62.5059208 Inexact Rounded +xcom283 compare -62.5059208 9.5795779E-898350012 -> -1 +xdiv283 divide -62.5059208 9.5795779E-898350012 -> -6.52491388E+898350012 Inexact Rounded +xdvi283 divideint -62.5059208 9.5795779E-898350012 -> NaN Division_impossible +xmul283 multiply -62.5059208 9.5795779E-898350012 -> -5.98780338E-898350010 Inexact Rounded +xpow283 power -62.5059208 10 -> 9.10356659E+17 Inexact Rounded +xrem283 remainder -62.5059208 9.5795779E-898350012 -> NaN Division_impossible +xsub283 subtract -62.5059208 9.5795779E-898350012 -> -62.5059208 Inexact Rounded +xadd284 add 9090950.80 436.400932 -> 9091387.20 Inexact Rounded +xcom284 compare 9090950.80 436.400932 -> 1 +xdiv284 divide 9090950.80 436.400932 -> 20831.6485 Inexact Rounded +xdvi284 divideint 9090950.80 436.400932 -> 20831 +xmul284 multiply 9090950.80 436.400932 -> 3.96729940E+9 Inexact Rounded +xpow284 power 9090950.80 436 -> 8.98789557E+3033 Inexact Rounded +xrem284 remainder 9090950.80 436.400932 -> 282.985508 +xsub284 subtract 9090950.80 436.400932 -> 9090514.40 Inexact Rounded +xadd285 add -89833825.7E+329205393 -779430.194 -> -8.98338257E+329205400 Inexact Rounded +xcom285 compare -89833825.7E+329205393 -779430.194 -> -1 +xdiv285 divide -89833825.7E+329205393 -779430.194 -> 1.15255768E+329205395 Inexact Rounded +xdvi285 divideint -89833825.7E+329205393 -779430.194 -> NaN Division_impossible +xmul285 multiply -89833825.7E+329205393 -779430.194 -> 7.00191962E+329205406 Inexact Rounded +xpow285 power -89833825.7E+329205393 -779430 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem285 remainder -89833825.7E+329205393 -779430.194 -> NaN Division_impossible +xsub285 subtract -89833825.7E+329205393 -779430.194 -> -8.98338257E+329205400 Inexact Rounded +xadd286 add -714562.019E+750205688 704079764 -> -7.14562019E+750205693 Inexact Rounded +xcom286 compare -714562.019E+750205688 704079764 -> -1 +xdiv286 divide -714562.019E+750205688 704079764 -> -1.01488788E+750205685 Inexact Rounded +xdvi286 divideint -714562.019E+750205688 704079764 -> NaN Division_impossible +xmul286 multiply -714562.019E+750205688 704079764 -> -5.03108658E+750205702 Inexact Rounded +xpow286 power -714562.019E+750205688 704079764 -> Infinity Overflow Inexact Rounded +xrem286 remainder -714562.019E+750205688 704079764 -> NaN Division_impossible +xsub286 subtract -714562.019E+750205688 704079764 -> -7.14562019E+750205693 Inexact Rounded +xadd287 add -584537670. 31139.7737E-146687560 -> -584537670 Inexact Rounded +xcom287 compare -584537670. 31139.7737E-146687560 -> -1 +xdiv287 divide -584537670. 31139.7737E-146687560 -> -1.87714168E+146687564 Inexact Rounded +xdvi287 divideint -584537670. 31139.7737E-146687560 -> NaN Division_impossible +xmul287 multiply -584537670. 31139.7737E-146687560 -> -1.82023708E-146687547 Inexact Rounded +xpow287 power -584537670. 3 -> -1.99727337E+26 Inexact Rounded +xrem287 remainder -584537670. 31139.7737E-146687560 -> NaN Division_impossible +xsub287 subtract -584537670. 31139.7737E-146687560 -> -584537670 Inexact Rounded +xadd288 add -4.18074650E-858746879 571035.277E-279409165 -> 5.71035277E-279409160 Inexact Rounded +xcom288 compare -4.18074650E-858746879 571035.277E-279409165 -> -1 +xdiv288 divide -4.18074650E-858746879 571035.277E-279409165 -> -7.32134540E-579337720 Inexact Rounded +xdvi288 divideint -4.18074650E-858746879 571035.277E-279409165 -> -0 +xmul288 multiply -4.18074650E-858746879 571035.277E-279409165 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow288 power -4.18074650E-858746879 6 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem288 remainder -4.18074650E-858746879 571035.277E-279409165 -> -4.18074650E-858746879 +xsub288 subtract -4.18074650E-858746879 571035.277E-279409165 -> -5.71035277E-279409160 Inexact Rounded +xadd289 add 5.15309635 -695649.219E+451948183 -> -6.95649219E+451948188 Inexact Rounded +xcom289 compare 5.15309635 -695649.219E+451948183 -> 1 +xdiv289 divide 5.15309635 -695649.219E+451948183 -> -7.40760747E-451948189 Inexact Rounded +xdvi289 divideint 5.15309635 -695649.219E+451948183 -> -0 +xmul289 multiply 5.15309635 -695649.219E+451948183 -> -3.58474745E+451948189 Inexact Rounded +xpow289 power 5.15309635 -7 -> 0.0000103638749 Inexact Rounded +xrem289 remainder 5.15309635 -695649.219E+451948183 -> 5.15309635 +xsub289 subtract 5.15309635 -695649.219E+451948183 -> 6.95649219E+451948188 Inexact Rounded +xadd290 add -940030153.E+83797657 -4.11510193 -> -9.40030153E+83797665 Inexact Rounded +xcom290 compare -940030153.E+83797657 -4.11510193 -> -1 +xdiv290 divide -940030153.E+83797657 -4.11510193 -> 2.28434233E+83797665 Inexact Rounded +xdvi290 divideint -940030153.E+83797657 -4.11510193 -> NaN Division_impossible +xmul290 multiply -940030153.E+83797657 -4.11510193 -> 3.86831990E+83797666 Inexact Rounded +xpow290 power -940030153.E+83797657 -4 -> 1.28065710E-335190664 Inexact Rounded +xrem290 remainder -940030153.E+83797657 -4.11510193 -> NaN Division_impossible +xsub290 subtract -940030153.E+83797657 -4.11510193 -> -9.40030153E+83797665 Inexact Rounded +xadd291 add 89088.9683E+587739290 1.31932110 -> 8.90889683E+587739294 Inexact Rounded +xcom291 compare 89088.9683E+587739290 1.31932110 -> 1 +xdiv291 divide 89088.9683E+587739290 1.31932110 -> 6.75263727E+587739294 Inexact Rounded +xdvi291 divideint 89088.9683E+587739290 1.31932110 -> NaN Division_impossible +xmul291 multiply 89088.9683E+587739290 1.31932110 -> 1.17536956E+587739295 Inexact Rounded +xpow291 power 89088.9683E+587739290 1 -> 8.90889683E+587739294 +xrem291 remainder 89088.9683E+587739290 1.31932110 -> NaN Division_impossible +xsub291 subtract 89088.9683E+587739290 1.31932110 -> 8.90889683E+587739294 Inexact Rounded +xadd292 add 3336750 6.47961126 -> 3336756.48 Inexact Rounded +xcom292 compare 3336750 6.47961126 -> 1 +xdiv292 divide 3336750 6.47961126 -> 514961.448 Inexact Rounded +xdvi292 divideint 3336750 6.47961126 -> 514961 +xmul292 multiply 3336750 6.47961126 -> 21620842.9 Inexact Rounded +xpow292 power 3336750 6 -> 1.38019997E+39 Inexact Rounded +xrem292 remainder 3336750 6.47961126 -> 2.90593914 +xsub292 subtract 3336750 6.47961126 -> 3336743.52 Inexact Rounded +xadd293 add 904654622. 692065270.E+329081915 -> 6.92065270E+329081923 Inexact Rounded +xcom293 compare 904654622. 692065270.E+329081915 -> -1 +xdiv293 divide 904654622. 692065270.E+329081915 -> 1.30718107E-329081915 Inexact Rounded +xdvi293 divideint 904654622. 692065270.E+329081915 -> 0 +xmul293 multiply 904654622. 692065270.E+329081915 -> 6.26080045E+329081932 Inexact Rounded +xpow293 power 904654622. 7 -> 4.95883485E+62 Inexact Rounded +xrem293 remainder 904654622. 692065270.E+329081915 -> 904654622 +xsub293 subtract 904654622. 692065270.E+329081915 -> -6.92065270E+329081923 Inexact Rounded +xadd294 add 304804380 -4681.23698 -> 304799699 Inexact Rounded +xcom294 compare 304804380 -4681.23698 -> 1 +xdiv294 divide 304804380 -4681.23698 -> -65111.9312 Inexact Rounded +xdvi294 divideint 304804380 -4681.23698 -> -65111 +xmul294 multiply 304804380 -4681.23698 -> -1.42686154E+12 Inexact Rounded +xpow294 power 304804380 -4681 -> 1.98037102E-39714 Inexact Rounded +xrem294 remainder 304804380 -4681.23698 -> 4358.99522 +xsub294 subtract 304804380 -4681.23698 -> 304809061 Inexact Rounded +xadd295 add 674.55569 -82981.2684E+852890752 -> -8.29812684E+852890756 Inexact Rounded +xcom295 compare 674.55569 -82981.2684E+852890752 -> 1 +xdiv295 divide 674.55569 -82981.2684E+852890752 -> -8.12901156E-852890755 Inexact Rounded +xdvi295 divideint 674.55569 -82981.2684E+852890752 -> -0 +xmul295 multiply 674.55569 -82981.2684E+852890752 -> -5.59754868E+852890759 Inexact Rounded +xpow295 power 674.55569 -8 -> 2.33269265E-23 Inexact Rounded +xrem295 remainder 674.55569 -82981.2684E+852890752 -> 674.55569 +xsub295 subtract 674.55569 -82981.2684E+852890752 -> 8.29812684E+852890756 Inexact Rounded +xadd296 add -5111.51025E-108006096 5448870.4E+279212255 -> 5.44887040E+279212261 Inexact Rounded +xcom296 compare -5111.51025E-108006096 5448870.4E+279212255 -> -1 +xdiv296 divide -5111.51025E-108006096 5448870.4E+279212255 -> -9.38086222E-387218355 Inexact Rounded +xdvi296 divideint -5111.51025E-108006096 5448870.4E+279212255 -> -0 +xmul296 multiply -5111.51025E-108006096 5448870.4E+279212255 -> -2.78519569E+171206169 Inexact Rounded +xpow296 power -5111.51025E-108006096 5 -> -3.48936323E-540030462 Inexact Rounded +xrem296 remainder -5111.51025E-108006096 5448870.4E+279212255 -> -5.11151025E-108006093 +xsub296 subtract -5111.51025E-108006096 5448870.4E+279212255 -> -5.44887040E+279212261 Inexact Rounded +xadd297 add -2623.45068 -466463938. -> -466466561 Inexact Rounded +xcom297 compare -2623.45068 -466463938. -> 1 +xdiv297 divide -2623.45068 -466463938. -> 0.00000562412325 Inexact Rounded +xdvi297 divideint -2623.45068 -466463938. -> 0 +xmul297 multiply -2623.45068 -466463938. -> 1.22374514E+12 Inexact Rounded +xpow297 power -2623.45068 -466463938 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem297 remainder -2623.45068 -466463938. -> -2623.45068 +xsub297 subtract -2623.45068 -466463938. -> 466461315 Inexact Rounded +xadd298 add 299350.435 3373.33551 -> 302723.771 Inexact Rounded +xcom298 compare 299350.435 3373.33551 -> 1 +xdiv298 divide 299350.435 3373.33551 -> 88.7401903 Inexact Rounded +xdvi298 divideint 299350.435 3373.33551 -> 88 +xmul298 multiply 299350.435 3373.33551 -> 1.00980945E+9 Inexact Rounded +xpow298 power 299350.435 3373 -> 1.42817370E+18471 Inexact Rounded +xrem298 remainder 299350.435 3373.33551 -> 2496.91012 +xsub298 subtract 299350.435 3373.33551 -> 295977.099 Inexact Rounded +xadd299 add -6589947.80 -2448.75933E-591549734 -> -6589947.80 Inexact Rounded +xcom299 compare -6589947.80 -2448.75933E-591549734 -> -1 +xdiv299 divide -6589947.80 -2448.75933E-591549734 -> 2.69113739E+591549737 Inexact Rounded +xdvi299 divideint -6589947.80 -2448.75933E-591549734 -> NaN Division_impossible +xmul299 multiply -6589947.80 -2448.75933E-591549734 -> 1.61371962E-591549724 Inexact Rounded +xpow299 power -6589947.80 -2 -> 2.30269305E-14 Inexact Rounded +xrem299 remainder -6589947.80 -2448.75933E-591549734 -> NaN Division_impossible +xsub299 subtract -6589947.80 -2448.75933E-591549734 -> -6589947.80 Inexact Rounded +xadd300 add 3774.5358E-491090520 173.060090 -> 173.060090 Inexact Rounded +xcom300 compare 3774.5358E-491090520 173.060090 -> -1 +xdiv300 divide 3774.5358E-491090520 173.060090 -> 2.18105503E-491090519 Inexact Rounded +xdvi300 divideint 3774.5358E-491090520 173.060090 -> 0 +xmul300 multiply 3774.5358E-491090520 173.060090 -> 6.53221505E-491090515 Inexact Rounded +xpow300 power 3774.5358E-491090520 173 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem300 remainder 3774.5358E-491090520 173.060090 -> 3.7745358E-491090517 +xsub300 subtract 3774.5358E-491090520 173.060090 -> -173.060090 Inexact Rounded +xadd301 add -13.6783690 -453.610117 -> -467.288486 Rounded +xcom301 compare -13.6783690 -453.610117 -> 1 +xdiv301 divide -13.6783690 -453.610117 -> 0.0301544619 Inexact Rounded +xdvi301 divideint -13.6783690 -453.610117 -> 0 +xmul301 multiply -13.6783690 -453.610117 -> 6204.64656 Inexact Rounded +xpow301 power -13.6783690 -454 -> 1.73948535E-516 Inexact Rounded +xrem301 remainder -13.6783690 -453.610117 -> -13.6783690 +xsub301 subtract -13.6783690 -453.610117 -> 439.931748 Rounded +xadd302 add -990100927.E-615244634 223801.421E+247632618 -> 2.23801421E+247632623 Inexact Rounded +xcom302 compare -990100927.E-615244634 223801.421E+247632618 -> -1 +xdiv302 divide -990100927.E-615244634 223801.421E+247632618 -> -4.42401537E-862877249 Inexact Rounded +xdvi302 divideint -990100927.E-615244634 223801.421E+247632618 -> -0 +xmul302 multiply -990100927.E-615244634 223801.421E+247632618 -> -2.21585994E-367612002 Inexact Rounded +xpow302 power -990100927.E-615244634 2 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem302 remainder -990100927.E-615244634 223801.421E+247632618 -> -9.90100927E-615244626 +xsub302 subtract -990100927.E-615244634 223801.421E+247632618 -> -2.23801421E+247632623 Inexact Rounded +xadd303 add 1275.10292 -667965353 -> -667964078 Inexact Rounded +xcom303 compare 1275.10292 -667965353 -> 1 +xdiv303 divide 1275.10292 -667965353 -> -0.00000190893572 Inexact Rounded +xdvi303 divideint 1275.10292 -667965353 -> -0 +xmul303 multiply 1275.10292 -667965353 -> -8.51724572E+11 Inexact Rounded +xpow303 power 1275.10292 -667965353 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem303 remainder 1275.10292 -667965353 -> 1275.10292 +xsub303 subtract 1275.10292 -667965353 -> 667966628 Inexact Rounded +xadd304 add -8.76375480E-596792197 992.077361 -> 992.077361 Inexact Rounded +xcom304 compare -8.76375480E-596792197 992.077361 -> -1 +xdiv304 divide -8.76375480E-596792197 992.077361 -> -8.83374134E-596792200 Inexact Rounded +xdvi304 divideint -8.76375480E-596792197 992.077361 -> -0 +xmul304 multiply -8.76375480E-596792197 992.077361 -> -8.69432273E-596792194 Inexact Rounded +xpow304 power -8.76375480E-596792197 992 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem304 remainder -8.76375480E-596792197 992.077361 -> -8.76375480E-596792197 +xsub304 subtract -8.76375480E-596792197 992.077361 -> -992.077361 Inexact Rounded +xadd305 add 953.976935E+385444720 96503.3378 -> 9.53976935E+385444722 Inexact Rounded +xcom305 compare 953.976935E+385444720 96503.3378 -> 1 +xdiv305 divide 953.976935E+385444720 96503.3378 -> 9.88542942E+385444717 Inexact Rounded +xdvi305 divideint 953.976935E+385444720 96503.3378 -> NaN Division_impossible +xmul305 multiply 953.976935E+385444720 96503.3378 -> 9.20619584E+385444727 Inexact Rounded +xpow305 power 953.976935E+385444720 96503 -> Infinity Overflow Inexact Rounded +xrem305 remainder 953.976935E+385444720 96503.3378 -> NaN Division_impossible +xsub305 subtract 953.976935E+385444720 96503.3378 -> 9.53976935E+385444722 Inexact Rounded +xadd306 add 213577152 -986710073E+31900046 -> -9.86710073E+31900054 Inexact Rounded +xcom306 compare 213577152 -986710073E+31900046 -> 1 +xdiv306 divide 213577152 -986710073E+31900046 -> -2.16453807E-31900047 Inexact Rounded +xdvi306 divideint 213577152 -986710073E+31900046 -> -0 +xmul306 multiply 213577152 -986710073E+31900046 -> -2.10738727E+31900063 Inexact Rounded +xpow306 power 213577152 -10 -> 5.06351487E-84 Inexact Rounded +xrem306 remainder 213577152 -986710073E+31900046 -> 213577152 +xsub306 subtract 213577152 -986710073E+31900046 -> 9.86710073E+31900054 Inexact Rounded +xadd307 add 91393.9398E-323439228 -135.701000 -> -135.701000 Inexact Rounded +xcom307 compare 91393.9398E-323439228 -135.701000 -> 1 +xdiv307 divide 91393.9398E-323439228 -135.701000 -> -6.73494962E-323439226 Inexact Rounded +xdvi307 divideint 91393.9398E-323439228 -135.701000 -> -0 +xmul307 multiply 91393.9398E-323439228 -135.701000 -> -1.24022490E-323439221 Inexact Rounded +xpow307 power 91393.9398E-323439228 -136 -> Infinity Overflow Inexact Rounded +xrem307 remainder 91393.9398E-323439228 -135.701000 -> 9.13939398E-323439224 +xsub307 subtract 91393.9398E-323439228 -135.701000 -> 135.701000 Inexact Rounded +xadd308 add -396.503557 45757264.E-254363788 -> -396.503557 Inexact Rounded +xcom308 compare -396.503557 45757264.E-254363788 -> -1 +xdiv308 divide -396.503557 45757264.E-254363788 -> -8.66536856E+254363782 Inexact Rounded +xdvi308 divideint -396.503557 45757264.E-254363788 -> NaN Division_impossible +xmul308 multiply -396.503557 45757264.E-254363788 -> -1.81429179E-254363778 Inexact Rounded +xpow308 power -396.503557 5 -> -9.80021128E+12 Inexact Rounded +xrem308 remainder -396.503557 45757264.E-254363788 -> NaN Division_impossible +xsub308 subtract -396.503557 45757264.E-254363788 -> -396.503557 Inexact Rounded +xadd309 add 59807846.1 1.53345254 -> 59807847.6 Inexact Rounded +xcom309 compare 59807846.1 1.53345254 -> 1 +xdiv309 divide 59807846.1 1.53345254 -> 39002084.9 Inexact Rounded +xdvi309 divideint 59807846.1 1.53345254 -> 39002084 +xmul309 multiply 59807846.1 1.53345254 -> 91712493.5 Inexact Rounded +xpow309 power 59807846.1 2 -> 3.57697846E+15 Inexact Rounded +xrem309 remainder 59807846.1 1.53345254 -> 1.32490664 +xsub309 subtract 59807846.1 1.53345254 -> 59807844.6 Inexact Rounded +xadd310 add -8046158.45 8.3635397 -> -8046150.09 Inexact Rounded +xcom310 compare -8046158.45 8.3635397 -> -1 +xdiv310 divide -8046158.45 8.3635397 -> -962051.803 Inexact Rounded +xdvi310 divideint -8046158.45 8.3635397 -> -962051 +xmul310 multiply -8046158.45 8.3635397 -> -67294365.6 Inexact Rounded +xpow310 power -8046158.45 8 -> 1.75674467E+55 Inexact Rounded +xrem310 remainder -8046158.45 8.3635397 -> -6.7180753 +xsub310 subtract -8046158.45 8.3635397 -> -8046166.81 Inexact Rounded +xadd311 add 55.1123381E+50627250 -94.0355047E-162540316 -> 5.51123381E+50627251 Inexact Rounded +xcom311 compare 55.1123381E+50627250 -94.0355047E-162540316 -> 1 +xdiv311 divide 55.1123381E+50627250 -94.0355047E-162540316 -> -5.86080101E+213167565 Inexact Rounded +xdvi311 divideint 55.1123381E+50627250 -94.0355047E-162540316 -> NaN Division_impossible +xmul311 multiply 55.1123381E+50627250 -94.0355047E-162540316 -> -5.18251653E-111913063 Inexact Rounded +xpow311 power 55.1123381E+50627250 -9 -> 2.13186881E-455645266 Inexact Rounded +xrem311 remainder 55.1123381E+50627250 -94.0355047E-162540316 -> NaN Division_impossible +xsub311 subtract 55.1123381E+50627250 -94.0355047E-162540316 -> 5.51123381E+50627251 Inexact Rounded +xadd312 add -948.038054 3580.84510 -> 2632.80705 Inexact Rounded +xcom312 compare -948.038054 3580.84510 -> -1 +xdiv312 divide -948.038054 3580.84510 -> -0.264752601 Inexact Rounded +xdvi312 divideint -948.038054 3580.84510 -> -0 +xmul312 multiply -948.038054 3580.84510 -> -3394777.42 Inexact Rounded +xpow312 power -948.038054 3581 -> -1.03058288E+10660 Inexact Rounded +xrem312 remainder -948.038054 3580.84510 -> -948.038054 +xsub312 subtract -948.038054 3580.84510 -> -4528.88315 Inexact Rounded +xadd313 add -6026.42752 -14.2286406E-334921364 -> -6026.42752 Inexact Rounded +xcom313 compare -6026.42752 -14.2286406E-334921364 -> -1 +xdiv313 divide -6026.42752 -14.2286406E-334921364 -> 4.23542044E+334921366 Inexact Rounded +xdvi313 divideint -6026.42752 -14.2286406E-334921364 -> NaN Division_impossible +xmul313 multiply -6026.42752 -14.2286406E-334921364 -> 8.57478713E-334921360 Inexact Rounded +xpow313 power -6026.42752 -1 -> -0.000165935788 Inexact Rounded +xrem313 remainder -6026.42752 -14.2286406E-334921364 -> NaN Division_impossible +xsub313 subtract -6026.42752 -14.2286406E-334921364 -> -6026.42752 Inexact Rounded +xadd314 add 79551.5014 -538.186229 -> 79013.3152 Inexact Rounded +xcom314 compare 79551.5014 -538.186229 -> 1 +xdiv314 divide 79551.5014 -538.186229 -> -147.814078 Inexact Rounded +xdvi314 divideint 79551.5014 -538.186229 -> -147 +xmul314 multiply 79551.5014 -538.186229 -> -42813522.5 Inexact Rounded +xpow314 power 79551.5014 -538 -> 2.82599389E-2637 Inexact Rounded +xrem314 remainder 79551.5014 -538.186229 -> 438.125737 +xsub314 subtract 79551.5014 -538.186229 -> 80089.6876 Inexact Rounded +xadd315 add 42706056.E+623578292 -690.327745 -> 4.27060560E+623578299 Inexact Rounded +xcom315 compare 42706056.E+623578292 -690.327745 -> 1 +xdiv315 divide 42706056.E+623578292 -690.327745 -> -6.18634501E+623578296 Inexact Rounded +xdvi315 divideint 42706056.E+623578292 -690.327745 -> NaN Division_impossible +xmul315 multiply 42706056.E+623578292 -690.327745 -> -2.94811753E+623578302 Inexact Rounded +xpow315 power 42706056.E+623578292 -690 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem315 remainder 42706056.E+623578292 -690.327745 -> NaN Division_impossible +xsub315 subtract 42706056.E+623578292 -690.327745 -> 4.27060560E+623578299 Inexact Rounded +xadd316 add 2454136.08E+502374077 856268.795E-356664934 -> 2.45413608E+502374083 Inexact Rounded +xcom316 compare 2454136.08E+502374077 856268.795E-356664934 -> 1 +xdiv316 divide 2454136.08E+502374077 856268.795E-356664934 -> 2.86608142E+859039011 Inexact Rounded +xdvi316 divideint 2454136.08E+502374077 856268.795E-356664934 -> NaN Division_impossible +xmul316 multiply 2454136.08E+502374077 856268.795E-356664934 -> 2.10140014E+145709155 Inexact Rounded +xpow316 power 2454136.08E+502374077 9 -> Infinity Overflow Inexact Rounded +xrem316 remainder 2454136.08E+502374077 856268.795E-356664934 -> NaN Division_impossible +xsub316 subtract 2454136.08E+502374077 856268.795E-356664934 -> 2.45413608E+502374083 Inexact Rounded +xadd317 add -3264204.54 -42704.501 -> -3306909.04 Inexact Rounded +xcom317 compare -3264204.54 -42704.501 -> -1 +xdiv317 divide -3264204.54 -42704.501 -> 76.4370140 Inexact Rounded +xdvi317 divideint -3264204.54 -42704.501 -> 76 +xmul317 multiply -3264204.54 -42704.501 -> 1.39396226E+11 Inexact Rounded +xpow317 power -3264204.54 -42705 -> -1.37293410E-278171 Inexact Rounded +xrem317 remainder -3264204.54 -42704.501 -> -18662.464 +xsub317 subtract -3264204.54 -42704.501 -> -3221500.04 Inexact Rounded +xadd318 add 1.21265492 44102.6073 -> 44103.8200 Inexact Rounded +xcom318 compare 1.21265492 44102.6073 -> -1 +xdiv318 divide 1.21265492 44102.6073 -> 0.0000274962183 Inexact Rounded +xdvi318 divideint 1.21265492 44102.6073 -> 0 +xmul318 multiply 1.21265492 44102.6073 -> 53481.2437 Inexact Rounded +xpow318 power 1.21265492 44103 -> 1.15662573E+3693 Inexact Rounded +xrem318 remainder 1.21265492 44102.6073 -> 1.21265492 +xsub318 subtract 1.21265492 44102.6073 -> -44101.3946 Inexact Rounded +xadd319 add -19.054711E+975514652 -22144.0822 -> -1.90547110E+975514653 Inexact Rounded +xcom319 compare -19.054711E+975514652 -22144.0822 -> -1 +xdiv319 divide -19.054711E+975514652 -22144.0822 -> 8.60487729E+975514648 Inexact Rounded +xdvi319 divideint -19.054711E+975514652 -22144.0822 -> NaN Division_impossible +xmul319 multiply -19.054711E+975514652 -22144.0822 -> 4.21949087E+975514657 Inexact Rounded +xpow319 power -19.054711E+975514652 -22144 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem319 remainder -19.054711E+975514652 -22144.0822 -> NaN Division_impossible +xsub319 subtract -19.054711E+975514652 -22144.0822 -> -1.90547110E+975514653 Inexact Rounded +xadd320 add 745.78452 -1922.00670E+375923302 -> -1.92200670E+375923305 Inexact Rounded +xcom320 compare 745.78452 -1922.00670E+375923302 -> 1 +xdiv320 divide 745.78452 -1922.00670E+375923302 -> -3.88023892E-375923303 Inexact Rounded +xdvi320 divideint 745.78452 -1922.00670E+375923302 -> -0 +xmul320 multiply 745.78452 -1922.00670E+375923302 -> -1.43340284E+375923308 Inexact Rounded +xpow320 power 745.78452 -2 -> 0.00000179793204 Inexact Rounded +xrem320 remainder 745.78452 -1922.00670E+375923302 -> 745.78452 +xsub320 subtract 745.78452 -1922.00670E+375923302 -> 1.92200670E+375923305 Inexact Rounded +xadd321 add -963717836 -823989308 -> -1.78770714E+9 Inexact Rounded +xcom321 compare -963717836 -823989308 -> -1 +xdiv321 divide -963717836 -823989308 -> 1.16957566 Inexact Rounded +xdvi321 divideint -963717836 -823989308 -> 1 +xmul321 multiply -963717836 -823989308 -> 7.94093193E+17 Inexact Rounded +xpow321 power -963717836 -823989308 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem321 remainder -963717836 -823989308 -> -139728528 +xsub321 subtract -963717836 -823989308 -> -139728528 +xadd322 add 82.4185291E-321919303 -215747737.E-995147400 -> 8.24185291E-321919302 Inexact Rounded +xcom322 compare 82.4185291E-321919303 -215747737.E-995147400 -> 1 +xdiv322 divide 82.4185291E-321919303 -215747737.E-995147400 -> -3.82013412E+673228090 Inexact Rounded +xdvi322 divideint 82.4185291E-321919303 -215747737.E-995147400 -> NaN Division_impossible +xmul322 multiply 82.4185291E-321919303 -215747737.E-995147400 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow322 power 82.4185291E-321919303 -2 -> 1.47214396E+643838602 Inexact Rounded +xrem322 remainder 82.4185291E-321919303 -215747737.E-995147400 -> NaN Division_impossible +xsub322 subtract 82.4185291E-321919303 -215747737.E-995147400 -> 8.24185291E-321919302 Inexact Rounded +xadd323 add -808328.607E-790810342 53075.7082 -> 53075.7082 Inexact Rounded +xcom323 compare -808328.607E-790810342 53075.7082 -> -1 +xdiv323 divide -808328.607E-790810342 53075.7082 -> -1.52297281E-790810341 Inexact Rounded +xdvi323 divideint -808328.607E-790810342 53075.7082 -> -0 +xmul323 multiply -808328.607E-790810342 53075.7082 -> -4.29026133E-790810332 Inexact Rounded +xpow323 power -808328.607E-790810342 53076 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem323 remainder -808328.607E-790810342 53075.7082 -> -8.08328607E-790810337 +xsub323 subtract -808328.607E-790810342 53075.7082 -> -53075.7082 Inexact Rounded +xadd324 add 700592.720 -698485.085 -> 2107.635 +xcom324 compare 700592.720 -698485.085 -> 1 +xdiv324 divide 700592.720 -698485.085 -> -1.00301744 Inexact Rounded +xdvi324 divideint 700592.720 -698485.085 -> -1 +xmul324 multiply 700592.720 -698485.085 -> -4.89353566E+11 Inexact Rounded +xpow324 power 700592.720 -698485 -> 8.83690000E-4082971 Inexact Rounded +xrem324 remainder 700592.720 -698485.085 -> 2107.635 +xsub324 subtract 700592.720 -698485.085 -> 1399077.81 Inexact Rounded +xadd325 add -80273928.0 661346.239 -> -79612581.8 Inexact Rounded +xcom325 compare -80273928.0 661346.239 -> -1 +xdiv325 divide -80273928.0 661346.239 -> -121.379579 Inexact Rounded +xdvi325 divideint -80273928.0 661346.239 -> -121 +xmul325 multiply -80273928.0 661346.239 -> -5.30888604E+13 Inexact Rounded +xpow325 power -80273928.0 661346 -> 5.45664856E+5227658 Inexact Rounded +xrem325 remainder -80273928.0 661346.239 -> -251033.081 +xsub325 subtract -80273928.0 661346.239 -> -80935274.2 Inexact Rounded +xadd326 add -24018251.0E+819786764 59141.9600E-167165065 -> -2.40182510E+819786771 Inexact Rounded +xcom326 compare -24018251.0E+819786764 59141.9600E-167165065 -> -1 +xdiv326 divide -24018251.0E+819786764 59141.9600E-167165065 -> -4.06111854E+986951831 Inexact Rounded +xdvi326 divideint -24018251.0E+819786764 59141.9600E-167165065 -> NaN Division_impossible +xmul326 multiply -24018251.0E+819786764 59141.9600E-167165065 -> -1.42048644E+652621711 Inexact Rounded +xpow326 power -24018251.0E+819786764 6 -> Infinity Overflow Inexact Rounded +xrem326 remainder -24018251.0E+819786764 59141.9600E-167165065 -> NaN Division_impossible +xsub326 subtract -24018251.0E+819786764 59141.9600E-167165065 -> -2.40182510E+819786771 Inexact Rounded +xadd327 add 2512953.3 -3769170.35E-993621645 -> 2512953.30 Inexact Rounded +xcom327 compare 2512953.3 -3769170.35E-993621645 -> 1 +xdiv327 divide 2512953.3 -3769170.35E-993621645 -> -6.66712583E+993621644 Inexact Rounded +xdvi327 divideint 2512953.3 -3769170.35E-993621645 -> NaN Division_impossible +xmul327 multiply 2512953.3 -3769170.35E-993621645 -> -9.47174907E-993621633 Inexact Rounded +xpow327 power 2512953.3 -4 -> 2.50762348E-26 Inexact Rounded +xrem327 remainder 2512953.3 -3769170.35E-993621645 -> NaN Division_impossible +xsub327 subtract 2512953.3 -3769170.35E-993621645 -> 2512953.30 Inexact Rounded +xadd328 add -682.796370 71131.0224 -> 70448.2260 Inexact Rounded +xcom328 compare -682.796370 71131.0224 -> -1 +xdiv328 divide -682.796370 71131.0224 -> -0.00959913617 Inexact Rounded +xdvi328 divideint -682.796370 71131.0224 -> -0 +xmul328 multiply -682.796370 71131.0224 -> -48568003.9 Inexact Rounded +xpow328 power -682.796370 71131 -> -9.28114741E+201605 Inexact Rounded +xrem328 remainder -682.796370 71131.0224 -> -682.796370 +xsub328 subtract -682.796370 71131.0224 -> -71813.8188 Inexact Rounded +xadd329 add 89.9997490 -4993.69831 -> -4903.69856 Inexact Rounded +xcom329 compare 89.9997490 -4993.69831 -> 1 +xdiv329 divide 89.9997490 -4993.69831 -> -0.0180226644 Inexact Rounded +xdvi329 divideint 89.9997490 -4993.69831 -> -0 +xmul329 multiply 89.9997490 -4993.69831 -> -449431.594 Inexact Rounded +xpow329 power 89.9997490 -4994 -> 3.30336525E-9760 Inexact Rounded +xrem329 remainder 89.9997490 -4993.69831 -> 89.9997490 +xsub329 subtract 89.9997490 -4993.69831 -> 5083.69806 Inexact Rounded +xadd330 add 76563354.6E-112338836 278271.585E-511481095 -> 7.65633546E-112338829 Inexact Rounded +xcom330 compare 76563354.6E-112338836 278271.585E-511481095 -> 1 +xdiv330 divide 76563354.6E-112338836 278271.585E-511481095 -> 2.75138960E+399142261 Inexact Rounded +xdvi330 divideint 76563354.6E-112338836 278271.585E-511481095 -> NaN Division_impossible +xmul330 multiply 76563354.6E-112338836 278271.585E-511481095 -> 2.13054060E-623819918 Inexact Rounded +xpow330 power 76563354.6E-112338836 3 -> 4.48810347E-337016485 Inexact Rounded +xrem330 remainder 76563354.6E-112338836 278271.585E-511481095 -> NaN Division_impossible +xsub330 subtract 76563354.6E-112338836 278271.585E-511481095 -> 7.65633546E-112338829 Inexact Rounded +xadd331 add -932499.010 873.377701E-502190452 -> -932499.010 Inexact Rounded +xcom331 compare -932499.010 873.377701E-502190452 -> -1 +xdiv331 divide -932499.010 873.377701E-502190452 -> -1.06769272E+502190455 Inexact Rounded +xdvi331 divideint -932499.010 873.377701E-502190452 -> NaN Division_impossible +xmul331 multiply -932499.010 873.377701E-502190452 -> -8.14423842E-502190444 Inexact Rounded +xpow331 power -932499.010 9 -> -5.33132815E+53 Inexact Rounded +xrem331 remainder -932499.010 873.377701E-502190452 -> NaN Division_impossible +xsub331 subtract -932499.010 873.377701E-502190452 -> -932499.010 Inexact Rounded +xadd332 add -7735918.21E+799514797 -7748.78023 -> -7.73591821E+799514803 Inexact Rounded +xcom332 compare -7735918.21E+799514797 -7748.78023 -> -1 +xdiv332 divide -7735918.21E+799514797 -7748.78023 -> 9.98340123E+799514799 Inexact Rounded +xdvi332 divideint -7735918.21E+799514797 -7748.78023 -> NaN Division_impossible +xmul332 multiply -7735918.21E+799514797 -7748.78023 -> 5.99439301E+799514807 Inexact Rounded +xpow332 power -7735918.21E+799514797 -7749 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem332 remainder -7735918.21E+799514797 -7748.78023 -> NaN Division_impossible +xsub332 subtract -7735918.21E+799514797 -7748.78023 -> -7.73591821E+799514803 Inexact Rounded +xadd333 add -3708780.75E+445232787 980.006567E-780728623 -> -3.70878075E+445232793 Inexact Rounded +xcom333 compare -3708780.75E+445232787 980.006567E-780728623 -> -1 +xdiv333 divide -3708780.75E+445232787 980.006567E-780728623 -> -Infinity Inexact Overflow Rounded +xdvi333 divideint -3708780.75E+445232787 980.006567E-780728623 -> NaN Division_impossible +xmul333 multiply -3708780.75E+445232787 980.006567E-780728623 -> -3.63462949E-335495827 Inexact Rounded +xpow333 power -3708780.75E+445232787 10 -> Infinity Overflow Inexact Rounded +xrem333 remainder -3708780.75E+445232787 980.006567E-780728623 -> NaN Division_impossible +xsub333 subtract -3708780.75E+445232787 980.006567E-780728623 -> -3.70878075E+445232793 Inexact Rounded +xadd334 add -5205124.44E-140588661 -495394029.E-620856313 -> -5.20512444E-140588655 Inexact Rounded +xcom334 compare -5205124.44E-140588661 -495394029.E-620856313 -> -1 +xdiv334 divide -5205124.44E-140588661 -495394029.E-620856313 -> 1.05070391E+480267650 Inexact Rounded +xdvi334 divideint -5205124.44E-140588661 -495394029.E-620856313 -> NaN Division_impossible +xmul334 multiply -5205124.44E-140588661 -495394029.E-620856313 -> 2.57858757E-761444959 Inexact Rounded +xpow334 power -5205124.44E-140588661 -5 -> -2.61724523E+702943271 Inexact Rounded +xrem334 remainder -5205124.44E-140588661 -495394029.E-620856313 -> NaN Division_impossible +xsub334 subtract -5205124.44E-140588661 -495394029.E-620856313 -> -5.20512444E-140588655 Inexact Rounded +xadd335 add -8868.72074 5592399.93 -> 5583531.21 Inexact Rounded +xcom335 compare -8868.72074 5592399.93 -> -1 +xdiv335 divide -8868.72074 5592399.93 -> -0.00158585238 Inexact Rounded +xdvi335 divideint -8868.72074 5592399.93 -> -0 +xmul335 multiply -8868.72074 5592399.93 -> -4.95974332E+10 Inexact Rounded +xpow335 power -8868.72074 5592400 -> 5.55074142E+22078017 Inexact Rounded +xrem335 remainder -8868.72074 5592399.93 -> -8868.72074 +xsub335 subtract -8868.72074 5592399.93 -> -5601268.65 Inexact Rounded +xadd336 add -74.7852037E-175205809 4.14316542 -> 4.14316542 Inexact Rounded +xcom336 compare -74.7852037E-175205809 4.14316542 -> -1 +xdiv336 divide -74.7852037E-175205809 4.14316542 -> -1.80502577E-175205808 Inexact Rounded +xdvi336 divideint -74.7852037E-175205809 4.14316542 -> -0 +xmul336 multiply -74.7852037E-175205809 4.14316542 -> -3.09847470E-175205807 Inexact Rounded +xpow336 power -74.7852037E-175205809 4 -> 3.12797104E-700823229 Inexact Rounded +xrem336 remainder -74.7852037E-175205809 4.14316542 -> -7.47852037E-175205808 +xsub336 subtract -74.7852037E-175205809 4.14316542 -> -4.14316542 Inexact Rounded +xadd337 add 84196.1091E+242628748 8.07523036E-288231467 -> 8.41961091E+242628752 Inexact Rounded +xcom337 compare 84196.1091E+242628748 8.07523036E-288231467 -> 1 +xdiv337 divide 84196.1091E+242628748 8.07523036E-288231467 -> 1.04264653E+530860219 Inexact Rounded +xdvi337 divideint 84196.1091E+242628748 8.07523036E-288231467 -> NaN Division_impossible +xmul337 multiply 84196.1091E+242628748 8.07523036E-288231467 -> 6.79902976E-45602714 Inexact Rounded +xpow337 power 84196.1091E+242628748 8 -> Infinity Overflow Inexact Rounded +xrem337 remainder 84196.1091E+242628748 8.07523036E-288231467 -> NaN Division_impossible +xsub337 subtract 84196.1091E+242628748 8.07523036E-288231467 -> 8.41961091E+242628752 Inexact Rounded +xadd338 add 38660103.1 -6671.73085E+900998477 -> -6.67173085E+900998480 Inexact Rounded +xcom338 compare 38660103.1 -6671.73085E+900998477 -> 1 +xdiv338 divide 38660103.1 -6671.73085E+900998477 -> -5.79461372E-900998474 Inexact Rounded +xdvi338 divideint 38660103.1 -6671.73085E+900998477 -> -0 +xmul338 multiply 38660103.1 -6671.73085E+900998477 -> -2.57929803E+900998488 Inexact Rounded +xpow338 power 38660103.1 -7 -> 7.74745290E-54 Inexact Rounded +xrem338 remainder 38660103.1 -6671.73085E+900998477 -> 38660103.1 +xsub338 subtract 38660103.1 -6671.73085E+900998477 -> 6.67173085E+900998480 Inexact Rounded +xadd339 add -52.2659460 -296404199E+372050476 -> -2.96404199E+372050484 Inexact Rounded +xcom339 compare -52.2659460 -296404199E+372050476 -> 1 +xdiv339 divide -52.2659460 -296404199E+372050476 -> 1.76333352E-372050483 Inexact Rounded +xdvi339 divideint -52.2659460 -296404199E+372050476 -> 0 +xmul339 multiply -52.2659460 -296404199E+372050476 -> 1.54918459E+372050486 Inexact Rounded +xpow339 power -52.2659460 -3 -> -0.00000700395833 Inexact Rounded +xrem339 remainder -52.2659460 -296404199E+372050476 -> -52.2659460 +xsub339 subtract -52.2659460 -296404199E+372050476 -> 2.96404199E+372050484 Inexact Rounded +xadd340 add 6.06625013 -276.359186 -> -270.292936 Inexact Rounded +xcom340 compare 6.06625013 -276.359186 -> 1 +xdiv340 divide 6.06625013 -276.359186 -> -0.0219506007 Inexact Rounded +xdvi340 divideint 6.06625013 -276.359186 -> -0 +xmul340 multiply 6.06625013 -276.359186 -> -1676.46395 Inexact Rounded +xpow340 power 6.06625013 -276 -> 8.20339149E-217 Inexact Rounded +xrem340 remainder 6.06625013 -276.359186 -> 6.06625013 +xsub340 subtract 6.06625013 -276.359186 -> 282.425436 Inexact Rounded +xadd341 add -62971617.5E-241444744 46266799.3 -> 46266799.3 Inexact Rounded +xcom341 compare -62971617.5E-241444744 46266799.3 -> -1 +xdiv341 divide -62971617.5E-241444744 46266799.3 -> -1.36105411E-241444744 Inexact Rounded +xdvi341 divideint -62971617.5E-241444744 46266799.3 -> -0 +xmul341 multiply -62971617.5E-241444744 46266799.3 -> -2.91349519E-241444729 Inexact Rounded +xpow341 power -62971617.5E-241444744 46266799 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem341 remainder -62971617.5E-241444744 46266799.3 -> -6.29716175E-241444737 +xsub341 subtract -62971617.5E-241444744 46266799.3 -> -46266799.3 Inexact Rounded +xadd342 add -5.36917800 -311124593.E-976066491 -> -5.36917800 Inexact Rounded +xcom342 compare -5.36917800 -311124593.E-976066491 -> -1 +xdiv342 divide -5.36917800 -311124593.E-976066491 -> 1.72573243E+976066483 Inexact Rounded +xdvi342 divideint -5.36917800 -311124593.E-976066491 -> NaN Division_impossible +xmul342 multiply -5.36917800 -311124593.E-976066491 -> 1.67048332E-976066482 Inexact Rounded +xpow342 power -5.36917800 -3 -> -0.00646065565 Inexact Rounded +xrem342 remainder -5.36917800 -311124593.E-976066491 -> NaN Division_impossible +xsub342 subtract -5.36917800 -311124593.E-976066491 -> -5.36917800 Inexact Rounded +xadd343 add 2467915.01 -92.5558322 -> 2467822.45 Inexact Rounded +xcom343 compare 2467915.01 -92.5558322 -> 1 +xdiv343 divide 2467915.01 -92.5558322 -> -26664.0681 Inexact Rounded +xdvi343 divideint 2467915.01 -92.5558322 -> -26664 +xmul343 multiply 2467915.01 -92.5558322 -> -228419928 Inexact Rounded +xpow343 power 2467915.01 -93 -> 3.26055444E-595 Inexact Rounded +xrem343 remainder 2467915.01 -92.5558322 -> 6.3002192 +xsub343 subtract 2467915.01 -92.5558322 -> 2468007.57 Inexact Rounded +xadd344 add 187.232671 -840.469347 -> -653.236676 +xcom344 compare 187.232671 -840.469347 -> 1 +xdiv344 divide 187.232671 -840.469347 -> -0.222771564 Inexact Rounded +xdvi344 divideint 187.232671 -840.469347 -> -0 +xmul344 multiply 187.232671 -840.469347 -> -157363.321 Inexact Rounded +xpow344 power 187.232671 -840 -> 1.58280862E-1909 Inexact Rounded +xrem344 remainder 187.232671 -840.469347 -> 187.232671 +xsub344 subtract 187.232671 -840.469347 -> 1027.70202 Inexact Rounded +xadd345 add 81233.6823 -5192.21666E+309315093 -> -5.19221666E+309315096 Inexact Rounded +xcom345 compare 81233.6823 -5192.21666E+309315093 -> 1 +xdiv345 divide 81233.6823 -5192.21666E+309315093 -> -1.56452798E-309315092 Inexact Rounded +xdvi345 divideint 81233.6823 -5192.21666E+309315093 -> -0 +xmul345 multiply 81233.6823 -5192.21666E+309315093 -> -4.21782879E+309315101 Inexact Rounded +xpow345 power 81233.6823 -5 -> 2.82695763E-25 Inexact Rounded +xrem345 remainder 81233.6823 -5192.21666E+309315093 -> 81233.6823 +xsub345 subtract 81233.6823 -5192.21666E+309315093 -> 5.19221666E+309315096 Inexact Rounded +xadd346 add -854.586113 -79.8715762E-853065103 -> -854.586113 Inexact Rounded +xcom346 compare -854.586113 -79.8715762E-853065103 -> -1 +xdiv346 divide -854.586113 -79.8715762E-853065103 -> 1.06995023E+853065104 Inexact Rounded +xdvi346 divideint -854.586113 -79.8715762E-853065103 -> NaN Division_impossible +xmul346 multiply -854.586113 -79.8715762E-853065103 -> 6.82571398E-853065099 Inexact Rounded +xpow346 power -854.586113 -8 -> 3.51522679E-24 Inexact Rounded +xrem346 remainder -854.586113 -79.8715762E-853065103 -> NaN Division_impossible +xsub346 subtract -854.586113 -79.8715762E-853065103 -> -854.586113 Inexact Rounded +xadd347 add 78872665.3 172.102119 -> 78872837.4 Inexact Rounded +xcom347 compare 78872665.3 172.102119 -> 1 +xdiv347 divide 78872665.3 172.102119 -> 458289.914 Inexact Rounded +xdvi347 divideint 78872665.3 172.102119 -> 458289 +xmul347 multiply 78872665.3 172.102119 -> 1.35741528E+10 Inexact Rounded +xpow347 power 78872665.3 172 -> 1.86793137E+1358 Inexact Rounded +xrem347 remainder 78872665.3 172.102119 -> 157.285609 +xsub347 subtract 78872665.3 172.102119 -> 78872493.2 Inexact Rounded +xadd348 add 328268.1E-436315617 -204.522245 -> -204.522245 Inexact Rounded +xcom348 compare 328268.1E-436315617 -204.522245 -> 1 +xdiv348 divide 328268.1E-436315617 -204.522245 -> -1.60504839E-436315614 Inexact Rounded +xdvi348 divideint 328268.1E-436315617 -204.522245 -> -0 +xmul348 multiply 328268.1E-436315617 -204.522245 -> -6.71381288E-436315610 Inexact Rounded +xpow348 power 328268.1E-436315617 -205 -> Infinity Overflow Inexact Rounded +xrem348 remainder 328268.1E-436315617 -204.522245 -> 3.282681E-436315612 +xsub348 subtract 328268.1E-436315617 -204.522245 -> 204.522245 Inexact Rounded +xadd349 add -4037911.02E+641367645 29.5713010 -> -4.03791102E+641367651 Inexact Rounded +xcom349 compare -4037911.02E+641367645 29.5713010 -> -1 +xdiv349 divide -4037911.02E+641367645 29.5713010 -> -1.36548305E+641367650 Inexact Rounded +xdvi349 divideint -4037911.02E+641367645 29.5713010 -> NaN Division_impossible +xmul349 multiply -4037911.02E+641367645 29.5713010 -> -1.19406282E+641367653 Inexact Rounded +xpow349 power -4037911.02E+641367645 30 -> Infinity Overflow Inexact Rounded +xrem349 remainder -4037911.02E+641367645 29.5713010 -> NaN Division_impossible +xsub349 subtract -4037911.02E+641367645 29.5713010 -> -4.03791102E+641367651 Inexact Rounded +xadd350 add -688755561.E-95301699 978.275312E+913812609 -> 9.78275312E+913812611 Inexact Rounded +xcom350 compare -688755561.E-95301699 978.275312E+913812609 -> -1 +xdiv350 divide -688755561.E-95301699 978.275312E+913812609 -> -0E-1000000007 Inexact Rounded Underflow Subnormal Clamped +xdvi350 divideint -688755561.E-95301699 978.275312E+913812609 -> -0 +xmul350 multiply -688755561.E-95301699 978.275312E+913812609 -> -6.73792561E+818510921 Inexact Rounded +xpow350 power -688755561.E-95301699 10 -> 2.40243244E-953016902 Inexact Rounded +xrem350 remainder -688755561.E-95301699 978.275312E+913812609 -> -6.88755561E-95301691 +xsub350 subtract -688755561.E-95301699 978.275312E+913812609 -> -9.78275312E+913812611 Inexact Rounded +xadd351 add -5.47345502 59818.7580 -> 59813.2845 Inexact Rounded +xcom351 compare -5.47345502 59818.7580 -> -1 +xdiv351 divide -5.47345502 59818.7580 -> -0.0000915006463 Inexact Rounded +xdvi351 divideint -5.47345502 59818.7580 -> -0 +xmul351 multiply -5.47345502 59818.7580 -> -327415.281 Inexact Rounded +xpow351 power -5.47345502 59819 -> -1.16914146E+44162 Inexact Rounded +xrem351 remainder -5.47345502 59818.7580 -> -5.47345502 +xsub351 subtract -5.47345502 59818.7580 -> -59824.2315 Inexact Rounded +xadd352 add 563891620E-361354567 -845900362. -> -845900362 Inexact Rounded +xcom352 compare 563891620E-361354567 -845900362. -> 1 +xdiv352 divide 563891620E-361354567 -845900362. -> -6.66617069E-361354568 Inexact Rounded +xdvi352 divideint 563891620E-361354567 -845900362. -> -0 +xmul352 multiply 563891620E-361354567 -845900362. -> -4.76996125E-361354550 Inexact Rounded +xpow352 power 563891620E-361354567 -845900362 -> Infinity Overflow Inexact Rounded +xrem352 remainder 563891620E-361354567 -845900362. -> 5.63891620E-361354559 +xsub352 subtract 563891620E-361354567 -845900362. -> 845900362 Inexact Rounded +xadd353 add -69.7231286 85773.7504 -> 85704.0273 Inexact Rounded +xcom353 compare -69.7231286 85773.7504 -> -1 +xdiv353 divide -69.7231286 85773.7504 -> -0.000812872566 Inexact Rounded +xdvi353 divideint -69.7231286 85773.7504 -> -0 +xmul353 multiply -69.7231286 85773.7504 -> -5980414.23 Inexact Rounded +xpow353 power -69.7231286 85774 -> 6.41714261E+158113 Inexact Rounded +xrem353 remainder -69.7231286 85773.7504 -> -69.7231286 +xsub353 subtract -69.7231286 85773.7504 -> -85843.4735 Inexact Rounded +xadd354 add 5125.51188 73814638.4E-500934741 -> 5125.51188 Inexact Rounded +xcom354 compare 5125.51188 73814638.4E-500934741 -> 1 +xdiv354 divide 5125.51188 73814638.4E-500934741 -> 6.94376074E+500934736 Inexact Rounded +xdvi354 divideint 5125.51188 73814638.4E-500934741 -> NaN Division_impossible +xmul354 multiply 5125.51188 73814638.4E-500934741 -> 3.78337806E-500934730 Inexact Rounded +xpow354 power 5125.51188 7 -> 9.29310216E+25 Inexact Rounded +xrem354 remainder 5125.51188 73814638.4E-500934741 -> NaN Division_impossible +xsub354 subtract 5125.51188 73814638.4E-500934741 -> 5125.51188 Inexact Rounded +xadd355 add -54.6254096 -332921899. -> -332921954 Inexact Rounded +xcom355 compare -54.6254096 -332921899. -> 1 +xdiv355 divide -54.6254096 -332921899. -> 1.64078752E-7 Inexact Rounded +xdvi355 divideint -54.6254096 -332921899. -> 0 +xmul355 multiply -54.6254096 -332921899. -> 1.81859951E+10 Inexact Rounded +xpow355 power -54.6254096 -332921899 -> -1.01482569E-578416745 Inexact Rounded +xrem355 remainder -54.6254096 -332921899. -> -54.6254096 +xsub355 subtract -54.6254096 -332921899. -> 332921844 Inexact Rounded +xadd356 add -9.04778095E-591874079 8719.40286 -> 8719.40286 Inexact Rounded +xcom356 compare -9.04778095E-591874079 8719.40286 -> -1 +xdiv356 divide -9.04778095E-591874079 8719.40286 -> -1.03766062E-591874082 Inexact Rounded +xdvi356 divideint -9.04778095E-591874079 8719.40286 -> -0 +xmul356 multiply -9.04778095E-591874079 8719.40286 -> -7.88912471E-591874075 Inexact Rounded +xpow356 power -9.04778095E-591874079 8719 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem356 remainder -9.04778095E-591874079 8719.40286 -> -9.04778095E-591874079 +xsub356 subtract -9.04778095E-591874079 8719.40286 -> -8719.40286 Inexact Rounded +xadd357 add -21006.1733E+884684431 -48872.9175 -> -2.10061733E+884684435 Inexact Rounded +xcom357 compare -21006.1733E+884684431 -48872.9175 -> -1 +xdiv357 divide -21006.1733E+884684431 -48872.9175 -> 4.29812141E+884684430 Inexact Rounded +xdvi357 divideint -21006.1733E+884684431 -48872.9175 -> NaN Division_impossible +xmul357 multiply -21006.1733E+884684431 -48872.9175 -> 1.02663297E+884684440 Inexact Rounded +xpow357 power -21006.1733E+884684431 -48873 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem357 remainder -21006.1733E+884684431 -48872.9175 -> NaN Division_impossible +xsub357 subtract -21006.1733E+884684431 -48872.9175 -> -2.10061733E+884684435 Inexact Rounded +xadd358 add -1546783 -51935370.4 -> -53482153.4 +xcom358 compare -1546783 -51935370.4 -> 1 +xdiv358 divide -1546783 -51935370.4 -> 0.0297828433 Inexact Rounded +xdvi358 divideint -1546783 -51935370.4 -> 0 +xmul358 multiply -1546783 -51935370.4 -> 8.03327480E+13 Inexact Rounded +xpow358 power -1546783 -51935370 -> 3.36022461E-321450306 Inexact Rounded +xrem358 remainder -1546783 -51935370.4 -> -1546783.0 +xsub358 subtract -1546783 -51935370.4 -> 50388587.4 +xadd359 add 61302486.8 205.490417 -> 61302692.3 Inexact Rounded +xcom359 compare 61302486.8 205.490417 -> 1 +xdiv359 divide 61302486.8 205.490417 -> 298322.850 Inexact Rounded +xdvi359 divideint 61302486.8 205.490417 -> 298322 +xmul359 multiply 61302486.8 205.490417 -> 1.25970736E+10 Inexact Rounded +xpow359 power 61302486.8 205 -> 2.71024755E+1596 Inexact Rounded +xrem359 remainder 61302486.8 205.490417 -> 174.619726 +xsub359 subtract 61302486.8 205.490417 -> 61302281.3 Inexact Rounded +xadd360 add -318180109. -54008744.6E-170931002 -> -318180109 Inexact Rounded +xcom360 compare -318180109. -54008744.6E-170931002 -> -1 +xdiv360 divide -318180109. -54008744.6E-170931002 -> 5.89127023E+170931002 Inexact Rounded +xdvi360 divideint -318180109. -54008744.6E-170931002 -> NaN Division_impossible +xmul360 multiply -318180109. -54008744.6E-170931002 -> 1.71845082E-170930986 Inexact Rounded +xpow360 power -318180109. -5 -> -3.06644280E-43 Inexact Rounded +xrem360 remainder -318180109. -54008744.6E-170931002 -> NaN Division_impossible +xsub360 subtract -318180109. -54008744.6E-170931002 -> -318180109 Inexact Rounded +xadd361 add -28486137.1E+901441714 -42454.940 -> -2.84861371E+901441721 Inexact Rounded +xcom361 compare -28486137.1E+901441714 -42454.940 -> -1 +xdiv361 divide -28486137.1E+901441714 -42454.940 -> 6.70973439E+901441716 Inexact Rounded +xdvi361 divideint -28486137.1E+901441714 -42454.940 -> NaN Division_impossible +xmul361 multiply -28486137.1E+901441714 -42454.940 -> 1.20937724E+901441726 Inexact Rounded +xpow361 power -28486137.1E+901441714 -42455 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem361 remainder -28486137.1E+901441714 -42454.940 -> NaN Division_impossible +xsub361 subtract -28486137.1E+901441714 -42454.940 -> -2.84861371E+901441721 Inexact Rounded +xadd362 add -546398328. -27.9149712 -> -546398356 Inexact Rounded +xcom362 compare -546398328. -27.9149712 -> -1 +xdiv362 divide -546398328. -27.9149712 -> 19573666.2 Inexact Rounded +xdvi362 divideint -546398328. -27.9149712 -> 19573666 +xmul362 multiply -546398328. -27.9149712 -> 1.52526936E+10 Inexact Rounded +xpow362 power -546398328. -28 -> 2.23737032E-245 Inexact Rounded +xrem362 remainder -546398328. -27.9149712 -> -5.3315808 +xsub362 subtract -546398328. -27.9149712 -> -546398300 Inexact Rounded +xadd363 add 5402066.1E-284978216 622.751128 -> 622.751128 Inexact Rounded +xcom363 compare 5402066.1E-284978216 622.751128 -> -1 +xdiv363 divide 5402066.1E-284978216 622.751128 -> 8.67451837E-284978213 Inexact Rounded +xdvi363 divideint 5402066.1E-284978216 622.751128 -> 0 +xmul363 multiply 5402066.1E-284978216 622.751128 -> 3.36414276E-284978207 Inexact Rounded +xpow363 power 5402066.1E-284978216 623 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem363 remainder 5402066.1E-284978216 622.751128 -> 5.4020661E-284978210 +xsub363 subtract 5402066.1E-284978216 622.751128 -> -622.751128 Inexact Rounded +xadd364 add 18845620 3129.43753 -> 18848749.4 Inexact Rounded +xcom364 compare 18845620 3129.43753 -> 1 +xdiv364 divide 18845620 3129.43753 -> 6022.04704 Inexact Rounded +xdvi364 divideint 18845620 3129.43753 -> 6022 +xmul364 multiply 18845620 3129.43753 -> 5.89761905E+10 Inexact Rounded +xpow364 power 18845620 3129 -> 1.35967443E+22764 Inexact Rounded +xrem364 remainder 18845620 3129.43753 -> 147.19434 +xsub364 subtract 18845620 3129.43753 -> 18842490.6 Inexact Rounded +xadd365 add 50707.1412E+912475670 -198098.186E+701407524 -> 5.07071412E+912475674 Inexact Rounded +xcom365 compare 50707.1412E+912475670 -198098.186E+701407524 -> 1 +xdiv365 divide 50707.1412E+912475670 -198098.186E+701407524 -> -2.55969740E+211068145 Inexact Rounded +xdvi365 divideint 50707.1412E+912475670 -198098.186E+701407524 -> NaN Division_impossible +xmul365 multiply 50707.1412E+912475670 -198098.186E+701407524 -> -Infinity Inexact Overflow Rounded +xpow365 power 50707.1412E+912475670 -2 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem365 remainder 50707.1412E+912475670 -198098.186E+701407524 -> NaN Division_impossible +xsub365 subtract 50707.1412E+912475670 -198098.186E+701407524 -> 5.07071412E+912475674 Inexact Rounded +xadd366 add 55.8245006E+928885991 99170843.9E-47402167 -> 5.58245006E+928885992 Inexact Rounded +xcom366 compare 55.8245006E+928885991 99170843.9E-47402167 -> 1 +xdiv366 divide 55.8245006E+928885991 99170843.9E-47402167 -> 5.62912429E+976288151 Inexact Rounded +xdvi366 divideint 55.8245006E+928885991 99170843.9E-47402167 -> NaN Division_impossible +xmul366 multiply 55.8245006E+928885991 99170843.9E-47402167 -> 5.53616283E+881483833 Inexact Rounded +xpow366 power 55.8245006E+928885991 10 -> Infinity Overflow Inexact Rounded +xrem366 remainder 55.8245006E+928885991 99170843.9E-47402167 -> NaN Division_impossible +xsub366 subtract 55.8245006E+928885991 99170843.9E-47402167 -> 5.58245006E+928885992 Inexact Rounded +xadd367 add 13.8003883E-386224921 -84126481.9E-296378341 -> -8.41264819E-296378334 Inexact Rounded +xcom367 compare 13.8003883E-386224921 -84126481.9E-296378341 -> 1 +xdiv367 divide 13.8003883E-386224921 -84126481.9E-296378341 -> -1.64043331E-89846587 Inexact Rounded +xdvi367 divideint 13.8003883E-386224921 -84126481.9E-296378341 -> -0 +xmul367 multiply 13.8003883E-386224921 -84126481.9E-296378341 -> -1.16097812E-682603253 Inexact Rounded +xpow367 power 13.8003883E-386224921 -8 -> Infinity Overflow Inexact Rounded +xrem367 remainder 13.8003883E-386224921 -84126481.9E-296378341 -> 1.38003883E-386224920 +xsub367 subtract 13.8003883E-386224921 -84126481.9E-296378341 -> 8.41264819E-296378334 Inexact Rounded +xadd368 add 9820.90457 46671.5915 -> 56492.4961 Inexact Rounded +xcom368 compare 9820.90457 46671.5915 -> -1 +xdiv368 divide 9820.90457 46671.5915 -> 0.210425748 Inexact Rounded +xdvi368 divideint 9820.90457 46671.5915 -> 0 +xmul368 multiply 9820.90457 46671.5915 -> 458357246 Inexact Rounded +xpow368 power 9820.90457 46672 -> 4.94753070E+186321 Inexact Rounded +xrem368 remainder 9820.90457 46671.5915 -> 9820.90457 +xsub368 subtract 9820.90457 46671.5915 -> -36850.6869 Inexact Rounded +xadd369 add 7.22436006E+831949153 -11168830E+322331045 -> 7.22436006E+831949153 Inexact Rounded +xcom369 compare 7.22436006E+831949153 -11168830E+322331045 -> 1 +xdiv369 divide 7.22436006E+831949153 -11168830E+322331045 -> -6.46832306E+509618101 Inexact Rounded +xdvi369 divideint 7.22436006E+831949153 -11168830E+322331045 -> NaN Division_impossible +xmul369 multiply 7.22436006E+831949153 -11168830E+322331045 -> -Infinity Inexact Overflow Rounded +xpow369 power 7.22436006E+831949153 -1 -> 1.38420565E-831949154 Inexact Rounded +xrem369 remainder 7.22436006E+831949153 -11168830E+322331045 -> NaN Division_impossible +xsub369 subtract 7.22436006E+831949153 -11168830E+322331045 -> 7.22436006E+831949153 Inexact Rounded +xadd370 add 472648900 -207.784153 -> 472648692 Inexact Rounded +xcom370 compare 472648900 -207.784153 -> 1 +xdiv370 divide 472648900 -207.784153 -> -2274711.01 Inexact Rounded +xdvi370 divideint 472648900 -207.784153 -> -2274711 +xmul370 multiply 472648900 -207.784153 -> -9.82089514E+10 Inexact Rounded +xpow370 power 472648900 -208 -> 4.96547145E-1805 Inexact Rounded +xrem370 remainder 472648900 -207.784153 -> 1.545217 +xsub370 subtract 472648900 -207.784153 -> 472649108 Inexact Rounded +xadd371 add -8754.49306 -818.165153E+631475457 -> -8.18165153E+631475459 Inexact Rounded +xcom371 compare -8754.49306 -818.165153E+631475457 -> 1 +xdiv371 divide -8754.49306 -818.165153E+631475457 -> 1.07001539E-631475456 Inexact Rounded +xdvi371 divideint -8754.49306 -818.165153E+631475457 -> 0 +xmul371 multiply -8754.49306 -818.165153E+631475457 -> 7.16262115E+631475463 Inexact Rounded +xpow371 power -8754.49306 -8 -> 2.89835767E-32 Inexact Rounded +xrem371 remainder -8754.49306 -818.165153E+631475457 -> -8754.49306 +xsub371 subtract -8754.49306 -818.165153E+631475457 -> 8.18165153E+631475459 Inexact Rounded +xadd372 add 98750864 191380.551 -> 98942244.6 Inexact Rounded +xcom372 compare 98750864 191380.551 -> 1 +xdiv372 divide 98750864 191380.551 -> 515.992161 Inexact Rounded +xdvi372 divideint 98750864 191380.551 -> 515 +xmul372 multiply 98750864 191380.551 -> 1.88989948E+13 Inexact Rounded +xpow372 power 98750864 191381 -> 1.70908809E+1530003 Inexact Rounded +xrem372 remainder 98750864 191380.551 -> 189880.235 +xsub372 subtract 98750864 191380.551 -> 98559483.4 Inexact Rounded +xadd373 add 725292561. -768963606.E+340762986 -> -7.68963606E+340762994 Inexact Rounded +xcom373 compare 725292561. -768963606.E+340762986 -> 1 +xdiv373 divide 725292561. -768963606.E+340762986 -> -9.43207917E-340762987 Inexact Rounded +xdvi373 divideint 725292561. -768963606.E+340762986 -> -0 +xmul373 multiply 725292561. -768963606.E+340762986 -> -5.57723583E+340763003 Inexact Rounded +xpow373 power 725292561. -8 -> 1.30585277E-71 Inexact Rounded +xrem373 remainder 725292561. -768963606.E+340762986 -> 725292561 +xsub373 subtract 725292561. -768963606.E+340762986 -> 7.68963606E+340762994 Inexact Rounded +xadd374 add 1862.80445 648254483. -> 648256346 Inexact Rounded +xcom374 compare 1862.80445 648254483. -> -1 +xdiv374 divide 1862.80445 648254483. -> 0.00000287356972 Inexact Rounded +xdvi374 divideint 1862.80445 648254483. -> 0 +xmul374 multiply 1862.80445 648254483. -> 1.20757134E+12 Inexact Rounded +xpow374 power 1862.80445 648254483 -> Infinity Overflow Inexact Rounded +xrem374 remainder 1862.80445 648254483. -> 1862.80445 +xsub374 subtract 1862.80445 648254483. -> -648252620 Inexact Rounded +xadd375 add -5549320.1 -93580684.1 -> -99130004.2 +xcom375 compare -5549320.1 -93580684.1 -> 1 +xdiv375 divide -5549320.1 -93580684.1 -> 0.0592998454 Inexact Rounded +xdvi375 divideint -5549320.1 -93580684.1 -> 0 +xmul375 multiply -5549320.1 -93580684.1 -> 5.19309171E+14 Inexact Rounded +xpow375 power -5549320.1 -93580684 -> 4.20662079E-631130572 Inexact Rounded +xrem375 remainder -5549320.1 -93580684.1 -> -5549320.1 +xsub375 subtract -5549320.1 -93580684.1 -> 88031364.0 +xadd376 add -14677053.1 -25784.7358 -> -14702837.8 Inexact Rounded +xcom376 compare -14677053.1 -25784.7358 -> -1 +xdiv376 divide -14677053.1 -25784.7358 -> 569.214795 Inexact Rounded +xdvi376 divideint -14677053.1 -25784.7358 -> 569 +xmul376 multiply -14677053.1 -25784.7358 -> 3.78443937E+11 Inexact Rounded +xpow376 power -14677053.1 -25785 -> -1.64760831E-184792 Inexact Rounded +xrem376 remainder -14677053.1 -25784.7358 -> -5538.4298 +xsub376 subtract -14677053.1 -25784.7358 -> -14651268.4 Inexact Rounded +xadd377 add 547402.308E+571687617 -7835797.01E+500067364 -> 5.47402308E+571687622 Inexact Rounded +xcom377 compare 547402.308E+571687617 -7835797.01E+500067364 -> 1 +xdiv377 divide 547402.308E+571687617 -7835797.01E+500067364 -> -6.98591742E+71620251 Inexact Rounded +xdvi377 divideint 547402.308E+571687617 -7835797.01E+500067364 -> NaN Division_impossible +xmul377 multiply 547402.308E+571687617 -7835797.01E+500067364 -> -Infinity Inexact Overflow Rounded +xpow377 power 547402.308E+571687617 -8 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem377 remainder 547402.308E+571687617 -7835797.01E+500067364 -> NaN Division_impossible +xsub377 subtract 547402.308E+571687617 -7835797.01E+500067364 -> 5.47402308E+571687622 Inexact Rounded +xadd378 add -4131738.09 7579.07566 -> -4124159.01 Inexact Rounded +xcom378 compare -4131738.09 7579.07566 -> -1 +xdiv378 divide -4131738.09 7579.07566 -> -545.150659 Inexact Rounded +xdvi378 divideint -4131738.09 7579.07566 -> -545 +xmul378 multiply -4131738.09 7579.07566 -> -3.13147556E+10 Inexact Rounded +xpow378 power -4131738.09 7579 -> -4.68132794E+50143 Inexact Rounded +xrem378 remainder -4131738.09 7579.07566 -> -1141.85530 +xsub378 subtract -4131738.09 7579.07566 -> -4139317.17 Inexact Rounded +xadd379 add 504544.648 -7678.96133E-662143268 -> 504544.648 Inexact Rounded +xcom379 compare 504544.648 -7678.96133E-662143268 -> 1 +xdiv379 divide 504544.648 -7678.96133E-662143268 -> -6.57048039E+662143269 Inexact Rounded +xdvi379 divideint 504544.648 -7678.96133E-662143268 -> NaN Division_impossible +xmul379 multiply 504544.648 -7678.96133E-662143268 -> -3.87437884E-662143259 Inexact Rounded +xpow379 power 504544.648 -8 -> 2.38124001E-46 Inexact Rounded +xrem379 remainder 504544.648 -7678.96133E-662143268 -> NaN Division_impossible +xsub379 subtract 504544.648 -7678.96133E-662143268 -> 504544.648 Inexact Rounded +xadd380 add 829898241 8912.99114E+929228149 -> 8.91299114E+929228152 Inexact Rounded +xcom380 compare 829898241 8912.99114E+929228149 -> -1 +xdiv380 divide 829898241 8912.99114E+929228149 -> 9.31110811E-929228145 Inexact Rounded +xdvi380 divideint 829898241 8912.99114E+929228149 -> 0 +xmul380 multiply 829898241 8912.99114E+929228149 -> 7.39687567E+929228161 Inexact Rounded +xpow380 power 829898241 9 -> 1.86734084E+80 Inexact Rounded +xrem380 remainder 829898241 8912.99114E+929228149 -> 829898241 +xsub380 subtract 829898241 8912.99114E+929228149 -> -8.91299114E+929228152 Inexact Rounded +xadd381 add 53.6891691 -11.2371140 -> 42.4520551 +xcom381 compare 53.6891691 -11.2371140 -> 1 +xdiv381 divide 53.6891691 -11.2371140 -> -4.77784323 Inexact Rounded +xdvi381 divideint 53.6891691 -11.2371140 -> -4 +xmul381 multiply 53.6891691 -11.2371140 -> -603.311314 Inexact Rounded +xpow381 power 53.6891691 -11 -> 9.35936725E-20 Inexact Rounded +xrem381 remainder 53.6891691 -11.2371140 -> 8.7407131 +xsub381 subtract 53.6891691 -11.2371140 -> 64.9262831 +xadd382 add -93951823.4 -25317.8645 -> -93977141.3 Inexact Rounded +xcom382 compare -93951823.4 -25317.8645 -> -1 +xdiv382 divide -93951823.4 -25317.8645 -> 3710.89052 Inexact Rounded +xdvi382 divideint -93951823.4 -25317.8645 -> 3710 +xmul382 multiply -93951823.4 -25317.8645 -> 2.37865953E+12 Inexact Rounded +xpow382 power -93951823.4 -25318 -> 9.67857714E-201859 Inexact Rounded +xrem382 remainder -93951823.4 -25317.8645 -> -22546.1050 +xsub382 subtract -93951823.4 -25317.8645 -> -93926505.5 Inexact Rounded +xadd383 add 446919.123 951338490. -> 951785409 Inexact Rounded +xcom383 compare 446919.123 951338490. -> -1 +xdiv383 divide 446919.123 951338490. -> 0.000469779293 Inexact Rounded +xdvi383 divideint 446919.123 951338490. -> 0 +xmul383 multiply 446919.123 951338490. -> 4.25171364E+14 Inexact Rounded +xpow383 power 446919.123 951338490 -> Infinity Overflow Inexact Rounded +xrem383 remainder 446919.123 951338490. -> 446919.123 +xsub383 subtract 446919.123 951338490. -> -950891571 Inexact Rounded +xadd384 add -8.01787748 -88.3076852 -> -96.3255627 Inexact Rounded +xcom384 compare -8.01787748 -88.3076852 -> 1 +xdiv384 divide -8.01787748 -88.3076852 -> 0.0907947871 Inexact Rounded +xdvi384 divideint -8.01787748 -88.3076852 -> 0 +xmul384 multiply -8.01787748 -88.3076852 -> 708.040200 Inexact Rounded +xpow384 power -8.01787748 -88 -> 2.77186088E-80 Inexact Rounded +xrem384 remainder -8.01787748 -88.3076852 -> -8.01787748 +xsub384 subtract -8.01787748 -88.3076852 -> 80.2898077 Inexact Rounded +xadd385 add 517458139 -999731.548 -> 516458407 Inexact Rounded +xcom385 compare 517458139 -999731.548 -> 1 +xdiv385 divide 517458139 -999731.548 -> -517.597089 Inexact Rounded +xdvi385 divideint 517458139 -999731.548 -> -517 +xmul385 multiply 517458139 -999731.548 -> -5.17319226E+14 Inexact Rounded +xpow385 power 517458139 -999732 -> 1.24821346E-8711540 Inexact Rounded +xrem385 remainder 517458139 -999731.548 -> 596928.684 +xsub385 subtract 517458139 -999731.548 -> 518457871 Inexact Rounded +xadd386 add -405543440 -4013.18295 -> -405547453 Inexact Rounded +xcom386 compare -405543440 -4013.18295 -> -1 +xdiv386 divide -405543440 -4013.18295 -> 101052.816 Inexact Rounded +xdvi386 divideint -405543440 -4013.18295 -> 101052 +xmul386 multiply -405543440 -4013.18295 -> 1.62752002E+12 Inexact Rounded +xpow386 power -405543440 -4013 -> -8.83061932E-34545 Inexact Rounded +xrem386 remainder -405543440 -4013.18295 -> -3276.53660 +xsub386 subtract -405543440 -4013.18295 -> -405539427 Inexact Rounded +xadd387 add -49245250.1E+682760825 -848776.637 -> -4.92452501E+682760832 Inexact Rounded +xcom387 compare -49245250.1E+682760825 -848776.637 -> -1 +xdiv387 divide -49245250.1E+682760825 -848776.637 -> 5.80190924E+682760826 Inexact Rounded +xdvi387 divideint -49245250.1E+682760825 -848776.637 -> NaN Division_impossible +xmul387 multiply -49245250.1E+682760825 -848776.637 -> 4.17982178E+682760838 Inexact Rounded +xpow387 power -49245250.1E+682760825 -848777 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem387 remainder -49245250.1E+682760825 -848776.637 -> NaN Division_impossible +xsub387 subtract -49245250.1E+682760825 -848776.637 -> -4.92452501E+682760832 Inexact Rounded +xadd388 add -151144455 -170371.29 -> -151314826 Inexact Rounded +xcom388 compare -151144455 -170371.29 -> -1 +xdiv388 divide -151144455 -170371.29 -> 887.147447 Inexact Rounded +xdvi388 divideint -151144455 -170371.29 -> 887 +xmul388 multiply -151144455 -170371.29 -> 2.57506758E+13 Inexact Rounded +xpow388 power -151144455 -170371 -> -5.86496369E-1393532 Inexact Rounded +xrem388 remainder -151144455 -170371.29 -> -25120.77 +xsub388 subtract -151144455 -170371.29 -> -150974084 Inexact Rounded +xadd389 add -729236746.E+662737067 9.10823602 -> -7.29236746E+662737075 Inexact Rounded +xcom389 compare -729236746.E+662737067 9.10823602 -> -1 +xdiv389 divide -729236746.E+662737067 9.10823602 -> -8.00634442E+662737074 Inexact Rounded +xdvi389 divideint -729236746.E+662737067 9.10823602 -> NaN Division_impossible +xmul389 multiply -729236746.E+662737067 9.10823602 -> -6.64206040E+662737076 Inexact Rounded +xpow389 power -729236746.E+662737067 9 -> -Infinity Overflow Inexact Rounded +xrem389 remainder -729236746.E+662737067 9.10823602 -> NaN Division_impossible +xsub389 subtract -729236746.E+662737067 9.10823602 -> -7.29236746E+662737075 Inexact Rounded +xadd390 add 534.394729 -2369839.37 -> -2369304.98 Inexact Rounded +xcom390 compare 534.394729 -2369839.37 -> 1 +xdiv390 divide 534.394729 -2369839.37 -> -0.000225498291 Inexact Rounded +xdvi390 divideint 534.394729 -2369839.37 -> -0 +xmul390 multiply 534.394729 -2369839.37 -> -1.26642967E+9 Inexact Rounded +xpow390 power 534.394729 -2369839 -> 7.12522896E-6464595 Inexact Rounded +xrem390 remainder 534.394729 -2369839.37 -> 534.394729 +xsub390 subtract 534.394729 -2369839.37 -> 2370373.76 Inexact Rounded +xadd391 add 89100.1797 224.370309 -> 89324.5500 Inexact Rounded +xcom391 compare 89100.1797 224.370309 -> 1 +xdiv391 divide 89100.1797 224.370309 -> 397.112167 Inexact Rounded +xdvi391 divideint 89100.1797 224.370309 -> 397 +xmul391 multiply 89100.1797 224.370309 -> 19991434.9 Inexact Rounded +xpow391 power 89100.1797 224 -> 5.92654936E+1108 Inexact Rounded +xrem391 remainder 89100.1797 224.370309 -> 25.167027 +xsub391 subtract 89100.1797 224.370309 -> 88875.8094 Inexact Rounded +xadd392 add -821377.777 38.552821 -> -821339.224 Inexact Rounded +xcom392 compare -821377.777 38.552821 -> -1 +xdiv392 divide -821377.777 38.552821 -> -21305.2575 Inexact Rounded +xdvi392 divideint -821377.777 38.552821 -> -21305 +xmul392 multiply -821377.777 38.552821 -> -31666430.4 Inexact Rounded +xpow392 power -821377.777 39 -> -4.64702482E+230 Inexact Rounded +xrem392 remainder -821377.777 38.552821 -> -9.925595 +xsub392 subtract -821377.777 38.552821 -> -821416.330 Inexact Rounded +xadd393 add -392640.782 -2571619.5E+113237865 -> -2.57161950E+113237871 Inexact Rounded +xcom393 compare -392640.782 -2571619.5E+113237865 -> 1 +xdiv393 divide -392640.782 -2571619.5E+113237865 -> 1.52682301E-113237866 Inexact Rounded +xdvi393 divideint -392640.782 -2571619.5E+113237865 -> 0 +xmul393 multiply -392640.782 -2571619.5E+113237865 -> 1.00972269E+113237877 Inexact Rounded +xpow393 power -392640.782 -3 -> -1.65201422E-17 Inexact Rounded +xrem393 remainder -392640.782 -2571619.5E+113237865 -> -392640.782 +xsub393 subtract -392640.782 -2571619.5E+113237865 -> 2.57161950E+113237871 Inexact Rounded +xadd394 add -651397.712 -723.59673 -> -652121.309 Inexact Rounded +xcom394 compare -651397.712 -723.59673 -> -1 +xdiv394 divide -651397.712 -723.59673 -> 900.222023 Inexact Rounded +xdvi394 divideint -651397.712 -723.59673 -> 900 +xmul394 multiply -651397.712 -723.59673 -> 471349254 Inexact Rounded +xpow394 power -651397.712 -724 -> 5.96115415E-4210 Inexact Rounded +xrem394 remainder -651397.712 -723.59673 -> -160.65500 +xsub394 subtract -651397.712 -723.59673 -> -650674.115 Inexact Rounded +xadd395 add 86.6890892 940380864 -> 940380951 Inexact Rounded +xcom395 compare 86.6890892 940380864 -> -1 +xdiv395 divide 86.6890892 940380864 -> 9.21850843E-8 Inexact Rounded +xdvi395 divideint 86.6890892 940380864 -> 0 +xmul395 multiply 86.6890892 940380864 -> 8.15207606E+10 Inexact Rounded +xpow395 power 86.6890892 940380864 -> Infinity Overflow Inexact Rounded +xrem395 remainder 86.6890892 940380864 -> 86.6890892 +xsub395 subtract 86.6890892 940380864 -> -940380777 Inexact Rounded +xadd396 add 4880.06442E-382222621 -115627239E-912834031 -> 4.88006442E-382222618 Inexact Rounded +xcom396 compare 4880.06442E-382222621 -115627239E-912834031 -> 1 +xdiv396 divide 4880.06442E-382222621 -115627239E-912834031 -> -4.22051453E+530611405 Inexact Rounded +xdvi396 divideint 4880.06442E-382222621 -115627239E-912834031 -> NaN Division_impossible +xmul396 multiply 4880.06442E-382222621 -115627239E-912834031 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow396 power 4880.06442E-382222621 -1 -> 2.04915328E+382222617 Inexact Rounded +xrem396 remainder 4880.06442E-382222621 -115627239E-912834031 -> NaN Division_impossible +xsub396 subtract 4880.06442E-382222621 -115627239E-912834031 -> 4.88006442E-382222618 Inexact Rounded +xadd397 add 173398265E-532383158 3462.51450E+80986915 -> 3.46251450E+80986918 Inexact Rounded +xcom397 compare 173398265E-532383158 3462.51450E+80986915 -> -1 +xdiv397 divide 173398265E-532383158 3462.51450E+80986915 -> 5.00787116E-613370069 Inexact Rounded +xdvi397 divideint 173398265E-532383158 3462.51450E+80986915 -> 0 +xmul397 multiply 173398265E-532383158 3462.51450E+80986915 -> 6.00394007E-451396232 Inexact Rounded +xpow397 power 173398265E-532383158 3 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem397 remainder 173398265E-532383158 3462.51450E+80986915 -> 1.73398265E-532383150 +xsub397 subtract 173398265E-532383158 3462.51450E+80986915 -> -3.46251450E+80986918 Inexact Rounded +xadd398 add -1522176.78 -6631061.77 -> -8153238.55 +xcom398 compare -1522176.78 -6631061.77 -> 1 +xdiv398 divide -1522176.78 -6631061.77 -> 0.229552496 Inexact Rounded +xdvi398 divideint -1522176.78 -6631061.77 -> 0 +xmul398 multiply -1522176.78 -6631061.77 -> 1.00936483E+13 Inexact Rounded +xpow398 power -1522176.78 -6631062 -> 4.54268854E-40996310 Inexact Rounded +xrem398 remainder -1522176.78 -6631061.77 -> -1522176.78 +xsub398 subtract -1522176.78 -6631061.77 -> 5108884.99 +xadd399 add 538.10453 522934310 -> 522934848 Inexact Rounded +xcom399 compare 538.10453 522934310 -> -1 +xdiv399 divide 538.10453 522934310 -> 0.00000102900980 Inexact Rounded +xdvi399 divideint 538.10453 522934310 -> 0 +xmul399 multiply 538.10453 522934310 -> 2.81393321E+11 Inexact Rounded +xpow399 power 538.10453 522934310 -> Infinity Overflow Inexact Rounded +xrem399 remainder 538.10453 522934310 -> 538.10453 +xsub399 subtract 538.10453 522934310 -> -522933772 Inexact Rounded +xadd400 add 880243.444E-750940977 -354.601578E-204943740 -> -3.54601578E-204943738 Inexact Rounded +xcom400 compare 880243.444E-750940977 -354.601578E-204943740 -> 1 +xdiv400 divide 880243.444E-750940977 -354.601578E-204943740 -> -2.48234497E-545997234 Inexact Rounded +xdvi400 divideint 880243.444E-750940977 -354.601578E-204943740 -> -0 +xmul400 multiply 880243.444E-750940977 -354.601578E-204943740 -> -3.12135714E-955884709 Inexact Rounded +xpow400 power 880243.444E-750940977 -4 -> Infinity Overflow Inexact Rounded +xrem400 remainder 880243.444E-750940977 -354.601578E-204943740 -> 8.80243444E-750940972 +xsub400 subtract 880243.444E-750940977 -354.601578E-204943740 -> 3.54601578E-204943738 Inexact Rounded +xadd401 add 968370.780 6677268.73 -> 7645639.51 Rounded +xcom401 compare 968370.780 6677268.73 -> -1 +xdiv401 divide 968370.780 6677268.73 -> 0.145024982 Inexact Rounded +xdvi401 divideint 968370.780 6677268.73 -> 0 +xmul401 multiply 968370.780 6677268.73 -> 6.46607193E+12 Inexact Rounded +xpow401 power 968370.780 6677269 -> 3.29990931E+39970410 Inexact Rounded +xrem401 remainder 968370.780 6677268.73 -> 968370.780 +xsub401 subtract 968370.780 6677268.73 -> -5708897.95 Rounded +xadd402 add -97.7474945 31248241.5 -> 31248143.8 Inexact Rounded +xcom402 compare -97.7474945 31248241.5 -> -1 +xdiv402 divide -97.7474945 31248241.5 -> -0.00000312809585 Inexact Rounded +xdvi402 divideint -97.7474945 31248241.5 -> -0 +xmul402 multiply -97.7474945 31248241.5 -> -3.05443731E+9 Inexact Rounded +xpow402 power -97.7474945 31248242 -> 2.90714257E+62187302 Inexact Rounded +xrem402 remainder -97.7474945 31248241.5 -> -97.7474945 +xsub402 subtract -97.7474945 31248241.5 -> -31248339.2 Inexact Rounded +xadd403 add -187582786.E+369916952 957840435E+744365567 -> 9.57840435E+744365575 Inexact Rounded +xcom403 compare -187582786.E+369916952 957840435E+744365567 -> -1 +xdiv403 divide -187582786.E+369916952 957840435E+744365567 -> -1.95839285E-374448616 Inexact Rounded +xdvi403 divideint -187582786.E+369916952 957840435E+744365567 -> -0 +xmul403 multiply -187582786.E+369916952 957840435E+744365567 -> -Infinity Inexact Overflow Rounded +xpow403 power -187582786.E+369916952 10 -> Infinity Overflow Inexact Rounded +xrem403 remainder -187582786.E+369916952 957840435E+744365567 -> -1.87582786E+369916960 +xsub403 subtract -187582786.E+369916952 957840435E+744365567 -> -9.57840435E+744365575 Inexact Rounded +xadd404 add -328026144. -125499735. -> -453525879 +xcom404 compare -328026144. -125499735. -> -1 +xdiv404 divide -328026144. -125499735. -> 2.61375965 Inexact Rounded +xdvi404 divideint -328026144. -125499735. -> 2 +xmul404 multiply -328026144. -125499735. -> 4.11671941E+16 Inexact Rounded +xpow404 power -328026144. -125499735 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem404 remainder -328026144. -125499735. -> -77026674 +xsub404 subtract -328026144. -125499735. -> -202526409 +xadd405 add -99424150.2E-523662102 3712.35030 -> 3712.35030 Inexact Rounded +xcom405 compare -99424150.2E-523662102 3712.35030 -> -1 +xdiv405 divide -99424150.2E-523662102 3712.35030 -> -2.67819958E-523662098 Inexact Rounded +xdvi405 divideint -99424150.2E-523662102 3712.35030 -> -0 +xmul405 multiply -99424150.2E-523662102 3712.35030 -> -3.69097274E-523662091 Inexact Rounded +xpow405 power -99424150.2E-523662102 3712 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem405 remainder -99424150.2E-523662102 3712.35030 -> -9.94241502E-523662095 +xsub405 subtract -99424150.2E-523662102 3712.35030 -> -3712.35030 Inexact Rounded +xadd406 add 14838.0718 9489893.28E+830631266 -> 9.48989328E+830631272 Inexact Rounded +xcom406 compare 14838.0718 9489893.28E+830631266 -> -1 +xdiv406 divide 14838.0718 9489893.28E+830631266 -> 1.56356572E-830631269 Inexact Rounded +xdvi406 divideint 14838.0718 9489893.28E+830631266 -> 0 +xmul406 multiply 14838.0718 9489893.28E+830631266 -> 1.40811718E+830631277 Inexact Rounded +xpow406 power 14838.0718 9 -> 3.48656057E+37 Inexact Rounded +xrem406 remainder 14838.0718 9489893.28E+830631266 -> 14838.0718 +xsub406 subtract 14838.0718 9489893.28E+830631266 -> -9.48989328E+830631272 Inexact Rounded +xadd407 add 71207472.8 -31835.0809 -> 71175637.7 Inexact Rounded +xcom407 compare 71207472.8 -31835.0809 -> 1 +xdiv407 divide 71207472.8 -31835.0809 -> -2236.76117 Inexact Rounded +xdvi407 divideint 71207472.8 -31835.0809 -> -2236 +xmul407 multiply 71207472.8 -31835.0809 -> -2.26689566E+12 Inexact Rounded +xpow407 power 71207472.8 -31835 -> 7.05333953E-249986 Inexact Rounded +xrem407 remainder 71207472.8 -31835.0809 -> 24231.9076 +xsub407 subtract 71207472.8 -31835.0809 -> 71239307.9 Inexact Rounded +xadd408 add -20440.4394 -44.4064328E+511085806 -> -4.44064328E+511085807 Inexact Rounded +xcom408 compare -20440.4394 -44.4064328E+511085806 -> 1 +xdiv408 divide -20440.4394 -44.4064328E+511085806 -> 4.60303567E-511085804 Inexact Rounded +xdvi408 divideint -20440.4394 -44.4064328E+511085806 -> 0 +xmul408 multiply -20440.4394 -44.4064328E+511085806 -> 9.07686999E+511085811 Inexact Rounded +xpow408 power -20440.4394 -4 -> 5.72847590E-18 Inexact Rounded +xrem408 remainder -20440.4394 -44.4064328E+511085806 -> -20440.4394 +xsub408 subtract -20440.4394 -44.4064328E+511085806 -> 4.44064328E+511085807 Inexact Rounded +xadd409 add -54.3684171E-807210192 1.04592973E-984041807 -> -5.43684171E-807210191 Inexact Rounded +xcom409 compare -54.3684171E-807210192 1.04592973E-984041807 -> -1 +xdiv409 divide -54.3684171E-807210192 1.04592973E-984041807 -> -5.19809463E+176831616 Inexact Rounded +xdvi409 divideint -54.3684171E-807210192 1.04592973E-984041807 -> NaN Division_impossible +xmul409 multiply -54.3684171E-807210192 1.04592973E-984041807 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow409 power -54.3684171E-807210192 1 -> -5.43684171E-807210191 +xrem409 remainder -54.3684171E-807210192 1.04592973E-984041807 -> NaN Division_impossible +xsub409 subtract -54.3684171E-807210192 1.04592973E-984041807 -> -5.43684171E-807210191 Inexact Rounded +xadd410 add 54310060.5E+948159739 274320701.E+205880484 -> 5.43100605E+948159746 Inexact Rounded +xcom410 compare 54310060.5E+948159739 274320701.E+205880484 -> 1 +xdiv410 divide 54310060.5E+948159739 274320701.E+205880484 -> 1.97980175E+742279254 Inexact Rounded +xdvi410 divideint 54310060.5E+948159739 274320701.E+205880484 -> NaN Division_impossible +xmul410 multiply 54310060.5E+948159739 274320701.E+205880484 -> Infinity Inexact Overflow Rounded +xpow410 power 54310060.5E+948159739 3 -> Infinity Overflow Inexact Rounded +xrem410 remainder 54310060.5E+948159739 274320701.E+205880484 -> NaN Division_impossible +xsub410 subtract 54310060.5E+948159739 274320701.E+205880484 -> 5.43100605E+948159746 Inexact Rounded +xadd411 add -657.186702 426844.39 -> 426187.203 Inexact Rounded +xcom411 compare -657.186702 426844.39 -> -1 +xdiv411 divide -657.186702 426844.39 -> -0.00153964001 Inexact Rounded +xdvi411 divideint -657.186702 426844.39 -> -0 +xmul411 multiply -657.186702 426844.39 -> -280516457 Inexact Rounded +xpow411 power -657.186702 426844 -> 3.50000575E+1202713 Inexact Rounded +xrem411 remainder -657.186702 426844.39 -> -657.186702 +xsub411 subtract -657.186702 426844.39 -> -427501.577 Inexact Rounded +xadd412 add -41593077.0 -688607.564 -> -42281684.6 Inexact Rounded +xcom412 compare -41593077.0 -688607.564 -> -1 +xdiv412 divide -41593077.0 -688607.564 -> 60.4017138 Inexact Rounded +xdvi412 divideint -41593077.0 -688607.564 -> 60 +xmul412 multiply -41593077.0 -688607.564 -> 2.86413074E+13 Inexact Rounded +xpow412 power -41593077.0 -688608 -> 1.42150750E-5246519 Inexact Rounded +xrem412 remainder -41593077.0 -688607.564 -> -276623.160 +xsub412 subtract -41593077.0 -688607.564 -> -40904469.4 Inexact Rounded +xadd413 add -5786.38132 190556652.E+177045877 -> 1.90556652E+177045885 Inexact Rounded +xcom413 compare -5786.38132 190556652.E+177045877 -> -1 +xdiv413 divide -5786.38132 190556652.E+177045877 -> -3.03656748E-177045882 Inexact Rounded +xdvi413 divideint -5786.38132 190556652.E+177045877 -> -0 +xmul413 multiply -5786.38132 190556652.E+177045877 -> -1.10263345E+177045889 Inexact Rounded +xpow413 power -5786.38132 2 -> 33482208.8 Inexact Rounded +xrem413 remainder -5786.38132 190556652.E+177045877 -> -5786.38132 +xsub413 subtract -5786.38132 190556652.E+177045877 -> -1.90556652E+177045885 Inexact Rounded +xadd414 add 737622.974 -241560693E+249506565 -> -2.41560693E+249506573 Inexact Rounded +xcom414 compare 737622.974 -241560693E+249506565 -> 1 +xdiv414 divide 737622.974 -241560693E+249506565 -> -3.05357202E-249506568 Inexact Rounded +xdvi414 divideint 737622.974 -241560693E+249506565 -> -0 +xmul414 multiply 737622.974 -241560693E+249506565 -> -1.78180717E+249506579 Inexact Rounded +xpow414 power 737622.974 -2 -> 1.83793916E-12 Inexact Rounded +xrem414 remainder 737622.974 -241560693E+249506565 -> 737622.974 +xsub414 subtract 737622.974 -241560693E+249506565 -> 2.41560693E+249506573 Inexact Rounded +xadd415 add 5615373.52 -7.27583808E-949781048 -> 5615373.52 Inexact Rounded +xcom415 compare 5615373.52 -7.27583808E-949781048 -> 1 +xdiv415 divide 5615373.52 -7.27583808E-949781048 -> -7.71783739E+949781053 Inexact Rounded +xdvi415 divideint 5615373.52 -7.27583808E-949781048 -> NaN Division_impossible +xmul415 multiply 5615373.52 -7.27583808E-949781048 -> -4.08565485E-949781041 Inexact Rounded +xpow415 power 5615373.52 -7 -> 5.68001460E-48 Inexact Rounded +xrem415 remainder 5615373.52 -7.27583808E-949781048 -> NaN Division_impossible +xsub415 subtract 5615373.52 -7.27583808E-949781048 -> 5615373.52 Inexact Rounded +xadd416 add 644136.179 -835708.103 -> -191571.924 +xcom416 compare 644136.179 -835708.103 -> 1 +xdiv416 divide 644136.179 -835708.103 -> -0.770766942 Inexact Rounded +xdvi416 divideint 644136.179 -835708.103 -> -0 +xmul416 multiply 644136.179 -835708.103 -> -5.38309824E+11 Inexact Rounded +xpow416 power 644136.179 -835708 -> 7.41936858E-4854610 Inexact Rounded +xrem416 remainder 644136.179 -835708.103 -> 644136.179 +xsub416 subtract 644136.179 -835708.103 -> 1479844.28 Inexact Rounded +xadd417 add -307.419521E+466861843 -738689976.E-199032711 -> -3.07419521E+466861845 Inexact Rounded +xcom417 compare -307.419521E+466861843 -738689976.E-199032711 -> -1 +xdiv417 divide -307.419521E+466861843 -738689976.E-199032711 -> 4.16168529E+665894547 Inexact Rounded +xdvi417 divideint -307.419521E+466861843 -738689976.E-199032711 -> NaN Division_impossible +xmul417 multiply -307.419521E+466861843 -738689976.E-199032711 -> 2.27087719E+267829143 Inexact Rounded +xpow417 power -307.419521E+466861843 -7 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem417 remainder -307.419521E+466861843 -738689976.E-199032711 -> NaN Division_impossible +xsub417 subtract -307.419521E+466861843 -738689976.E-199032711 -> -3.07419521E+466861845 Inexact Rounded +xadd418 add -619642.130 -226740537.E-902590153 -> -619642.130 Inexact Rounded +xcom418 compare -619642.130 -226740537.E-902590153 -> -1 +xdiv418 divide -619642.130 -226740537.E-902590153 -> 2.73282466E+902590150 Inexact Rounded +xdvi418 divideint -619642.130 -226740537.E-902590153 -> NaN Division_impossible +xmul418 multiply -619642.130 -226740537.E-902590153 -> 1.40497989E-902590139 Inexact Rounded +xpow418 power -619642.130 -2 -> 2.60446259E-12 Inexact Rounded +xrem418 remainder -619642.130 -226740537.E-902590153 -> NaN Division_impossible +xsub418 subtract -619642.130 -226740537.E-902590153 -> -619642.130 Inexact Rounded +xadd419 add -31068.7549 -3.41495042E+86001379 -> -3.41495042E+86001379 Inexact Rounded +xcom419 compare -31068.7549 -3.41495042E+86001379 -> 1 +xdiv419 divide -31068.7549 -3.41495042E+86001379 -> 9.09786412E-86001376 Inexact Rounded +xdvi419 divideint -31068.7549 -3.41495042E+86001379 -> 0 +xmul419 multiply -31068.7549 -3.41495042E+86001379 -> 1.06098258E+86001384 Inexact Rounded +xpow419 power -31068.7549 -3 -> -3.33448258E-14 Inexact Rounded +xrem419 remainder -31068.7549 -3.41495042E+86001379 -> -31068.7549 +xsub419 subtract -31068.7549 -3.41495042E+86001379 -> 3.41495042E+86001379 Inexact Rounded +xadd420 add -68951173. -211804977.E-97318126 -> -68951173.0 Inexact Rounded +xcom420 compare -68951173. -211804977.E-97318126 -> -1 +xdiv420 divide -68951173. -211804977.E-97318126 -> 3.25540854E+97318125 Inexact Rounded +xdvi420 divideint -68951173. -211804977.E-97318126 -> NaN Division_impossible +xmul420 multiply -68951173. -211804977.E-97318126 -> 1.46042016E-97318110 Inexact Rounded +xpow420 power -68951173. -2 -> 2.10337488E-16 Inexact Rounded +xrem420 remainder -68951173. -211804977.E-97318126 -> NaN Division_impossible +xsub420 subtract -68951173. -211804977.E-97318126 -> -68951173.0 Inexact Rounded +xadd421 add -4.09492571E-301749490 434.20199E-749390952 -> -4.09492571E-301749490 Inexact Rounded +xcom421 compare -4.09492571E-301749490 434.20199E-749390952 -> -1 +xdiv421 divide -4.09492571E-301749490 434.20199E-749390952 -> -9.43092341E+447641459 Inexact Rounded +xdvi421 divideint -4.09492571E-301749490 434.20199E-749390952 -> NaN Division_impossible +xmul421 multiply -4.09492571E-301749490 434.20199E-749390952 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow421 power -4.09492571E-301749490 4 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem421 remainder -4.09492571E-301749490 434.20199E-749390952 -> NaN Division_impossible +xsub421 subtract -4.09492571E-301749490 434.20199E-749390952 -> -4.09492571E-301749490 Inexact Rounded +xadd422 add 3898.03188 -82572.615 -> -78674.5831 Inexact Rounded +xcom422 compare 3898.03188 -82572.615 -> 1 +xdiv422 divide 3898.03188 -82572.615 -> -0.0472073202 Inexact Rounded +xdvi422 divideint 3898.03188 -82572.615 -> -0 +xmul422 multiply 3898.03188 -82572.615 -> -321870686 Inexact Rounded +xpow422 power 3898.03188 -82573 -> 1.33010737E-296507 Inexact Rounded +xrem422 remainder 3898.03188 -82572.615 -> 3898.03188 +xsub422 subtract 3898.03188 -82572.615 -> 86470.6469 Inexact Rounded +xadd423 add -1.7619356 -2546.64043 -> -2548.40237 Inexact Rounded +xcom423 compare -1.7619356 -2546.64043 -> 1 +xdiv423 divide -1.7619356 -2546.64043 -> 0.000691866657 Inexact Rounded +xdvi423 divideint -1.7619356 -2546.64043 -> 0 +xmul423 multiply -1.7619356 -2546.64043 -> 4487.01643 Inexact Rounded +xpow423 power -1.7619356 -2547 -> -2.90664557E-627 Inexact Rounded +xrem423 remainder -1.7619356 -2546.64043 -> -1.7619356 +xsub423 subtract -1.7619356 -2546.64043 -> 2544.87849 Inexact Rounded +xadd424 add 59714.1968 29734388.6E-564525525 -> 59714.1968 Inexact Rounded +xcom424 compare 59714.1968 29734388.6E-564525525 -> 1 +xdiv424 divide 59714.1968 29734388.6E-564525525 -> 2.00825373E+564525522 Inexact Rounded +xdvi424 divideint 59714.1968 29734388.6E-564525525 -> NaN Division_impossible +xmul424 multiply 59714.1968 29734388.6E-564525525 -> 1.77556513E-564525513 Inexact Rounded +xpow424 power 59714.1968 3 -> 2.12928005E+14 Inexact Rounded +xrem424 remainder 59714.1968 29734388.6E-564525525 -> NaN Division_impossible +xsub424 subtract 59714.1968 29734388.6E-564525525 -> 59714.1968 Inexact Rounded +xadd425 add 6.88891136E-935467395 -785049.562E-741671442 -> -7.85049562E-741671437 Inexact Rounded +xcom425 compare 6.88891136E-935467395 -785049.562E-741671442 -> 1 +xdiv425 divide 6.88891136E-935467395 -785049.562E-741671442 -> -8.77512923E-193795959 Inexact Rounded +xdvi425 divideint 6.88891136E-935467395 -785049.562E-741671442 -> -0 +xmul425 multiply 6.88891136E-935467395 -785049.562E-741671442 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow425 power 6.88891136E-935467395 -8 -> Infinity Overflow Inexact Rounded +xrem425 remainder 6.88891136E-935467395 -785049.562E-741671442 -> 6.88891136E-935467395 +xsub425 subtract 6.88891136E-935467395 -785049.562E-741671442 -> 7.85049562E-741671437 Inexact Rounded +xadd426 add 975566251 -519.858530 -> 975565731 Inexact Rounded +xcom426 compare 975566251 -519.858530 -> 1 +xdiv426 divide 975566251 -519.858530 -> -1876599.49 Inexact Rounded +xdvi426 divideint 975566251 -519.858530 -> -1876599 +xmul426 multiply 975566251 -519.858530 -> -5.07156437E+11 Inexact Rounded +xpow426 power 975566251 -520 -> 3.85905300E-4675 Inexact Rounded +xrem426 remainder 975566251 -519.858530 -> 253.460530 +xsub426 subtract 975566251 -519.858530 -> 975566771 Inexact Rounded +xadd427 add 307401954 -231481582. -> 75920372 +xcom427 compare 307401954 -231481582. -> 1 +xdiv427 divide 307401954 -231481582. -> -1.32797586 Inexact Rounded +xdvi427 divideint 307401954 -231481582. -> -1 +xmul427 multiply 307401954 -231481582. -> -7.11578906E+16 Inexact Rounded +xpow427 power 307401954 -231481582 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem427 remainder 307401954 -231481582. -> 75920372 +xsub427 subtract 307401954 -231481582. -> 538883536 +xadd428 add 2237645.48E+992947388 -60618055.3E-857316706 -> 2.23764548E+992947394 Inexact Rounded +xcom428 compare 2237645.48E+992947388 -60618055.3E-857316706 -> 1 +xdiv428 divide 2237645.48E+992947388 -60618055.3E-857316706 -> -Infinity Inexact Overflow Rounded +xdvi428 divideint 2237645.48E+992947388 -60618055.3E-857316706 -> NaN Division_impossible +xmul428 multiply 2237645.48E+992947388 -60618055.3E-857316706 -> -1.35641717E+135630696 Inexact Rounded +xpow428 power 2237645.48E+992947388 -6 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem428 remainder 2237645.48E+992947388 -60618055.3E-857316706 -> NaN Division_impossible +xsub428 subtract 2237645.48E+992947388 -60618055.3E-857316706 -> 2.23764548E+992947394 Inexact Rounded +xadd429 add -403903.851 35.5049687E-72095155 -> -403903.851 Inexact Rounded +xcom429 compare -403903.851 35.5049687E-72095155 -> -1 +xdiv429 divide -403903.851 35.5049687E-72095155 -> -1.13759810E+72095159 Inexact Rounded +xdvi429 divideint -403903.851 35.5049687E-72095155 -> NaN Division_impossible +xmul429 multiply -403903.851 35.5049687E-72095155 -> -1.43405936E-72095148 Inexact Rounded +xpow429 power -403903.851 4 -> 2.66141117E+22 Inexact Rounded +xrem429 remainder -403903.851 35.5049687E-72095155 -> NaN Division_impossible +xsub429 subtract -403903.851 35.5049687E-72095155 -> -403903.851 Inexact Rounded +xadd430 add 6.48674979 -621732.532E+422575800 -> -6.21732532E+422575805 Inexact Rounded +xcom430 compare 6.48674979 -621732.532E+422575800 -> 1 +xdiv430 divide 6.48674979 -621732.532E+422575800 -> -1.04333447E-422575805 Inexact Rounded +xdvi430 divideint 6.48674979 -621732.532E+422575800 -> -0 +xmul430 multiply 6.48674979 -621732.532E+422575800 -> -4.03302337E+422575806 Inexact Rounded +xpow430 power 6.48674979 -6 -> 0.0000134226146 Inexact Rounded +xrem430 remainder 6.48674979 -621732.532E+422575800 -> 6.48674979 +xsub430 subtract 6.48674979 -621732.532E+422575800 -> 6.21732532E+422575805 Inexact Rounded +xadd431 add -31401.9418 36.3960679 -> -31365.5457 Inexact Rounded +xcom431 compare -31401.9418 36.3960679 -> -1 +xdiv431 divide -31401.9418 36.3960679 -> -862.783911 Inexact Rounded +xdvi431 divideint -31401.9418 36.3960679 -> -862 +xmul431 multiply -31401.9418 36.3960679 -> -1142907.21 Inexact Rounded +xpow431 power -31401.9418 36 -> 7.77023505E+161 Inexact Rounded +xrem431 remainder -31401.9418 36.3960679 -> -28.5312702 +xsub431 subtract -31401.9418 36.3960679 -> -31438.3379 Inexact Rounded +xadd432 add 31345321.1 51.5482191 -> 31345372.6 Inexact Rounded +xcom432 compare 31345321.1 51.5482191 -> 1 +xdiv432 divide 31345321.1 51.5482191 -> 608077.673 Inexact Rounded +xdvi432 divideint 31345321.1 51.5482191 -> 608077 +xmul432 multiply 31345321.1 51.5482191 -> 1.61579548E+9 Inexact Rounded +xpow432 power 31345321.1 52 -> 6.32385059E+389 Inexact Rounded +xrem432 remainder 31345321.1 51.5482191 -> 34.6743293 +xsub432 subtract 31345321.1 51.5482191 -> 31345269.6 Inexact Rounded +xadd433 add -64.172844 -28506227.2E-767965800 -> -64.1728440 Inexact Rounded +xcom433 compare -64.172844 -28506227.2E-767965800 -> -1 +xdiv433 divide -64.172844 -28506227.2E-767965800 -> 2.25118686E+767965794 Inexact Rounded +xdvi433 divideint -64.172844 -28506227.2E-767965800 -> NaN Division_impossible +xmul433 multiply -64.172844 -28506227.2E-767965800 -> 1.82932567E-767965791 Inexact Rounded +xpow433 power -64.172844 -3 -> -0.00000378395654 Inexact Rounded +xrem433 remainder -64.172844 -28506227.2E-767965800 -> NaN Division_impossible +xsub433 subtract -64.172844 -28506227.2E-767965800 -> -64.1728440 Inexact Rounded +xadd434 add 70437.1551 -62916.1233 -> 7521.0318 +xcom434 compare 70437.1551 -62916.1233 -> 1 +xdiv434 divide 70437.1551 -62916.1233 -> -1.11954061 Inexact Rounded +xdvi434 divideint 70437.1551 -62916.1233 -> -1 +xmul434 multiply 70437.1551 -62916.1233 -> -4.43163274E+9 Inexact Rounded +xpow434 power 70437.1551 -62916 -> 5.02945060E-305005 Inexact Rounded +xrem434 remainder 70437.1551 -62916.1233 -> 7521.0318 +xsub434 subtract 70437.1551 -62916.1233 -> 133353.278 Inexact Rounded +xadd435 add 916260164 -58.4017325 -> 916260106 Inexact Rounded +xcom435 compare 916260164 -58.4017325 -> 1 +xdiv435 divide 916260164 -58.4017325 -> -15688920.9 Inexact Rounded +xdvi435 divideint 916260164 -58.4017325 -> -15688920 +xmul435 multiply 916260164 -58.4017325 -> -5.35111810E+10 Inexact Rounded +xpow435 power 916260164 -58 -> 1.59554587E-520 Inexact Rounded +xrem435 remainder 916260164 -58.4017325 -> 54.9461000 +xsub435 subtract 916260164 -58.4017325 -> 916260222 Inexact Rounded +xadd436 add 19889085.3E-46816480 1581683.94 -> 1581683.94 Inexact Rounded +xcom436 compare 19889085.3E-46816480 1581683.94 -> -1 +xdiv436 divide 19889085.3E-46816480 1581683.94 -> 1.25746268E-46816479 Inexact Rounded +xdvi436 divideint 19889085.3E-46816480 1581683.94 -> 0 +xmul436 multiply 19889085.3E-46816480 1581683.94 -> 3.14582468E-46816467 Inexact Rounded +xpow436 power 19889085.3E-46816480 1581684 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem436 remainder 19889085.3E-46816480 1581683.94 -> 1.98890853E-46816473 +xsub436 subtract 19889085.3E-46816480 1581683.94 -> -1581683.94 Inexact Rounded +xadd437 add -56312.3383 789.466064 -> -55522.8722 Inexact Rounded +xcom437 compare -56312.3383 789.466064 -> -1 +xdiv437 divide -56312.3383 789.466064 -> -71.3296503 Inexact Rounded +xdvi437 divideint -56312.3383 789.466064 -> -71 +xmul437 multiply -56312.3383 789.466064 -> -44456680.1 Inexact Rounded +xpow437 power -56312.3383 789 -> -1.68348724E+3748 Inexact Rounded +xrem437 remainder -56312.3383 789.466064 -> -260.247756 +xsub437 subtract -56312.3383 789.466064 -> -57101.8044 Inexact Rounded +xadd438 add 183442.849 -925876106 -> -925692663 Inexact Rounded +xcom438 compare 183442.849 -925876106 -> 1 +xdiv438 divide 183442.849 -925876106 -> -0.000198128937 Inexact Rounded +xdvi438 divideint 183442.849 -925876106 -> -0 +xmul438 multiply 183442.849 -925876106 -> -1.69845351E+14 Inexact Rounded +xpow438 power 183442.849 -925876106 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem438 remainder 183442.849 -925876106 -> 183442.849 +xsub438 subtract 183442.849 -925876106 -> 926059549 Inexact Rounded +xadd439 add 971113.655E-695540249 -419351120E-977743823 -> 9.71113655E-695540244 Inexact Rounded +xcom439 compare 971113.655E-695540249 -419351120E-977743823 -> 1 +xdiv439 divide 971113.655E-695540249 -419351120E-977743823 -> -2.31575310E+282203571 Inexact Rounded +xdvi439 divideint 971113.655E-695540249 -419351120E-977743823 -> NaN Division_impossible +xmul439 multiply 971113.655E-695540249 -419351120E-977743823 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xpow439 power 971113.655E-695540249 -4 -> Infinity Overflow Inexact Rounded +xrem439 remainder 971113.655E-695540249 -419351120E-977743823 -> NaN Division_impossible +xsub439 subtract 971113.655E-695540249 -419351120E-977743823 -> 9.71113655E-695540244 Inexact Rounded +xadd440 add 859658551. 72338.2054 -> 859730889 Inexact Rounded +xcom440 compare 859658551. 72338.2054 -> 1 +xdiv440 divide 859658551. 72338.2054 -> 11883.8800 Inexact Rounded +xdvi440 divideint 859658551. 72338.2054 -> 11883 +xmul440 multiply 859658551. 72338.2054 -> 6.21861568E+13 Inexact Rounded +xpow440 power 859658551. 72338 -> 1.87620450E+646291 Inexact Rounded +xrem440 remainder 859658551. 72338.2054 -> 63656.2318 +xsub440 subtract 859658551. 72338.2054 -> 859586213 Inexact Rounded +xadd441 add -3.86446630E+426816068 -664.534737 -> -3.86446630E+426816068 Inexact Rounded +xcom441 compare -3.86446630E+426816068 -664.534737 -> -1 +xdiv441 divide -3.86446630E+426816068 -664.534737 -> 5.81529615E+426816065 Inexact Rounded +xdvi441 divideint -3.86446630E+426816068 -664.534737 -> NaN Division_impossible +xmul441 multiply -3.86446630E+426816068 -664.534737 -> 2.56807210E+426816071 Inexact Rounded +xpow441 power -3.86446630E+426816068 -665 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem441 remainder -3.86446630E+426816068 -664.534737 -> NaN Division_impossible +xsub441 subtract -3.86446630E+426816068 -664.534737 -> -3.86446630E+426816068 Inexact Rounded +xadd442 add -969.881818 31170.8555 -> 30200.9737 Inexact Rounded +xcom442 compare -969.881818 31170.8555 -> -1 +xdiv442 divide -969.881818 31170.8555 -> -0.0311150208 Inexact Rounded +xdvi442 divideint -969.881818 31170.8555 -> -0 +xmul442 multiply -969.881818 31170.8555 -> -30232046.0 Inexact Rounded +xpow442 power -969.881818 31171 -> -1.02865894E+93099 Inexact Rounded +xrem442 remainder -969.881818 31170.8555 -> -969.881818 +xsub442 subtract -969.881818 31170.8555 -> -32140.7373 Inexact Rounded +xadd443 add 7980537.27 85.4040512 -> 7980622.67 Inexact Rounded +xcom443 compare 7980537.27 85.4040512 -> 1 +xdiv443 divide 7980537.27 85.4040512 -> 93444.4814 Inexact Rounded +xdvi443 divideint 7980537.27 85.4040512 -> 93444 +xmul443 multiply 7980537.27 85.4040512 -> 681570214 Inexact Rounded +xpow443 power 7980537.27 85 -> 4.70685763E+586 Inexact Rounded +xrem443 remainder 7980537.27 85.4040512 -> 41.1096672 +xsub443 subtract 7980537.27 85.4040512 -> 7980451.87 Inexact Rounded +xadd444 add -114609916. 7525.14981 -> -114602391 Inexact Rounded +xcom444 compare -114609916. 7525.14981 -> -1 +xdiv444 divide -114609916. 7525.14981 -> -15230.2504 Inexact Rounded +xdvi444 divideint -114609916. 7525.14981 -> -15230 +xmul444 multiply -114609916. 7525.14981 -> -8.62456788E+11 Inexact Rounded +xpow444 power -114609916. 7525 -> -4.43620445E+60645 Inexact Rounded +xrem444 remainder -114609916. 7525.14981 -> -1884.39370 +xsub444 subtract -114609916. 7525.14981 -> -114617441 Inexact Rounded +xadd445 add 8.43404682E-500572568 474526719 -> 474526719 Inexact Rounded +xcom445 compare 8.43404682E-500572568 474526719 -> -1 +xdiv445 divide 8.43404682E-500572568 474526719 -> 1.77735973E-500572576 Inexact Rounded +xdvi445 divideint 8.43404682E-500572568 474526719 -> 0 +xmul445 multiply 8.43404682E-500572568 474526719 -> 4.00218057E-500572559 Inexact Rounded +xpow445 power 8.43404682E-500572568 474526719 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem445 remainder 8.43404682E-500572568 474526719 -> 8.43404682E-500572568 +xsub445 subtract 8.43404682E-500572568 474526719 -> -474526719 Inexact Rounded +xadd446 add 188006433 2260.17037E-978192525 -> 188006433 Inexact Rounded +xcom446 compare 188006433 2260.17037E-978192525 -> 1 +xdiv446 divide 188006433 2260.17037E-978192525 -> 8.31824165E+978192529 Inexact Rounded +xdvi446 divideint 188006433 2260.17037E-978192525 -> NaN Division_impossible +xmul446 multiply 188006433 2260.17037E-978192525 -> 4.24926569E-978192514 Inexact Rounded +xpow446 power 188006433 2 -> 3.53464188E+16 Inexact Rounded +xrem446 remainder 188006433 2260.17037E-978192525 -> NaN Division_impossible +xsub446 subtract 188006433 2260.17037E-978192525 -> 188006433 Inexact Rounded +xadd447 add -9.95836312 -866466703 -> -866466713 Inexact Rounded +xcom447 compare -9.95836312 -866466703 -> 1 +xdiv447 divide -9.95836312 -866466703 -> 1.14930707E-8 Inexact Rounded +xdvi447 divideint -9.95836312 -866466703 -> 0 +xmul447 multiply -9.95836312 -866466703 -> 8.62859006E+9 Inexact Rounded +xpow447 power -9.95836312 -866466703 -> -6.71744369E-864896630 Inexact Rounded +xrem447 remainder -9.95836312 -866466703 -> -9.95836312 +xsub447 subtract -9.95836312 -866466703 -> 866466693 Inexact Rounded +xadd448 add 80919339.2E-967231586 219.824266 -> 219.824266 Inexact Rounded +xcom448 compare 80919339.2E-967231586 219.824266 -> -1 +xdiv448 divide 80919339.2E-967231586 219.824266 -> 3.68109220E-967231581 Inexact Rounded +xdvi448 divideint 80919339.2E-967231586 219.824266 -> 0 +xmul448 multiply 80919339.2E-967231586 219.824266 -> 1.77880343E-967231576 Inexact Rounded +xpow448 power 80919339.2E-967231586 220 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem448 remainder 80919339.2E-967231586 219.824266 -> 8.09193392E-967231579 +xsub448 subtract 80919339.2E-967231586 219.824266 -> -219.824266 Inexact Rounded +xadd449 add 159579.444 -89827.5229 -> 69751.9211 +xcom449 compare 159579.444 -89827.5229 -> 1 +xdiv449 divide 159579.444 -89827.5229 -> -1.77650946 Inexact Rounded +xdvi449 divideint 159579.444 -89827.5229 -> -1 +xmul449 multiply 159579.444 -89827.5229 -> -1.43346262E+10 Inexact Rounded +xpow449 power 159579.444 -89828 -> 9.69955850E-467374 Inexact Rounded +xrem449 remainder 159579.444 -89827.5229 -> 69751.9211 +xsub449 subtract 159579.444 -89827.5229 -> 249406.967 Inexact Rounded +xadd450 add -4.54000153 6966333.74 -> 6966329.20 Inexact Rounded +xcom450 compare -4.54000153 6966333.74 -> -1 +xdiv450 divide -4.54000153 6966333.74 -> -6.51706005E-7 Inexact Rounded +xdvi450 divideint -4.54000153 6966333.74 -> -0 +xmul450 multiply -4.54000153 6966333.74 -> -31627165.8 Inexact Rounded +xpow450 power -4.54000153 6966334 -> 3.52568913E+4577271 Inexact Rounded +xrem450 remainder -4.54000153 6966333.74 -> -4.54000153 +xsub450 subtract -4.54000153 6966333.74 -> -6966338.28 Inexact Rounded +xadd451 add 28701538.7E-391015649 -920999192. -> -920999192 Inexact Rounded +xcom451 compare 28701538.7E-391015649 -920999192. -> 1 +xdiv451 divide 28701538.7E-391015649 -920999192. -> -3.11634787E-391015651 Inexact Rounded +xdvi451 divideint 28701538.7E-391015649 -920999192. -> -0 +xmul451 multiply 28701538.7E-391015649 -920999192. -> -2.64340940E-391015633 Inexact Rounded +xpow451 power 28701538.7E-391015649 -920999192 -> Infinity Overflow Inexact Rounded +xrem451 remainder 28701538.7E-391015649 -920999192. -> 2.87015387E-391015642 +xsub451 subtract 28701538.7E-391015649 -920999192. -> 920999192 Inexact Rounded +xadd452 add -361382575. -7976.15286E+898491169 -> -7.97615286E+898491172 Inexact Rounded +xcom452 compare -361382575. -7976.15286E+898491169 -> 1 +xdiv452 divide -361382575. -7976.15286E+898491169 -> 4.53078798E-898491165 Inexact Rounded +xdvi452 divideint -361382575. -7976.15286E+898491169 -> 0 +xmul452 multiply -361382575. -7976.15286E+898491169 -> 2.88244266E+898491181 Inexact Rounded +xpow452 power -361382575. -8 -> 3.43765537E-69 Inexact Rounded +xrem452 remainder -361382575. -7976.15286E+898491169 -> -361382575 +xsub452 subtract -361382575. -7976.15286E+898491169 -> 7.97615286E+898491172 Inexact Rounded +xadd453 add 7021805.61 1222952.83 -> 8244758.44 +xcom453 compare 7021805.61 1222952.83 -> 1 +xdiv453 divide 7021805.61 1222952.83 -> 5.74168148 Inexact Rounded +xdvi453 divideint 7021805.61 1222952.83 -> 5 +xmul453 multiply 7021805.61 1222952.83 -> 8.58733704E+12 Inexact Rounded +xpow453 power 7021805.61 1222953 -> 1.26540553E+8372885 Inexact Rounded +xrem453 remainder 7021805.61 1222952.83 -> 907041.46 +xsub453 subtract 7021805.61 1222952.83 -> 5798852.78 +xadd454 add -40.4811667 -79655.5635 -> -79696.0447 Inexact Rounded +xcom454 compare -40.4811667 -79655.5635 -> 1 +xdiv454 divide -40.4811667 -79655.5635 -> 0.000508202628 Inexact Rounded +xdvi454 divideint -40.4811667 -79655.5635 -> 0 +xmul454 multiply -40.4811667 -79655.5635 -> 3224550.14 Inexact Rounded +xpow454 power -40.4811667 -79656 -> 4.50174275E-128028 Inexact Rounded +xrem454 remainder -40.4811667 -79655.5635 -> -40.4811667 +xsub454 subtract -40.4811667 -79655.5635 -> 79615.0823 Inexact Rounded +xadd455 add -8755674.38E+117168177 148.903404 -> -8.75567438E+117168183 Inexact Rounded +xcom455 compare -8755674.38E+117168177 148.903404 -> -1 +xdiv455 divide -8755674.38E+117168177 148.903404 -> -5.88010357E+117168181 Inexact Rounded +xdvi455 divideint -8755674.38E+117168177 148.903404 -> NaN Division_impossible +xmul455 multiply -8755674.38E+117168177 148.903404 -> -1.30374972E+117168186 Inexact Rounded +xpow455 power -8755674.38E+117168177 149 -> -Infinity Overflow Inexact Rounded +xrem455 remainder -8755674.38E+117168177 148.903404 -> NaN Division_impossible +xsub455 subtract -8755674.38E+117168177 148.903404 -> -8.75567438E+117168183 Inexact Rounded +xadd456 add 34.5329781E+382829392 -45.2177309 -> 3.45329781E+382829393 Inexact Rounded +xcom456 compare 34.5329781E+382829392 -45.2177309 -> 1 +xdiv456 divide 34.5329781E+382829392 -45.2177309 -> -7.63704357E+382829391 Inexact Rounded +xdvi456 divideint 34.5329781E+382829392 -45.2177309 -> NaN Division_impossible +xmul456 multiply 34.5329781E+382829392 -45.2177309 -> -1.56150291E+382829395 Inexact Rounded +xpow456 power 34.5329781E+382829392 -45 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem456 remainder 34.5329781E+382829392 -45.2177309 -> NaN Division_impossible +xsub456 subtract 34.5329781E+382829392 -45.2177309 -> 3.45329781E+382829393 Inexact Rounded +xadd457 add -37958476.0 584367.935 -> -37374108.1 Inexact Rounded +xcom457 compare -37958476.0 584367.935 -> -1 +xdiv457 divide -37958476.0 584367.935 -> -64.9564662 Inexact Rounded +xdvi457 divideint -37958476.0 584367.935 -> -64 +xmul457 multiply -37958476.0 584367.935 -> -2.21817162E+13 Inexact Rounded +xpow457 power -37958476.0 584368 -> 3.20538268E+4429105 Inexact Rounded +xrem457 remainder -37958476.0 584367.935 -> -558928.160 +xsub457 subtract -37958476.0 584367.935 -> -38542843.9 Inexact Rounded +xadd458 add 495233.553E-414152215 62352759.2 -> 62352759.2 Inexact Rounded +xcom458 compare 495233.553E-414152215 62352759.2 -> -1 +xdiv458 divide 495233.553E-414152215 62352759.2 -> 7.94244809E-414152218 Inexact Rounded +xdvi458 divideint 495233.553E-414152215 62352759.2 -> 0 +xmul458 multiply 495233.553E-414152215 62352759.2 -> 3.08791785E-414152202 Inexact Rounded +xpow458 power 495233.553E-414152215 62352759 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem458 remainder 495233.553E-414152215 62352759.2 -> 4.95233553E-414152210 +xsub458 subtract 495233.553E-414152215 62352759.2 -> -62352759.2 Inexact Rounded +xadd459 add -502343060 -96828.994 -> -502439889 Inexact Rounded +xcom459 compare -502343060 -96828.994 -> -1 +xdiv459 divide -502343060 -96828.994 -> 5187.94050 Inexact Rounded +xdvi459 divideint -502343060 -96828.994 -> 5187 +xmul459 multiply -502343060 -96828.994 -> 4.86413731E+13 Inexact Rounded +xpow459 power -502343060 -96829 -> -6.78602119E-842510 Inexact Rounded +xrem459 remainder -502343060 -96828.994 -> -91068.122 +xsub459 subtract -502343060 -96828.994 -> -502246231 Inexact Rounded +xadd460 add -22.439639E+916362878 -39.4037681 -> -2.24396390E+916362879 Inexact Rounded +xcom460 compare -22.439639E+916362878 -39.4037681 -> -1 +xdiv460 divide -22.439639E+916362878 -39.4037681 -> 5.69479521E+916362877 Inexact Rounded +xdvi460 divideint -22.439639E+916362878 -39.4037681 -> NaN Division_impossible +xmul460 multiply -22.439639E+916362878 -39.4037681 -> 8.84206331E+916362880 Inexact Rounded +xpow460 power -22.439639E+916362878 -39 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem460 remainder -22.439639E+916362878 -39.4037681 -> NaN Division_impossible +xsub460 subtract -22.439639E+916362878 -39.4037681 -> -2.24396390E+916362879 Inexact Rounded +xadd461 add 718180.587E-957473722 1.66223443 -> 1.66223443 Inexact Rounded +xcom461 compare 718180.587E-957473722 1.66223443 -> -1 +xdiv461 divide 718180.587E-957473722 1.66223443 -> 4.32057340E-957473717 Inexact Rounded +xdvi461 divideint 718180.587E-957473722 1.66223443 -> 0 +xmul461 multiply 718180.587E-957473722 1.66223443 -> 1.19378450E-957473716 Inexact Rounded +xpow461 power 718180.587E-957473722 2 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem461 remainder 718180.587E-957473722 1.66223443 -> 7.18180587E-957473717 +xsub461 subtract 718180.587E-957473722 1.66223443 -> -1.66223443 Inexact Rounded +xadd462 add -51592.2698 -713885.741 -> -765478.011 Inexact Rounded +xcom462 compare -51592.2698 -713885.741 -> 1 +xdiv462 divide -51592.2698 -713885.741 -> 0.0722696460 Inexact Rounded +xdvi462 divideint -51592.2698 -713885.741 -> 0 +xmul462 multiply -51592.2698 -713885.741 -> 3.68309858E+10 Inexact Rounded +xpow462 power -51592.2698 -713886 -> 6.38576920E-3364249 Inexact Rounded +xrem462 remainder -51592.2698 -713885.741 -> -51592.2698 +xsub462 subtract -51592.2698 -713885.741 -> 662293.471 Inexact Rounded +xadd463 add 51.2279848E+80439745 207.55925E+865165070 -> 2.07559250E+865165072 Inexact Rounded +xcom463 compare 51.2279848E+80439745 207.55925E+865165070 -> -1 +xdiv463 divide 51.2279848E+80439745 207.55925E+865165070 -> 2.46811379E-784725326 Inexact Rounded +xdvi463 divideint 51.2279848E+80439745 207.55925E+865165070 -> 0 +xmul463 multiply 51.2279848E+80439745 207.55925E+865165070 -> 1.06328421E+945604819 Inexact Rounded +xpow463 power 51.2279848E+80439745 2 -> 2.62430643E+160879493 Inexact Rounded +xrem463 remainder 51.2279848E+80439745 207.55925E+865165070 -> 5.12279848E+80439746 +xsub463 subtract 51.2279848E+80439745 207.55925E+865165070 -> -2.07559250E+865165072 Inexact Rounded +xadd464 add -5983.23468 -39.9544513 -> -6023.18913 Inexact Rounded +xcom464 compare -5983.23468 -39.9544513 -> -1 +xdiv464 divide -5983.23468 -39.9544513 -> 149.751392 Inexact Rounded +xdvi464 divideint -5983.23468 -39.9544513 -> 149 +xmul464 multiply -5983.23468 -39.9544513 -> 239056.859 Inexact Rounded +xpow464 power -5983.23468 -40 -> 8.36678291E-152 Inexact Rounded +xrem464 remainder -5983.23468 -39.9544513 -> -30.0214363 +xsub464 subtract -5983.23468 -39.9544513 -> -5943.28023 Inexact Rounded +xadd465 add 921639332.E-917542963 287325.891 -> 287325.891 Inexact Rounded +xcom465 compare 921639332.E-917542963 287325.891 -> -1 +xdiv465 divide 921639332.E-917542963 287325.891 -> 3.20764456E-917542960 Inexact Rounded +xdvi465 divideint 921639332.E-917542963 287325.891 -> 0 +xmul465 multiply 921639332.E-917542963 287325.891 -> 2.64810842E-917542949 Inexact Rounded +xpow465 power 921639332.E-917542963 287326 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem465 remainder 921639332.E-917542963 287325.891 -> 9.21639332E-917542955 +xsub465 subtract 921639332.E-917542963 287325.891 -> -287325.891 Inexact Rounded +xadd466 add 91095916.8E-787312969 -58643.418E+58189880 -> -5.86434180E+58189884 Inexact Rounded +xcom466 compare 91095916.8E-787312969 -58643.418E+58189880 -> 1 +xdiv466 divide 91095916.8E-787312969 -58643.418E+58189880 -> -1.55338689E-845502846 Inexact Rounded +xdvi466 divideint 91095916.8E-787312969 -58643.418E+58189880 -> -0 +xmul466 multiply 91095916.8E-787312969 -58643.418E+58189880 -> -5.34217593E-729123077 Inexact Rounded +xpow466 power 91095916.8E-787312969 -6 -> Infinity Overflow Inexact Rounded +xrem466 remainder 91095916.8E-787312969 -58643.418E+58189880 -> 9.10959168E-787312962 +xsub466 subtract 91095916.8E-787312969 -58643.418E+58189880 -> 5.86434180E+58189884 Inexact Rounded +xadd467 add -6410.5555 -234964259 -> -234970670 Inexact Rounded +xcom467 compare -6410.5555 -234964259 -> 1 +xdiv467 divide -6410.5555 -234964259 -> 0.0000272831090 Inexact Rounded +xdvi467 divideint -6410.5555 -234964259 -> 0 +xmul467 multiply -6410.5555 -234964259 -> 1.50625142E+12 Inexact Rounded +xpow467 power -6410.5555 -234964259 -> -1.27064467E-894484419 Inexact Rounded +xrem467 remainder -6410.5555 -234964259 -> -6410.5555 +xsub467 subtract -6410.5555 -234964259 -> 234957848 Inexact Rounded +xadd468 add -5.32711606 -8447286.21 -> -8447291.54 Inexact Rounded +xcom468 compare -5.32711606 -8447286.21 -> 1 +xdiv468 divide -5.32711606 -8447286.21 -> 6.30630468E-7 Inexact Rounded +xdvi468 divideint -5.32711606 -8447286.21 -> 0 +xmul468 multiply -5.32711606 -8447286.21 -> 44999674.0 Inexact Rounded +xpow468 power -5.32711606 -8447286 -> 9.09138728E-6136888 Inexact Rounded +xrem468 remainder -5.32711606 -8447286.21 -> -5.32711606 +xsub468 subtract -5.32711606 -8447286.21 -> 8447280.88 Inexact Rounded +xadd469 add -82272171.8 -776.238587E-372690416 -> -82272171.8 Inexact Rounded +xcom469 compare -82272171.8 -776.238587E-372690416 -> -1 +xdiv469 divide -82272171.8 -776.238587E-372690416 -> 1.05988253E+372690421 Inexact Rounded +xdvi469 divideint -82272171.8 -776.238587E-372690416 -> NaN Division_impossible +xmul469 multiply -82272171.8 -776.238587E-372690416 -> 6.38628344E-372690406 Inexact Rounded +xpow469 power -82272171.8 -8 -> 4.76404994E-64 Inexact Rounded +xrem469 remainder -82272171.8 -776.238587E-372690416 -> NaN Division_impossible +xsub469 subtract -82272171.8 -776.238587E-372690416 -> -82272171.8 Inexact Rounded +xadd470 add 412411244.E-774339264 866452.465 -> 866452.465 Inexact Rounded +xcom470 compare 412411244.E-774339264 866452.465 -> -1 +xdiv470 divide 412411244.E-774339264 866452.465 -> 4.75976768E-774339262 Inexact Rounded +xdvi470 divideint 412411244.E-774339264 866452.465 -> 0 +xmul470 multiply 412411244.E-774339264 866452.465 -> 3.57334739E-774339250 Inexact Rounded +xpow470 power 412411244.E-774339264 866452 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem470 remainder 412411244.E-774339264 866452.465 -> 4.12411244E-774339256 +xsub470 subtract 412411244.E-774339264 866452.465 -> -866452.465 Inexact Rounded +xadd471 add -103.474598 -3.01660661E-446661257 -> -103.474598 Inexact Rounded +xcom471 compare -103.474598 -3.01660661E-446661257 -> -1 +xdiv471 divide -103.474598 -3.01660661E-446661257 -> 3.43016546E+446661258 Inexact Rounded +xdvi471 divideint -103.474598 -3.01660661E-446661257 -> NaN Division_impossible +xmul471 multiply -103.474598 -3.01660661E-446661257 -> 3.12142156E-446661255 Inexact Rounded +xpow471 power -103.474598 -3 -> -9.02607123E-7 Inexact Rounded +xrem471 remainder -103.474598 -3.01660661E-446661257 -> NaN Division_impossible +xsub471 subtract -103.474598 -3.01660661E-446661257 -> -103.474598 Inexact Rounded +xadd472 add -31027.8323 -475378186. -> -475409214 Inexact Rounded +xcom472 compare -31027.8323 -475378186. -> 1 +xdiv472 divide -31027.8323 -475378186. -> 0.0000652697856 Inexact Rounded +xdvi472 divideint -31027.8323 -475378186. -> 0 +xmul472 multiply -31027.8323 -475378186. -> 1.47499546E+13 Inexact Rounded +xpow472 power -31027.8323 -475378186 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem472 remainder -31027.8323 -475378186. -> -31027.8323 +xsub472 subtract -31027.8323 -475378186. -> 475347158 Inexact Rounded +xadd473 add -1199339.72 -5.73068392E+53774632 -> -5.73068392E+53774632 Inexact Rounded +xcom473 compare -1199339.72 -5.73068392E+53774632 -> 1 +xdiv473 divide -1199339.72 -5.73068392E+53774632 -> 2.09283872E-53774627 Inexact Rounded +xdvi473 divideint -1199339.72 -5.73068392E+53774632 -> 0 +xmul473 multiply -1199339.72 -5.73068392E+53774632 -> 6.87303685E+53774638 Inexact Rounded +xpow473 power -1199339.72 -6 -> 3.36005741E-37 Inexact Rounded +xrem473 remainder -1199339.72 -5.73068392E+53774632 -> -1199339.72 +xsub473 subtract -1199339.72 -5.73068392E+53774632 -> 5.73068392E+53774632 Inexact Rounded +xadd474 add -732908.930E+364345433 -3486146.26 -> -7.32908930E+364345438 Inexact Rounded +xcom474 compare -732908.930E+364345433 -3486146.26 -> -1 +xdiv474 divide -732908.930E+364345433 -3486146.26 -> 2.10234705E+364345432 Inexact Rounded +xdvi474 divideint -732908.930E+364345433 -3486146.26 -> NaN Division_impossible +xmul474 multiply -732908.930E+364345433 -3486146.26 -> 2.55502773E+364345445 Inexact Rounded +xpow474 power -732908.930E+364345433 -3486146 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem474 remainder -732908.930E+364345433 -3486146.26 -> NaN Division_impossible +xsub474 subtract -732908.930E+364345433 -3486146.26 -> -7.32908930E+364345438 Inexact Rounded +xadd475 add -2376150.83 -46777583.3 -> -49153734.1 Inexact Rounded +xcom475 compare -2376150.83 -46777583.3 -> 1 +xdiv475 divide -2376150.83 -46777583.3 -> 0.0507967847 Inexact Rounded +xdvi475 divideint -2376150.83 -46777583.3 -> 0 +xmul475 multiply -2376150.83 -46777583.3 -> 1.11150593E+14 Inexact Rounded +xpow475 power -2376150.83 -46777583 -> -3.51886193E-298247976 Inexact Rounded +xrem475 remainder -2376150.83 -46777583.3 -> -2376150.83 +xsub475 subtract -2376150.83 -46777583.3 -> 44401432.5 Inexact Rounded +xadd476 add 6.3664211 -140854908. -> -140854902 Inexact Rounded +xcom476 compare 6.3664211 -140854908. -> 1 +xdiv476 divide 6.3664211 -140854908. -> -4.51984328E-8 Inexact Rounded +xdvi476 divideint 6.3664211 -140854908. -> -0 +xmul476 multiply 6.3664211 -140854908. -> -896741658 Inexact Rounded +xpow476 power 6.3664211 -140854908 -> 7.25432803E-113232608 Inexact Rounded +xrem476 remainder 6.3664211 -140854908. -> 6.3664211 +xsub476 subtract 6.3664211 -140854908. -> 140854914 Inexact Rounded +xadd477 add -15.791522 1902.30210E+90741844 -> 1.90230210E+90741847 Inexact Rounded +xcom477 compare -15.791522 1902.30210E+90741844 -> -1 +xdiv477 divide -15.791522 1902.30210E+90741844 -> -8.30126929E-90741847 Inexact Rounded +xdvi477 divideint -15.791522 1902.30210E+90741844 -> -0 +xmul477 multiply -15.791522 1902.30210E+90741844 -> -3.00402455E+90741848 Inexact Rounded +xpow477 power -15.791522 2 -> 249.372167 Inexact Rounded +xrem477 remainder -15.791522 1902.30210E+90741844 -> -15.791522 +xsub477 subtract -15.791522 1902.30210E+90741844 -> -1.90230210E+90741847 Inexact Rounded +xadd478 add 15356.1505E+373950429 2.88020400 -> 1.53561505E+373950433 Inexact Rounded +xcom478 compare 15356.1505E+373950429 2.88020400 -> 1 +xdiv478 divide 15356.1505E+373950429 2.88020400 -> 5.33161905E+373950432 Inexact Rounded +xdvi478 divideint 15356.1505E+373950429 2.88020400 -> NaN Division_impossible +xmul478 multiply 15356.1505E+373950429 2.88020400 -> 4.42288461E+373950433 Inexact Rounded +xpow478 power 15356.1505E+373950429 3 -> Infinity Overflow Inexact Rounded +xrem478 remainder 15356.1505E+373950429 2.88020400 -> NaN Division_impossible +xsub478 subtract 15356.1505E+373950429 2.88020400 -> 1.53561505E+373950433 Inexact Rounded +xadd479 add -3.12001326E+318884762 9567.21595 -> -3.12001326E+318884762 Inexact Rounded +xcom479 compare -3.12001326E+318884762 9567.21595 -> -1 +xdiv479 divide -3.12001326E+318884762 9567.21595 -> -3.26115066E+318884758 Inexact Rounded +xdvi479 divideint -3.12001326E+318884762 9567.21595 -> NaN Division_impossible +xmul479 multiply -3.12001326E+318884762 9567.21595 -> -2.98498406E+318884766 Inexact Rounded +xpow479 power -3.12001326E+318884762 9567 -> -Infinity Overflow Inexact Rounded +xrem479 remainder -3.12001326E+318884762 9567.21595 -> NaN Division_impossible +xsub479 subtract -3.12001326E+318884762 9567.21595 -> -3.12001326E+318884762 Inexact Rounded +xadd480 add 49436.6528 751.919517 -> 50188.5723 Inexact Rounded +xcom480 compare 49436.6528 751.919517 -> 1 +xdiv480 divide 49436.6528 751.919517 -> 65.7472664 Inexact Rounded +xdvi480 divideint 49436.6528 751.919517 -> 65 +xmul480 multiply 49436.6528 751.919517 -> 37172384.1 Inexact Rounded +xpow480 power 49436.6528 752 -> 8.41185718E+3529 Inexact Rounded +xrem480 remainder 49436.6528 751.919517 -> 561.884195 +xsub480 subtract 49436.6528 751.919517 -> 48684.7333 Inexact Rounded +xadd481 add 552.669453 8.3725760E+16223526 -> 8.37257600E+16223526 Inexact Rounded +xcom481 compare 552.669453 8.3725760E+16223526 -> -1 +xdiv481 divide 552.669453 8.3725760E+16223526 -> 6.60094878E-16223525 Inexact Rounded +xdvi481 divideint 552.669453 8.3725760E+16223526 -> 0 +xmul481 multiply 552.669453 8.3725760E+16223526 -> 4.62726700E+16223529 Inexact Rounded +xpow481 power 552.669453 8 -> 8.70409632E+21 Inexact Rounded +xrem481 remainder 552.669453 8.3725760E+16223526 -> 552.669453 +xsub481 subtract 552.669453 8.3725760E+16223526 -> -8.37257600E+16223526 Inexact Rounded +xadd482 add -3266303 453741.520 -> -2812561.48 Rounded +xcom482 compare -3266303 453741.520 -> -1 +xdiv482 divide -3266303 453741.520 -> -7.19859844 Inexact Rounded +xdvi482 divideint -3266303 453741.520 -> -7 +xmul482 multiply -3266303 453741.520 -> -1.48205729E+12 Inexact Rounded +xpow482 power -3266303 453742 -> 1.02497315E+2955701 Inexact Rounded +xrem482 remainder -3266303 453741.520 -> -90112.360 +xsub482 subtract -3266303 453741.520 -> -3720044.52 Rounded +xadd483 add 12302757.4 542922.487E+414443353 -> 5.42922487E+414443358 Inexact Rounded +xcom483 compare 12302757.4 542922.487E+414443353 -> -1 +xdiv483 divide 12302757.4 542922.487E+414443353 -> 2.26602465E-414443352 Inexact Rounded +xdvi483 divideint 12302757.4 542922.487E+414443353 -> 0 +xmul483 multiply 12302757.4 542922.487E+414443353 -> 6.67944364E+414443365 Inexact Rounded +xpow483 power 12302757.4 5 -> 2.81846276E+35 Inexact Rounded +xrem483 remainder 12302757.4 542922.487E+414443353 -> 12302757.4 +xsub483 subtract 12302757.4 542922.487E+414443353 -> -5.42922487E+414443358 Inexact Rounded +xadd484 add -5670757.79E-784754984 128144.503 -> 128144.503 Inexact Rounded +xcom484 compare -5670757.79E-784754984 128144.503 -> -1 +xdiv484 divide -5670757.79E-784754984 128144.503 -> -4.42528369E-784754983 Inexact Rounded +xdvi484 divideint -5670757.79E-784754984 128144.503 -> -0 +xmul484 multiply -5670757.79E-784754984 128144.503 -> -7.26676439E-784754973 Inexact Rounded +xpow484 power -5670757.79E-784754984 128145 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem484 remainder -5670757.79E-784754984 128144.503 -> -5.67075779E-784754978 +xsub484 subtract -5670757.79E-784754984 128144.503 -> -128144.503 Inexact Rounded +xadd485 add 22.7721968E+842530698 5223.70462 -> 2.27721968E+842530699 Inexact Rounded +xcom485 compare 22.7721968E+842530698 5223.70462 -> 1 +xdiv485 divide 22.7721968E+842530698 5223.70462 -> 4.35939596E+842530695 Inexact Rounded +xdvi485 divideint 22.7721968E+842530698 5223.70462 -> NaN Division_impossible +xmul485 multiply 22.7721968E+842530698 5223.70462 -> 1.18955230E+842530703 Inexact Rounded +xpow485 power 22.7721968E+842530698 5224 -> Infinity Overflow Inexact Rounded +xrem485 remainder 22.7721968E+842530698 5223.70462 -> NaN Division_impossible +xsub485 subtract 22.7721968E+842530698 5223.70462 -> 2.27721968E+842530699 Inexact Rounded +xadd486 add 88.5158199E-980164357 325846116 -> 325846116 Inexact Rounded +xcom486 compare 88.5158199E-980164357 325846116 -> -1 +xdiv486 divide 88.5158199E-980164357 325846116 -> 2.71649148E-980164364 Inexact Rounded +xdvi486 divideint 88.5158199E-980164357 325846116 -> 0 +xmul486 multiply 88.5158199E-980164357 325846116 -> 2.88425361E-980164347 Inexact Rounded +xpow486 power 88.5158199E-980164357 325846116 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem486 remainder 88.5158199E-980164357 325846116 -> 8.85158199E-980164356 +xsub486 subtract 88.5158199E-980164357 325846116 -> -325846116 Inexact Rounded +xadd487 add -22881.0408 5.63661562 -> -22875.4042 Inexact Rounded +xcom487 compare -22881.0408 5.63661562 -> -1 +xdiv487 divide -22881.0408 5.63661562 -> -4059.35802 Inexact Rounded +xdvi487 divideint -22881.0408 5.63661562 -> -4059 +xmul487 multiply -22881.0408 5.63661562 -> -128971.632 Inexact Rounded +xpow487 power -22881.0408 6 -> 1.43500909E+26 Inexact Rounded +xrem487 remainder -22881.0408 5.63661562 -> -2.01799842 +xsub487 subtract -22881.0408 5.63661562 -> -22886.6774 Inexact Rounded +xadd488 add -7157.57449 -76.4455519E-85647047 -> -7157.57449 Inexact Rounded +xcom488 compare -7157.57449 -76.4455519E-85647047 -> -1 +xdiv488 divide -7157.57449 -76.4455519E-85647047 -> 9.36297052E+85647048 Inexact Rounded +xdvi488 divideint -7157.57449 -76.4455519E-85647047 -> NaN Division_impossible +xmul488 multiply -7157.57449 -76.4455519E-85647047 -> 5.47164732E-85647042 Inexact Rounded +xpow488 power -7157.57449 -8 -> 1.45168700E-31 Inexact Rounded +xrem488 remainder -7157.57449 -76.4455519E-85647047 -> NaN Division_impossible +xsub488 subtract -7157.57449 -76.4455519E-85647047 -> -7157.57449 Inexact Rounded +xadd489 add -503113.801 -9715149.82E-612184422 -> -503113.801 Inexact Rounded +xcom489 compare -503113.801 -9715149.82E-612184422 -> -1 +xdiv489 divide -503113.801 -9715149.82E-612184422 -> 5.17865201E+612184420 Inexact Rounded +xdvi489 divideint -503113.801 -9715149.82E-612184422 -> NaN Division_impossible +xmul489 multiply -503113.801 -9715149.82E-612184422 -> 4.88782595E-612184410 Inexact Rounded +xpow489 power -503113.801 -10 -> 9.62360287E-58 Inexact Rounded +xrem489 remainder -503113.801 -9715149.82E-612184422 -> NaN Division_impossible +xsub489 subtract -503113.801 -9715149.82E-612184422 -> -503113.801 Inexact Rounded +xadd490 add -3066962.41 -55.3096879 -> -3067017.72 Inexact Rounded +xcom490 compare -3066962.41 -55.3096879 -> -1 +xdiv490 divide -3066962.41 -55.3096879 -> 55450.7271 Inexact Rounded +xdvi490 divideint -3066962.41 -55.3096879 -> 55450 +xmul490 multiply -3066962.41 -55.3096879 -> 169632734 Inexact Rounded +xpow490 power -3066962.41 -55 -> -1.70229600E-357 Inexact Rounded +xrem490 remainder -3066962.41 -55.3096879 -> -40.2159450 +xsub490 subtract -3066962.41 -55.3096879 -> -3066907.10 Inexact Rounded +xadd491 add -53311.5738E+156608936 -7.45890666 -> -5.33115738E+156608940 Inexact Rounded +xcom491 compare -53311.5738E+156608936 -7.45890666 -> -1 +xdiv491 divide -53311.5738E+156608936 -7.45890666 -> 7.14737109E+156608939 Inexact Rounded +xdvi491 divideint -53311.5738E+156608936 -7.45890666 -> NaN Division_impossible +xmul491 multiply -53311.5738E+156608936 -7.45890666 -> 3.97646053E+156608941 Inexact Rounded +xpow491 power -53311.5738E+156608936 -7 -> -0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem491 remainder -53311.5738E+156608936 -7.45890666 -> NaN Division_impossible +xsub491 subtract -53311.5738E+156608936 -7.45890666 -> -5.33115738E+156608940 Inexact Rounded +xadd492 add 998890068. -92.057879 -> 998889976 Inexact Rounded +xcom492 compare 998890068. -92.057879 -> 1 +xdiv492 divide 998890068. -92.057879 -> -10850674.4 Inexact Rounded +xdvi492 divideint 998890068. -92.057879 -> -10850674 +xmul492 multiply 998890068. -92.057879 -> -9.19557010E+10 Inexact Rounded +xpow492 power 998890068. -92 -> 1.10757225E-828 Inexact Rounded +xrem492 remainder 998890068. -92.057879 -> 33.839554 +xsub492 subtract 998890068. -92.057879 -> 998890160 Inexact Rounded +xadd493 add 122.495591 -407836028. -> -407835906 Inexact Rounded +xcom493 compare 122.495591 -407836028. -> 1 +xdiv493 divide 122.495591 -407836028. -> -3.00355002E-7 Inexact Rounded +xdvi493 divideint 122.495591 -407836028. -> -0 +xmul493 multiply 122.495591 -407836028. -> -4.99581153E+10 Inexact Rounded +xpow493 power 122.495591 -407836028 -> 4.82463773E-851610754 Inexact Rounded +xrem493 remainder 122.495591 -407836028. -> 122.495591 +xsub493 subtract 122.495591 -407836028. -> 407836150 Inexact Rounded +xadd494 add 187098.488 6220.05584E-236541249 -> 187098.488 Inexact Rounded +xcom494 compare 187098.488 6220.05584E-236541249 -> 1 +xdiv494 divide 187098.488 6220.05584E-236541249 -> 3.00798727E+236541250 Inexact Rounded +xdvi494 divideint 187098.488 6220.05584E-236541249 -> NaN Division_impossible +xmul494 multiply 187098.488 6220.05584E-236541249 -> 1.16376304E-236541240 Inexact Rounded +xpow494 power 187098.488 6 -> 4.28964811E+31 Inexact Rounded +xrem494 remainder 187098.488 6220.05584E-236541249 -> NaN Division_impossible +xsub494 subtract 187098.488 6220.05584E-236541249 -> 187098.488 Inexact Rounded +xadd495 add 4819899.21E+432982550 -727441917 -> 4.81989921E+432982556 Inexact Rounded +xcom495 compare 4819899.21E+432982550 -727441917 -> 1 +xdiv495 divide 4819899.21E+432982550 -727441917 -> -6.62582001E+432982547 Inexact Rounded +xdvi495 divideint 4819899.21E+432982550 -727441917 -> NaN Division_impossible +xmul495 multiply 4819899.21E+432982550 -727441917 -> -3.50619672E+432982565 Inexact Rounded +xpow495 power 4819899.21E+432982550 -727441917 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem495 remainder 4819899.21E+432982550 -727441917 -> NaN Division_impossible +xsub495 subtract 4819899.21E+432982550 -727441917 -> 4.81989921E+432982556 Inexact Rounded +xadd496 add 5770.01020E+507459752 -4208339.33E-129766680 -> 5.77001020E+507459755 Inexact Rounded +xcom496 compare 5770.01020E+507459752 -4208339.33E-129766680 -> 1 +xdiv496 divide 5770.01020E+507459752 -4208339.33E-129766680 -> -1.37108958E+637226429 Inexact Rounded +xdvi496 divideint 5770.01020E+507459752 -4208339.33E-129766680 -> NaN Division_impossible +xmul496 multiply 5770.01020E+507459752 -4208339.33E-129766680 -> -2.42821609E+377693082 Inexact Rounded +xpow496 power 5770.01020E+507459752 -4 -> 0E-1000000007 Underflow Subnormal Inexact Rounded Clamped +xrem496 remainder 5770.01020E+507459752 -4208339.33E-129766680 -> NaN Division_impossible +xsub496 subtract 5770.01020E+507459752 -4208339.33E-129766680 -> 5.77001020E+507459755 Inexact Rounded +xadd497 add -286.371320 710319152 -> 710318866 Inexact Rounded +xcom497 compare -286.371320 710319152 -> -1 +xdiv497 divide -286.371320 710319152 -> -4.03158664E-7 Inexact Rounded +xdvi497 divideint -286.371320 710319152 -> -0 +xmul497 multiply -286.371320 710319152 -> -2.03415033E+11 Inexact Rounded +xpow497 power -286.371320 710319152 -> Infinity Overflow Inexact Rounded +xrem497 remainder -286.371320 710319152 -> -286.371320 +xsub497 subtract -286.371320 710319152 -> -710319438 Inexact Rounded +xadd498 add -7.27403536 -481469656E-835183700 -> -7.27403536 Inexact Rounded +xcom498 compare -7.27403536 -481469656E-835183700 -> -1 +xdiv498 divide -7.27403536 -481469656E-835183700 -> 1.51079830E+835183692 Inexact Rounded +xdvi498 divideint -7.27403536 -481469656E-835183700 -> NaN Division_impossible +xmul498 multiply -7.27403536 -481469656E-835183700 -> 3.50222730E-835183691 Inexact Rounded +xpow498 power -7.27403536 -5 -> -0.0000491046885 Inexact Rounded +xrem498 remainder -7.27403536 -481469656E-835183700 -> NaN Division_impossible +xsub498 subtract -7.27403536 -481469656E-835183700 -> -7.27403536 Inexact Rounded +xadd499 add -6157.74292 -94075286.2E+92555877 -> -9.40752862E+92555884 Inexact Rounded +xcom499 compare -6157.74292 -94075286.2E+92555877 -> 1 +xdiv499 divide -6157.74292 -94075286.2E+92555877 -> 6.54554790E-92555882 Inexact Rounded +xdvi499 divideint -6157.74292 -94075286.2E+92555877 -> 0 +xmul499 multiply -6157.74292 -94075286.2E+92555877 -> 5.79291428E+92555888 Inexact Rounded +xpow499 power -6157.74292 -9 -> -7.85608218E-35 Inexact Rounded +xrem499 remainder -6157.74292 -94075286.2E+92555877 -> -6157.74292 +xsub499 subtract -6157.74292 -94075286.2E+92555877 -> 9.40752862E+92555884 Inexact Rounded +xadd500 add -525445087.E+231529167 188227460 -> -5.25445087E+231529175 Inexact Rounded +xcom500 compare -525445087.E+231529167 188227460 -> -1 +xdiv500 divide -525445087.E+231529167 188227460 -> -2.79154321E+231529167 Inexact Rounded +xdvi500 divideint -525445087.E+231529167 188227460 -> NaN Division_impossible +xmul500 multiply -525445087.E+231529167 188227460 -> -9.89031941E+231529183 Inexact Rounded +xpow500 power -525445087.E+231529167 188227460 -> Infinity Overflow Inexact Rounded +xrem500 remainder -525445087.E+231529167 188227460 -> NaN Division_impossible +xsub500 subtract -525445087.E+231529167 188227460 -> -5.25445087E+231529175 Inexact Rounded + Added: sandbox/trunk/decimal-c/new_dt/remainder.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/remainder.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,629 @@ +------------------------------------------------------------------------ +-- remainder.decTest -- decimal remainder -- +-- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- sanity checks (as base, above) +remx001 remainder 1 1 -> 0 +remx002 remainder 2 1 -> 0 +remx003 remainder 1 2 -> 1 +remx004 remainder 2 2 -> 0 +remx005 remainder 0 1 -> 0 +remx006 remainder 0 2 -> 0 +remx007 remainder 1 3 -> 1 +remx008 remainder 2 3 -> 2 +remx009 remainder 3 3 -> 0 + +remx010 remainder 2.4 1 -> 0.4 +remx011 remainder 2.4 -1 -> 0.4 +remx012 remainder -2.4 1 -> -0.4 +remx013 remainder -2.4 -1 -> -0.4 +remx014 remainder 2.40 1 -> 0.40 +remx015 remainder 2.400 1 -> 0.400 +remx016 remainder 2.4 2 -> 0.4 +remx017 remainder 2.400 2 -> 0.400 +remx018 remainder 2. 2 -> 0 +remx019 remainder 20 20 -> 0 + +remx020 remainder 187 187 -> 0 +remx021 remainder 5 2 -> 1 +remx022 remainder 5 2.0 -> 1.0 +remx023 remainder 5 2.000 -> 1.000 +remx024 remainder 5 0.200 -> 0.000 +remx025 remainder 5 0.200 -> 0.000 + +remx030 remainder 1 2 -> 1 +remx031 remainder 1 4 -> 1 +remx032 remainder 1 8 -> 1 + +remx033 remainder 1 16 -> 1 +remx034 remainder 1 32 -> 1 +remx035 remainder 1 64 -> 1 +remx040 remainder 1 -2 -> 1 +remx041 remainder 1 -4 -> 1 +remx042 remainder 1 -8 -> 1 +remx043 remainder 1 -16 -> 1 +remx044 remainder 1 -32 -> 1 +remx045 remainder 1 -64 -> 1 +remx050 remainder -1 2 -> -1 +remx051 remainder -1 4 -> -1 +remx052 remainder -1 8 -> -1 +remx053 remainder -1 16 -> -1 +remx054 remainder -1 32 -> -1 +remx055 remainder -1 64 -> -1 +remx060 remainder -1 -2 -> -1 +remx061 remainder -1 -4 -> -1 +remx062 remainder -1 -8 -> -1 +remx063 remainder -1 -16 -> -1 +remx064 remainder -1 -32 -> -1 +remx065 remainder -1 -64 -> -1 + +remx066 remainder 999999999 1 -> 0 +remx067 remainder 999999999.4 1 -> 0.4 +remx068 remainder 999999999.5 1 -> 0.5 +remx069 remainder 999999999.9 1 -> 0.9 +remx070 remainder 999999999.999 1 -> 0.999 +precision: 6 +remx071 remainder 999999999 1 -> NaN Division_impossible +remx072 remainder 99999999 1 -> NaN Division_impossible +remx073 remainder 9999999 1 -> NaN Division_impossible +remx074 remainder 999999 1 -> 0 +remx075 remainder 99999 1 -> 0 +remx076 remainder 9999 1 -> 0 +remx077 remainder 999 1 -> 0 +remx078 remainder 99 1 -> 0 +remx079 remainder 9 1 -> 0 + +precision: 9 +remx080 remainder 0. 1 -> 0 +remx081 remainder .0 1 -> 0.0 +remx082 remainder 0.00 1 -> 0.00 +remx083 remainder 0.00E+9 1 -> 0 +remx084 remainder 0.00E+3 1 -> 0 +remx085 remainder 0.00E+2 1 -> 0 +remx086 remainder 0.00E+1 1 -> 0.0 +remx087 remainder 0.00E+0 1 -> 0.00 +remx088 remainder 0.00E-0 1 -> 0.00 +remx089 remainder 0.00E-1 1 -> 0.000 +remx090 remainder 0.00E-2 1 -> 0.0000 +remx091 remainder 0.00E-3 1 -> 0.00000 +remx092 remainder 0.00E-4 1 -> 0.000000 +remx093 remainder 0.00E-5 1 -> 0E-7 +remx094 remainder 0.00E-6 1 -> 0E-8 +remx095 remainder 0.0000E-50 1 -> 0E-54 + +-- Various flavours of remainder by 0 +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +remx101 remainder 0 0 -> NaN Division_undefined +remx102 remainder 0 -0 -> NaN Division_undefined +remx103 remainder -0 0 -> NaN Division_undefined +remx104 remainder -0 -0 -> NaN Division_undefined +remx105 remainder 0.0E5 0 -> NaN Division_undefined +remx106 remainder 0.000 0 -> NaN Division_undefined +-- [Some think this next group should be Division_by_zero exception, but +-- IEEE 854 is explicit that it is Invalid operation .. for +-- remainder-near, anyway] +remx107 remainder 0.0001 0 -> NaN Invalid_operation +remx108 remainder 0.01 0 -> NaN Invalid_operation +remx109 remainder 0.1 0 -> NaN Invalid_operation +remx110 remainder 1 0 -> NaN Invalid_operation +remx111 remainder 1 0.0 -> NaN Invalid_operation +remx112 remainder 10 0.0 -> NaN Invalid_operation +remx113 remainder 1E+100 0.0 -> NaN Invalid_operation +remx114 remainder 1E+1000 0 -> NaN Invalid_operation +remx115 remainder 0.0001 -0 -> NaN Invalid_operation +remx116 remainder 0.01 -0 -> NaN Invalid_operation +remx119 remainder 0.1 -0 -> NaN Invalid_operation +remx120 remainder 1 -0 -> NaN Invalid_operation +remx121 remainder 1 -0.0 -> NaN Invalid_operation +remx122 remainder 10 -0.0 -> NaN Invalid_operation +remx123 remainder 1E+100 -0.0 -> NaN Invalid_operation +remx124 remainder 1E+1000 -0 -> NaN Invalid_operation +-- and zeros on left +remx130 remainder 0 1 -> 0 +remx131 remainder 0 -1 -> 0 +remx132 remainder 0.0 1 -> 0.0 +remx133 remainder 0.0 -1 -> 0.0 +remx134 remainder -0 1 -> -0 +remx135 remainder -0 -1 -> -0 +remx136 remainder -0.0 1 -> -0.0 +remx137 remainder -0.0 -1 -> -0.0 + +-- 0.5ers +remx143 remainder 0.5 2 -> 0.5 +remx144 remainder 0.5 2.1 -> 0.5 +remx145 remainder 0.5 2.01 -> 0.50 +remx146 remainder 0.5 2.001 -> 0.500 +remx147 remainder 0.50 2 -> 0.50 +remx148 remainder 0.50 2.01 -> 0.50 +remx149 remainder 0.50 2.001 -> 0.500 + +-- steadies +remx150 remainder 1 1 -> 0 +remx151 remainder 1 2 -> 1 +remx152 remainder 1 3 -> 1 +remx153 remainder 1 4 -> 1 +remx154 remainder 1 5 -> 1 +remx155 remainder 1 6 -> 1 +remx156 remainder 1 7 -> 1 +remx157 remainder 1 8 -> 1 +remx158 remainder 1 9 -> 1 +remx159 remainder 1 10 -> 1 +remx160 remainder 1 1 -> 0 +remx161 remainder 2 1 -> 0 +remx162 remainder 3 1 -> 0 +remx163 remainder 4 1 -> 0 +remx164 remainder 5 1 -> 0 +remx165 remainder 6 1 -> 0 +remx166 remainder 7 1 -> 0 +remx167 remainder 8 1 -> 0 +remx168 remainder 9 1 -> 0 +remx169 remainder 10 1 -> 0 + +-- some differences from remainderNear +remx171 remainder 0.4 1.020 -> 0.400 +remx172 remainder 0.50 1.020 -> 0.500 +remx173 remainder 0.51 1.020 -> 0.510 +remx174 remainder 0.52 1.020 -> 0.520 +remx175 remainder 0.6 1.020 -> 0.600 + + +-- More flavours of remainder by 0 +maxexponent: 999999999 +minexponent: -999999999 +remx201 remainder 0 0 -> NaN Division_undefined +remx202 remainder 0.0E5 0 -> NaN Division_undefined +remx203 remainder 0.000 0 -> NaN Division_undefined +remx204 remainder 0.0001 0 -> NaN Invalid_operation +remx205 remainder 0.01 0 -> NaN Invalid_operation +remx206 remainder 0.1 0 -> NaN Invalid_operation +remx207 remainder 1 0 -> NaN Invalid_operation +remx208 remainder 1 0.0 -> NaN Invalid_operation +remx209 remainder 10 0.0 -> NaN Invalid_operation +remx210 remainder 1E+100 0.0 -> NaN Invalid_operation +remx211 remainder 1E+1000 0 -> NaN Invalid_operation + +-- some differences from remainderNear +remx231 remainder -0.4 1.020 -> -0.400 +remx232 remainder -0.50 1.020 -> -0.500 +remx233 remainder -0.51 1.020 -> -0.510 +remx234 remainder -0.52 1.020 -> -0.520 +remx235 remainder -0.6 1.020 -> -0.600 + +-- high Xs +remx240 remainder 1E+2 1.00 -> 0.00 + + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +remx270 remainder 1 1e999999999 -> 1 +remx271 remainder 1 0.9e999999999 -> 1 +remx272 remainder 1 0.99e999999999 -> 1 +remx273 remainder 1 0.999999999e999999999 -> 1 +remx274 remainder 9e999999999 1 -> NaN Division_impossible +remx275 remainder 9.9e999999999 1 -> NaN Division_impossible +remx276 remainder 9.99e999999999 1 -> NaN Division_impossible +remx277 remainder 9.99999999e999999999 1 -> NaN Division_impossible + +remx280 remainder 0.1 9e-999999999 -> NaN Division_impossible +remx281 remainder 0.1 99e-999999999 -> NaN Division_impossible +remx282 remainder 0.1 999e-999999999 -> NaN Division_impossible + +remx283 remainder 0.1 9e-999999998 -> NaN Division_impossible +remx284 remainder 0.1 99e-999999998 -> NaN Division_impossible +remx285 remainder 0.1 999e-999999998 -> NaN Division_impossible +remx286 remainder 0.1 999e-999999997 -> NaN Division_impossible +remx287 remainder 0.1 9999e-999999997 -> NaN Division_impossible +remx288 remainder 0.1 99999e-999999997 -> NaN Division_impossible + +-- remx3xx are from DiagBigDecimal +remx301 remainder 1 3 -> 1 +remx302 remainder 5 5 -> 0 +remx303 remainder 13 10 -> 3 +remx304 remainder 13 50 -> 13 +remx305 remainder 13 100 -> 13 +remx306 remainder 13 1000 -> 13 +remx307 remainder .13 1 -> 0.13 +remx308 remainder 0.133 1 -> 0.133 +remx309 remainder 0.1033 1 -> 0.1033 +remx310 remainder 1.033 1 -> 0.033 +remx311 remainder 10.33 1 -> 0.33 +remx312 remainder 10.33 10 -> 0.33 +remx313 remainder 103.3 1 -> 0.3 +remx314 remainder 133 10 -> 3 +remx315 remainder 1033 10 -> 3 +remx316 remainder 1033 50 -> 33 +remx317 remainder 101.0 3 -> 2.0 +remx318 remainder 102.0 3 -> 0.0 +remx319 remainder 103.0 3 -> 1.0 +remx320 remainder 2.40 1 -> 0.40 +remx321 remainder 2.400 1 -> 0.400 +remx322 remainder 2.4 1 -> 0.4 +remx323 remainder 2.4 2 -> 0.4 +remx324 remainder 2.400 2 -> 0.400 +remx325 remainder 1 0.3 -> 0.1 +remx326 remainder 1 0.30 -> 0.10 +remx327 remainder 1 0.300 -> 0.100 +remx328 remainder 1 0.3000 -> 0.1000 +remx329 remainder 1.0 0.3 -> 0.1 +remx330 remainder 1.00 0.3 -> 0.10 +remx331 remainder 1.000 0.3 -> 0.100 +remx332 remainder 1.0000 0.3 -> 0.1000 +remx333 remainder 0.5 2 -> 0.5 +remx334 remainder 0.5 2.1 -> 0.5 +remx335 remainder 0.5 2.01 -> 0.50 +remx336 remainder 0.5 2.001 -> 0.500 +remx337 remainder 0.50 2 -> 0.50 +remx338 remainder 0.50 2.01 -> 0.50 +remx339 remainder 0.50 2.001 -> 0.500 + +remx340 remainder 0.5 0.5000001 -> 0.5000000 +remx341 remainder 0.5 0.50000001 -> 0.50000000 +remx342 remainder 0.5 0.500000001 -> 0.500000000 +remx343 remainder 0.5 0.5000000001 -> 0.500000000 Rounded +remx344 remainder 0.5 0.50000000001 -> 0.500000000 Rounded +remx345 remainder 0.5 0.4999999 -> 1E-7 +remx346 remainder 0.5 0.49999999 -> 1E-8 +remx347 remainder 0.5 0.499999999 -> 1E-9 +remx348 remainder 0.5 0.4999999999 -> 1E-10 +remx349 remainder 0.5 0.49999999999 -> 1E-11 +remx350 remainder 0.5 0.499999999999 -> 1E-12 + +remx351 remainder 0.03 7 -> 0.03 +remx352 remainder 5 2 -> 1 +remx353 remainder 4.1 2 -> 0.1 +remx354 remainder 4.01 2 -> 0.01 +remx355 remainder 4.001 2 -> 0.001 +remx356 remainder 4.0001 2 -> 0.0001 +remx357 remainder 4.00001 2 -> 0.00001 +remx358 remainder 4.000001 2 -> 0.000001 +remx359 remainder 4.0000001 2 -> 1E-7 + +remx360 remainder 1.2 0.7345 -> 0.4655 +remx361 remainder 0.8 12 -> 0.8 +remx362 remainder 0.8 0.2 -> 0.0 +remx363 remainder 0.8 0.3 -> 0.2 +remx364 remainder 0.800 12 -> 0.800 +remx365 remainder 0.800 1.7 -> 0.800 +remx366 remainder 2.400 2 -> 0.400 + +precision: 6 +remx371 remainder 2.400 2 -> 0.400 +precision: 3 +-- long operand, rounded, case +remx372 remainder 12345678900000 12e+12 -> 3.46E+11 Inexact Rounded +-- 12000000000000 + +precision: 5 +remx381 remainder 12345 1 -> 0 +remx382 remainder 12345 1.0001 -> 0.7657 +remx383 remainder 12345 1.001 -> 0.668 +remx384 remainder 12345 1.01 -> 0.78 +remx385 remainder 12345 1.1 -> 0.8 +remx386 remainder 12355 4 -> 3 +remx387 remainder 12345 4 -> 1 +remx388 remainder 12355 4.0001 -> 2.6912 +remx389 remainder 12345 4.0001 -> 0.6914 +remx390 remainder 12345 4.9 -> 1.9 +remx391 remainder 12345 4.99 -> 4.73 +remx392 remainder 12345 4.999 -> 2.469 +remx393 remainder 12345 4.9999 -> 0.2469 +remx394 remainder 12345 5 -> 0 +remx395 remainder 12345 5.0001 -> 4.7532 +remx396 remainder 12345 5.001 -> 2.532 +remx397 remainder 12345 5.01 -> 0.36 +remx398 remainder 12345 5.1 -> 3.0 + +precision: 9 +-- the nasty division-by-1 cases +remx401 remainder 0.5 1 -> 0.5 +remx402 remainder 0.55 1 -> 0.55 +remx403 remainder 0.555 1 -> 0.555 +remx404 remainder 0.5555 1 -> 0.5555 +remx405 remainder 0.55555 1 -> 0.55555 +remx406 remainder 0.555555 1 -> 0.555555 +remx407 remainder 0.5555555 1 -> 0.5555555 +remx408 remainder 0.55555555 1 -> 0.55555555 +remx409 remainder 0.555555555 1 -> 0.555555555 + + +-- Specials +remx680 remainder Inf -Inf -> NaN Invalid_operation +remx681 remainder Inf -1000 -> NaN Invalid_operation +remx682 remainder Inf -1 -> NaN Invalid_operation +remx683 remainder Inf 0 -> NaN Invalid_operation +remx684 remainder Inf -0 -> NaN Invalid_operation +remx685 remainder Inf 1 -> NaN Invalid_operation +remx686 remainder Inf 1000 -> NaN Invalid_operation +remx687 remainder Inf Inf -> NaN Invalid_operation +remx688 remainder -1000 Inf -> -1000 +remx689 remainder -Inf Inf -> NaN Invalid_operation +remx691 remainder -1 Inf -> -1 +remx692 remainder 0 Inf -> 0 +remx693 remainder -0 Inf -> -0 +remx694 remainder 1 Inf -> 1 +remx695 remainder 1000 Inf -> 1000 +remx696 remainder Inf Inf -> NaN Invalid_operation + +remx700 remainder -Inf -Inf -> NaN Invalid_operation +remx701 remainder -Inf -1000 -> NaN Invalid_operation +remx702 remainder -Inf -1 -> NaN Invalid_operation +remx703 remainder -Inf -0 -> NaN Invalid_operation +remx704 remainder -Inf 0 -> NaN Invalid_operation +remx705 remainder -Inf 1 -> NaN Invalid_operation +remx706 remainder -Inf 1000 -> NaN Invalid_operation +remx707 remainder -Inf Inf -> NaN Invalid_operation +remx708 remainder -Inf -Inf -> NaN Invalid_operation +remx709 remainder -1000 Inf -> -1000 +remx710 remainder -1 -Inf -> -1 +remx711 remainder -0 -Inf -> -0 +remx712 remainder 0 -Inf -> 0 +remx713 remainder 1 -Inf -> 1 +remx714 remainder 1000 -Inf -> 1000 +remx715 remainder Inf -Inf -> NaN Invalid_operation + +remx721 remainder NaN -Inf -> NaN +remx722 remainder NaN -1000 -> NaN +remx723 remainder NaN -1 -> NaN +remx724 remainder NaN -0 -> NaN +remx725 remainder -NaN 0 -> -NaN +remx726 remainder NaN 1 -> NaN +remx727 remainder NaN 1000 -> NaN +remx728 remainder NaN Inf -> NaN +remx729 remainder NaN -NaN -> NaN +remx730 remainder -Inf NaN -> NaN +remx731 remainder -1000 NaN -> NaN +remx732 remainder -1 NaN -> NaN +remx733 remainder -0 -NaN -> -NaN +remx734 remainder 0 NaN -> NaN +remx735 remainder 1 -NaN -> -NaN +remx736 remainder 1000 NaN -> NaN +remx737 remainder Inf NaN -> NaN + +remx741 remainder sNaN -Inf -> NaN Invalid_operation +remx742 remainder sNaN -1000 -> NaN Invalid_operation +remx743 remainder -sNaN -1 -> -NaN Invalid_operation +remx744 remainder sNaN -0 -> NaN Invalid_operation +remx745 remainder sNaN 0 -> NaN Invalid_operation +remx746 remainder sNaN 1 -> NaN Invalid_operation +remx747 remainder sNaN 1000 -> NaN Invalid_operation +remx749 remainder sNaN NaN -> NaN Invalid_operation +remx750 remainder sNaN sNaN -> NaN Invalid_operation +remx751 remainder NaN sNaN -> NaN Invalid_operation +remx752 remainder -Inf sNaN -> NaN Invalid_operation +remx753 remainder -1000 sNaN -> NaN Invalid_operation +remx754 remainder -1 sNaN -> NaN Invalid_operation +remx755 remainder -0 sNaN -> NaN Invalid_operation +remx756 remainder 0 sNaN -> NaN Invalid_operation +remx757 remainder 1 sNaN -> NaN Invalid_operation +remx758 remainder 1000 sNaN -> NaN Invalid_operation +remx759 remainder Inf -sNaN -> -NaN Invalid_operation + +-- propaging NaNs +remx760 remainder NaN1 NaN7 -> NaN1 +remx761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation +remx762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation +remx763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation +remx764 remainder 15 NaN11 -> NaN11 +remx765 remainder NaN6 NaN12 -> NaN6 +remx766 remainder Inf NaN13 -> NaN13 +remx767 remainder NaN14 -Inf -> NaN14 +remx768 remainder 0 NaN15 -> NaN15 +remx769 remainder NaN16 -0 -> NaN16 + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +remx770 remainder 1 1e999999999 -> 1 +remx771 remainder 1 0.9e999999999 -> 1 +remx772 remainder 1 0.99e999999999 -> 1 +remx773 remainder 1 0.999999999e999999999 -> 1 +remx774 remainder 9e999999999 1 -> NaN Division_impossible +remx775 remainder 9.9e999999999 1 -> NaN Division_impossible +remx776 remainder 9.99e999999999 1 -> NaN Division_impossible +remx777 remainder 9.99999999e999999999 1 -> NaN Division_impossible + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +remx801 remainder 12345678000 100 -> 0 +remx802 remainder 1 12345678000 -> 1 +remx803 remainder 1234567800 10 -> 0 +remx804 remainder 1 1234567800 -> 1 +remx805 remainder 1234567890 10 -> 0 +remx806 remainder 1 1234567890 -> 1 +remx807 remainder 1234567891 10 -> 1 +remx808 remainder 1 1234567891 -> 1 +remx809 remainder 12345678901 100 -> 1 +remx810 remainder 1 12345678901 -> 1 +remx811 remainder 1234567896 10 -> 6 +remx812 remainder 1 1234567896 -> 1 + +precision: 15 +remx821 remainder 12345678000 100 -> 0 +remx822 remainder 1 12345678000 -> 1 +remx823 remainder 1234567800 10 -> 0 +remx824 remainder 1 1234567800 -> 1 +remx825 remainder 1234567890 10 -> 0 +remx826 remainder 1 1234567890 -> 1 +remx827 remainder 1234567891 10 -> 1 +remx828 remainder 1 1234567891 -> 1 +remx829 remainder 12345678901 100 -> 1 +remx830 remainder 1 12345678901 -> 1 +remx831 remainder 1234567896 10 -> 6 +remx832 remainder 1 1234567896 -> 1 + +-- worries from divideint +precision: 8 +remx840 remainder 100000000.0 1 -> NaN Division_impossible +remx841 remainder 100000000.4 1 -> NaN Division_impossible +remx842 remainder 100000000.5 1 -> NaN Division_impossible +remx843 remainder 100000000.9 1 -> NaN Division_impossible +remx844 remainder 100000000.999 1 -> NaN Division_impossible +precision: 6 +remx850 remainder 100000003 5 -> NaN Division_impossible +remx851 remainder 10000003 5 -> NaN Division_impossible +remx852 remainder 1000003 5 -> 3 +remx853 remainder 100003 5 -> 3 +remx854 remainder 10003 5 -> 3 +remx855 remainder 1003 5 -> 3 +remx856 remainder 103 5 -> 3 +remx857 remainder 13 5 -> 3 +remx858 remainder 1 5 -> 1 + +-- Vladimir's cases +remx860 remainder 123.0e1 10000000000000000 -> 1230 +remx861 remainder 1230 10000000000000000 -> 1230 +remx862 remainder 12.3e2 10000000000000000 -> 1230 +remx863 remainder 1.23e3 10000000000000000 -> 1230 +remx864 remainder 123e1 10000000000000000 -> 1230 +remx870 remainder 123e1 1000000000000000 -> 1230 +remx871 remainder 123e1 100000000000000 -> 1230 +remx872 remainder 123e1 10000000000000 -> 1230 +remx873 remainder 123e1 1000000000000 -> 1230 +remx874 remainder 123e1 100000000000 -> 1230 +remx875 remainder 123e1 10000000000 -> 1230 +remx876 remainder 123e1 1000000000 -> 1230 +remx877 remainder 123e1 100000000 -> 1230 +remx878 remainder 1230 100000000 -> 1230 +remx879 remainder 123e1 10000000 -> 1230 +remx880 remainder 123e1 1000000 -> 1230 +remx881 remainder 123e1 100000 -> 1230 +remx882 remainder 123e1 10000 -> 1230 +remx883 remainder 123e1 1000 -> 230 +remx884 remainder 123e1 100 -> 30 +remx885 remainder 123e1 10 -> 0 +remx886 remainder 123e1 1 -> 0 + +remx889 remainder 123e1 20000000000000000 -> 1230 +remx890 remainder 123e1 2000000000000000 -> 1230 +remx891 remainder 123e1 200000000000000 -> 1230 +remx892 remainder 123e1 20000000000000 -> 1230 +remx893 remainder 123e1 2000000000000 -> 1230 +remx894 remainder 123e1 200000000000 -> 1230 +remx895 remainder 123e1 20000000000 -> 1230 +remx896 remainder 123e1 2000000000 -> 1230 +remx897 remainder 123e1 200000000 -> 1230 +remx899 remainder 123e1 20000000 -> 1230 +remx900 remainder 123e1 2000000 -> 1230 +remx901 remainder 123e1 200000 -> 1230 +remx902 remainder 123e1 20000 -> 1230 +remx903 remainder 123e1 2000 -> 1230 +remx904 remainder 123e1 200 -> 30 +remx905 remainder 123e1 20 -> 10 +remx906 remainder 123e1 2 -> 0 + +remx909 remainder 123e1 50000000000000000 -> 1230 +remx910 remainder 123e1 5000000000000000 -> 1230 +remx911 remainder 123e1 500000000000000 -> 1230 +remx912 remainder 123e1 50000000000000 -> 1230 +remx913 remainder 123e1 5000000000000 -> 1230 +remx914 remainder 123e1 500000000000 -> 1230 +remx915 remainder 123e1 50000000000 -> 1230 +remx916 remainder 123e1 5000000000 -> 1230 +remx917 remainder 123e1 500000000 -> 1230 +remx919 remainder 123e1 50000000 -> 1230 +remx920 remainder 123e1 5000000 -> 1230 +remx921 remainder 123e1 500000 -> 1230 +remx922 remainder 123e1 50000 -> 1230 +remx923 remainder 123e1 5000 -> 1230 +remx924 remainder 123e1 500 -> 230 +remx925 remainder 123e1 50 -> 30 +remx926 remainder 123e1 5 -> 0 + +remx929 remainder 123e1 90000000000000000 -> 1230 +remx930 remainder 123e1 9000000000000000 -> 1230 +remx931 remainder 123e1 900000000000000 -> 1230 +remx932 remainder 123e1 90000000000000 -> 1230 +remx933 remainder 123e1 9000000000000 -> 1230 +remx934 remainder 123e1 900000000000 -> 1230 +remx935 remainder 123e1 90000000000 -> 1230 +remx936 remainder 123e1 9000000000 -> 1230 +remx937 remainder 123e1 900000000 -> 1230 +remx939 remainder 123e1 90000000 -> 1230 +remx940 remainder 123e1 9000000 -> 1230 +remx941 remainder 123e1 900000 -> 1230 +remx942 remainder 123e1 90000 -> 1230 +remx943 remainder 123e1 9000 -> 1230 +remx944 remainder 123e1 900 -> 330 +remx945 remainder 123e1 90 -> 60 +remx946 remainder 123e1 9 -> 6 + +remx950 remainder 123e1 10000000000000000 -> 1230 +remx951 remainder 123e1 100000000000000000 -> 1230 +remx952 remainder 123e1 1000000000000000000 -> 1230 +remx953 remainder 123e1 10000000000000000000 -> 1230 +remx954 remainder 123e1 100000000000000000000 -> 1230 +remx955 remainder 123e1 1000000000000000000000 -> 1230 +remx956 remainder 123e1 10000000000000000000000 -> 1230 +remx957 remainder 123e1 100000000000000000000000 -> 1230 +remx958 remainder 123e1 1000000000000000000000000 -> 1230 +remx959 remainder 123e1 10000000000000000000000000 -> 1230 + +remx960 remainder 123e1 19999999999999999 -> 1230 +remx961 remainder 123e1 199999999999999990 -> 1230 +remx962 remainder 123e1 1999999999999999999 -> 1230 +remx963 remainder 123e1 19999999999999999990 -> 1230 +remx964 remainder 123e1 199999999999999999999 -> 1230 +remx965 remainder 123e1 1999999999999999999990 -> 1230 +remx966 remainder 123e1 19999999999999999999999 -> 1230 +remx967 remainder 123e1 199999999999999999999990 -> 1230 +remx968 remainder 123e1 1999999999999999999999999 -> 1230 +remx969 remainder 123e1 19999999999999999999999990 -> 1230 + +remx970 remainder 1e1 10000000000000000 -> 10 +remx971 remainder 1e1 100000000000000000 -> 10 +remx972 remainder 1e1 1000000000000000000 -> 10 +remx973 remainder 1e1 10000000000000000000 -> 10 +remx974 remainder 1e1 100000000000000000000 -> 10 +remx975 remainder 1e1 1000000000000000000000 -> 10 +remx976 remainder 1e1 10000000000000000000000 -> 10 +remx977 remainder 1e1 100000000000000000000000 -> 10 +remx978 remainder 1e1 1000000000000000000000000 -> 10 +remx979 remainder 1e1 10000000000000000000000000 -> 10 + +remx980 remainder 123e1 1000E999999 -> 1.23E+3 -- 123E+1 internally + +-- overflow and underflow tests [from divide] +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +remx990 remainder +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded +remx991 remainder 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible +remx992 remainder +0.100 9E+999999999 -> 0.100 +remx993 remainder 9E-999999999 +9.100 -> 9E-999999999 +remx995 remainder -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded +remx996 remainder 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible +remx997 remainder -0.100 9E+999999999 -> -0.100 +remx998 remainder 9E-999999999 -9.100 -> 9E-999999999 + +-- Null tests +remx1000 remainder 10 # -> NaN Invalid_operation +remx1001 remainder # 10 -> NaN Invalid_operation + Added: sandbox/trunk/decimal-c/new_dt/remainderNear.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/remainderNear.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,560 @@ +------------------------------------------------------------------------ +-- remainderNear.decTest -- decimal remainder-near (IEEE remainder) -- +-- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.39 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +rmnx001 remaindernear 1 1 -> 0 +rmnx002 remaindernear 2 1 -> 0 +rmnx003 remaindernear 1 2 -> 1 +rmnx004 remaindernear 2 2 -> 0 +rmnx005 remaindernear 0 1 -> 0 +rmnx006 remaindernear 0 2 -> 0 +rmnx007 remaindernear 1 3 -> 1 +rmnx008 remaindernear 2 3 -> -1 +rmnx009 remaindernear 3 3 -> 0 + +rmnx010 remaindernear 2.4 1 -> 0.4 +rmnx011 remaindernear 2.4 -1 -> 0.4 +rmnx012 remaindernear -2.4 1 -> -0.4 +rmnx013 remaindernear -2.4 -1 -> -0.4 +rmnx014 remaindernear 2.40 1 -> 0.40 +rmnx015 remaindernear 2.400 1 -> 0.400 +rmnx016 remaindernear 2.4 2 -> 0.4 +rmnx017 remaindernear 2.400 2 -> 0.400 +rmnx018 remaindernear 2. 2 -> 0 +rmnx019 remaindernear 20 20 -> 0 + +rmnx020 remaindernear 187 187 -> 0 +rmnx021 remaindernear 5 2 -> 1 +rmnx022 remaindernear 5 2.0 -> 1.0 +rmnx023 remaindernear 5 2.000 -> 1.000 +rmnx024 remaindernear 5 0.200 -> 0.000 +rmnx025 remaindernear 5 0.200 -> 0.000 + +rmnx030 remaindernear 1 2 -> 1 +rmnx031 remaindernear 1 4 -> 1 +rmnx032 remaindernear 1 8 -> 1 +rmnx033 remaindernear 1 16 -> 1 +rmnx034 remaindernear 1 32 -> 1 +rmnx035 remaindernear 1 64 -> 1 +rmnx040 remaindernear 1 -2 -> 1 +rmnx041 remaindernear 1 -4 -> 1 +rmnx042 remaindernear 1 -8 -> 1 +rmnx043 remaindernear 1 -16 -> 1 +rmnx044 remaindernear 1 -32 -> 1 +rmnx045 remaindernear 1 -64 -> 1 +rmnx050 remaindernear -1 2 -> -1 +rmnx051 remaindernear -1 4 -> -1 +rmnx052 remaindernear -1 8 -> -1 +rmnx053 remaindernear -1 16 -> -1 +rmnx054 remaindernear -1 32 -> -1 +rmnx055 remaindernear -1 64 -> -1 +rmnx060 remaindernear -1 -2 -> -1 +rmnx061 remaindernear -1 -4 -> -1 +rmnx062 remaindernear -1 -8 -> -1 +rmnx063 remaindernear -1 -16 -> -1 +rmnx064 remaindernear -1 -32 -> -1 +rmnx065 remaindernear -1 -64 -> -1 + +rmnx066 remaindernear 999999997 1 -> 0 +rmnx067 remaindernear 999999997.4 1 -> 0.4 +rmnx068 remaindernear 999999997.5 1 -> -0.5 +rmnx069 remaindernear 999999997.9 1 -> -0.1 +rmnx070 remaindernear 999999997.999 1 -> -0.001 + +rmnx071 remaindernear 999999998 1 -> 0 +rmnx072 remaindernear 999999998.4 1 -> 0.4 +rmnx073 remaindernear 999999998.5 1 -> 0.5 +rmnx074 remaindernear 999999998.9 1 -> -0.1 +rmnx075 remaindernear 999999998.999 1 -> -0.001 + +rmnx076 remaindernear 999999999 1 -> 0 +rmnx077 remaindernear 999999999.4 1 -> 0.4 +rmnx078 remaindernear 999999999.5 1 -> NaN Division_impossible +rmnx079 remaindernear 999999999.9 1 -> NaN Division_impossible +rmnx080 remaindernear 999999999.999 1 -> NaN Division_impossible + +precision: 6 +rmnx081 remaindernear 999999999 1 -> NaN Division_impossible +rmnx082 remaindernear 99999999 1 -> NaN Division_impossible +rmnx083 remaindernear 9999999 1 -> NaN Division_impossible +rmnx084 remaindernear 999999 1 -> 0 +rmnx085 remaindernear 99999 1 -> 0 +rmnx086 remaindernear 9999 1 -> 0 +rmnx087 remaindernear 999 1 -> 0 +rmnx088 remaindernear 99 1 -> 0 +rmnx089 remaindernear 9 1 -> 0 + +precision: 9 +rmnx090 remaindernear 0. 1 -> 0 +rmnx091 remaindernear .0 1 -> 0.0 +rmnx092 remaindernear 0.00 1 -> 0.00 +rmnx093 remaindernear 0.00E+9 1 -> 0 +rmnx094 remaindernear 0.0000E-50 1 -> 0E-54 + + +-- Various flavours of remaindernear by 0 +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +rmnx101 remaindernear 0 0 -> NaN Division_undefined +rmnx102 remaindernear 0 -0 -> NaN Division_undefined +rmnx103 remaindernear -0 0 -> NaN Division_undefined +rmnx104 remaindernear -0 -0 -> NaN Division_undefined +rmnx105 remaindernear 0.0E5 0 -> NaN Division_undefined +rmnx106 remaindernear 0.000 0 -> NaN Division_undefined +-- [Some think this next group should be Division_by_zero exception, +-- but IEEE 854 is explicit that it is Invalid operation .. for +-- remaindernear-near, anyway] +rmnx107 remaindernear 0.0001 0 -> NaN Invalid_operation +rmnx108 remaindernear 0.01 0 -> NaN Invalid_operation +rmnx109 remaindernear 0.1 0 -> NaN Invalid_operation +rmnx110 remaindernear 1 0 -> NaN Invalid_operation +rmnx111 remaindernear 1 0.0 -> NaN Invalid_operation +rmnx112 remaindernear 10 0.0 -> NaN Invalid_operation +rmnx113 remaindernear 1E+100 0.0 -> NaN Invalid_operation +rmnx114 remaindernear 1E+1000 0 -> NaN Invalid_operation +rmnx115 remaindernear 0.0001 -0 -> NaN Invalid_operation +rmnx116 remaindernear 0.01 -0 -> NaN Invalid_operation +rmnx119 remaindernear 0.1 -0 -> NaN Invalid_operation +rmnx120 remaindernear 1 -0 -> NaN Invalid_operation +rmnx121 remaindernear 1 -0.0 -> NaN Invalid_operation +rmnx122 remaindernear 10 -0.0 -> NaN Invalid_operation +rmnx123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation +rmnx124 remaindernear 1E+1000 -0 -> NaN Invalid_operation +-- and zeros on left +rmnx130 remaindernear 0 1 -> 0 +rmnx131 remaindernear 0 -1 -> 0 +rmnx132 remaindernear 0.0 1 -> 0.0 +rmnx133 remaindernear 0.0 -1 -> 0.0 +rmnx134 remaindernear -0 1 -> -0 +rmnx135 remaindernear -0 -1 -> -0 +rmnx136 remaindernear -0.0 1 -> -0.0 +rmnx137 remaindernear -0.0 -1 -> -0.0 + +-- 0.5ers +rmmx143 remaindernear 0.5 2 -> 0.5 +rmmx144 remaindernear 0.5 2.1 -> 0.5 +rmmx145 remaindernear 0.5 2.01 -> 0.50 +rmmx146 remaindernear 0.5 2.001 -> 0.500 +rmmx147 remaindernear 0.50 2 -> 0.50 +rmmx148 remaindernear 0.50 2.01 -> 0.50 +rmmx149 remaindernear 0.50 2.001 -> 0.500 + +-- some differences from remainder +rmnx150 remaindernear 0.4 1.020 -> 0.400 +rmnx151 remaindernear 0.50 1.020 -> 0.500 +rmnx152 remaindernear 0.51 1.020 -> 0.510 +rmnx153 remaindernear 0.52 1.020 -> -0.500 +rmnx154 remaindernear 0.6 1.020 -> -0.420 +rmnx155 remaindernear 0.49 1 -> 0.49 +rmnx156 remaindernear 0.50 1 -> 0.50 +rmnx157 remaindernear 1.50 1 -> -0.50 +rmnx158 remaindernear 2.50 1 -> 0.50 +rmnx159 remaindernear 9.50 1 -> -0.50 +rmnx160 remaindernear 0.51 1 -> -0.49 + +-- the nasty division-by-1 cases +rmnx161 remaindernear 0.4 1 -> 0.4 +rmnx162 remaindernear 0.45 1 -> 0.45 +rmnx163 remaindernear 0.455 1 -> 0.455 +rmnx164 remaindernear 0.4555 1 -> 0.4555 +rmnx165 remaindernear 0.45555 1 -> 0.45555 +rmnx166 remaindernear 0.455555 1 -> 0.455555 +rmnx167 remaindernear 0.4555555 1 -> 0.4555555 +rmnx168 remaindernear 0.45555555 1 -> 0.45555555 +rmnx169 remaindernear 0.455555555 1 -> 0.455555555 +-- with spill... +rmnx171 remaindernear 0.5 1 -> 0.5 +rmnx172 remaindernear 0.55 1 -> -0.45 +rmnx173 remaindernear 0.555 1 -> -0.445 +rmnx174 remaindernear 0.5555 1 -> -0.4445 +rmnx175 remaindernear 0.55555 1 -> -0.44445 +rmnx176 remaindernear 0.555555 1 -> -0.444445 +rmnx177 remaindernear 0.5555555 1 -> -0.4444445 +rmnx178 remaindernear 0.55555555 1 -> -0.44444445 +rmnx179 remaindernear 0.555555555 1 -> -0.444444445 + +-- progression +rmnx180 remaindernear 1 1 -> 0 +rmnx181 remaindernear 1 2 -> 1 +rmnx182 remaindernear 1 3 -> 1 +rmnx183 remaindernear 1 4 -> 1 +rmnx184 remaindernear 1 5 -> 1 +rmnx185 remaindernear 1 6 -> 1 +rmnx186 remaindernear 1 7 -> 1 +rmnx187 remaindernear 1 8 -> 1 +rmnx188 remaindernear 1 9 -> 1 +rmnx189 remaindernear 1 10 -> 1 +rmnx190 remaindernear 1 1 -> 0 +rmnx191 remaindernear 2 1 -> 0 +rmnx192 remaindernear 3 1 -> 0 +rmnx193 remaindernear 4 1 -> 0 +rmnx194 remaindernear 5 1 -> 0 +rmnx195 remaindernear 6 1 -> 0 +rmnx196 remaindernear 7 1 -> 0 +rmnx197 remaindernear 8 1 -> 0 +rmnx198 remaindernear 9 1 -> 0 +rmnx199 remaindernear 10 1 -> 0 + + +-- Various flavours of remaindernear by 0 +maxexponent: 999999999 +minexponent: -999999999 +rmnx201 remaindernear 0 0 -> NaN Division_undefined +rmnx202 remaindernear 0.0E5 0 -> NaN Division_undefined +rmnx203 remaindernear 0.000 0 -> NaN Division_undefined +rmnx204 remaindernear 0.0001 0 -> NaN Invalid_operation +rmnx205 remaindernear 0.01 0 -> NaN Invalid_operation +rmnx206 remaindernear 0.1 0 -> NaN Invalid_operation +rmnx207 remaindernear 1 0 -> NaN Invalid_operation +rmnx208 remaindernear 1 0.0 -> NaN Invalid_operation +rmnx209 remaindernear 10 0.0 -> NaN Invalid_operation +rmnx210 remaindernear 1E+100 0.0 -> NaN Invalid_operation +rmnx211 remaindernear 1E+1000 0 -> NaN Invalid_operation + +-- tests from the extended specification +rmnx221 remaindernear 2.1 3 -> -0.9 +rmnx222 remaindernear 10 6 -> -2 +rmnx223 remaindernear 10 3 -> 1 +rmnx224 remaindernear -10 3 -> -1 +rmnx225 remaindernear 10.2 1 -> 0.2 +rmnx226 remaindernear 10 0.3 -> 0.1 +rmnx227 remaindernear 3.6 1.3 -> -0.3 + +-- some differences from remainder +rmnx231 remaindernear 0.4 1.020 -> 0.400 +rmnx232 remaindernear 0.50 1.020 -> 0.500 +rmnx233 remaindernear 0.51 1.020 -> 0.510 +rmnx234 remaindernear 0.52 1.020 -> -0.500 +rmnx235 remaindernear 0.6 1.020 -> -0.420 + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +rmnx270 remaindernear 1 1e999999999 -> 1 +rmnx271 remaindernear 1 0.9e999999999 -> 1 +rmnx272 remaindernear 1 0.99e999999999 -> 1 +rmnx273 remaindernear 1 0.999999999e999999999 -> 1 +rmnx274 remaindernear 9e999999999 1 -> NaN Division_impossible +rmnx275 remaindernear 9.9e999999999 1 -> NaN Division_impossible +rmnx276 remaindernear 9.99e999999999 1 -> NaN Division_impossible +rmnx277 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible + +rmnx280 remaindernear 0.1 9e-999999999 -> NaN Division_impossible +rmnx281 remaindernear 0.1 99e-999999999 -> NaN Division_impossible +rmnx282 remaindernear 0.1 999e-999999999 -> NaN Division_impossible + +rmnx283 remaindernear 0.1 9e-999999998 -> NaN Division_impossible +rmnx284 remaindernear 0.1 99e-999999998 -> NaN Division_impossible +rmnx285 remaindernear 0.1 999e-999999998 -> NaN Division_impossible +rmnx286 remaindernear 0.1 999e-999999997 -> NaN Division_impossible +rmnx287 remaindernear 0.1 9999e-999999997 -> NaN Division_impossible +rmnx288 remaindernear 0.1 99999e-999999997 -> NaN Division_impossible + +-- rmnx3xx are from DiagBigDecimal +rmnx301 remaindernear 1 3 -> 1 +rmnx302 remaindernear 5 5 -> 0 +rmnx303 remaindernear 13 10 -> 3 +rmnx304 remaindernear 13 50 -> 13 +rmnx305 remaindernear 13 100 -> 13 +rmnx306 remaindernear 13 1000 -> 13 +rmnx307 remaindernear .13 1 -> 0.13 +rmnx308 remaindernear 0.133 1 -> 0.133 +rmnx309 remaindernear 0.1033 1 -> 0.1033 +rmnx310 remaindernear 1.033 1 -> 0.033 +rmnx311 remaindernear 10.33 1 -> 0.33 +rmnx312 remaindernear 10.33 10 -> 0.33 +rmnx313 remaindernear 103.3 1 -> 0.3 +rmnx314 remaindernear 133 10 -> 3 +rmnx315 remaindernear 1033 10 -> 3 +rmnx316 remaindernear 1033 50 -> -17 +rmnx317 remaindernear 101.0 3 -> -1.0 +rmnx318 remaindernear 102.0 3 -> 0.0 +rmnx319 remaindernear 103.0 3 -> 1.0 +rmnx320 remaindernear 2.40 1 -> 0.40 +rmnx321 remaindernear 2.400 1 -> 0.400 +rmnx322 remaindernear 2.4 1 -> 0.4 +rmnx323 remaindernear 2.4 2 -> 0.4 +rmnx324 remaindernear 2.400 2 -> 0.400 +rmnx325 remaindernear 1 0.3 -> 0.1 +rmnx326 remaindernear 1 0.30 -> 0.10 +rmnx327 remaindernear 1 0.300 -> 0.100 +rmnx328 remaindernear 1 0.3000 -> 0.1000 +rmnx329 remaindernear 1.0 0.3 -> 0.1 +rmnx330 remaindernear 1.00 0.3 -> 0.10 +rmnx331 remaindernear 1.000 0.3 -> 0.100 +rmnx332 remaindernear 1.0000 0.3 -> 0.1000 +rmnx333 remaindernear 0.5 2 -> 0.5 +rmnx334 remaindernear 0.5 2.1 -> 0.5 +rmnx335 remaindernear 0.5 2.01 -> 0.50 +rmnx336 remaindernear 0.5 2.001 -> 0.500 +rmnx337 remaindernear 0.50 2 -> 0.50 +rmnx338 remaindernear 0.50 2.01 -> 0.50 +rmnx339 remaindernear 0.50 2.001 -> 0.500 + +rmnx340 remaindernear 0.5 0.5000001 -> -1E-7 +rmnx341 remaindernear 0.5 0.50000001 -> -1E-8 +rmnx342 remaindernear 0.5 0.500000001 -> -1E-9 +rmnx343 remaindernear 0.5 0.5000000001 -> -1E-10 +rmnx344 remaindernear 0.5 0.50000000001 -> -1E-11 +rmnx345 remaindernear 0.5 0.4999999 -> 1E-7 +rmnx346 remaindernear 0.5 0.49999999 -> 1E-8 +rmnx347 remaindernear 0.5 0.499999999 -> 1E-9 +rmnx348 remaindernear 0.5 0.4999999999 -> 1E-10 +rmnx349 remaindernear 0.5 0.49999999999 -> 1E-11 + +rmnx350 remaindernear 0.03 7 -> 0.03 +rmnx351 remaindernear 5 2 -> 1 +rmnx352 remaindernear 4.1 2 -> 0.1 +rmnx353 remaindernear 4.01 2 -> 0.01 +rmnx354 remaindernear 4.001 2 -> 0.001 +rmnx355 remaindernear 4.0001 2 -> 0.0001 +rmnx356 remaindernear 4.00001 2 -> 0.00001 +rmnx357 remaindernear 4.000001 2 -> 0.000001 +rmnx358 remaindernear 4.0000001 2 -> 1E-7 + +rmnx360 remaindernear 1.2 0.7345 -> -0.2690 +rmnx361 remaindernear 0.8 12 -> 0.8 +rmnx362 remaindernear 0.8 0.2 -> 0.0 +rmnx363 remaindernear 0.8 0.3 -> -0.1 +rmnx364 remaindernear 0.800 12 -> 0.800 +rmnx365 remaindernear 0.800 1.7 -> 0.800 +rmnx366 remaindernear 2.400 2 -> 0.400 + +precision: 6 +rmnx371 remaindernear 2.400 2 -> 0.400 +precision: 3 +rmnx372 remaindernear 12345678900000 12e+12 -> 3.46E+11 Inexact Rounded + +precision: 5 +rmnx381 remaindernear 12345 1 -> 0 +rmnx382 remaindernear 12345 1.0001 -> -0.2344 +rmnx383 remaindernear 12345 1.001 -> -0.333 +rmnx384 remaindernear 12345 1.01 -> -0.23 +rmnx385 remaindernear 12345 1.1 -> -0.3 +rmnx386 remaindernear 12355 4 -> -1 +rmnx387 remaindernear 12345 4 -> 1 +rmnx388 remaindernear 12355 4.0001 -> -1.3089 +rmnx389 remaindernear 12345 4.0001 -> 0.6914 +rmnx390 remaindernear 12345 4.9 -> 1.9 +rmnx391 remaindernear 12345 4.99 -> -0.26 +rmnx392 remaindernear 12345 4.999 -> 2.469 +rmnx393 remaindernear 12345 4.9999 -> 0.2469 +rmnx394 remaindernear 12345 5 -> 0 +rmnx395 remaindernear 12345 5.0001 -> -0.2469 +rmnx396 remaindernear 12345 5.001 -> -2.469 +rmnx397 remaindernear 12345 5.01 -> 0.36 +rmnx398 remaindernear 12345 5.1 -> -2.1 + +precision: 9 +-- some nasty division-by-1 cases [some similar above] +rmnx401 remaindernear 0.4 1 -> 0.4 +rmnx402 remaindernear 0.45 1 -> 0.45 +rmnx403 remaindernear 0.455 1 -> 0.455 +rmnx404 remaindernear 0.4555 1 -> 0.4555 +rmnx405 remaindernear 0.45555 1 -> 0.45555 +rmnx406 remaindernear 0.455555 1 -> 0.455555 +rmnx407 remaindernear 0.4555555 1 -> 0.4555555 +rmnx408 remaindernear 0.45555555 1 -> 0.45555555 +rmnx409 remaindernear 0.455555555 1 -> 0.455555555 + +-- some tricky LHSs +rmnx420 remaindernear 99999999.999999999 1E+8 -> -1E-9 +rmnx421 remaindernear 999999999.999999999 1E+9 -> -1E-9 +precision: 9 +rmnx430 remaindernear 0.455555555 1 -> 0.455555555 +precision: 8 +rmnx431 remaindernear 0.455555555 1 -> 0.45555556 Inexact Rounded +precision: 7 +rmnx432 remaindernear 0.455555555 1 -> 0.4555556 Inexact Rounded +precision: 6 +rmnx433 remaindernear 0.455555555 1 -> 0.455556 Inexact Rounded +precision: 5 +rmnx434 remaindernear 0.455555555 1 -> 0.45556 Inexact Rounded +precision: 4 +rmnx435 remaindernear 0.455555555 1 -> 0.4556 Inexact Rounded +precision: 3 +rmnx436 remaindernear 0.455555555 1 -> 0.456 Inexact Rounded +precision: 2 +rmnx437 remaindernear 0.455555555 1 -> 0.46 Inexact Rounded +precision: 1 +rmnx438 remaindernear 0.455555555 1 -> 0.5 Inexact Rounded + +-- early tests; from text descriptions +precision: 9 +rmnx601 remaindernear 10 6 -> -2 +rmnx602 remaindernear -10 6 -> 2 +rmnx603 remaindernear 11 3 -> -1 +rmnx604 remaindernear 11 5 -> 1 +rmnx605 remaindernear 7.7 8 -> -0.3 +rmnx606 remaindernear 31.5 3 -> 1.5 -- i=10 +rmnx607 remaindernear 34.5 3 -> -1.5 -- i=11 + +-- Specials +rmnx680 remaindernear Inf -Inf -> NaN Invalid_operation +rmnx681 remaindernear Inf -1000 -> NaN Invalid_operation +rmnx682 remaindernear Inf -1 -> NaN Invalid_operation +rmnx683 remaindernear Inf 0 -> NaN Invalid_operation +rmnx684 remaindernear Inf -0 -> NaN Invalid_operation +rmnx685 remaindernear Inf 1 -> NaN Invalid_operation +rmnx686 remaindernear Inf 1000 -> NaN Invalid_operation +rmnx687 remaindernear Inf Inf -> NaN Invalid_operation +rmnx688 remaindernear -1000 Inf -> -1000 +rmnx689 remaindernear -Inf Inf -> NaN Invalid_operation +rmnx691 remaindernear -1 Inf -> -1 +rmnx692 remaindernear 0 Inf -> 0 +rmnx693 remaindernear -0 Inf -> -0 +rmnx694 remaindernear 1 Inf -> 1 +rmnx695 remaindernear 1000 Inf -> 1000 +rmnx696 remaindernear Inf Inf -> NaN Invalid_operation + +rmnx700 remaindernear -Inf -Inf -> NaN Invalid_operation +rmnx701 remaindernear -Inf -1000 -> NaN Invalid_operation +rmnx702 remaindernear -Inf -1 -> NaN Invalid_operation +rmnx703 remaindernear -Inf -0 -> NaN Invalid_operation +rmnx704 remaindernear -Inf 0 -> NaN Invalid_operation +rmnx705 remaindernear -Inf 1 -> NaN Invalid_operation +rmnx706 remaindernear -Inf 1000 -> NaN Invalid_operation +rmnx707 remaindernear -Inf Inf -> NaN Invalid_operation +rmnx708 remaindernear -Inf -Inf -> NaN Invalid_operation +rmnx709 remaindernear -1000 Inf -> -1000 +rmnx710 remaindernear -1 -Inf -> -1 +rmnx711 remaindernear -0 -Inf -> -0 +rmnx712 remaindernear 0 -Inf -> 0 +rmnx713 remaindernear 1 -Inf -> 1 +rmnx714 remaindernear 1000 -Inf -> 1000 +rmnx715 remaindernear Inf -Inf -> NaN Invalid_operation + +rmnx721 remaindernear NaN -Inf -> NaN +rmnx722 remaindernear NaN -1000 -> NaN +rmnx723 remaindernear NaN -1 -> NaN +rmnx724 remaindernear NaN -0 -> NaN +rmnx725 remaindernear NaN 0 -> NaN +rmnx726 remaindernear NaN 1 -> NaN +rmnx727 remaindernear NaN 1000 -> NaN +rmnx728 remaindernear NaN Inf -> NaN +rmnx729 remaindernear NaN NaN -> NaN +rmnx730 remaindernear -Inf NaN -> NaN +rmnx731 remaindernear -1000 NaN -> NaN +rmnx732 remaindernear -1 -NaN -> -NaN +rmnx733 remaindernear -0 NaN -> NaN +rmnx734 remaindernear 0 NaN -> NaN +rmnx735 remaindernear 1 NaN -> NaN +rmnx736 remaindernear 1000 NaN -> NaN +rmnx737 remaindernear Inf NaN -> NaN + +rmnx741 remaindernear sNaN -Inf -> NaN Invalid_operation +rmnx742 remaindernear sNaN -1000 -> NaN Invalid_operation +rmnx743 remaindernear -sNaN -1 -> -NaN Invalid_operation +rmnx744 remaindernear sNaN -0 -> NaN Invalid_operation +rmnx745 remaindernear sNaN 0 -> NaN Invalid_operation +rmnx746 remaindernear sNaN 1 -> NaN Invalid_operation +rmnx747 remaindernear sNaN 1000 -> NaN Invalid_operation +rmnx749 remaindernear sNaN NaN -> NaN Invalid_operation +rmnx750 remaindernear sNaN sNaN -> NaN Invalid_operation +rmnx751 remaindernear NaN sNaN -> NaN Invalid_operation +rmnx752 remaindernear -Inf sNaN -> NaN Invalid_operation +rmnx753 remaindernear -1000 sNaN -> NaN Invalid_operation +rmnx754 remaindernear -1 sNaN -> NaN Invalid_operation +rmnx755 remaindernear -0 -sNaN -> -NaN Invalid_operation +rmnx756 remaindernear 0 sNaN -> NaN Invalid_operation +rmnx757 remaindernear 1 sNaN -> NaN Invalid_operation +rmnx758 remaindernear 1000 sNaN -> NaN Invalid_operation +rmnx759 remaindernear Inf sNaN -> NaN Invalid_operation +rmnx760 remaindernear NaN sNaN -> NaN Invalid_operation + +-- propaging NaNs +rmnx761 remaindernear NaN1 NaN7 -> NaN1 +rmnx762 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation +rmnx763 remaindernear NaN3 -sNaN9 -> -NaN9 Invalid_operation +rmnx764 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation +rmnx765 remaindernear 15 NaN11 -> NaN11 +rmnx766 remaindernear NaN6 NaN12 -> NaN6 +rmnx767 remaindernear Inf -NaN13 -> -NaN13 +rmnx768 remaindernear NaN14 -Inf -> NaN14 +rmnx769 remaindernear 0 NaN15 -> NaN15 +rmnx770 remaindernear -NaN16 -0 -> -NaN16 + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +rmnx780 remaindernear 1 1e999999999 -> 1 +rmnx781 remaindernear 1 0.9e999999999 -> 1 +rmnx782 remaindernear 1 0.99e999999999 -> 1 +rmnx783 remaindernear 1 0.999999999e999999999 -> 1 +rmnx784 remaindernear 9e999999999 1 -> NaN Division_impossible +rmnx785 remaindernear 9.9e999999999 1 -> NaN Division_impossible +rmnx786 remaindernear 9.99e999999999 1 -> NaN Division_impossible +rmnx787 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible + + +-- overflow and underflow tests [from divide] +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +rmnx790 remaindernear +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded +rmnx791 remaindernear 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible +rmnx792 remaindernear +0.100 9E+999999999 -> 0.100 +rmnx793 remaindernear 9E-999999999 +9.100 -> 9E-999999999 +rmnx795 remaindernear -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded +rmnx796 remaindernear 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible +rmnx797 remaindernear -0.100 9E+999999999 -> -0.100 +rmnx798 remaindernear 9E-999999999 -9.100 -> 9E-999999999 + +-- long operands checks +maxexponent: 999 +minexponent: -999 +precision: 9 +rmnx801 remaindernear 12345678000 100 -> 0 +rmnx802 remaindernear 1 12345678000 -> 1 +rmnx803 remaindernear 1234567800 10 -> 0 +rmnx804 remaindernear 1 1234567800 -> 1 +rmnx805 remaindernear 1234567890 10 -> 0 +rmnx806 remaindernear 1 1234567890 -> 1 +rmnx807 remaindernear 1234567891 10 -> 1 +rmnx808 remaindernear 1 1234567891 -> 1 +rmnx809 remaindernear 12345678901 100 -> 1 +rmnx810 remaindernear 1 12345678901 -> 1 +rmnx811 remaindernear 1234567896 10 -> -4 +rmnx812 remaindernear 1 1234567896 -> 1 + +precision: 15 +rmnx841 remaindernear 12345678000 100 -> 0 +rmnx842 remaindernear 1 12345678000 -> 1 +rmnx843 remaindernear 1234567800 10 -> 0 +rmnx844 remaindernear 1 1234567800 -> 1 +rmnx845 remaindernear 1234567890 10 -> 0 +rmnx846 remaindernear 1 1234567890 -> 1 +rmnx847 remaindernear 1234567891 10 -> 1 +rmnx848 remaindernear 1 1234567891 -> 1 +rmnx849 remaindernear 12345678901 100 -> 1 +rmnx850 remaindernear 1 12345678901 -> 1 +rmnx851 remaindernear 1234567896 10 -> -4 +rmnx852 remaindernear 1 1234567896 -> 1 + +-- Null tests +rmnx900 remaindernear 10 # -> NaN Invalid_operation +rmnx901 remaindernear # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal-c/new_dt/remaindernear.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/remaindernear.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,560 @@ +------------------------------------------------------------------------ +-- remainderNear.decTest -- decimal remainder-near (IEEE remainder) -- +-- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +rmnx001 remaindernear 1 1 -> 0 +rmnx002 remaindernear 2 1 -> 0 +rmnx003 remaindernear 1 2 -> 1 +rmnx004 remaindernear 2 2 -> 0 +rmnx005 remaindernear 0 1 -> 0 +rmnx006 remaindernear 0 2 -> 0 +rmnx007 remaindernear 1 3 -> 1 +rmnx008 remaindernear 2 3 -> -1 +rmnx009 remaindernear 3 3 -> 0 + +rmnx010 remaindernear 2.4 1 -> 0.4 +rmnx011 remaindernear 2.4 -1 -> 0.4 +rmnx012 remaindernear -2.4 1 -> -0.4 +rmnx013 remaindernear -2.4 -1 -> -0.4 +rmnx014 remaindernear 2.40 1 -> 0.40 +rmnx015 remaindernear 2.400 1 -> 0.400 +rmnx016 remaindernear 2.4 2 -> 0.4 +rmnx017 remaindernear 2.400 2 -> 0.400 +rmnx018 remaindernear 2. 2 -> 0 +rmnx019 remaindernear 20 20 -> 0 + +rmnx020 remaindernear 187 187 -> 0 +rmnx021 remaindernear 5 2 -> 1 +rmnx022 remaindernear 5 2.0 -> 1.0 +rmnx023 remaindernear 5 2.000 -> 1.000 +rmnx024 remaindernear 5 0.200 -> 0.000 +rmnx025 remaindernear 5 0.200 -> 0.000 + +rmnx030 remaindernear 1 2 -> 1 +rmnx031 remaindernear 1 4 -> 1 +rmnx032 remaindernear 1 8 -> 1 +rmnx033 remaindernear 1 16 -> 1 +rmnx034 remaindernear 1 32 -> 1 +rmnx035 remaindernear 1 64 -> 1 +rmnx040 remaindernear 1 -2 -> 1 +rmnx041 remaindernear 1 -4 -> 1 +rmnx042 remaindernear 1 -8 -> 1 +rmnx043 remaindernear 1 -16 -> 1 +rmnx044 remaindernear 1 -32 -> 1 +rmnx045 remaindernear 1 -64 -> 1 +rmnx050 remaindernear -1 2 -> -1 +rmnx051 remaindernear -1 4 -> -1 +rmnx052 remaindernear -1 8 -> -1 +rmnx053 remaindernear -1 16 -> -1 +rmnx054 remaindernear -1 32 -> -1 +rmnx055 remaindernear -1 64 -> -1 +rmnx060 remaindernear -1 -2 -> -1 +rmnx061 remaindernear -1 -4 -> -1 +rmnx062 remaindernear -1 -8 -> -1 +rmnx063 remaindernear -1 -16 -> -1 +rmnx064 remaindernear -1 -32 -> -1 +rmnx065 remaindernear -1 -64 -> -1 + +rmnx066 remaindernear 999999997 1 -> 0 +rmnx067 remaindernear 999999997.4 1 -> 0.4 +rmnx068 remaindernear 999999997.5 1 -> -0.5 +rmnx069 remaindernear 999999997.9 1 -> -0.1 +rmnx070 remaindernear 999999997.999 1 -> -0.001 + +rmnx071 remaindernear 999999998 1 -> 0 +rmnx072 remaindernear 999999998.4 1 -> 0.4 +rmnx073 remaindernear 999999998.5 1 -> 0.5 +rmnx074 remaindernear 999999998.9 1 -> -0.1 +rmnx075 remaindernear 999999998.999 1 -> -0.001 + +rmnx076 remaindernear 999999999 1 -> 0 +rmnx077 remaindernear 999999999.4 1 -> 0.4 +rmnx078 remaindernear 999999999.5 1 -> NaN Division_impossible +rmnx079 remaindernear 999999999.9 1 -> NaN Division_impossible +rmnx080 remaindernear 999999999.999 1 -> NaN Division_impossible + +precision: 6 +rmnx081 remaindernear 999999999 1 -> NaN Division_impossible +rmnx082 remaindernear 99999999 1 -> NaN Division_impossible +rmnx083 remaindernear 9999999 1 -> NaN Division_impossible +rmnx084 remaindernear 999999 1 -> 0 +rmnx085 remaindernear 99999 1 -> 0 +rmnx086 remaindernear 9999 1 -> 0 +rmnx087 remaindernear 999 1 -> 0 +rmnx088 remaindernear 99 1 -> 0 +rmnx089 remaindernear 9 1 -> 0 + +precision: 9 +rmnx090 remaindernear 0. 1 -> 0 +rmnx091 remaindernear .0 1 -> 0.0 +rmnx092 remaindernear 0.00 1 -> 0.00 +rmnx093 remaindernear 0.00E+9 1 -> 0 +rmnx094 remaindernear 0.0000E-50 1 -> 0E-54 + + +-- Various flavours of remaindernear by 0 +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +rmnx101 remaindernear 0 0 -> NaN Division_undefined +rmnx102 remaindernear 0 -0 -> NaN Division_undefined +rmnx103 remaindernear -0 0 -> NaN Division_undefined +rmnx104 remaindernear -0 -0 -> NaN Division_undefined +rmnx105 remaindernear 0.0E5 0 -> NaN Division_undefined +rmnx106 remaindernear 0.000 0 -> NaN Division_undefined +-- [Some think this next group should be Division_by_zero exception, +-- but IEEE 854 is explicit that it is Invalid operation .. for +-- remaindernear-near, anyway] +rmnx107 remaindernear 0.0001 0 -> NaN Invalid_operation +rmnx108 remaindernear 0.01 0 -> NaN Invalid_operation +rmnx109 remaindernear 0.1 0 -> NaN Invalid_operation +rmnx110 remaindernear 1 0 -> NaN Invalid_operation +rmnx111 remaindernear 1 0.0 -> NaN Invalid_operation +rmnx112 remaindernear 10 0.0 -> NaN Invalid_operation +rmnx113 remaindernear 1E+100 0.0 -> NaN Invalid_operation +rmnx114 remaindernear 1E+1000 0 -> NaN Invalid_operation +rmnx115 remaindernear 0.0001 -0 -> NaN Invalid_operation +rmnx116 remaindernear 0.01 -0 -> NaN Invalid_operation +rmnx119 remaindernear 0.1 -0 -> NaN Invalid_operation +rmnx120 remaindernear 1 -0 -> NaN Invalid_operation +rmnx121 remaindernear 1 -0.0 -> NaN Invalid_operation +rmnx122 remaindernear 10 -0.0 -> NaN Invalid_operation +rmnx123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation +rmnx124 remaindernear 1E+1000 -0 -> NaN Invalid_operation +-- and zeros on left +rmnx130 remaindernear 0 1 -> 0 +rmnx131 remaindernear 0 -1 -> 0 +rmnx132 remaindernear 0.0 1 -> 0.0 +rmnx133 remaindernear 0.0 -1 -> 0.0 +rmnx134 remaindernear -0 1 -> -0 +rmnx135 remaindernear -0 -1 -> -0 +rmnx136 remaindernear -0.0 1 -> -0.0 +rmnx137 remaindernear -0.0 -1 -> -0.0 + +-- 0.5ers +rmmx143 remaindernear 0.5 2 -> 0.5 +rmmx144 remaindernear 0.5 2.1 -> 0.5 +rmmx145 remaindernear 0.5 2.01 -> 0.50 +rmmx146 remaindernear 0.5 2.001 -> 0.500 +rmmx147 remaindernear 0.50 2 -> 0.50 +rmmx148 remaindernear 0.50 2.01 -> 0.50 +rmmx149 remaindernear 0.50 2.001 -> 0.500 + +-- some differences from remainder +rmnx150 remaindernear 0.4 1.020 -> 0.400 +rmnx151 remaindernear 0.50 1.020 -> 0.500 +rmnx152 remaindernear 0.51 1.020 -> 0.510 +rmnx153 remaindernear 0.52 1.020 -> -0.500 +rmnx154 remaindernear 0.6 1.020 -> -0.420 +rmnx155 remaindernear 0.49 1 -> 0.49 +rmnx156 remaindernear 0.50 1 -> 0.50 +rmnx157 remaindernear 1.50 1 -> -0.50 +rmnx158 remaindernear 2.50 1 -> 0.50 +rmnx159 remaindernear 9.50 1 -> -0.50 +rmnx160 remaindernear 0.51 1 -> -0.49 + +-- the nasty division-by-1 cases +rmnx161 remaindernear 0.4 1 -> 0.4 +rmnx162 remaindernear 0.45 1 -> 0.45 +rmnx163 remaindernear 0.455 1 -> 0.455 +rmnx164 remaindernear 0.4555 1 -> 0.4555 +rmnx165 remaindernear 0.45555 1 -> 0.45555 +rmnx166 remaindernear 0.455555 1 -> 0.455555 +rmnx167 remaindernear 0.4555555 1 -> 0.4555555 +rmnx168 remaindernear 0.45555555 1 -> 0.45555555 +rmnx169 remaindernear 0.455555555 1 -> 0.455555555 +-- with spill... +rmnx171 remaindernear 0.5 1 -> 0.5 +rmnx172 remaindernear 0.55 1 -> -0.45 +rmnx173 remaindernear 0.555 1 -> -0.445 +rmnx174 remaindernear 0.5555 1 -> -0.4445 +rmnx175 remaindernear 0.55555 1 -> -0.44445 +rmnx176 remaindernear 0.555555 1 -> -0.444445 +rmnx177 remaindernear 0.5555555 1 -> -0.4444445 +rmnx178 remaindernear 0.55555555 1 -> -0.44444445 +rmnx179 remaindernear 0.555555555 1 -> -0.444444445 + +-- progression +rmnx180 remaindernear 1 1 -> 0 +rmnx181 remaindernear 1 2 -> 1 +rmnx182 remaindernear 1 3 -> 1 +rmnx183 remaindernear 1 4 -> 1 +rmnx184 remaindernear 1 5 -> 1 +rmnx185 remaindernear 1 6 -> 1 +rmnx186 remaindernear 1 7 -> 1 +rmnx187 remaindernear 1 8 -> 1 +rmnx188 remaindernear 1 9 -> 1 +rmnx189 remaindernear 1 10 -> 1 +rmnx190 remaindernear 1 1 -> 0 +rmnx191 remaindernear 2 1 -> 0 +rmnx192 remaindernear 3 1 -> 0 +rmnx193 remaindernear 4 1 -> 0 +rmnx194 remaindernear 5 1 -> 0 +rmnx195 remaindernear 6 1 -> 0 +rmnx196 remaindernear 7 1 -> 0 +rmnx197 remaindernear 8 1 -> 0 +rmnx198 remaindernear 9 1 -> 0 +rmnx199 remaindernear 10 1 -> 0 + + +-- Various flavours of remaindernear by 0 +maxexponent: 999999999 +minexponent: -999999999 +rmnx201 remaindernear 0 0 -> NaN Division_undefined +rmnx202 remaindernear 0.0E5 0 -> NaN Division_undefined +rmnx203 remaindernear 0.000 0 -> NaN Division_undefined +rmnx204 remaindernear 0.0001 0 -> NaN Invalid_operation +rmnx205 remaindernear 0.01 0 -> NaN Invalid_operation +rmnx206 remaindernear 0.1 0 -> NaN Invalid_operation +rmnx207 remaindernear 1 0 -> NaN Invalid_operation +rmnx208 remaindernear 1 0.0 -> NaN Invalid_operation +rmnx209 remaindernear 10 0.0 -> NaN Invalid_operation +rmnx210 remaindernear 1E+100 0.0 -> NaN Invalid_operation +rmnx211 remaindernear 1E+1000 0 -> NaN Invalid_operation + +-- tests from the extended specification +rmnx221 remaindernear 2.1 3 -> -0.9 +rmnx222 remaindernear 10 6 -> -2 +rmnx223 remaindernear 10 3 -> 1 +rmnx224 remaindernear -10 3 -> -1 +rmnx225 remaindernear 10.2 1 -> 0.2 +rmnx226 remaindernear 10 0.3 -> 0.1 +rmnx227 remaindernear 3.6 1.3 -> -0.3 + +-- some differences from remainder +rmnx231 remaindernear 0.4 1.020 -> 0.400 +rmnx232 remaindernear 0.50 1.020 -> 0.500 +rmnx233 remaindernear 0.51 1.020 -> 0.510 +rmnx234 remaindernear 0.52 1.020 -> -0.500 +rmnx235 remaindernear 0.6 1.020 -> -0.420 + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +rmnx270 remaindernear 1 1e999999999 -> 1 +rmnx271 remaindernear 1 0.9e999999999 -> 1 +rmnx272 remaindernear 1 0.99e999999999 -> 1 +rmnx273 remaindernear 1 0.999999999e999999999 -> 1 +rmnx274 remaindernear 9e999999999 1 -> NaN Division_impossible +rmnx275 remaindernear 9.9e999999999 1 -> NaN Division_impossible +rmnx276 remaindernear 9.99e999999999 1 -> NaN Division_impossible +rmnx277 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible + +rmnx280 remaindernear 0.1 9e-999999999 -> NaN Division_impossible +rmnx281 remaindernear 0.1 99e-999999999 -> NaN Division_impossible +rmnx282 remaindernear 0.1 999e-999999999 -> NaN Division_impossible + +rmnx283 remaindernear 0.1 9e-999999998 -> NaN Division_impossible +rmnx284 remaindernear 0.1 99e-999999998 -> NaN Division_impossible +rmnx285 remaindernear 0.1 999e-999999998 -> NaN Division_impossible +rmnx286 remaindernear 0.1 999e-999999997 -> NaN Division_impossible +rmnx287 remaindernear 0.1 9999e-999999997 -> NaN Division_impossible +rmnx288 remaindernear 0.1 99999e-999999997 -> NaN Division_impossible + +-- rmnx3xx are from DiagBigDecimal +rmnx301 remaindernear 1 3 -> 1 +rmnx302 remaindernear 5 5 -> 0 +rmnx303 remaindernear 13 10 -> 3 +rmnx304 remaindernear 13 50 -> 13 +rmnx305 remaindernear 13 100 -> 13 +rmnx306 remaindernear 13 1000 -> 13 +rmnx307 remaindernear .13 1 -> 0.13 +rmnx308 remaindernear 0.133 1 -> 0.133 +rmnx309 remaindernear 0.1033 1 -> 0.1033 +rmnx310 remaindernear 1.033 1 -> 0.033 +rmnx311 remaindernear 10.33 1 -> 0.33 +rmnx312 remaindernear 10.33 10 -> 0.33 +rmnx313 remaindernear 103.3 1 -> 0.3 +rmnx314 remaindernear 133 10 -> 3 +rmnx315 remaindernear 1033 10 -> 3 +rmnx316 remaindernear 1033 50 -> -17 +rmnx317 remaindernear 101.0 3 -> -1.0 +rmnx318 remaindernear 102.0 3 -> 0.0 +rmnx319 remaindernear 103.0 3 -> 1.0 +rmnx320 remaindernear 2.40 1 -> 0.40 +rmnx321 remaindernear 2.400 1 -> 0.400 +rmnx322 remaindernear 2.4 1 -> 0.4 +rmnx323 remaindernear 2.4 2 -> 0.4 +rmnx324 remaindernear 2.400 2 -> 0.400 +rmnx325 remaindernear 1 0.3 -> 0.1 +rmnx326 remaindernear 1 0.30 -> 0.10 +rmnx327 remaindernear 1 0.300 -> 0.100 +rmnx328 remaindernear 1 0.3000 -> 0.1000 +rmnx329 remaindernear 1.0 0.3 -> 0.1 +rmnx330 remaindernear 1.00 0.3 -> 0.10 +rmnx331 remaindernear 1.000 0.3 -> 0.100 +rmnx332 remaindernear 1.0000 0.3 -> 0.1000 +rmnx333 remaindernear 0.5 2 -> 0.5 +rmnx334 remaindernear 0.5 2.1 -> 0.5 +rmnx335 remaindernear 0.5 2.01 -> 0.50 +rmnx336 remaindernear 0.5 2.001 -> 0.500 +rmnx337 remaindernear 0.50 2 -> 0.50 +rmnx338 remaindernear 0.50 2.01 -> 0.50 +rmnx339 remaindernear 0.50 2.001 -> 0.500 + +rmnx340 remaindernear 0.5 0.5000001 -> -1E-7 +rmnx341 remaindernear 0.5 0.50000001 -> -1E-8 +rmnx342 remaindernear 0.5 0.500000001 -> -1E-9 +rmnx343 remaindernear 0.5 0.5000000001 -> -1E-10 +rmnx344 remaindernear 0.5 0.50000000001 -> -1E-11 +rmnx345 remaindernear 0.5 0.4999999 -> 1E-7 +rmnx346 remaindernear 0.5 0.49999999 -> 1E-8 +rmnx347 remaindernear 0.5 0.499999999 -> 1E-9 +rmnx348 remaindernear 0.5 0.4999999999 -> 1E-10 +rmnx349 remaindernear 0.5 0.49999999999 -> 1E-11 + +rmnx350 remaindernear 0.03 7 -> 0.03 +rmnx351 remaindernear 5 2 -> 1 +rmnx352 remaindernear 4.1 2 -> 0.1 +rmnx353 remaindernear 4.01 2 -> 0.01 +rmnx354 remaindernear 4.001 2 -> 0.001 +rmnx355 remaindernear 4.0001 2 -> 0.0001 +rmnx356 remaindernear 4.00001 2 -> 0.00001 +rmnx357 remaindernear 4.000001 2 -> 0.000001 +rmnx358 remaindernear 4.0000001 2 -> 1E-7 + +rmnx360 remaindernear 1.2 0.7345 -> -0.2690 +rmnx361 remaindernear 0.8 12 -> 0.8 +rmnx362 remaindernear 0.8 0.2 -> 0.0 +rmnx363 remaindernear 0.8 0.3 -> -0.1 +rmnx364 remaindernear 0.800 12 -> 0.800 +rmnx365 remaindernear 0.800 1.7 -> 0.800 +rmnx366 remaindernear 2.400 2 -> 0.400 + +precision: 6 +rmnx371 remaindernear 2.400 2 -> 0.400 +precision: 3 +rmnx372 remaindernear 12345678900000 12e+12 -> 3.46E+11 Inexact Rounded + +precision: 5 +rmnx381 remaindernear 12345 1 -> 0 +rmnx382 remaindernear 12345 1.0001 -> -0.2344 +rmnx383 remaindernear 12345 1.001 -> -0.333 +rmnx384 remaindernear 12345 1.01 -> -0.23 +rmnx385 remaindernear 12345 1.1 -> -0.3 +rmnx386 remaindernear 12355 4 -> -1 +rmnx387 remaindernear 12345 4 -> 1 +rmnx388 remaindernear 12355 4.0001 -> -1.3089 +rmnx389 remaindernear 12345 4.0001 -> 0.6914 +rmnx390 remaindernear 12345 4.9 -> 1.9 +rmnx391 remaindernear 12345 4.99 -> -0.26 +rmnx392 remaindernear 12345 4.999 -> 2.469 +rmnx393 remaindernear 12345 4.9999 -> 0.2469 +rmnx394 remaindernear 12345 5 -> 0 +rmnx395 remaindernear 12345 5.0001 -> -0.2469 +rmnx396 remaindernear 12345 5.001 -> -2.469 +rmnx397 remaindernear 12345 5.01 -> 0.36 +rmnx398 remaindernear 12345 5.1 -> -2.1 + +precision: 9 +-- some nasty division-by-1 cases [some similar above] +rmnx401 remaindernear 0.4 1 -> 0.4 +rmnx402 remaindernear 0.45 1 -> 0.45 +rmnx403 remaindernear 0.455 1 -> 0.455 +rmnx404 remaindernear 0.4555 1 -> 0.4555 +rmnx405 remaindernear 0.45555 1 -> 0.45555 +rmnx406 remaindernear 0.455555 1 -> 0.455555 +rmnx407 remaindernear 0.4555555 1 -> 0.4555555 +rmnx408 remaindernear 0.45555555 1 -> 0.45555555 +rmnx409 remaindernear 0.455555555 1 -> 0.455555555 + +-- some tricky LHSs +rmnx420 remaindernear 99999999.999999999 1E+8 -> -1E-9 +rmnx421 remaindernear 999999999.999999999 1E+9 -> -1E-9 +precision: 9 +rmnx430 remaindernear 0.455555555 1 -> 0.455555555 +precision: 8 +rmnx431 remaindernear 0.455555555 1 -> 0.45555556 Inexact Rounded +precision: 7 +rmnx432 remaindernear 0.455555555 1 -> 0.4555556 Inexact Rounded +precision: 6 +rmnx433 remaindernear 0.455555555 1 -> 0.455556 Inexact Rounded +precision: 5 +rmnx434 remaindernear 0.455555555 1 -> 0.45556 Inexact Rounded +precision: 4 +rmnx435 remaindernear 0.455555555 1 -> 0.4556 Inexact Rounded +precision: 3 +rmnx436 remaindernear 0.455555555 1 -> 0.456 Inexact Rounded +precision: 2 +rmnx437 remaindernear 0.455555555 1 -> 0.46 Inexact Rounded +precision: 1 +rmnx438 remaindernear 0.455555555 1 -> 0.5 Inexact Rounded + +-- early tests; from text descriptions +precision: 9 +rmnx601 remaindernear 10 6 -> -2 +rmnx602 remaindernear -10 6 -> 2 +rmnx603 remaindernear 11 3 -> -1 +rmnx604 remaindernear 11 5 -> 1 +rmnx605 remaindernear 7.7 8 -> -0.3 +rmnx606 remaindernear 31.5 3 -> 1.5 -- i=10 +rmnx607 remaindernear 34.5 3 -> -1.5 -- i=11 + +-- Specials +rmnx680 remaindernear Inf -Inf -> NaN Invalid_operation +rmnx681 remaindernear Inf -1000 -> NaN Invalid_operation +rmnx682 remaindernear Inf -1 -> NaN Invalid_operation +rmnx683 remaindernear Inf 0 -> NaN Invalid_operation +rmnx684 remaindernear Inf -0 -> NaN Invalid_operation +rmnx685 remaindernear Inf 1 -> NaN Invalid_operation +rmnx686 remaindernear Inf 1000 -> NaN Invalid_operation +rmnx687 remaindernear Inf Inf -> NaN Invalid_operation +rmnx688 remaindernear -1000 Inf -> -1000 +rmnx689 remaindernear -Inf Inf -> NaN Invalid_operation +rmnx691 remaindernear -1 Inf -> -1 +rmnx692 remaindernear 0 Inf -> 0 +rmnx693 remaindernear -0 Inf -> -0 +rmnx694 remaindernear 1 Inf -> 1 +rmnx695 remaindernear 1000 Inf -> 1000 +rmnx696 remaindernear Inf Inf -> NaN Invalid_operation + +rmnx700 remaindernear -Inf -Inf -> NaN Invalid_operation +rmnx701 remaindernear -Inf -1000 -> NaN Invalid_operation +rmnx702 remaindernear -Inf -1 -> NaN Invalid_operation +rmnx703 remaindernear -Inf -0 -> NaN Invalid_operation +rmnx704 remaindernear -Inf 0 -> NaN Invalid_operation +rmnx705 remaindernear -Inf 1 -> NaN Invalid_operation +rmnx706 remaindernear -Inf 1000 -> NaN Invalid_operation +rmnx707 remaindernear -Inf Inf -> NaN Invalid_operation +rmnx708 remaindernear -Inf -Inf -> NaN Invalid_operation +rmnx709 remaindernear -1000 Inf -> -1000 +rmnx710 remaindernear -1 -Inf -> -1 +rmnx711 remaindernear -0 -Inf -> -0 +rmnx712 remaindernear 0 -Inf -> 0 +rmnx713 remaindernear 1 -Inf -> 1 +rmnx714 remaindernear 1000 -Inf -> 1000 +rmnx715 remaindernear Inf -Inf -> NaN Invalid_operation + +rmnx721 remaindernear NaN -Inf -> NaN +rmnx722 remaindernear NaN -1000 -> NaN +rmnx723 remaindernear NaN -1 -> NaN +rmnx724 remaindernear NaN -0 -> NaN +rmnx725 remaindernear NaN 0 -> NaN +rmnx726 remaindernear NaN 1 -> NaN +rmnx727 remaindernear NaN 1000 -> NaN +rmnx728 remaindernear NaN Inf -> NaN +rmnx729 remaindernear NaN NaN -> NaN +rmnx730 remaindernear -Inf NaN -> NaN +rmnx731 remaindernear -1000 NaN -> NaN +rmnx732 remaindernear -1 -NaN -> -NaN +rmnx733 remaindernear -0 NaN -> NaN +rmnx734 remaindernear 0 NaN -> NaN +rmnx735 remaindernear 1 NaN -> NaN +rmnx736 remaindernear 1000 NaN -> NaN +rmnx737 remaindernear Inf NaN -> NaN + +rmnx741 remaindernear sNaN -Inf -> NaN Invalid_operation +rmnx742 remaindernear sNaN -1000 -> NaN Invalid_operation +rmnx743 remaindernear -sNaN -1 -> -NaN Invalid_operation +rmnx744 remaindernear sNaN -0 -> NaN Invalid_operation +rmnx745 remaindernear sNaN 0 -> NaN Invalid_operation +rmnx746 remaindernear sNaN 1 -> NaN Invalid_operation +rmnx747 remaindernear sNaN 1000 -> NaN Invalid_operation +rmnx749 remaindernear sNaN NaN -> NaN Invalid_operation +rmnx750 remaindernear sNaN sNaN -> NaN Invalid_operation +rmnx751 remaindernear NaN sNaN -> NaN Invalid_operation +rmnx752 remaindernear -Inf sNaN -> NaN Invalid_operation +rmnx753 remaindernear -1000 sNaN -> NaN Invalid_operation +rmnx754 remaindernear -1 sNaN -> NaN Invalid_operation +rmnx755 remaindernear -0 -sNaN -> -NaN Invalid_operation +rmnx756 remaindernear 0 sNaN -> NaN Invalid_operation +rmnx757 remaindernear 1 sNaN -> NaN Invalid_operation +rmnx758 remaindernear 1000 sNaN -> NaN Invalid_operation +rmnx759 remaindernear Inf sNaN -> NaN Invalid_operation +rmnx760 remaindernear NaN sNaN -> NaN Invalid_operation + +-- propaging NaNs +rmnx761 remaindernear NaN1 NaN7 -> NaN1 +rmnx762 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation +rmnx763 remaindernear NaN3 -sNaN9 -> -NaN9 Invalid_operation +rmnx764 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation +rmnx765 remaindernear 15 NaN11 -> NaN11 +rmnx766 remaindernear NaN6 NaN12 -> NaN6 +rmnx767 remaindernear Inf -NaN13 -> -NaN13 +rmnx768 remaindernear NaN14 -Inf -> NaN14 +rmnx769 remaindernear 0 NaN15 -> NaN15 +rmnx770 remaindernear -NaN16 -0 -> -NaN16 + +-- test some cases that are close to exponent overflow +maxexponent: 999999999 +minexponent: -999999999 +rmnx780 remaindernear 1 1e999999999 -> 1 +rmnx781 remaindernear 1 0.9e999999999 -> 1 +rmnx782 remaindernear 1 0.99e999999999 -> 1 +rmnx783 remaindernear 1 0.999999999e999999999 -> 1 +rmnx784 remaindernear 9e999999999 1 -> NaN Division_impossible +rmnx785 remaindernear 9.9e999999999 1 -> NaN Division_impossible +rmnx786 remaindernear 9.99e999999999 1 -> NaN Division_impossible +rmnx787 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible + + +-- overflow and underflow tests [from divide] +precision: 9 +maxexponent: 999999999 +minexponent: -999999999 +rmnx790 remaindernear +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded +rmnx791 remaindernear 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible +rmnx792 remaindernear +0.100 9E+999999999 -> 0.100 +rmnx793 remaindernear 9E-999999999 +9.100 -> 9E-999999999 +rmnx795 remaindernear -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded +rmnx796 remaindernear 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible +rmnx797 remaindernear -0.100 9E+999999999 -> -0.100 +rmnx798 remaindernear 9E-999999999 -9.100 -> 9E-999999999 + +-- long operands checks +maxexponent: 999 +minexponent: -999 +precision: 9 +rmnx801 remaindernear 12345678000 100 -> 0 +rmnx802 remaindernear 1 12345678000 -> 1 +rmnx803 remaindernear 1234567800 10 -> 0 +rmnx804 remaindernear 1 1234567800 -> 1 +rmnx805 remaindernear 1234567890 10 -> 0 +rmnx806 remaindernear 1 1234567890 -> 1 +rmnx807 remaindernear 1234567891 10 -> 1 +rmnx808 remaindernear 1 1234567891 -> 1 +rmnx809 remaindernear 12345678901 100 -> 1 +rmnx810 remaindernear 1 12345678901 -> 1 +rmnx811 remaindernear 1234567896 10 -> -4 +rmnx812 remaindernear 1 1234567896 -> 1 + +precision: 15 +rmnx841 remaindernear 12345678000 100 -> 0 +rmnx842 remaindernear 1 12345678000 -> 1 +rmnx843 remaindernear 1234567800 10 -> 0 +rmnx844 remaindernear 1 1234567800 -> 1 +rmnx845 remaindernear 1234567890 10 -> 0 +rmnx846 remaindernear 1 1234567890 -> 1 +rmnx847 remaindernear 1234567891 10 -> 1 +rmnx848 remaindernear 1 1234567891 -> 1 +rmnx849 remaindernear 12345678901 100 -> 1 +rmnx850 remaindernear 1 12345678901 -> 1 +rmnx851 remaindernear 1234567896 10 -> -4 +rmnx852 remaindernear 1 1234567896 -> 1 + +-- Null tests +rmnx900 remaindernear 10 # -> NaN Invalid_operation +rmnx901 remaindernear # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal-c/new_dt/rescale.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/rescale.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,764 @@ +------------------------------------------------------------------------ +-- rescale.decTest -- decimal rescale operation -- +-- Copyright (c) IBM Corporation, 1981, 2005. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- [obsolete] Quantize.decTest has the improved version + +-- 2004.03.15 Underflow for quantize is suppressed + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +-- sanity checks + +resx001 rescale 0 0 -> 0 +resx002 rescale 1 0 -> 1 +resx003 rescale 0.1 +2 -> 0E+2 Inexact Rounded +resx005 rescale 0.1 +1 -> 0E+1 Inexact Rounded +resx006 rescale 0.1 0 -> 0 Inexact Rounded +resx007 rescale 0.1 -1 -> 0.1 +resx008 rescale 0.1 -2 -> 0.10 +resx009 rescale 0.1 -3 -> 0.100 +resx010 rescale 0.9 +2 -> 0E+2 Inexact Rounded +resx011 rescale 0.9 +1 -> 0E+1 Inexact Rounded +resx012 rescale 0.9 +0 -> 1 Inexact Rounded +resx013 rescale 0.9 -1 -> 0.9 +resx014 rescale 0.9 -2 -> 0.90 +resx015 rescale 0.9 -3 -> 0.900 +-- negatives +resx021 rescale -0 0 -> -0 +resx022 rescale -1 0 -> -1 +resx023 rescale -0.1 +2 -> -0E+2 Inexact Rounded +resx025 rescale -0.1 +1 -> -0E+1 Inexact Rounded +resx026 rescale -0.1 0 -> -0 Inexact Rounded +resx027 rescale -0.1 -1 -> -0.1 +resx028 rescale -0.1 -2 -> -0.10 +resx029 rescale -0.1 -3 -> -0.100 +resx030 rescale -0.9 +2 -> -0E+2 Inexact Rounded +resx031 rescale -0.9 +1 -> -0E+1 Inexact Rounded +resx032 rescale -0.9 +0 -> -1 Inexact Rounded +resx033 rescale -0.9 -1 -> -0.9 +resx034 rescale -0.9 -2 -> -0.90 +resx035 rescale -0.9 -3 -> -0.900 +resx036 rescale -0.5 +2 -> -0E+2 Inexact Rounded +resx037 rescale -0.5 +1 -> -0E+1 Inexact Rounded +resx038 rescale -0.5 +0 -> -1 Inexact Rounded +resx039 rescale -0.5 -1 -> -0.5 +resx040 rescale -0.5 -2 -> -0.50 +resx041 rescale -0.5 -3 -> -0.500 +resx042 rescale -0.9 +2 -> -0E+2 Inexact Rounded +resx043 rescale -0.9 +1 -> -0E+1 Inexact Rounded +resx044 rescale -0.9 +0 -> -1 Inexact Rounded +resx045 rescale -0.9 -1 -> -0.9 +resx046 rescale -0.9 -2 -> -0.90 +resx047 rescale -0.9 -3 -> -0.900 + +-- examples from Specification +resx060 rescale 2.17 -3 -> 2.170 +resx061 rescale 2.17 -2 -> 2.17 +resx062 rescale 2.17 -1 -> 2.2 Inexact Rounded +resx063 rescale 2.17 0 -> 2 Inexact Rounded +resx064 rescale 2.17 +1 -> 0E+1 Inexact Rounded +resx065 rescale 2 Inf -> NaN Invalid_operation +resx066 rescale -0.1 0 -> -0 Inexact Rounded +resx067 rescale -0 5 -> -0E+5 +resx068 rescale +35236450.6 -2 -> NaN Invalid_operation +resx069 rescale -35236450.6 -2 -> NaN Invalid_operation +resx070 rescale 217 -1 -> 217.0 +resx071 rescale 217 0 -> 217 +resx072 rescale 217 +1 -> 2.2E+2 Inexact Rounded +resx073 rescale 217 +2 -> 2E+2 Inexact Rounded + +-- general tests .. +resx089 rescale 12 +4 -> 0E+4 Inexact Rounded +resx090 rescale 12 +3 -> 0E+3 Inexact Rounded +resx091 rescale 12 +2 -> 0E+2 Inexact Rounded +resx092 rescale 12 +1 -> 1E+1 Inexact Rounded +resx093 rescale 1.2345 -2 -> 1.23 Inexact Rounded +resx094 rescale 1.2355 -2 -> 1.24 Inexact Rounded +resx095 rescale 1.2345 -6 -> 1.234500 +resx096 rescale 9.9999 -2 -> 10.00 Inexact Rounded +resx097 rescale 0.0001 -2 -> 0.00 Inexact Rounded +resx098 rescale 0.001 -2 -> 0.00 Inexact Rounded +resx099 rescale 0.009 -2 -> 0.01 Inexact Rounded +resx100 rescale 92 +2 -> 1E+2 Inexact Rounded + +resx101 rescale -1 0 -> -1 +resx102 rescale -1 -1 -> -1.0 +resx103 rescale -1 -2 -> -1.00 +resx104 rescale 0 0 -> 0 +resx105 rescale 0 -1 -> 0.0 +resx106 rescale 0 -2 -> 0.00 +resx107 rescale 0.00 0 -> 0 +resx108 rescale 0 +1 -> 0E+1 +resx109 rescale 0 +2 -> 0E+2 +resx110 rescale +1 0 -> 1 +resx111 rescale +1 -1 -> 1.0 +resx112 rescale +1 -2 -> 1.00 + +resx120 rescale 1.04 -3 -> 1.040 +resx121 rescale 1.04 -2 -> 1.04 +resx122 rescale 1.04 -1 -> 1.0 Inexact Rounded +resx123 rescale 1.04 0 -> 1 Inexact Rounded +resx124 rescale 1.05 -3 -> 1.050 +resx125 rescale 1.05 -2 -> 1.05 +resx126 rescale 1.05 -1 -> 1.1 Inexact Rounded +resx127 rescale 1.05 0 -> 1 Inexact Rounded +resx128 rescale 1.05 -3 -> 1.050 +resx129 rescale 1.05 -2 -> 1.05 +resx130 rescale 1.05 -1 -> 1.1 Inexact Rounded +resx131 rescale 1.05 0 -> 1 Inexact Rounded +resx132 rescale 1.06 -3 -> 1.060 +resx133 rescale 1.06 -2 -> 1.06 +resx134 rescale 1.06 -1 -> 1.1 Inexact Rounded +resx135 rescale 1.06 0 -> 1 Inexact Rounded + +resx140 rescale -10 -2 -> -10.00 +resx141 rescale +1 -2 -> 1.00 +resx142 rescale +10 -2 -> 10.00 +resx143 rescale 1E+10 -2 -> NaN Invalid_operation +resx144 rescale 1E-10 -2 -> 0.00 Inexact Rounded +resx145 rescale 1E-3 -2 -> 0.00 Inexact Rounded +resx146 rescale 1E-2 -2 -> 0.01 +resx147 rescale 1E-1 -2 -> 0.10 +resx148 rescale 0E-10 -2 -> 0.00 + +resx150 rescale 1.0600 -5 -> 1.06000 +resx151 rescale 1.0600 -4 -> 1.0600 +resx152 rescale 1.0600 -3 -> 1.060 Rounded +resx153 rescale 1.0600 -2 -> 1.06 Rounded +resx154 rescale 1.0600 -1 -> 1.1 Inexact Rounded +resx155 rescale 1.0600 0 -> 1 Inexact Rounded + +-- +ve exponents .. +resx201 rescale -1 +0 -> -1 +resx202 rescale -1 +1 -> -0E+1 Inexact Rounded +resx203 rescale -1 +2 -> -0E+2 Inexact Rounded +resx204 rescale 0 +0 -> 0 +resx205 rescale 0 +1 -> 0E+1 +resx206 rescale 0 +2 -> 0E+2 +resx207 rescale +1 +0 -> 1 +resx208 rescale +1 +1 -> 0E+1 Inexact Rounded +resx209 rescale +1 +2 -> 0E+2 Inexact Rounded + +resx220 rescale 1.04 +3 -> 0E+3 Inexact Rounded +resx221 rescale 1.04 +2 -> 0E+2 Inexact Rounded +resx222 rescale 1.04 +1 -> 0E+1 Inexact Rounded +resx223 rescale 1.04 +0 -> 1 Inexact Rounded +resx224 rescale 1.05 +3 -> 0E+3 Inexact Rounded +resx225 rescale 1.05 +2 -> 0E+2 Inexact Rounded +resx226 rescale 1.05 +1 -> 0E+1 Inexact Rounded +resx227 rescale 1.05 +0 -> 1 Inexact Rounded +resx228 rescale 1.05 +3 -> 0E+3 Inexact Rounded +resx229 rescale 1.05 +2 -> 0E+2 Inexact Rounded +resx230 rescale 1.05 +1 -> 0E+1 Inexact Rounded +resx231 rescale 1.05 +0 -> 1 Inexact Rounded +resx232 rescale 1.06 +3 -> 0E+3 Inexact Rounded +resx233 rescale 1.06 +2 -> 0E+2 Inexact Rounded +resx234 rescale 1.06 +1 -> 0E+1 Inexact Rounded +resx235 rescale 1.06 +0 -> 1 Inexact Rounded + +resx240 rescale -10 +1 -> -1E+1 Rounded +resx241 rescale +1 +1 -> 0E+1 Inexact Rounded +resx242 rescale +10 +1 -> 1E+1 Rounded +resx243 rescale 1E+1 +1 -> 1E+1 -- underneath this is E+1 +resx244 rescale 1E+2 +1 -> 1.0E+2 -- underneath this is E+1 +resx245 rescale 1E+3 +1 -> 1.00E+3 -- underneath this is E+1 +resx246 rescale 1E+4 +1 -> 1.000E+4 -- underneath this is E+1 +resx247 rescale 1E+5 +1 -> 1.0000E+5 -- underneath this is E+1 +resx248 rescale 1E+6 +1 -> 1.00000E+6 -- underneath this is E+1 +resx249 rescale 1E+7 +1 -> 1.000000E+7 -- underneath this is E+1 +resx250 rescale 1E+8 +1 -> 1.0000000E+8 -- underneath this is E+1 +resx251 rescale 1E+9 +1 -> 1.00000000E+9 -- underneath this is E+1 +-- next one tries to add 9 zeros +resx252 rescale 1E+10 +1 -> NaN Invalid_operation +resx253 rescale 1E-10 +1 -> 0E+1 Inexact Rounded +resx254 rescale 1E-2 +1 -> 0E+1 Inexact Rounded +resx255 rescale 0E-10 +1 -> 0E+1 +resx256 rescale -0E-10 +1 -> -0E+1 +resx257 rescale -0E-1 +1 -> -0E+1 +resx258 rescale -0 +1 -> -0E+1 +resx259 rescale -0E+1 +1 -> -0E+1 + +resx260 rescale -10 +2 -> -0E+2 Inexact Rounded +resx261 rescale +1 +2 -> 0E+2 Inexact Rounded +resx262 rescale +10 +2 -> 0E+2 Inexact Rounded +resx263 rescale 1E+1 +2 -> 0E+2 Inexact Rounded +resx264 rescale 1E+2 +2 -> 1E+2 +resx265 rescale 1E+3 +2 -> 1.0E+3 +resx266 rescale 1E+4 +2 -> 1.00E+4 +resx267 rescale 1E+5 +2 -> 1.000E+5 +resx268 rescale 1E+6 +2 -> 1.0000E+6 +resx269 rescale 1E+7 +2 -> 1.00000E+7 +resx270 rescale 1E+8 +2 -> 1.000000E+8 +resx271 rescale 1E+9 +2 -> 1.0000000E+9 +resx272 rescale 1E+10 +2 -> 1.00000000E+10 +resx273 rescale 1E-10 +2 -> 0E+2 Inexact Rounded +resx274 rescale 1E-2 +2 -> 0E+2 Inexact Rounded +resx275 rescale 0E-10 +2 -> 0E+2 + +resx280 rescale -10 +3 -> -0E+3 Inexact Rounded +resx281 rescale +1 +3 -> 0E+3 Inexact Rounded +resx282 rescale +10 +3 -> 0E+3 Inexact Rounded +resx283 rescale 1E+1 +3 -> 0E+3 Inexact Rounded +resx284 rescale 1E+2 +3 -> 0E+3 Inexact Rounded +resx285 rescale 1E+3 +3 -> 1E+3 +resx286 rescale 1E+4 +3 -> 1.0E+4 +resx287 rescale 1E+5 +3 -> 1.00E+5 +resx288 rescale 1E+6 +3 -> 1.000E+6 +resx289 rescale 1E+7 +3 -> 1.0000E+7 +resx290 rescale 1E+8 +3 -> 1.00000E+8 +resx291 rescale 1E+9 +3 -> 1.000000E+9 +resx292 rescale 1E+10 +3 -> 1.0000000E+10 +resx293 rescale 1E-10 +3 -> 0E+3 Inexact Rounded +resx294 rescale 1E-2 +3 -> 0E+3 Inexact Rounded +resx295 rescale 0E-10 +3 -> 0E+3 + +-- round up from below [sign wrong in JIT compiler once] +resx300 rescale 0.0078 -5 -> 0.00780 +resx301 rescale 0.0078 -4 -> 0.0078 +resx302 rescale 0.0078 -3 -> 0.008 Inexact Rounded +resx303 rescale 0.0078 -2 -> 0.01 Inexact Rounded +resx304 rescale 0.0078 -1 -> 0.0 Inexact Rounded +resx305 rescale 0.0078 0 -> 0 Inexact Rounded +resx306 rescale 0.0078 +1 -> 0E+1 Inexact Rounded +resx307 rescale 0.0078 +2 -> 0E+2 Inexact Rounded + +resx310 rescale -0.0078 -5 -> -0.00780 +resx311 rescale -0.0078 -4 -> -0.0078 +resx312 rescale -0.0078 -3 -> -0.008 Inexact Rounded +resx313 rescale -0.0078 -2 -> -0.01 Inexact Rounded +resx314 rescale -0.0078 -1 -> -0.0 Inexact Rounded +resx315 rescale -0.0078 0 -> -0 Inexact Rounded +resx316 rescale -0.0078 +1 -> -0E+1 Inexact Rounded +resx317 rescale -0.0078 +2 -> -0E+2 Inexact Rounded + +resx320 rescale 0.078 -5 -> 0.07800 +resx321 rescale 0.078 -4 -> 0.0780 +resx322 rescale 0.078 -3 -> 0.078 +resx323 rescale 0.078 -2 -> 0.08 Inexact Rounded +resx324 rescale 0.078 -1 -> 0.1 Inexact Rounded +resx325 rescale 0.078 0 -> 0 Inexact Rounded +resx326 rescale 0.078 +1 -> 0E+1 Inexact Rounded +resx327 rescale 0.078 +2 -> 0E+2 Inexact Rounded + +resx330 rescale -0.078 -5 -> -0.07800 +resx331 rescale -0.078 -4 -> -0.0780 +resx332 rescale -0.078 -3 -> -0.078 +resx333 rescale -0.078 -2 -> -0.08 Inexact Rounded +resx334 rescale -0.078 -1 -> -0.1 Inexact Rounded +resx335 rescale -0.078 0 -> -0 Inexact Rounded +resx336 rescale -0.078 +1 -> -0E+1 Inexact Rounded +resx337 rescale -0.078 +2 -> -0E+2 Inexact Rounded + +resx340 rescale 0.78 -5 -> 0.78000 +resx341 rescale 0.78 -4 -> 0.7800 +resx342 rescale 0.78 -3 -> 0.780 +resx343 rescale 0.78 -2 -> 0.78 +resx344 rescale 0.78 -1 -> 0.8 Inexact Rounded +resx345 rescale 0.78 0 -> 1 Inexact Rounded +resx346 rescale 0.78 +1 -> 0E+1 Inexact Rounded +resx347 rescale 0.78 +2 -> 0E+2 Inexact Rounded + +resx350 rescale -0.78 -5 -> -0.78000 +resx351 rescale -0.78 -4 -> -0.7800 +resx352 rescale -0.78 -3 -> -0.780 +resx353 rescale -0.78 -2 -> -0.78 +resx354 rescale -0.78 -1 -> -0.8 Inexact Rounded +resx355 rescale -0.78 0 -> -1 Inexact Rounded +resx356 rescale -0.78 +1 -> -0E+1 Inexact Rounded +resx357 rescale -0.78 +2 -> -0E+2 Inexact Rounded + +resx360 rescale 7.8 -5 -> 7.80000 +resx361 rescale 7.8 -4 -> 7.8000 +resx362 rescale 7.8 -3 -> 7.800 +resx363 rescale 7.8 -2 -> 7.80 +resx364 rescale 7.8 -1 -> 7.8 +resx365 rescale 7.8 0 -> 8 Inexact Rounded +resx366 rescale 7.8 +1 -> 1E+1 Inexact Rounded +resx367 rescale 7.8 +2 -> 0E+2 Inexact Rounded +resx368 rescale 7.8 +3 -> 0E+3 Inexact Rounded + +resx370 rescale -7.8 -5 -> -7.80000 +resx371 rescale -7.8 -4 -> -7.8000 +resx372 rescale -7.8 -3 -> -7.800 +resx373 rescale -7.8 -2 -> -7.80 +resx374 rescale -7.8 -1 -> -7.8 +resx375 rescale -7.8 0 -> -8 Inexact Rounded +resx376 rescale -7.8 +1 -> -1E+1 Inexact Rounded +resx377 rescale -7.8 +2 -> -0E+2 Inexact Rounded +resx378 rescale -7.8 +3 -> -0E+3 Inexact Rounded + +-- some individuals +precision: 9 +resx380 rescale 352364.506 -2 -> 352364.51 Inexact Rounded +resx381 rescale 3523645.06 -2 -> 3523645.06 +resx382 rescale 35236450.6 -2 -> NaN Invalid_operation +resx383 rescale 352364506 -2 -> NaN Invalid_operation +resx384 rescale -352364.506 -2 -> -352364.51 Inexact Rounded +resx385 rescale -3523645.06 -2 -> -3523645.06 +resx386 rescale -35236450.6 -2 -> NaN Invalid_operation +resx387 rescale -352364506 -2 -> NaN Invalid_operation + +rounding: down +resx389 rescale 35236450.6 -2 -> NaN Invalid_operation +-- ? should that one instead have been: +-- resx389 rescale 35236450.6 -2 -> NaN Invalid_operation +rounding: half_up + +-- and a few more from e-mail discussions +precision: 7 +resx391 rescale 12.34567 -3 -> 12.346 Inexact Rounded +resx392 rescale 123.4567 -3 -> 123.457 Inexact Rounded +resx393 rescale 1234.567 -3 -> 1234.567 +resx394 rescale 12345.67 -3 -> NaN Invalid_operation +resx395 rescale 123456.7 -3 -> NaN Invalid_operation +resx396 rescale 1234567. -3 -> NaN Invalid_operation + +-- some 9999 round-up cases +precision: 9 +resx400 rescale 9.999 -5 -> 9.99900 +resx401 rescale 9.999 -4 -> 9.9990 +resx402 rescale 9.999 -3 -> 9.999 +resx403 rescale 9.999 -2 -> 10.00 Inexact Rounded +resx404 rescale 9.999 -1 -> 10.0 Inexact Rounded +resx405 rescale 9.999 0 -> 10 Inexact Rounded +resx406 rescale 9.999 1 -> 1E+1 Inexact Rounded +resx407 rescale 9.999 2 -> 0E+2 Inexact Rounded + +resx410 rescale 0.999 -5 -> 0.99900 +resx411 rescale 0.999 -4 -> 0.9990 +resx412 rescale 0.999 -3 -> 0.999 +resx413 rescale 0.999 -2 -> 1.00 Inexact Rounded +resx414 rescale 0.999 -1 -> 1.0 Inexact Rounded +resx415 rescale 0.999 0 -> 1 Inexact Rounded +resx416 rescale 0.999 1 -> 0E+1 Inexact Rounded + +resx420 rescale 0.0999 -5 -> 0.09990 +resx421 rescale 0.0999 -4 -> 0.0999 +resx422 rescale 0.0999 -3 -> 0.100 Inexact Rounded +resx423 rescale 0.0999 -2 -> 0.10 Inexact Rounded +resx424 rescale 0.0999 -1 -> 0.1 Inexact Rounded +resx425 rescale 0.0999 0 -> 0 Inexact Rounded +resx426 rescale 0.0999 1 -> 0E+1 Inexact Rounded + +resx430 rescale 0.00999 -5 -> 0.00999 +resx431 rescale 0.00999 -4 -> 0.0100 Inexact Rounded +resx432 rescale 0.00999 -3 -> 0.010 Inexact Rounded +resx433 rescale 0.00999 -2 -> 0.01 Inexact Rounded +resx434 rescale 0.00999 -1 -> 0.0 Inexact Rounded +resx435 rescale 0.00999 0 -> 0 Inexact Rounded +resx436 rescale 0.00999 1 -> 0E+1 Inexact Rounded + +resx440 rescale 0.000999 -5 -> 0.00100 Inexact Rounded +resx441 rescale 0.000999 -4 -> 0.0010 Inexact Rounded +resx442 rescale 0.000999 -3 -> 0.001 Inexact Rounded +resx443 rescale 0.000999 -2 -> 0.00 Inexact Rounded +resx444 rescale 0.000999 -1 -> 0.0 Inexact Rounded +resx445 rescale 0.000999 0 -> 0 Inexact Rounded +resx446 rescale 0.000999 1 -> 0E+1 Inexact Rounded + +precision: 8 +resx449 rescale 9.999E-15 -23 -> NaN Invalid_operation +resx450 rescale 9.999E-15 -22 -> 9.9990000E-15 +resx451 rescale 9.999E-15 -21 -> 9.999000E-15 +resx452 rescale 9.999E-15 -20 -> 9.99900E-15 +resx453 rescale 9.999E-15 -19 -> 9.9990E-15 +resx454 rescale 9.999E-15 -18 -> 9.999E-15 +resx455 rescale 9.999E-15 -17 -> 1.000E-14 Inexact Rounded +resx456 rescale 9.999E-15 -16 -> 1.00E-14 Inexact Rounded +resx457 rescale 9.999E-15 -15 -> 1.0E-14 Inexact Rounded +resx458 rescale 9.999E-15 -14 -> 1E-14 Inexact Rounded +resx459 rescale 9.999E-15 -13 -> 0E-13 Inexact Rounded +resx460 rescale 9.999E-15 -12 -> 0E-12 Inexact Rounded +resx461 rescale 9.999E-15 -11 -> 0E-11 Inexact Rounded +resx462 rescale 9.999E-15 -10 -> 0E-10 Inexact Rounded +resx463 rescale 9.999E-15 -9 -> 0E-9 Inexact Rounded +resx464 rescale 9.999E-15 -8 -> 0E-8 Inexact Rounded +resx465 rescale 9.999E-15 -7 -> 0E-7 Inexact Rounded +resx466 rescale 9.999E-15 -6 -> 0.000000 Inexact Rounded +resx467 rescale 9.999E-15 -5 -> 0.00000 Inexact Rounded +resx468 rescale 9.999E-15 -4 -> 0.0000 Inexact Rounded +resx469 rescale 9.999E-15 -3 -> 0.000 Inexact Rounded +resx470 rescale 9.999E-15 -2 -> 0.00 Inexact Rounded +resx471 rescale 9.999E-15 -1 -> 0.0 Inexact Rounded +resx472 rescale 9.999E-15 0 -> 0 Inexact Rounded +resx473 rescale 9.999E-15 1 -> 0E+1 Inexact Rounded + +-- [additional tests for "don't fit" edge cases are in +-- quantize.decTest. Here's a critical one.] +precision: 3 +resx480 rescale 0.9999 -3 -> NaN Invalid_operation + + +-- long operand checks [rhs checks removed] +maxexponent: 999 +minexponent: -999 +precision: 9 +resx481 rescale 12345678000 +3 -> 1.2345678E+10 Rounded +resx482 rescale 1234567800 +1 -> 1.23456780E+9 Rounded +resx483 rescale 1234567890 +1 -> 1.23456789E+9 Rounded +resx484 rescale 1234567891 +1 -> 1.23456789E+9 Inexact Rounded +resx485 rescale 12345678901 +2 -> 1.23456789E+10 Inexact Rounded +resx486 rescale 1234567896 +1 -> 1.23456790E+9 Inexact Rounded +-- a potential double-round +resx487 rescale 1234.987643 -4 -> 1234.9876 Inexact Rounded +resx488 rescale 1234.987647 -4 -> 1234.9876 Inexact Rounded + +precision: 15 +resx491 rescale 12345678000 +3 -> 1.2345678E+10 Rounded +resx492 rescale 1234567800 +1 -> 1.23456780E+9 Rounded +resx493 rescale 1234567890 +1 -> 1.23456789E+9 Rounded +resx494 rescale 1234567891 +1 -> 1.23456789E+9 Inexact Rounded +resx495 rescale 12345678901 +2 -> 1.23456789E+10 Inexact Rounded +resx496 rescale 1234567896 +1 -> 1.23456790E+9 Inexact Rounded +resx497 rescale 1234.987643 -4 -> 1234.9876 Inexact Rounded +resx498 rescale 1234.987647 -4 -> 1234.9876 Inexact Rounded + +-- Zeros +resx500 rescale 0 1 -> 0E+1 +resx501 rescale 0 0 -> 0 +resx502 rescale 0 -1 -> 0.0 +resx503 rescale 0.0 -1 -> 0.0 +resx504 rescale 0.0 0 -> 0 +resx505 rescale 0.0 +1 -> 0E+1 +resx506 rescale 0E+1 -1 -> 0.0 +resx507 rescale 0E+1 0 -> 0 +resx508 rescale 0E+1 +1 -> 0E+1 +resx509 rescale -0 1 -> -0E+1 +resx510 rescale -0 0 -> -0 +resx511 rescale -0 -1 -> -0.0 +resx512 rescale -0.0 -1 -> -0.0 +resx513 rescale -0.0 0 -> -0 +resx514 rescale -0.0 +1 -> -0E+1 +resx515 rescale -0E+1 -1 -> -0.0 +resx516 rescale -0E+1 0 -> -0 +resx517 rescale -0E+1 +1 -> -0E+1 + +-- Suspicious RHS values +maxexponent: 999999999 +minexponent: -999999999 +precision: 15 +resx520 rescale 1.234 999999E+3 -> 0E+999999000 Inexact Rounded +resx521 rescale 123.456 999999E+3 -> 0E+999999000 Inexact Rounded +resx522 rescale 1.234 999999999 -> 0E+999999999 Inexact Rounded +resx523 rescale 123.456 999999999 -> 0E+999999999 Inexact Rounded +resx524 rescale 123.456 1000000000 -> NaN Invalid_operation +resx525 rescale 123.456 12345678903 -> NaN Invalid_operation +-- next four are "won't fit" overflows +resx526 rescale 1.234 -999999E+3 -> NaN Invalid_operation +resx527 rescale 123.456 -999999E+3 -> NaN Invalid_operation +resx528 rescale 1.234 -999999999 -> NaN Invalid_operation +resx529 rescale 123.456 -999999999 -> NaN Invalid_operation +resx530 rescale 123.456 -1000000014 -> NaN Invalid_operation +resx531 rescale 123.456 -12345678903 -> NaN Invalid_operation + +maxexponent: 999 +minexponent: -999 +precision: 15 +resx532 rescale 1.234E+999 999 -> 1E+999 Inexact Rounded +resx533 rescale 1.234E+998 999 -> 0E+999 Inexact Rounded +resx534 rescale 1.234 999 -> 0E+999 Inexact Rounded +resx535 rescale 1.234 1000 -> NaN Invalid_operation +resx536 rescale 1.234 5000 -> NaN Invalid_operation +resx537 rescale 0 -999 -> 0E-999 +-- next two are "won't fit" overflows +resx538 rescale 1.234 -999 -> NaN Invalid_operation +resx539 rescale 1.234 -1000 -> NaN Invalid_operation +resx540 rescale 1.234 -5000 -> NaN Invalid_operation +-- [more below] + +-- check bounds (lhs maybe out of range for destination, etc.) +precision: 7 +resx541 rescale 1E+999 +999 -> 1E+999 +resx542 rescale 1E+1000 +999 -> NaN Invalid_operation +resx543 rescale 1E+999 +1000 -> NaN Invalid_operation +resx544 rescale 1E-999 -999 -> 1E-999 +resx545 rescale 1E-1000 -999 -> 0E-999 Inexact Rounded +resx546 rescale 1E-999 -1000 -> 1.0E-999 +resx547 rescale 1E-1005 -999 -> 0E-999 Inexact Rounded +resx548 rescale 1E-1006 -999 -> 0E-999 Inexact Rounded +resx549 rescale 1E-1007 -999 -> 0E-999 Inexact Rounded +resx550 rescale 1E-998 -1005 -> NaN Invalid_operation -- won't fit +resx551 rescale 1E-999 -1005 -> 1.000000E-999 +resx552 rescale 1E-1000 -1005 -> 1.00000E-1000 Subnormal +resx553 rescale 1E-999 -1006 -> NaN Invalid_operation +resx554 rescale 1E-999 -1007 -> NaN Invalid_operation +-- related subnormal rounding +resx555 rescale 1.666666E-999 -1005 -> 1.666666E-999 +resx556 rescale 1.666666E-1000 -1005 -> 1.66667E-1000 Subnormal Inexact Rounded +resx557 rescale 1.666666E-1001 -1005 -> 1.6667E-1001 Subnormal Inexact Rounded +resx558 rescale 1.666666E-1002 -1005 -> 1.667E-1002 Subnormal Inexact Rounded +resx559 rescale 1.666666E-1003 -1005 -> 1.67E-1003 Subnormal Inexact Rounded +resx560 rescale 1.666666E-1004 -1005 -> 1.7E-1004 Subnormal Inexact Rounded +resx561 rescale 1.666666E-1005 -1005 -> 2E-1005 Subnormal Inexact Rounded +resx562 rescale 1.666666E-1006 -1005 -> 0E-1005 Inexact Rounded +resx563 rescale 1.666666E-1007 -1005 -> 0E-1005 Inexact Rounded + +-- fractional RHS, some good and some bad +precision: 9 +resx564 rescale 222 +2.0 -> 2E+2 Inexact Rounded +resx565 rescale 222 +2.00000000 -> 2E+2 Inexact Rounded +resx566 rescale 222 +2.00100000000 -> NaN Invalid_operation +resx567 rescale 222 +2.000001 -> NaN Invalid_operation +resx568 rescale 222 +2.000000001 -> NaN Invalid_operation +resx569 rescale 222 +2.0000000001 -> NaN Invalid_operation +resx570 rescale 222 +2.00000000001 -> NaN Invalid_operation +resx571 rescale 222 +2.99999999999 -> NaN Invalid_operation +resx572 rescale 222 -2.00000000 -> 222.00 +resx573 rescale 222 -2.00100000000 -> NaN Invalid_operation +resx574 rescale 222 -2.0000001000 -> NaN Invalid_operation +resx575 rescale 222 -2.00000000001 -> NaN Invalid_operation +resx576 rescale 222 -2.99999999999 -> NaN Invalid_operation + +-- Specials +resx580 rescale Inf -Inf -> Infinity +resx581 rescale Inf -1000 -> NaN Invalid_operation +resx582 rescale Inf -1 -> NaN Invalid_operation +resx583 rescale Inf 0 -> NaN Invalid_operation +resx584 rescale Inf 1 -> NaN Invalid_operation +resx585 rescale Inf 1000 -> NaN Invalid_operation +resx586 rescale Inf Inf -> Infinity +resx587 rescale -1000 Inf -> NaN Invalid_operation +resx588 rescale -Inf Inf -> -Infinity +resx589 rescale -1 Inf -> NaN Invalid_operation +resx590 rescale 0 Inf -> NaN Invalid_operation +resx591 rescale 1 Inf -> NaN Invalid_operation +resx592 rescale 1000 Inf -> NaN Invalid_operation +resx593 rescale Inf Inf -> Infinity +resx594 rescale Inf -0 -> NaN Invalid_operation +resx595 rescale -0 Inf -> NaN Invalid_operation + +resx600 rescale -Inf -Inf -> -Infinity +resx601 rescale -Inf -1000 -> NaN Invalid_operation +resx602 rescale -Inf -1 -> NaN Invalid_operation +resx603 rescale -Inf 0 -> NaN Invalid_operation +resx604 rescale -Inf 1 -> NaN Invalid_operation +resx605 rescale -Inf 1000 -> NaN Invalid_operation +resx606 rescale -Inf Inf -> -Infinity +resx607 rescale -1000 Inf -> NaN Invalid_operation +resx608 rescale -Inf -Inf -> -Infinity +resx609 rescale -1 -Inf -> NaN Invalid_operation +resx610 rescale 0 -Inf -> NaN Invalid_operation +resx611 rescale 1 -Inf -> NaN Invalid_operation +resx612 rescale 1000 -Inf -> NaN Invalid_operation +resx613 rescale Inf -Inf -> Infinity +resx614 rescale -Inf -0 -> NaN Invalid_operation +resx615 rescale -0 -Inf -> NaN Invalid_operation + +resx621 rescale NaN -Inf -> NaN +resx622 rescale NaN -1000 -> NaN +resx623 rescale NaN -1 -> NaN +resx624 rescale NaN 0 -> NaN +resx625 rescale NaN 1 -> NaN +resx626 rescale NaN 1000 -> NaN +resx627 rescale NaN Inf -> NaN +resx628 rescale NaN NaN -> NaN +resx629 rescale -Inf NaN -> NaN +resx630 rescale -1000 NaN -> NaN +resx631 rescale -1 NaN -> NaN +resx632 rescale 0 NaN -> NaN +resx633 rescale 1 -NaN -> -NaN +resx634 rescale 1000 NaN -> NaN +resx635 rescale Inf NaN -> NaN +resx636 rescale NaN -0 -> NaN +resx637 rescale -0 NaN -> NaN + +resx641 rescale sNaN -Inf -> NaN Invalid_operation +resx642 rescale sNaN -1000 -> NaN Invalid_operation +resx643 rescale sNaN -1 -> NaN Invalid_operation +resx644 rescale sNaN 0 -> NaN Invalid_operation +resx645 rescale sNaN 1 -> NaN Invalid_operation +resx646 rescale sNaN 1000 -> NaN Invalid_operation +resx647 rescale -sNaN NaN -> -NaN Invalid_operation +resx648 rescale sNaN -sNaN -> NaN Invalid_operation +resx649 rescale NaN sNaN -> NaN Invalid_operation +resx650 rescale -Inf sNaN -> NaN Invalid_operation +resx651 rescale -1000 sNaN -> NaN Invalid_operation +resx652 rescale -1 sNaN -> NaN Invalid_operation +resx653 rescale 0 sNaN -> NaN Invalid_operation +resx654 rescale 1 -sNaN -> -NaN Invalid_operation +resx655 rescale 1000 sNaN -> NaN Invalid_operation +resx656 rescale Inf sNaN -> NaN Invalid_operation +resx657 rescale NaN sNaN -> NaN Invalid_operation +resx658 rescale sNaN -0 -> NaN Invalid_operation +resx659 rescale -0 sNaN -> NaN Invalid_operation + +-- propagating NaNs +resx661 rescale NaN9 -Inf -> NaN9 +resx662 rescale NaN81 919 -> NaN81 +resx663 rescale NaN72 Inf -> NaN72 +resx664 rescale -NaN66 NaN5 -> -NaN66 +resx665 rescale -Inf NaN4 -> NaN4 +resx666 rescale -919 NaN32 -> NaN32 +resx667 rescale Inf NaN2 -> NaN2 + +resx671 rescale sNaN99 -Inf -> NaN99 Invalid_operation +resx672 rescale -sNaN98 -11 -> -NaN98 Invalid_operation +resx673 rescale sNaN97 NaN -> NaN97 Invalid_operation +resx674 rescale sNaN16 sNaN94 -> NaN16 Invalid_operation +resx675 rescale NaN95 sNaN93 -> NaN93 Invalid_operation +resx676 rescale -Inf sNaN92 -> NaN92 Invalid_operation +resx677 rescale 088 -sNaN91 -> -NaN91 Invalid_operation +resx678 rescale Inf -sNaN90 -> -NaN90 Invalid_operation +resx679 rescale NaN sNaN87 -> NaN87 Invalid_operation + +-- subnormals and underflow +precision: 4 +maxexponent: 999 +minexponent: -999 +resx710 rescale 1.00E-999 -999 -> 1E-999 Rounded +resx711 rescale 0.1E-999 -1000 -> 1E-1000 Subnormal +resx712 rescale 0.10E-999 -1000 -> 1E-1000 Subnormal Rounded +resx713 rescale 0.100E-999 -1000 -> 1E-1000 Subnormal Rounded +resx714 rescale 0.01E-999 -1001 -> 1E-1001 Subnormal +-- next is rounded to Emin +resx715 rescale 0.999E-999 -999 -> 1E-999 Inexact Rounded +resx716 rescale 0.099E-999 -1000 -> 1E-1000 Inexact Rounded Subnormal + +resx717 rescale 0.009E-999 -1001 -> 1E-1001 Inexact Rounded Subnormal +resx718 rescale 0.001E-999 -1001 -> 0E-1001 Inexact Rounded +resx719 rescale 0.0009E-999 -1001 -> 0E-1001 Inexact Rounded +resx720 rescale 0.0001E-999 -1001 -> 0E-1001 Inexact Rounded + +resx730 rescale -1.00E-999 -999 -> -1E-999 Rounded +resx731 rescale -0.1E-999 -999 -> -0E-999 Rounded Inexact +resx732 rescale -0.10E-999 -999 -> -0E-999 Rounded Inexact +resx733 rescale -0.100E-999 -999 -> -0E-999 Rounded Inexact +resx734 rescale -0.01E-999 -999 -> -0E-999 Inexact Rounded +-- next is rounded to Emin +resx735 rescale -0.999E-999 -999 -> -1E-999 Inexact Rounded +resx736 rescale -0.099E-999 -999 -> -0E-999 Inexact Rounded +resx737 rescale -0.009E-999 -999 -> -0E-999 Inexact Rounded +resx738 rescale -0.001E-999 -999 -> -0E-999 Inexact Rounded +resx739 rescale -0.0001E-999 -999 -> -0E-999 Inexact Rounded + +resx740 rescale -1.00E-999 -1000 -> -1.0E-999 Rounded +resx741 rescale -0.1E-999 -1000 -> -1E-1000 Subnormal +resx742 rescale -0.10E-999 -1000 -> -1E-1000 Subnormal Rounded +resx743 rescale -0.100E-999 -1000 -> -1E-1000 Subnormal Rounded +resx744 rescale -0.01E-999 -1000 -> -0E-1000 Inexact Rounded +-- next is rounded to Emin +resx745 rescale -0.999E-999 -1000 -> -1.0E-999 Inexact Rounded +resx746 rescale -0.099E-999 -1000 -> -1E-1000 Inexact Rounded Subnormal +resx747 rescale -0.009E-999 -1000 -> -0E-1000 Inexact Rounded +resx748 rescale -0.001E-999 -1000 -> -0E-1000 Inexact Rounded +resx749 rescale -0.0001E-999 -1000 -> -0E-1000 Inexact Rounded + +resx750 rescale -1.00E-999 -1001 -> -1.00E-999 +resx751 rescale -0.1E-999 -1001 -> -1.0E-1000 Subnormal +resx752 rescale -0.10E-999 -1001 -> -1.0E-1000 Subnormal +resx753 rescale -0.100E-999 -1001 -> -1.0E-1000 Subnormal Rounded +resx754 rescale -0.01E-999 -1001 -> -1E-1001 Subnormal +-- next is rounded to Emin +resx755 rescale -0.999E-999 -1001 -> -1.00E-999 Inexact Rounded +resx756 rescale -0.099E-999 -1001 -> -1.0E-1000 Inexact Rounded Subnormal +resx757 rescale -0.009E-999 -1001 -> -1E-1001 Inexact Rounded Subnormal +resx758 rescale -0.001E-999 -1001 -> -0E-1001 Inexact Rounded +resx759 rescale -0.0001E-999 -1001 -> -0E-1001 Inexact Rounded + +resx760 rescale -1.00E-999 -1002 -> -1.000E-999 +resx761 rescale -0.1E-999 -1002 -> -1.00E-1000 Subnormal +resx762 rescale -0.10E-999 -1002 -> -1.00E-1000 Subnormal +resx763 rescale -0.100E-999 -1002 -> -1.00E-1000 Subnormal +resx764 rescale -0.01E-999 -1002 -> -1.0E-1001 Subnormal +resx765 rescale -0.999E-999 -1002 -> -9.99E-1000 Subnormal +resx766 rescale -0.099E-999 -1002 -> -9.9E-1001 Subnormal +resx767 rescale -0.009E-999 -1002 -> -9E-1002 Subnormal +resx768 rescale -0.001E-999 -1002 -> -1E-1002 Subnormal +resx769 rescale -0.0001E-999 -1002 -> -0E-1002 Inexact Rounded + +-- rhs must be no less than Etiny +resx770 rescale -1.00E-999 -1003 -> NaN Invalid_operation +resx771 rescale -0.1E-999 -1003 -> NaN Invalid_operation +resx772 rescale -0.10E-999 -1003 -> NaN Invalid_operation +resx773 rescale -0.100E-999 -1003 -> NaN Invalid_operation +resx774 rescale -0.01E-999 -1003 -> NaN Invalid_operation +resx775 rescale -0.999E-999 -1003 -> NaN Invalid_operation +resx776 rescale -0.099E-999 -1003 -> NaN Invalid_operation +resx777 rescale -0.009E-999 -1003 -> NaN Invalid_operation +resx778 rescale -0.001E-999 -1003 -> NaN Invalid_operation +resx779 rescale -0.0001E-999 -1003 -> NaN Invalid_operation + +precision: 9 +maxExponent: 999999999 +minexponent: -999999999 + +-- getInt worries +resx801 rescale 0 1000000000 -> NaN Invalid_operation +resx802 rescale 0 -1000000000 -> 0E-1000000000 +resx803 rescale 0 2000000000 -> NaN Invalid_operation +resx804 rescale 0 -2000000000 -> NaN Invalid_operation +resx805 rescale 0 3000000000 -> NaN Invalid_operation +resx806 rescale 0 -3000000000 -> NaN Invalid_operation +resx807 rescale 0 4000000000 -> NaN Invalid_operation +resx808 rescale 0 -4000000000 -> NaN Invalid_operation +resx809 rescale 0 5000000000 -> NaN Invalid_operation +resx810 rescale 0 -5000000000 -> NaN Invalid_operation +resx811 rescale 0 6000000000 -> NaN Invalid_operation +resx812 rescale 0 -6000000000 -> NaN Invalid_operation +resx813 rescale 0 7000000000 -> NaN Invalid_operation +resx814 rescale 0 -7000000000 -> NaN Invalid_operation +resx815 rescale 0 8000000000 -> NaN Invalid_operation +resx816 rescale 0 -8000000000 -> NaN Invalid_operation +resx817 rescale 0 9000000000 -> NaN Invalid_operation +resx818 rescale 0 -9000000000 -> NaN Invalid_operation +resx819 rescale 0 9999999999 -> NaN Invalid_operation +resx820 rescale 0 -9999999999 -> NaN Invalid_operation +resx821 rescale 0 10000000000 -> NaN Invalid_operation +resx822 rescale 0 -10000000000 -> NaN Invalid_operation + +resx831 rescale 1 0E-1 -> 1 +resx832 rescale 1 0E-2 -> 1 +resx833 rescale 1 0E-3 -> 1 +resx834 rescale 1 0E-4 -> 1 +resx835 rescale 1 0E-100 -> 1 +resx836 rescale 1 0E-100000 -> 1 +resx837 rescale 1 0E+100 -> 1 +resx838 rescale 1 0E+100000 -> 1 + +resx841 rescale 0 5E-1000000 -> NaN Invalid_operation +resx842 rescale 0 5E-1000000 -> NaN Invalid_operation +resx843 rescale 0 999999999 -> 0E+999999999 +resx844 rescale 0 1000000000 -> NaN Invalid_operation +resx845 rescale 0 -999999999 -> 0E-999999999 +resx846 rescale 0 -1000000000 -> 0E-1000000000 +resx847 rescale 0 -1000000001 -> 0E-1000000001 +resx848 rescale 0 -1000000002 -> 0E-1000000002 +resx849 rescale 0 -1000000003 -> 0E-1000000003 +resx850 rescale 0 -1000000004 -> 0E-1000000004 +resx851 rescale 0 -1000000005 -> 0E-1000000005 +resx852 rescale 0 -1000000006 -> 0E-1000000006 +resx853 rescale 0 -1000000007 -> 0E-1000000007 +resx854 rescale 0 -1000000008 -> NaN Invalid_operation + +resx861 rescale 1 +2147483649 -> NaN Invalid_operation +resx862 rescale 1 +2147483648 -> NaN Invalid_operation +resx863 rescale 1 +2147483647 -> NaN Invalid_operation +resx864 rescale 1 -2147483647 -> NaN Invalid_operation +resx865 rescale 1 -2147483648 -> NaN Invalid_operation +resx866 rescale 1 -2147483649 -> NaN Invalid_operation + +-- Null tests +res900 rescale 10 # -> NaN Invalid_operation +res901 rescale # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal-c/new_dt/rounding.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/rounding.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,1079 @@ +------------------------------------------------------------------------ +-- rounding.decTest -- decimal rounding modes testcases -- +-- Copyright (c) IBM Corporation, 1981, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- These tests require that implementations take account of residues in +-- order to get correct results for some rounding modes. Rather than +-- single rounding tests we therefore need tests for most operators. +-- [We do assume add/minus/plus/subtract are common paths, however, as +-- is rounding of negatives (if the latter works for addition, assume it +-- works for the others, too).] +-- +-- Underflow Subnormal and overflow behaviours are tested under the individual +-- operators. + +extended: 1 +precision: 5 -- for easier visual inspection +maxExponent: 999 +minexponent: -999 + +-- Addition operators ------------------------------------------------- +rounding: down + +radx100 add 12345 -0.1 -> 12344 Inexact Rounded +radx101 add 12345 -0.01 -> 12344 Inexact Rounded +radx102 add 12345 -0.001 -> 12344 Inexact Rounded +radx103 add 12345 -0.00001 -> 12344 Inexact Rounded +radx104 add 12345 -0.000001 -> 12344 Inexact Rounded +radx105 add 12345 -0.0000001 -> 12344 Inexact Rounded +radx106 add 12345 0 -> 12345 +radx107 add 12345 0.0000001 -> 12345 Inexact Rounded +radx108 add 12345 0.000001 -> 12345 Inexact Rounded +radx109 add 12345 0.00001 -> 12345 Inexact Rounded +radx110 add 12345 0.0001 -> 12345 Inexact Rounded +radx111 add 12345 0.001 -> 12345 Inexact Rounded +radx112 add 12345 0.01 -> 12345 Inexact Rounded +radx113 add 12345 0.1 -> 12345 Inexact Rounded + +radx115 add 12346 0.49999 -> 12346 Inexact Rounded +radx116 add 12346 0.5 -> 12346 Inexact Rounded +radx117 add 12346 0.50001 -> 12346 Inexact Rounded + +radx120 add 12345 0.4 -> 12345 Inexact Rounded +radx121 add 12345 0.49 -> 12345 Inexact Rounded +radx122 add 12345 0.499 -> 12345 Inexact Rounded +radx123 add 12345 0.49999 -> 12345 Inexact Rounded +radx124 add 12345 0.5 -> 12345 Inexact Rounded +radx125 add 12345 0.50001 -> 12345 Inexact Rounded +radx126 add 12345 0.5001 -> 12345 Inexact Rounded +radx127 add 12345 0.501 -> 12345 Inexact Rounded +radx128 add 12345 0.51 -> 12345 Inexact Rounded +radx129 add 12345 0.6 -> 12345 Inexact Rounded + +rounding: half_down + +radx140 add 12345 -0.1 -> 12345 Inexact Rounded +radx141 add 12345 -0.01 -> 12345 Inexact Rounded +radx142 add 12345 -0.001 -> 12345 Inexact Rounded +radx143 add 12345 -0.00001 -> 12345 Inexact Rounded +radx144 add 12345 -0.000001 -> 12345 Inexact Rounded +radx145 add 12345 -0.0000001 -> 12345 Inexact Rounded +radx146 add 12345 0 -> 12345 +radx147 add 12345 0.0000001 -> 12345 Inexact Rounded +radx148 add 12345 0.000001 -> 12345 Inexact Rounded +radx149 add 12345 0.00001 -> 12345 Inexact Rounded +radx150 add 12345 0.0001 -> 12345 Inexact Rounded +radx151 add 12345 0.001 -> 12345 Inexact Rounded +radx152 add 12345 0.01 -> 12345 Inexact Rounded +radx153 add 12345 0.1 -> 12345 Inexact Rounded + +radx155 add 12346 0.49999 -> 12346 Inexact Rounded +radx156 add 12346 0.5 -> 12346 Inexact Rounded +radx157 add 12346 0.50001 -> 12347 Inexact Rounded + +radx160 add 12345 0.4 -> 12345 Inexact Rounded +radx161 add 12345 0.49 -> 12345 Inexact Rounded +radx162 add 12345 0.499 -> 12345 Inexact Rounded +radx163 add 12345 0.49999 -> 12345 Inexact Rounded +radx164 add 12345 0.5 -> 12345 Inexact Rounded +radx165 add 12345 0.50001 -> 12346 Inexact Rounded +radx166 add 12345 0.5001 -> 12346 Inexact Rounded +radx167 add 12345 0.501 -> 12346 Inexact Rounded +radx168 add 12345 0.51 -> 12346 Inexact Rounded +radx169 add 12345 0.6 -> 12346 Inexact Rounded + +rounding: half_even + +radx170 add 12345 -0.1 -> 12345 Inexact Rounded +radx171 add 12345 -0.01 -> 12345 Inexact Rounded +radx172 add 12345 -0.001 -> 12345 Inexact Rounded +radx173 add 12345 -0.00001 -> 12345 Inexact Rounded +radx174 add 12345 -0.000001 -> 12345 Inexact Rounded +radx175 add 12345 -0.0000001 -> 12345 Inexact Rounded +radx176 add 12345 0 -> 12345 +radx177 add 12345 0.0000001 -> 12345 Inexact Rounded +radx178 add 12345 0.000001 -> 12345 Inexact Rounded +radx179 add 12345 0.00001 -> 12345 Inexact Rounded +radx180 add 12345 0.0001 -> 12345 Inexact Rounded +radx181 add 12345 0.001 -> 12345 Inexact Rounded +radx182 add 12345 0.01 -> 12345 Inexact Rounded +radx183 add 12345 0.1 -> 12345 Inexact Rounded + +radx185 add 12346 0.49999 -> 12346 Inexact Rounded +radx186 add 12346 0.5 -> 12346 Inexact Rounded +radx187 add 12346 0.50001 -> 12347 Inexact Rounded + +radx190 add 12345 0.4 -> 12345 Inexact Rounded +radx191 add 12345 0.49 -> 12345 Inexact Rounded +radx192 add 12345 0.499 -> 12345 Inexact Rounded +radx193 add 12345 0.49999 -> 12345 Inexact Rounded +radx194 add 12345 0.5 -> 12346 Inexact Rounded +radx195 add 12345 0.50001 -> 12346 Inexact Rounded +radx196 add 12345 0.5001 -> 12346 Inexact Rounded +radx197 add 12345 0.501 -> 12346 Inexact Rounded +radx198 add 12345 0.51 -> 12346 Inexact Rounded +radx199 add 12345 0.6 -> 12346 Inexact Rounded + +rounding: half_up + +radx200 add 12345 -0.1 -> 12345 Inexact Rounded +radx201 add 12345 -0.01 -> 12345 Inexact Rounded +radx202 add 12345 -0.001 -> 12345 Inexact Rounded +radx203 add 12345 -0.00001 -> 12345 Inexact Rounded +radx204 add 12345 -0.000001 -> 12345 Inexact Rounded +radx205 add 12345 -0.0000001 -> 12345 Inexact Rounded +radx206 add 12345 0 -> 12345 +radx207 add 12345 0.0000001 -> 12345 Inexact Rounded +radx208 add 12345 0.000001 -> 12345 Inexact Rounded +radx209 add 12345 0.00001 -> 12345 Inexact Rounded +radx210 add 12345 0.0001 -> 12345 Inexact Rounded +radx211 add 12345 0.001 -> 12345 Inexact Rounded +radx212 add 12345 0.01 -> 12345 Inexact Rounded +radx213 add 12345 0.1 -> 12345 Inexact Rounded + +radx215 add 12346 0.49999 -> 12346 Inexact Rounded +radx216 add 12346 0.5 -> 12347 Inexact Rounded +radx217 add 12346 0.50001 -> 12347 Inexact Rounded + +radx220 add 12345 0.4 -> 12345 Inexact Rounded +radx221 add 12345 0.49 -> 12345 Inexact Rounded +radx222 add 12345 0.499 -> 12345 Inexact Rounded +radx223 add 12345 0.49999 -> 12345 Inexact Rounded +radx224 add 12345 0.5 -> 12346 Inexact Rounded +radx225 add 12345 0.50001 -> 12346 Inexact Rounded +radx226 add 12345 0.5001 -> 12346 Inexact Rounded +radx227 add 12345 0.501 -> 12346 Inexact Rounded +radx228 add 12345 0.51 -> 12346 Inexact Rounded +radx229 add 12345 0.6 -> 12346 Inexact Rounded + +rounding: up + +radx230 add 12345 -0.1 -> 12345 Inexact Rounded +radx231 add 12345 -0.01 -> 12345 Inexact Rounded +radx232 add 12345 -0.001 -> 12345 Inexact Rounded +radx233 add 12345 -0.00001 -> 12345 Inexact Rounded +radx234 add 12345 -0.000001 -> 12345 Inexact Rounded +radx235 add 12345 -0.0000001 -> 12345 Inexact Rounded +radx236 add 12345 0 -> 12345 +radx237 add 12345 0.0000001 -> 12346 Inexact Rounded +radx238 add 12345 0.000001 -> 12346 Inexact Rounded +radx239 add 12345 0.00001 -> 12346 Inexact Rounded +radx240 add 12345 0.0001 -> 12346 Inexact Rounded +radx241 add 12345 0.001 -> 12346 Inexact Rounded +radx242 add 12345 0.01 -> 12346 Inexact Rounded +radx243 add 12345 0.1 -> 12346 Inexact Rounded + +radx245 add 12346 0.49999 -> 12347 Inexact Rounded +radx246 add 12346 0.5 -> 12347 Inexact Rounded +radx247 add 12346 0.50001 -> 12347 Inexact Rounded + +radx250 add 12345 0.4 -> 12346 Inexact Rounded +radx251 add 12345 0.49 -> 12346 Inexact Rounded +radx252 add 12345 0.499 -> 12346 Inexact Rounded +radx253 add 12345 0.49999 -> 12346 Inexact Rounded +radx254 add 12345 0.5 -> 12346 Inexact Rounded +radx255 add 12345 0.50001 -> 12346 Inexact Rounded +radx256 add 12345 0.5001 -> 12346 Inexact Rounded +radx257 add 12345 0.501 -> 12346 Inexact Rounded +radx258 add 12345 0.51 -> 12346 Inexact Rounded +radx259 add 12345 0.6 -> 12346 Inexact Rounded + +rounding: floor + +radx300 add 12345 -0.1 -> 12344 Inexact Rounded +radx301 add 12345 -0.01 -> 12344 Inexact Rounded +radx302 add 12345 -0.001 -> 12344 Inexact Rounded +radx303 add 12345 -0.00001 -> 12344 Inexact Rounded +radx304 add 12345 -0.000001 -> 12344 Inexact Rounded +radx305 add 12345 -0.0000001 -> 12344 Inexact Rounded +radx306 add 12345 0 -> 12345 +radx307 add 12345 0.0000001 -> 12345 Inexact Rounded +radx308 add 12345 0.000001 -> 12345 Inexact Rounded +radx309 add 12345 0.00001 -> 12345 Inexact Rounded +radx310 add 12345 0.0001 -> 12345 Inexact Rounded +radx311 add 12345 0.001 -> 12345 Inexact Rounded +radx312 add 12345 0.01 -> 12345 Inexact Rounded +radx313 add 12345 0.1 -> 12345 Inexact Rounded + +radx315 add 12346 0.49999 -> 12346 Inexact Rounded +radx316 add 12346 0.5 -> 12346 Inexact Rounded +radx317 add 12346 0.50001 -> 12346 Inexact Rounded + +radx320 add 12345 0.4 -> 12345 Inexact Rounded +radx321 add 12345 0.49 -> 12345 Inexact Rounded +radx322 add 12345 0.499 -> 12345 Inexact Rounded +radx323 add 12345 0.49999 -> 12345 Inexact Rounded +radx324 add 12345 0.5 -> 12345 Inexact Rounded +radx325 add 12345 0.50001 -> 12345 Inexact Rounded +radx326 add 12345 0.5001 -> 12345 Inexact Rounded +radx327 add 12345 0.501 -> 12345 Inexact Rounded +radx328 add 12345 0.51 -> 12345 Inexact Rounded +radx329 add 12345 0.6 -> 12345 Inexact Rounded + +rounding: ceiling + +radx330 add 12345 -0.1 -> 12345 Inexact Rounded +radx331 add 12345 -0.01 -> 12345 Inexact Rounded +radx332 add 12345 -0.001 -> 12345 Inexact Rounded +radx333 add 12345 -0.00001 -> 12345 Inexact Rounded +radx334 add 12345 -0.000001 -> 12345 Inexact Rounded +radx335 add 12345 -0.0000001 -> 12345 Inexact Rounded +radx336 add 12345 0 -> 12345 +radx337 add 12345 0.0000001 -> 12346 Inexact Rounded +radx338 add 12345 0.000001 -> 12346 Inexact Rounded +radx339 add 12345 0.00001 -> 12346 Inexact Rounded +radx340 add 12345 0.0001 -> 12346 Inexact Rounded +radx341 add 12345 0.001 -> 12346 Inexact Rounded +radx342 add 12345 0.01 -> 12346 Inexact Rounded +radx343 add 12345 0.1 -> 12346 Inexact Rounded + +radx345 add 12346 0.49999 -> 12347 Inexact Rounded +radx346 add 12346 0.5 -> 12347 Inexact Rounded +radx347 add 12346 0.50001 -> 12347 Inexact Rounded + +radx350 add 12345 0.4 -> 12346 Inexact Rounded +radx351 add 12345 0.49 -> 12346 Inexact Rounded +radx352 add 12345 0.499 -> 12346 Inexact Rounded +radx353 add 12345 0.49999 -> 12346 Inexact Rounded +radx354 add 12345 0.5 -> 12346 Inexact Rounded +radx355 add 12345 0.50001 -> 12346 Inexact Rounded +radx356 add 12345 0.5001 -> 12346 Inexact Rounded +radx357 add 12345 0.501 -> 12346 Inexact Rounded +radx358 add 12345 0.51 -> 12346 Inexact Rounded +radx359 add 12345 0.6 -> 12346 Inexact Rounded + +-- negatives... + +rounding: down + +rsux100 add -12345 -0.1 -> -12345 Inexact Rounded +rsux101 add -12345 -0.01 -> -12345 Inexact Rounded +rsux102 add -12345 -0.001 -> -12345 Inexact Rounded +rsux103 add -12345 -0.00001 -> -12345 Inexact Rounded +rsux104 add -12345 -0.000001 -> -12345 Inexact Rounded +rsux105 add -12345 -0.0000001 -> -12345 Inexact Rounded +rsux106 add -12345 0 -> -12345 +rsux107 add -12345 0.0000001 -> -12344 Inexact Rounded +rsux108 add -12345 0.000001 -> -12344 Inexact Rounded +rsux109 add -12345 0.00001 -> -12344 Inexact Rounded +rsux110 add -12345 0.0001 -> -12344 Inexact Rounded +rsux111 add -12345 0.001 -> -12344 Inexact Rounded +rsux112 add -12345 0.01 -> -12344 Inexact Rounded +rsux113 add -12345 0.1 -> -12344 Inexact Rounded + +rsux115 add -12346 0.49999 -> -12345 Inexact Rounded +rsux116 add -12346 0.5 -> -12345 Inexact Rounded +rsux117 add -12346 0.50001 -> -12345 Inexact Rounded + +rsux120 add -12345 0.4 -> -12344 Inexact Rounded +rsux121 add -12345 0.49 -> -12344 Inexact Rounded +rsux122 add -12345 0.499 -> -12344 Inexact Rounded +rsux123 add -12345 0.49999 -> -12344 Inexact Rounded +rsux124 add -12345 0.5 -> -12344 Inexact Rounded +rsux125 add -12345 0.50001 -> -12344 Inexact Rounded +rsux126 add -12345 0.5001 -> -12344 Inexact Rounded +rsux127 add -12345 0.501 -> -12344 Inexact Rounded +rsux128 add -12345 0.51 -> -12344 Inexact Rounded +rsux129 add -12345 0.6 -> -12344 Inexact Rounded + +rounding: half_down + +rsux140 add -12345 -0.1 -> -12345 Inexact Rounded +rsux141 add -12345 -0.01 -> -12345 Inexact Rounded +rsux142 add -12345 -0.001 -> -12345 Inexact Rounded +rsux143 add -12345 -0.00001 -> -12345 Inexact Rounded +rsux144 add -12345 -0.000001 -> -12345 Inexact Rounded +rsux145 add -12345 -0.0000001 -> -12345 Inexact Rounded +rsux146 add -12345 0 -> -12345 +rsux147 add -12345 0.0000001 -> -12345 Inexact Rounded +rsux148 add -12345 0.000001 -> -12345 Inexact Rounded +rsux149 add -12345 0.00001 -> -12345 Inexact Rounded +rsux150 add -12345 0.0001 -> -12345 Inexact Rounded +rsux151 add -12345 0.001 -> -12345 Inexact Rounded +rsux152 add -12345 0.01 -> -12345 Inexact Rounded +rsux153 add -12345 0.1 -> -12345 Inexact Rounded + +rsux155 add -12346 0.49999 -> -12346 Inexact Rounded +rsux156 add -12346 0.5 -> -12345 Inexact Rounded +rsux157 add -12346 0.50001 -> -12345 Inexact Rounded + +rsux160 add -12345 0.4 -> -12345 Inexact Rounded +rsux161 add -12345 0.49 -> -12345 Inexact Rounded +rsux162 add -12345 0.499 -> -12345 Inexact Rounded +rsux163 add -12345 0.49999 -> -12345 Inexact Rounded +rsux164 add -12345 0.5 -> -12344 Inexact Rounded +rsux165 add -12345 0.50001 -> -12344 Inexact Rounded +rsux166 add -12345 0.5001 -> -12344 Inexact Rounded +rsux167 add -12345 0.501 -> -12344 Inexact Rounded +rsux168 add -12345 0.51 -> -12344 Inexact Rounded +rsux169 add -12345 0.6 -> -12344 Inexact Rounded + +rounding: half_even + +rsux170 add -12345 -0.1 -> -12345 Inexact Rounded +rsux171 add -12345 -0.01 -> -12345 Inexact Rounded +rsux172 add -12345 -0.001 -> -12345 Inexact Rounded +rsux173 add -12345 -0.00001 -> -12345 Inexact Rounded +rsux174 add -12345 -0.000001 -> -12345 Inexact Rounded +rsux175 add -12345 -0.0000001 -> -12345 Inexact Rounded +rsux176 add -12345 0 -> -12345 +rsux177 add -12345 0.0000001 -> -12345 Inexact Rounded +rsux178 add -12345 0.000001 -> -12345 Inexact Rounded +rsux179 add -12345 0.00001 -> -12345 Inexact Rounded +rsux180 add -12345 0.0001 -> -12345 Inexact Rounded +rsux181 add -12345 0.001 -> -12345 Inexact Rounded +rsux182 add -12345 0.01 -> -12345 Inexact Rounded +rsux183 add -12345 0.1 -> -12345 Inexact Rounded + +rsux185 add -12346 0.49999 -> -12346 Inexact Rounded +rsux186 add -12346 0.5 -> -12346 Inexact Rounded +rsux187 add -12346 0.50001 -> -12345 Inexact Rounded + +rsux190 add -12345 0.4 -> -12345 Inexact Rounded +rsux191 add -12345 0.49 -> -12345 Inexact Rounded +rsux192 add -12345 0.499 -> -12345 Inexact Rounded +rsux193 add -12345 0.49999 -> -12345 Inexact Rounded +rsux194 add -12345 0.5 -> -12344 Inexact Rounded +rsux195 add -12345 0.50001 -> -12344 Inexact Rounded +rsux196 add -12345 0.5001 -> -12344 Inexact Rounded +rsux197 add -12345 0.501 -> -12344 Inexact Rounded +rsux198 add -12345 0.51 -> -12344 Inexact Rounded +rsux199 add -12345 0.6 -> -12344 Inexact Rounded + +rounding: half_up + +rsux200 add -12345 -0.1 -> -12345 Inexact Rounded +rsux201 add -12345 -0.01 -> -12345 Inexact Rounded +rsux202 add -12345 -0.001 -> -12345 Inexact Rounded +rsux203 add -12345 -0.00001 -> -12345 Inexact Rounded +rsux204 add -12345 -0.000001 -> -12345 Inexact Rounded +rsux205 add -12345 -0.0000001 -> -12345 Inexact Rounded +rsux206 add -12345 0 -> -12345 +rsux207 add -12345 0.0000001 -> -12345 Inexact Rounded +rsux208 add -12345 0.000001 -> -12345 Inexact Rounded +rsux209 add -12345 0.00001 -> -12345 Inexact Rounded +rsux210 add -12345 0.0001 -> -12345 Inexact Rounded +rsux211 add -12345 0.001 -> -12345 Inexact Rounded +rsux212 add -12345 0.01 -> -12345 Inexact Rounded +rsux213 add -12345 0.1 -> -12345 Inexact Rounded + +rsux215 add -12346 0.49999 -> -12346 Inexact Rounded +rsux216 add -12346 0.5 -> -12346 Inexact Rounded +rsux217 add -12346 0.50001 -> -12345 Inexact Rounded + +rsux220 add -12345 0.4 -> -12345 Inexact Rounded +rsux221 add -12345 0.49 -> -12345 Inexact Rounded +rsux222 add -12345 0.499 -> -12345 Inexact Rounded +rsux223 add -12345 0.49999 -> -12345 Inexact Rounded +rsux224 add -12345 0.5 -> -12345 Inexact Rounded +rsux225 add -12345 0.50001 -> -12344 Inexact Rounded +rsux226 add -12345 0.5001 -> -12344 Inexact Rounded +rsux227 add -12345 0.501 -> -12344 Inexact Rounded +rsux228 add -12345 0.51 -> -12344 Inexact Rounded +rsux229 add -12345 0.6 -> -12344 Inexact Rounded + +rounding: up + +rsux230 add -12345 -0.1 -> -12346 Inexact Rounded +rsux231 add -12345 -0.01 -> -12346 Inexact Rounded +rsux232 add -12345 -0.001 -> -12346 Inexact Rounded +rsux233 add -12345 -0.00001 -> -12346 Inexact Rounded +rsux234 add -12345 -0.000001 -> -12346 Inexact Rounded +rsux235 add -12345 -0.0000001 -> -12346 Inexact Rounded +rsux236 add -12345 0 -> -12345 +rsux237 add -12345 0.0000001 -> -12345 Inexact Rounded +rsux238 add -12345 0.000001 -> -12345 Inexact Rounded +rsux239 add -12345 0.00001 -> -12345 Inexact Rounded +rsux240 add -12345 0.0001 -> -12345 Inexact Rounded +rsux241 add -12345 0.001 -> -12345 Inexact Rounded +rsux242 add -12345 0.01 -> -12345 Inexact Rounded +rsux243 add -12345 0.1 -> -12345 Inexact Rounded + +rsux245 add -12346 0.49999 -> -12346 Inexact Rounded +rsux246 add -12346 0.5 -> -12346 Inexact Rounded +rsux247 add -12346 0.50001 -> -12346 Inexact Rounded + +rsux250 add -12345 0.4 -> -12345 Inexact Rounded +rsux251 add -12345 0.49 -> -12345 Inexact Rounded +rsux252 add -12345 0.499 -> -12345 Inexact Rounded +rsux253 add -12345 0.49999 -> -12345 Inexact Rounded +rsux254 add -12345 0.5 -> -12345 Inexact Rounded +rsux255 add -12345 0.50001 -> -12345 Inexact Rounded +rsux256 add -12345 0.5001 -> -12345 Inexact Rounded +rsux257 add -12345 0.501 -> -12345 Inexact Rounded +rsux258 add -12345 0.51 -> -12345 Inexact Rounded +rsux259 add -12345 0.6 -> -12345 Inexact Rounded + +rounding: floor + +rsux300 add -12345 -0.1 -> -12346 Inexact Rounded +rsux301 add -12345 -0.01 -> -12346 Inexact Rounded +rsux302 add -12345 -0.001 -> -12346 Inexact Rounded +rsux303 add -12345 -0.00001 -> -12346 Inexact Rounded +rsux304 add -12345 -0.000001 -> -12346 Inexact Rounded +rsux305 add -12345 -0.0000001 -> -12346 Inexact Rounded +rsux306 add -12345 0 -> -12345 +rsux307 add -12345 0.0000001 -> -12345 Inexact Rounded +rsux308 add -12345 0.000001 -> -12345 Inexact Rounded +rsux309 add -12345 0.00001 -> -12345 Inexact Rounded +rsux310 add -12345 0.0001 -> -12345 Inexact Rounded +rsux311 add -12345 0.001 -> -12345 Inexact Rounded +rsux312 add -12345 0.01 -> -12345 Inexact Rounded +rsux313 add -12345 0.1 -> -12345 Inexact Rounded + +rsux315 add -12346 0.49999 -> -12346 Inexact Rounded +rsux316 add -12346 0.5 -> -12346 Inexact Rounded +rsux317 add -12346 0.50001 -> -12346 Inexact Rounded + +rsux320 add -12345 0.4 -> -12345 Inexact Rounded +rsux321 add -12345 0.49 -> -12345 Inexact Rounded +rsux322 add -12345 0.499 -> -12345 Inexact Rounded +rsux323 add -12345 0.49999 -> -12345 Inexact Rounded +rsux324 add -12345 0.5 -> -12345 Inexact Rounded +rsux325 add -12345 0.50001 -> -12345 Inexact Rounded +rsux326 add -12345 0.5001 -> -12345 Inexact Rounded +rsux327 add -12345 0.501 -> -12345 Inexact Rounded +rsux328 add -12345 0.51 -> -12345 Inexact Rounded +rsux329 add -12345 0.6 -> -12345 Inexact Rounded + +rounding: ceiling + +rsux330 add -12345 -0.1 -> -12345 Inexact Rounded +rsux331 add -12345 -0.01 -> -12345 Inexact Rounded +rsux332 add -12345 -0.001 -> -12345 Inexact Rounded +rsux333 add -12345 -0.00001 -> -12345 Inexact Rounded +rsux334 add -12345 -0.000001 -> -12345 Inexact Rounded +rsux335 add -12345 -0.0000001 -> -12345 Inexact Rounded +rsux336 add -12345 0 -> -12345 +rsux337 add -12345 0.0000001 -> -12344 Inexact Rounded +rsux338 add -12345 0.000001 -> -12344 Inexact Rounded +rsux339 add -12345 0.00001 -> -12344 Inexact Rounded +rsux340 add -12345 0.0001 -> -12344 Inexact Rounded +rsux341 add -12345 0.001 -> -12344 Inexact Rounded +rsux342 add -12345 0.01 -> -12344 Inexact Rounded +rsux343 add -12345 0.1 -> -12344 Inexact Rounded + +rsux345 add -12346 0.49999 -> -12345 Inexact Rounded +rsux346 add -12346 0.5 -> -12345 Inexact Rounded +rsux347 add -12346 0.50001 -> -12345 Inexact Rounded + +rsux350 add -12345 0.4 -> -12344 Inexact Rounded +rsux351 add -12345 0.49 -> -12344 Inexact Rounded +rsux352 add -12345 0.499 -> -12344 Inexact Rounded +rsux353 add -12345 0.49999 -> -12344 Inexact Rounded +rsux354 add -12345 0.5 -> -12344 Inexact Rounded +rsux355 add -12345 0.50001 -> -12344 Inexact Rounded +rsux356 add -12345 0.5001 -> -12344 Inexact Rounded +rsux357 add -12345 0.501 -> -12344 Inexact Rounded +rsux358 add -12345 0.51 -> -12344 Inexact Rounded +rsux359 add -12345 0.6 -> -12344 Inexact Rounded + +-- Check cancellation subtractions +-- (The IEEE 854 'curious rule' in $6.3) + +rounding: down +rzex001 add 0 0 -> 0 +rzex002 add 0 -0 -> 0 +rzex003 add -0 0 -> 0 +rzex004 add -0 -0 -> -0 +rzex005 add 1 -1 -> 0 +rzex006 add -1 1 -> 0 +rzex007 add 1.5 -1.5 -> 0.0 +rzex008 add -1.5 1.5 -> 0.0 +rzex009 add 2 -2 -> 0 +rzex010 add -2 2 -> 0 + +rounding: up +rzex011 add 0 0 -> 0 +rzex012 add 0 -0 -> 0 +rzex013 add -0 0 -> 0 +rzex014 add -0 -0 -> -0 +rzex015 add 1 -1 -> 0 +rzex016 add -1 1 -> 0 +rzex017 add 1.5 -1.5 -> 0.0 +rzex018 add -1.5 1.5 -> 0.0 +rzex019 add 2 -2 -> 0 +rzex020 add -2 2 -> 0 + +rounding: half_up +rzex021 add 0 0 -> 0 +rzex022 add 0 -0 -> 0 +rzex023 add -0 0 -> 0 +rzex024 add -0 -0 -> -0 +rzex025 add 1 -1 -> 0 +rzex026 add -1 1 -> 0 +rzex027 add 1.5 -1.5 -> 0.0 +rzex028 add -1.5 1.5 -> 0.0 +rzex029 add 2 -2 -> 0 +rzex030 add -2 2 -> 0 + +rounding: half_down +rzex031 add 0 0 -> 0 +rzex032 add 0 -0 -> 0 +rzex033 add -0 0 -> 0 +rzex034 add -0 -0 -> -0 +rzex035 add 1 -1 -> 0 +rzex036 add -1 1 -> 0 +rzex037 add 1.5 -1.5 -> 0.0 +rzex038 add -1.5 1.5 -> 0.0 +rzex039 add 2 -2 -> 0 +rzex040 add -2 2 -> 0 + +rounding: half_even +rzex041 add 0 0 -> 0 +rzex042 add 0 -0 -> 0 +rzex043 add -0 0 -> 0 +rzex044 add -0 -0 -> -0 +rzex045 add 1 -1 -> 0 +rzex046 add -1 1 -> 0 +rzex047 add 1.5 -1.5 -> 0.0 +rzex048 add -1.5 1.5 -> 0.0 +rzex049 add 2 -2 -> 0 +rzex050 add -2 2 -> 0 + +rounding: floor +rzex051 add 0 0 -> 0 +rzex052 add 0 -0 -> -0 -- here are two 'curious' +rzex053 add -0 0 -> -0 -- +rzex054 add -0 -0 -> -0 +rzex055 add 1 -1 -> -0 -- here are the rest +rzex056 add -1 1 -> -0 -- .. +rzex057 add 1.5 -1.5 -> -0.0 -- .. +rzex058 add -1.5 1.5 -> -0.0 -- .. +rzex059 add 2 -2 -> -0 -- .. +rzex060 add -2 2 -> -0 -- .. + +rounding: ceiling +rzex061 add 0 0 -> 0 +rzex062 add 0 -0 -> 0 +rzex063 add -0 0 -> 0 +rzex064 add -0 -0 -> -0 +rzex065 add 1 -1 -> 0 +rzex066 add -1 1 -> 0 +rzex067 add 1.5 -1.5 -> 0.0 +rzex068 add -1.5 1.5 -> 0.0 +rzex069 add 2 -2 -> 0 +rzex070 add -2 2 -> 0 + + +-- Division operators ------------------------------------------------- + +rounding: down +rdvx101 divide 12345 1 -> 12345 +rdvx102 divide 12345 1.0001 -> 12343 Inexact Rounded +rdvx103 divide 12345 1.001 -> 12332 Inexact Rounded +rdvx104 divide 12345 1.01 -> 12222 Inexact Rounded +rdvx105 divide 12345 1.1 -> 11222 Inexact Rounded +rdvx106 divide 12355 4 -> 3088.7 Inexact Rounded +rdvx107 divide 12345 4 -> 3086.2 Inexact Rounded +rdvx108 divide 12355 4.0001 -> 3088.6 Inexact Rounded +rdvx109 divide 12345 4.0001 -> 3086.1 Inexact Rounded +rdvx110 divide 12345 4.9 -> 2519.3 Inexact Rounded +rdvx111 divide 12345 4.99 -> 2473.9 Inexact Rounded +rdvx112 divide 12345 4.999 -> 2469.4 Inexact Rounded +rdvx113 divide 12345 4.9999 -> 2469.0 Inexact Rounded +rdvx114 divide 12345 5 -> 2469 +rdvx115 divide 12345 5.0001 -> 2468.9 Inexact Rounded +rdvx116 divide 12345 5.001 -> 2468.5 Inexact Rounded +rdvx117 divide 12345 5.01 -> 2464.0 Inexact Rounded +rdvx118 divide 12345 5.1 -> 2420.5 Inexact Rounded + +rounding: half_down +rdvx201 divide 12345 1 -> 12345 +rdvx202 divide 12345 1.0001 -> 12344 Inexact Rounded +rdvx203 divide 12345 1.001 -> 12333 Inexact Rounded +rdvx204 divide 12345 1.01 -> 12223 Inexact Rounded +rdvx205 divide 12345 1.1 -> 11223 Inexact Rounded +rdvx206 divide 12355 4 -> 3088.7 Inexact Rounded +rdvx207 divide 12345 4 -> 3086.2 Inexact Rounded +rdvx208 divide 12355 4.0001 -> 3088.7 Inexact Rounded +rdvx209 divide 12345 4.0001 -> 3086.2 Inexact Rounded +rdvx210 divide 12345 4.9 -> 2519.4 Inexact Rounded +rdvx211 divide 12345 4.99 -> 2473.9 Inexact Rounded +rdvx212 divide 12345 4.999 -> 2469.5 Inexact Rounded +rdvx213 divide 12345 4.9999 -> 2469.0 Inexact Rounded +rdvx214 divide 12345 5 -> 2469 +rdvx215 divide 12345 5.0001 -> 2469.0 Inexact Rounded +rdvx216 divide 12345 5.001 -> 2468.5 Inexact Rounded +rdvx217 divide 12345 5.01 -> 2464.1 Inexact Rounded +rdvx218 divide 12345 5.1 -> 2420.6 Inexact Rounded + +rounding: half_even +rdvx301 divide 12345 1 -> 12345 +rdvx302 divide 12345 1.0001 -> 12344 Inexact Rounded +rdvx303 divide 12345 1.001 -> 12333 Inexact Rounded +rdvx304 divide 12345 1.01 -> 12223 Inexact Rounded +rdvx305 divide 12345 1.1 -> 11223 Inexact Rounded +rdvx306 divide 12355 4 -> 3088.8 Inexact Rounded +rdvx307 divide 12345 4 -> 3086.2 Inexact Rounded +rdvx308 divide 12355 4.0001 -> 3088.7 Inexact Rounded +rdvx309 divide 12345 4.0001 -> 3086.2 Inexact Rounded +rdvx310 divide 12345 4.9 -> 2519.4 Inexact Rounded +rdvx311 divide 12345 4.99 -> 2473.9 Inexact Rounded +rdvx312 divide 12345 4.999 -> 2469.5 Inexact Rounded +rdvx313 divide 12345 4.9999 -> 2469.0 Inexact Rounded +rdvx314 divide 12345 5 -> 2469 +rdvx315 divide 12345 5.0001 -> 2469.0 Inexact Rounded +rdvx316 divide 12345 5.001 -> 2468.5 Inexact Rounded +rdvx317 divide 12345 5.01 -> 2464.1 Inexact Rounded +rdvx318 divide 12345 5.1 -> 2420.6 Inexact Rounded + +rounding: half_up +rdvx401 divide 12345 1 -> 12345 +rdvx402 divide 12345 1.0001 -> 12344 Inexact Rounded +rdvx403 divide 12345 1.001 -> 12333 Inexact Rounded +rdvx404 divide 12345 1.01 -> 12223 Inexact Rounded +rdvx405 divide 12345 1.1 -> 11223 Inexact Rounded +rdvx406 divide 12355 4 -> 3088.8 Inexact Rounded +rdvx407 divide 12345 4 -> 3086.3 Inexact Rounded +rdvx408 divide 12355 4.0001 -> 3088.7 Inexact Rounded +rdvx409 divide 12345 4.0001 -> 3086.2 Inexact Rounded +rdvx410 divide 12345 4.9 -> 2519.4 Inexact Rounded +rdvx411 divide 12345 4.99 -> 2473.9 Inexact Rounded +rdvx412 divide 12345 4.999 -> 2469.5 Inexact Rounded +rdvx413 divide 12345 4.9999 -> 2469.0 Inexact Rounded +rdvx414 divide 12345 5 -> 2469 +rdvx415 divide 12345 5.0001 -> 2469.0 Inexact Rounded +rdvx416 divide 12345 5.001 -> 2468.5 Inexact Rounded +rdvx417 divide 12345 5.01 -> 2464.1 Inexact Rounded +rdvx418 divide 12345 5.1 -> 2420.6 Inexact Rounded + +rounding: up +rdvx501 divide 12345 1 -> 12345 +rdvx502 divide 12345 1.0001 -> 12344 Inexact Rounded +rdvx503 divide 12345 1.001 -> 12333 Inexact Rounded +rdvx504 divide 12345 1.01 -> 12223 Inexact Rounded +rdvx505 divide 12345 1.1 -> 11223 Inexact Rounded +rdvx506 divide 12355 4 -> 3088.8 Inexact Rounded +rdvx507 divide 12345 4 -> 3086.3 Inexact Rounded +rdvx508 divide 12355 4.0001 -> 3088.7 Inexact Rounded +rdvx509 divide 12345 4.0001 -> 3086.2 Inexact Rounded +rdvx510 divide 12345 4.9 -> 2519.4 Inexact Rounded +rdvx511 divide 12345 4.99 -> 2474.0 Inexact Rounded +rdvx512 divide 12345 4.999 -> 2469.5 Inexact Rounded +rdvx513 divide 12345 4.9999 -> 2469.1 Inexact Rounded +rdvx514 divide 12345 5 -> 2469 +rdvx515 divide 12345 5.0001 -> 2469.0 Inexact Rounded +rdvx516 divide 12345 5.001 -> 2468.6 Inexact Rounded +rdvx517 divide 12345 5.01 -> 2464.1 Inexact Rounded +rdvx518 divide 12345 5.1 -> 2420.6 Inexact Rounded + +rounding: floor +rdvx601 divide 12345 1 -> 12345 +rdvx602 divide 12345 1.0001 -> 12343 Inexact Rounded +rdvx603 divide 12345 1.001 -> 12332 Inexact Rounded +rdvx604 divide 12345 1.01 -> 12222 Inexact Rounded +rdvx605 divide 12345 1.1 -> 11222 Inexact Rounded +rdvx606 divide 12355 4 -> 3088.7 Inexact Rounded +rdvx607 divide 12345 4 -> 3086.2 Inexact Rounded +rdvx608 divide 12355 4.0001 -> 3088.6 Inexact Rounded +rdvx609 divide 12345 4.0001 -> 3086.1 Inexact Rounded +rdvx610 divide 12345 4.9 -> 2519.3 Inexact Rounded +rdvx611 divide 12345 4.99 -> 2473.9 Inexact Rounded +rdvx612 divide 12345 4.999 -> 2469.4 Inexact Rounded +rdvx613 divide 12345 4.9999 -> 2469.0 Inexact Rounded +rdvx614 divide 12345 5 -> 2469 +rdvx615 divide 12345 5.0001 -> 2468.9 Inexact Rounded +rdvx616 divide 12345 5.001 -> 2468.5 Inexact Rounded +rdvx617 divide 12345 5.01 -> 2464.0 Inexact Rounded +rdvx618 divide 12345 5.1 -> 2420.5 Inexact Rounded + +rounding: ceiling +rdvx701 divide 12345 1 -> 12345 +rdvx702 divide 12345 1.0001 -> 12344 Inexact Rounded +rdvx703 divide 12345 1.001 -> 12333 Inexact Rounded +rdvx704 divide 12345 1.01 -> 12223 Inexact Rounded +rdvx705 divide 12345 1.1 -> 11223 Inexact Rounded +rdvx706 divide 12355 4 -> 3088.8 Inexact Rounded +rdvx707 divide 12345 4 -> 3086.3 Inexact Rounded +rdvx708 divide 12355 4.0001 -> 3088.7 Inexact Rounded +rdvx709 divide 12345 4.0001 -> 3086.2 Inexact Rounded +rdvx710 divide 12345 4.9 -> 2519.4 Inexact Rounded +rdvx711 divide 12345 4.99 -> 2474.0 Inexact Rounded +rdvx712 divide 12345 4.999 -> 2469.5 Inexact Rounded +rdvx713 divide 12345 4.9999 -> 2469.1 Inexact Rounded +rdvx714 divide 12345 5 -> 2469 +rdvx715 divide 12345 5.0001 -> 2469.0 Inexact Rounded +rdvx716 divide 12345 5.001 -> 2468.6 Inexact Rounded +rdvx717 divide 12345 5.01 -> 2464.1 Inexact Rounded +rdvx718 divide 12345 5.1 -> 2420.6 Inexact Rounded + +-- [divideInteger and remainder unaffected] + +-- Multiplication operator -------------------------------------------- + +rounding: down +rmux101 multiply 12345 1 -> 12345 +rmux102 multiply 12345 1.0001 -> 12346 Inexact Rounded +rmux103 multiply 12345 1.001 -> 12357 Inexact Rounded +rmux104 multiply 12345 1.01 -> 12468 Inexact Rounded +rmux105 multiply 12345 1.1 -> 13579 Inexact Rounded +rmux106 multiply 12345 4 -> 49380 +rmux107 multiply 12345 4.0001 -> 49381 Inexact Rounded +rmux108 multiply 12345 4.9 -> 60490 Inexact Rounded +rmux109 multiply 12345 4.99 -> 61601 Inexact Rounded +rmux110 multiply 12345 4.999 -> 61712 Inexact Rounded +rmux111 multiply 12345 4.9999 -> 61723 Inexact Rounded +rmux112 multiply 12345 5 -> 61725 +rmux113 multiply 12345 5.0001 -> 61726 Inexact Rounded +rmux114 multiply 12345 5.001 -> 61737 Inexact Rounded +rmux115 multiply 12345 5.01 -> 61848 Inexact Rounded +rmux116 multiply 12345 12 -> 1.4814E+5 Rounded +rmux117 multiply 12345 13 -> 1.6048E+5 Inexact Rounded +rmux118 multiply 12355 12 -> 1.4826E+5 Rounded +rmux119 multiply 12355 13 -> 1.6061E+5 Inexact Rounded + +rounding: half_down +rmux201 multiply 12345 1 -> 12345 +rmux202 multiply 12345 1.0001 -> 12346 Inexact Rounded +rmux203 multiply 12345 1.001 -> 12357 Inexact Rounded +rmux204 multiply 12345 1.01 -> 12468 Inexact Rounded +rmux205 multiply 12345 1.1 -> 13579 Inexact Rounded +rmux206 multiply 12345 4 -> 49380 +rmux207 multiply 12345 4.0001 -> 49381 Inexact Rounded +rmux208 multiply 12345 4.9 -> 60490 Inexact Rounded +rmux209 multiply 12345 4.99 -> 61602 Inexact Rounded +rmux210 multiply 12345 4.999 -> 61713 Inexact Rounded +rmux211 multiply 12345 4.9999 -> 61724 Inexact Rounded +rmux212 multiply 12345 5 -> 61725 +rmux213 multiply 12345 5.0001 -> 61726 Inexact Rounded +rmux214 multiply 12345 5.001 -> 61737 Inexact Rounded +rmux215 multiply 12345 5.01 -> 61848 Inexact Rounded +rmux216 multiply 12345 12 -> 1.4814E+5 Rounded +rmux217 multiply 12345 13 -> 1.6048E+5 Inexact Rounded +rmux218 multiply 12355 12 -> 1.4826E+5 Rounded +rmux219 multiply 12355 13 -> 1.6061E+5 Inexact Rounded + +rounding: half_even +rmux301 multiply 12345 1 -> 12345 +rmux302 multiply 12345 1.0001 -> 12346 Inexact Rounded +rmux303 multiply 12345 1.001 -> 12357 Inexact Rounded +rmux304 multiply 12345 1.01 -> 12468 Inexact Rounded +rmux305 multiply 12345 1.1 -> 13580 Inexact Rounded +rmux306 multiply 12345 4 -> 49380 +rmux307 multiply 12345 4.0001 -> 49381 Inexact Rounded +rmux308 multiply 12345 4.9 -> 60490 Inexact Rounded +rmux309 multiply 12345 4.99 -> 61602 Inexact Rounded +rmux310 multiply 12345 4.999 -> 61713 Inexact Rounded +rmux311 multiply 12345 4.9999 -> 61724 Inexact Rounded +rmux312 multiply 12345 5 -> 61725 +rmux313 multiply 12345 5.0001 -> 61726 Inexact Rounded +rmux314 multiply 12345 5.001 -> 61737 Inexact Rounded +rmux315 multiply 12345 5.01 -> 61848 Inexact Rounded +rmux316 multiply 12345 12 -> 1.4814E+5 Rounded +rmux317 multiply 12345 13 -> 1.6048E+5 Inexact Rounded +rmux318 multiply 12355 12 -> 1.4826E+5 Rounded +rmux319 multiply 12355 13 -> 1.6062E+5 Inexact Rounded + +rounding: half_up +rmux401 multiply 12345 1 -> 12345 +rmux402 multiply 12345 1.0001 -> 12346 Inexact Rounded +rmux403 multiply 12345 1.001 -> 12357 Inexact Rounded +rmux404 multiply 12345 1.01 -> 12468 Inexact Rounded +rmux405 multiply 12345 1.1 -> 13580 Inexact Rounded +rmux406 multiply 12345 4 -> 49380 +rmux407 multiply 12345 4.0001 -> 49381 Inexact Rounded +rmux408 multiply 12345 4.9 -> 60491 Inexact Rounded +rmux409 multiply 12345 4.99 -> 61602 Inexact Rounded +rmux410 multiply 12345 4.999 -> 61713 Inexact Rounded +rmux411 multiply 12345 4.9999 -> 61724 Inexact Rounded +rmux412 multiply 12345 5 -> 61725 +rmux413 multiply 12345 5.0001 -> 61726 Inexact Rounded +rmux414 multiply 12345 5.001 -> 61737 Inexact Rounded +rmux415 multiply 12345 5.01 -> 61848 Inexact Rounded +rmux416 multiply 12345 12 -> 1.4814E+5 Rounded +rmux417 multiply 12345 13 -> 1.6049E+5 Inexact Rounded +rmux418 multiply 12355 12 -> 1.4826E+5 Rounded +rmux419 multiply 12355 13 -> 1.6062E+5 Inexact Rounded + +rounding: up +rmux501 multiply 12345 1 -> 12345 +rmux502 multiply 12345 1.0001 -> 12347 Inexact Rounded +rmux503 multiply 12345 1.001 -> 12358 Inexact Rounded +rmux504 multiply 12345 1.01 -> 12469 Inexact Rounded +rmux505 multiply 12345 1.1 -> 13580 Inexact Rounded +rmux506 multiply 12345 4 -> 49380 +rmux507 multiply 12345 4.0001 -> 49382 Inexact Rounded +rmux508 multiply 12345 4.9 -> 60491 Inexact Rounded +rmux509 multiply 12345 4.99 -> 61602 Inexact Rounded +rmux510 multiply 12345 4.999 -> 61713 Inexact Rounded +rmux511 multiply 12345 4.9999 -> 61724 Inexact Rounded +rmux512 multiply 12345 5 -> 61725 +rmux513 multiply 12345 5.0001 -> 61727 Inexact Rounded +rmux514 multiply 12345 5.001 -> 61738 Inexact Rounded +rmux515 multiply 12345 5.01 -> 61849 Inexact Rounded +rmux516 multiply 12345 12 -> 1.4814E+5 Rounded +rmux517 multiply 12345 13 -> 1.6049E+5 Inexact Rounded +rmux518 multiply 12355 12 -> 1.4826E+5 Rounded +rmux519 multiply 12355 13 -> 1.6062E+5 Inexact Rounded +-- [rmux516 & rmux518] can surprise + +rounding: floor +rmux601 multiply 12345 1 -> 12345 +rmux602 multiply 12345 1.0001 -> 12346 Inexact Rounded +rmux603 multiply 12345 1.001 -> 12357 Inexact Rounded +rmux604 multiply 12345 1.01 -> 12468 Inexact Rounded +rmux605 multiply 12345 1.1 -> 13579 Inexact Rounded +rmux606 multiply 12345 4 -> 49380 +rmux607 multiply 12345 4.0001 -> 49381 Inexact Rounded +rmux608 multiply 12345 4.9 -> 60490 Inexact Rounded +rmux609 multiply 12345 4.99 -> 61601 Inexact Rounded +rmux610 multiply 12345 4.999 -> 61712 Inexact Rounded +rmux611 multiply 12345 4.9999 -> 61723 Inexact Rounded +rmux612 multiply 12345 5 -> 61725 +rmux613 multiply 12345 5.0001 -> 61726 Inexact Rounded +rmux614 multiply 12345 5.001 -> 61737 Inexact Rounded +rmux615 multiply 12345 5.01 -> 61848 Inexact Rounded +rmux616 multiply 12345 12 -> 1.4814E+5 Rounded +rmux617 multiply 12345 13 -> 1.6048E+5 Inexact Rounded +rmux618 multiply 12355 12 -> 1.4826E+5 Rounded +rmux619 multiply 12355 13 -> 1.6061E+5 Inexact Rounded + +rounding: ceiling +rmux701 multiply 12345 1 -> 12345 +rmux702 multiply 12345 1.0001 -> 12347 Inexact Rounded +rmux703 multiply 12345 1.001 -> 12358 Inexact Rounded +rmux704 multiply 12345 1.01 -> 12469 Inexact Rounded +rmux705 multiply 12345 1.1 -> 13580 Inexact Rounded +rmux706 multiply 12345 4 -> 49380 +rmux707 multiply 12345 4.0001 -> 49382 Inexact Rounded +rmux708 multiply 12345 4.9 -> 60491 Inexact Rounded +rmux709 multiply 12345 4.99 -> 61602 Inexact Rounded +rmux710 multiply 12345 4.999 -> 61713 Inexact Rounded +rmux711 multiply 12345 4.9999 -> 61724 Inexact Rounded +rmux712 multiply 12345 5 -> 61725 +rmux713 multiply 12345 5.0001 -> 61727 Inexact Rounded +rmux714 multiply 12345 5.001 -> 61738 Inexact Rounded +rmux715 multiply 12345 5.01 -> 61849 Inexact Rounded +rmux716 multiply 12345 12 -> 1.4814E+5 Rounded +rmux717 multiply 12345 13 -> 1.6049E+5 Inexact Rounded +rmux718 multiply 12355 12 -> 1.4826E+5 Rounded +rmux719 multiply 12355 13 -> 1.6062E+5 Inexact Rounded + +-- Power operator ----------------------------------------------------- + +rounding: down +rpox101 power 12345 -5 -> 3.4877E-21 Inexact Rounded +rpox102 power 12345 -4 -> 4.3056E-17 Inexact Rounded +rpox103 power 12345 -3 -> 5.3152E-13 Inexact Rounded +rpox104 power 12345 -2 -> 6.5617E-9 Inexact Rounded +rpox105 power 12345 -1 -> 0.000081004 Inexact Rounded +rpox106 power 12345 0 -> 1 +rpox107 power 12345 1 -> 12345 +rpox108 power 12345 2 -> 1.5239E+8 Inexact Rounded +rpox109 power 12345 3 -> 1.8813E+12 Inexact Rounded +rpox110 power 12345 4 -> 2.3225E+16 Inexact Rounded +rpox111 power 12345 5 -> 2.8671E+20 Inexact Rounded +rpox112 power 415 2 -> 1.7222E+5 Inexact Rounded +rpox113 power 75 3 -> 4.2187E+5 Inexact Rounded + +rounding: half_down +rpox201 power 12345 -5 -> 3.4877E-21 Inexact Rounded +rpox202 power 12345 -4 -> 4.3056E-17 Inexact Rounded +rpox203 power 12345 -3 -> 5.3153E-13 Inexact Rounded +rpox204 power 12345 -2 -> 6.5617E-9 Inexact Rounded +rpox205 power 12345 -1 -> 0.000081004 Inexact Rounded +rpox206 power 12345 0 -> 1 +rpox207 power 12345 1 -> 12345 +rpox208 power 12345 2 -> 1.5240E+8 Inexact Rounded +rpox209 power 12345 3 -> 1.8814E+12 Inexact Rounded +rpox210 power 12345 4 -> 2.3225E+16 Inexact Rounded +rpox211 power 12345 5 -> 2.8672E+20 Inexact Rounded +rpox212 power 415 2 -> 1.7222E+5 Inexact Rounded +rpox213 power 75 3 -> 4.2187E+5 Inexact Rounded + +rounding: half_even +rpox301 power 12345 -5 -> 3.4877E-21 Inexact Rounded +rpox302 power 12345 -4 -> 4.3056E-17 Inexact Rounded +rpox303 power 12345 -3 -> 5.3153E-13 Inexact Rounded +rpox304 power 12345 -2 -> 6.5617E-9 Inexact Rounded +rpox305 power 12345 -1 -> 0.000081004 Inexact Rounded +rpox306 power 12345 0 -> 1 +rpox307 power 12345 1 -> 12345 +rpox308 power 12345 2 -> 1.5240E+8 Inexact Rounded +rpox309 power 12345 3 -> 1.8814E+12 Inexact Rounded +rpox310 power 12345 4 -> 2.3225E+16 Inexact Rounded +rpox311 power 12345 5 -> 2.8672E+20 Inexact Rounded +rpox312 power 415 2 -> 1.7222E+5 Inexact Rounded +rpox313 power 75 3 -> 4.2188E+5 Inexact Rounded + +rounding: half_up +rpox401 power 12345 -5 -> 3.4877E-21 Inexact Rounded +rpox402 power 12345 -4 -> 4.3056E-17 Inexact Rounded +rpox403 power 12345 -3 -> 5.3153E-13 Inexact Rounded +rpox404 power 12345 -2 -> 6.5617E-9 Inexact Rounded +rpox405 power 12345 -1 -> 0.000081004 Inexact Rounded +rpox406 power 12345 0 -> 1 +rpox407 power 12345 1 -> 12345 +rpox408 power 12345 2 -> 1.5240E+8 Inexact Rounded +rpox409 power 12345 3 -> 1.8814E+12 Inexact Rounded +rpox410 power 12345 4 -> 2.3225E+16 Inexact Rounded +rpox411 power 12345 5 -> 2.8672E+20 Inexact Rounded +rpox412 power 415 2 -> 1.7223E+5 Inexact Rounded +rpox413 power 75 3 -> 4.2188E+5 Inexact Rounded + +rounding: up +rpox501 power 12345 -5 -> 3.4878E-21 Inexact Rounded +rpox502 power 12345 -4 -> 4.3057E-17 Inexact Rounded +rpox503 power 12345 -3 -> 5.3153E-13 Inexact Rounded +rpox504 power 12345 -2 -> 6.5618E-9 Inexact Rounded +rpox505 power 12345 -1 -> 0.000081005 Inexact Rounded +rpox506 power 12345 0 -> 1 +rpox507 power 12345 1 -> 12345 +rpox508 power 12345 2 -> 1.5240E+8 Inexact Rounded +rpox509 power 12345 3 -> 1.8814E+12 Inexact Rounded +rpox510 power 12345 4 -> 2.3226E+16 Inexact Rounded +rpox511 power 12345 5 -> 2.8672E+20 Inexact Rounded +rpox512 power 415 2 -> 1.7223E+5 Inexact Rounded +rpox513 power 75 3 -> 4.2188E+5 Inexact Rounded + +rounding: floor +rpox601 power 12345 -5 -> 3.4877E-21 Inexact Rounded +rpox602 power 12345 -4 -> 4.3056E-17 Inexact Rounded +rpox603 power 12345 -3 -> 5.3152E-13 Inexact Rounded +rpox604 power 12345 -2 -> 6.5617E-9 Inexact Rounded +rpox605 power 12345 -1 -> 0.000081004 Inexact Rounded +rpox606 power 12345 0 -> 1 +rpox607 power 12345 1 -> 12345 +rpox608 power 12345 2 -> 1.5239E+8 Inexact Rounded +rpox609 power 12345 3 -> 1.8813E+12 Inexact Rounded +rpox610 power 12345 4 -> 2.3225E+16 Inexact Rounded +rpox611 power 12345 5 -> 2.8671E+20 Inexact Rounded +rpox612 power 415 2 -> 1.7222E+5 Inexact Rounded +rpox613 power 75 3 -> 4.2187E+5 Inexact Rounded + +rounding: ceiling +rpox701 power 12345 -5 -> 3.4878E-21 Inexact Rounded +rpox702 power 12345 -4 -> 4.3057E-17 Inexact Rounded +rpox703 power 12345 -3 -> 5.3153E-13 Inexact Rounded +rpox704 power 12345 -2 -> 6.5618E-9 Inexact Rounded +rpox705 power 12345 -1 -> 0.000081005 Inexact Rounded +rpox706 power 12345 0 -> 1 +rpox707 power 12345 1 -> 12345 +rpox708 power 12345 2 -> 1.5240E+8 Inexact Rounded +rpox709 power 12345 3 -> 1.8814E+12 Inexact Rounded +rpox710 power 12345 4 -> 2.3226E+16 Inexact Rounded +rpox711 power 12345 5 -> 2.8672E+20 Inexact Rounded +rpox712 power 415 2 -> 1.7223E+5 Inexact Rounded +rpox713 power 75 3 -> 4.2188E+5 Inexact Rounded + +-- Underflow Subnormal and overflow values vary with rounding mode and sign +maxexponent: 999999999 +minexponent: -999999999 +rounding: down +rovx100 multiply 10 9E+999999999 -> 9.9999E+999999999 Overflow Inexact Rounded +rovx101 multiply -10 9E+999999999 -> -9.9999E+999999999 Overflow Inexact Rounded +rovx102 divide 1E-9 9E+999999999 -> 0E-1000000003 Underflow Subnormal Inexact Rounded Clamped +rovx104 divide -1E-9 9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped + +rounding: up +rovx110 multiply 10 9E+999999999 -> Infinity Overflow Inexact Rounded +rovx111 multiply -10 9E+999999999 -> -Infinity Overflow Inexact Rounded +rovx112 divide 1E-9 9E+999999999 -> 1E-1000000003 Underflow Subnormal Inexact Rounded +rovx114 divide -1E-9 9E+999999999 -> -1E-1000000003 Underflow Subnormal Inexact Rounded + +rounding: ceiling +rovx120 multiply 10 9E+999999999 -> Infinity Overflow Inexact Rounded +rovx121 multiply -10 9E+999999999 -> -9.9999E+999999999 Overflow Inexact Rounded +rovx122 divide 1E-9 9E+999999999 -> 1E-1000000003 Underflow Subnormal Inexact Rounded +rovx124 divide -1E-9 9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped + +rounding: floor +rovx130 multiply 10 9E+999999999 -> 9.9999E+999999999 Overflow Inexact Rounded +rovx131 multiply -10 9E+999999999 -> -Infinity Overflow Inexact Rounded +rovx132 divide 1E-9 9E+999999999 -> 0E-1000000003 Underflow Subnormal Inexact Rounded Clamped +rovx134 divide -1E-9 9E+999999999 -> -1E-1000000003 Underflow Subnormal Inexact Rounded + +rounding: half_up +rovx140 multiply 10 9E+999999999 -> Infinity Overflow Inexact Rounded +rovx141 multiply -10 9E+999999999 -> -Infinity Overflow Inexact Rounded +rovx142 divide 1E-9 9E+999999999 -> 0E-1000000003 Underflow Subnormal Inexact Rounded Clamped +rovx144 divide -1E-9 9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped + +rounding: half_even +rovx150 multiply 10 9E+999999999 -> Infinity Overflow Inexact Rounded +rovx151 multiply -10 9E+999999999 -> -Infinity Overflow Inexact Rounded +rovx152 divide 1E-9 9E+999999999 -> 0E-1000000003 Underflow Subnormal Inexact Rounded Clamped +rovx154 divide -1E-9 9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped + +rounding: half_down +rovx160 multiply 10 9E+999999999 -> Infinity Overflow Inexact Rounded +rovx161 multiply -10 9E+999999999 -> -Infinity Overflow Inexact Rounded +rovx162 divide 1E-9 9E+999999999 -> 0E-1000000003 Underflow Subnormal Inexact Rounded Clamped +rovx164 divide -1E-9 9E+999999999 -> -0E-1000000003 Underflow Subnormal Inexact Rounded Clamped + +-- check maximum finite value over a range of precisions +rounding: down +precision: 1 +rovx200 multiply 10 9E+999999999 -> 9E+999999999 Overflow Inexact Rounded +rovx201 multiply -10 9E+999999999 -> -9E+999999999 Overflow Inexact Rounded +precision: 2 +rovx210 multiply 10 9E+999999999 -> 9.9E+999999999 Overflow Inexact Rounded +rovx211 multiply -10 9E+999999999 -> -9.9E+999999999 Overflow Inexact Rounded +precision: 3 +rovx220 multiply 10 9E+999999999 -> 9.99E+999999999 Overflow Inexact Rounded +rovx221 multiply -10 9E+999999999 -> -9.99E+999999999 Overflow Inexact Rounded +precision: 4 +rovx230 multiply 10 9E+999999999 -> 9.999E+999999999 Overflow Inexact Rounded +rovx231 multiply -10 9E+999999999 -> -9.999E+999999999 Overflow Inexact Rounded +precision: 5 +rovx240 multiply 10 9E+999999999 -> 9.9999E+999999999 Overflow Inexact Rounded +rovx241 multiply -10 9E+999999999 -> -9.9999E+999999999 Overflow Inexact Rounded +precision: 6 +rovx250 multiply 10 9E+999999999 -> 9.99999E+999999999 Overflow Inexact Rounded +rovx251 multiply -10 9E+999999999 -> -9.99999E+999999999 Overflow Inexact Rounded +precision: 7 +rovx260 multiply 10 9E+999999999 -> 9.999999E+999999999 Overflow Inexact Rounded +rovx261 multiply -10 9E+999999999 -> -9.999999E+999999999 Overflow Inexact Rounded +precision: 8 +rovx270 multiply 10 9E+999999999 -> 9.9999999E+999999999 Overflow Inexact Rounded +rovx271 multiply -10 9E+999999999 -> -9.9999999E+999999999 Overflow Inexact Rounded +precision: 9 +rovx280 multiply 10 9E+999999999 -> 9.99999999E+999999999 Overflow Inexact Rounded +rovx281 multiply -10 9E+999999999 -> -9.99999999E+999999999 Overflow Inexact Rounded +precision: 10 +rovx290 multiply 10 9E+999999999 -> 9.999999999E+999999999 Overflow Inexact Rounded +rovx291 multiply -10 9E+999999999 -> -9.999999999E+999999999 Overflow Inexact Rounded + +-- reprise rounding mode effect (using multiplies so precision directive used) +precision: 9 +maxexponent: 999999999 +rounding: half_up +rmex400 multiply -9.999E+999999999 10 -> -Infinity Overflow Inexact Rounded +rmex401 multiply 9.999E+999999999 10 -> Infinity Overflow Inexact Rounded +rounding: half_down +rmex402 multiply -9.999E+999999999 10 -> -Infinity Overflow Inexact Rounded +rmex403 multiply 9.999E+999999999 10 -> Infinity Overflow Inexact Rounded +rounding: half_even +rmex404 multiply -9.999E+999999999 10 -> -Infinity Overflow Inexact Rounded +rmex405 multiply 9.999E+999999999 10 -> Infinity Overflow Inexact Rounded +rounding: floor +rmex406 multiply -9.999E+999999999 10 -> -Infinity Overflow Inexact Rounded +rmex407 multiply 9.999E+999999999 10 -> 9.99999999E+999999999 Overflow Inexact Rounded +rounding: ceiling +rmex408 multiply -9.999E+999999999 10 -> -9.99999999E+999999999 Overflow Inexact Rounded +rmex409 multiply 9.999E+999999999 10 -> Infinity Overflow Inexact Rounded +rounding: up +rmex410 multiply -9.999E+999999999 10 -> -Infinity Overflow Inexact Rounded +rmex411 multiply 9.999E+999999999 10 -> Infinity Overflow Inexact Rounded +rounding: down +rmex412 multiply -9.999E+999999999 10 -> -9.99999999E+999999999 Overflow Inexact Rounded +rmex413 multiply 9.999E+999999999 10 -> 9.99999999E+999999999 Overflow Inexact Rounded + Added: sandbox/trunk/decimal-c/new_dt/samequantum.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/samequantum.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,353 @@ +------------------------------------------------------------------------ +-- samequantum.decTest -- check quantums match -- +-- Copyright (c) IBM Corporation, 2001, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +samq001 samequantum 0 0 -> 1 +samq002 samequantum 0 1 -> 1 +samq003 samequantum 1 0 -> 1 +samq004 samequantum 1 1 -> 1 + +samq011 samequantum 10 1E+1 -> 0 +samq012 samequantum 10E+1 10E+1 -> 1 +samq013 samequantum 100 10E+1 -> 0 +samq014 samequantum 100 1E+2 -> 0 +samq015 samequantum 0.1 1E-2 -> 0 +samq016 samequantum 0.1 1E-1 -> 1 +samq017 samequantum 0.1 1E-0 -> 0 +samq018 samequantum 999 999 -> 1 +samq019 samequantum 999E-1 99.9 -> 1 +samq020 samequantum 111E-1 22.2 -> 1 +samq021 samequantum 111E-1 1234.2 -> 1 + +-- zeros +samq030 samequantum 0.0 1.1 -> 1 +samq031 samequantum 0.0 1.11 -> 0 +samq032 samequantum 0.0 0 -> 0 +samq033 samequantum 0.0 0.0 -> 1 +samq034 samequantum 0.0 0.00 -> 0 +samq035 samequantum 0E+1 0E+0 -> 0 +samq036 samequantum 0E+1 0E+1 -> 1 +samq037 samequantum 0E+1 0E+2 -> 0 +samq038 samequantum 0E-17 0E-16 -> 0 +samq039 samequantum 0E-17 0E-17 -> 1 +samq040 samequantum 0E-17 0E-18 -> 0 +samq041 samequantum 0E-17 0.0E-15 -> 0 +samq042 samequantum 0E-17 0.0E-16 -> 1 +samq043 samequantum 0E-17 0.0E-17 -> 0 +samq044 samequantum -0E-17 0.0E-16 -> 1 +samq045 samequantum 0E-17 -0.0E-17 -> 0 +samq046 samequantum 0E-17 -0.0E-16 -> 1 +samq047 samequantum -0E-17 0.0E-17 -> 0 +samq048 samequantum -0E-17 -0.0E-16 -> 1 +samq049 samequantum -0E-17 -0.0E-17 -> 0 + +-- specials & combinations + +samq0110 samequantum -Inf -Inf -> 1 +samq0111 samequantum -Inf Inf -> 1 +samq0112 samequantum -Inf NaN -> 0 +samq0113 samequantum -Inf -7E+3 -> 0 +samq0114 samequantum -Inf -7 -> 0 +samq0115 samequantum -Inf -7E-3 -> 0 +samq0116 samequantum -Inf -0E-3 -> 0 +samq0117 samequantum -Inf -0 -> 0 +samq0118 samequantum -Inf -0E+3 -> 0 +samq0119 samequantum -Inf 0E-3 -> 0 +samq0120 samequantum -Inf 0 -> 0 +samq0121 samequantum -Inf 0E+3 -> 0 +samq0122 samequantum -Inf 7E-3 -> 0 +samq0123 samequantum -Inf 7 -> 0 +samq0124 samequantum -Inf 7E+3 -> 0 +samq0125 samequantum -Inf sNaN -> 0 + +samq0210 samequantum Inf -Inf -> 1 +samq0211 samequantum Inf Inf -> 1 +samq0212 samequantum Inf NaN -> 0 +samq0213 samequantum Inf -7E+3 -> 0 +samq0214 samequantum Inf -7 -> 0 +samq0215 samequantum Inf -7E-3 -> 0 +samq0216 samequantum Inf -0E-3 -> 0 +samq0217 samequantum Inf -0 -> 0 +samq0218 samequantum Inf -0E+3 -> 0 +samq0219 samequantum Inf 0E-3 -> 0 +samq0220 samequantum Inf 0 -> 0 +samq0221 samequantum Inf 0E+3 -> 0 +samq0222 samequantum Inf 7E-3 -> 0 +samq0223 samequantum Inf 7 -> 0 +samq0224 samequantum Inf 7E+3 -> 0 +samq0225 samequantum Inf sNaN -> 0 + +samq0310 samequantum NaN -Inf -> 0 +samq0311 samequantum NaN Inf -> 0 +samq0312 samequantum NaN NaN -> 1 +samq0313 samequantum NaN -7E+3 -> 0 +samq0314 samequantum NaN -7 -> 0 +samq0315 samequantum NaN -7E-3 -> 0 +samq0316 samequantum NaN -0E-3 -> 0 +samq0317 samequantum NaN -0 -> 0 +samq0318 samequantum NaN -0E+3 -> 0 +samq0319 samequantum NaN 0E-3 -> 0 +samq0320 samequantum NaN 0 -> 0 +samq0321 samequantum NaN 0E+3 -> 0 +samq0322 samequantum NaN 7E-3 -> 0 +samq0323 samequantum NaN 7 -> 0 +samq0324 samequantum NaN 7E+3 -> 0 +samq0325 samequantum NaN sNaN -> 1 + +samq0410 samequantum -7E+3 -Inf -> 0 +samq0411 samequantum -7E+3 Inf -> 0 +samq0412 samequantum -7E+3 NaN -> 0 +samq0413 samequantum -7E+3 -7E+3 -> 1 +samq0414 samequantum -7E+3 -7 -> 0 +samq0415 samequantum -7E+3 -7E-3 -> 0 +samq0416 samequantum -7E+3 -0E-3 -> 0 +samq0417 samequantum -7E+3 -0 -> 0 +samq0418 samequantum -7E+3 -0E+3 -> 1 +samq0419 samequantum -7E+3 0E-3 -> 0 +samq0420 samequantum -7E+3 0 -> 0 +samq0421 samequantum -7E+3 0E+3 -> 1 +samq0422 samequantum -7E+3 7E-3 -> 0 +samq0423 samequantum -7E+3 7 -> 0 +samq0424 samequantum -7E+3 7E+3 -> 1 +samq0425 samequantum -7E+3 sNaN -> 0 + +samq0510 samequantum -7 -Inf -> 0 +samq0511 samequantum -7 Inf -> 0 +samq0512 samequantum -7 NaN -> 0 +samq0513 samequantum -7 -7E+3 -> 0 +samq0514 samequantum -7 -7 -> 1 +samq0515 samequantum -7 -7E-3 -> 0 +samq0516 samequantum -7 -0E-3 -> 0 +samq0517 samequantum -7 -0 -> 1 +samq0518 samequantum -7 -0E+3 -> 0 +samq0519 samequantum -7 0E-3 -> 0 +samq0520 samequantum -7 0 -> 1 +samq0521 samequantum -7 0E+3 -> 0 +samq0522 samequantum -7 7E-3 -> 0 +samq0523 samequantum -7 7 -> 1 +samq0524 samequantum -7 7E+3 -> 0 +samq0525 samequantum -7 sNaN -> 0 + +samq0610 samequantum -7E-3 -Inf -> 0 +samq0611 samequantum -7E-3 Inf -> 0 +samq0612 samequantum -7E-3 NaN -> 0 +samq0613 samequantum -7E-3 -7E+3 -> 0 +samq0614 samequantum -7E-3 -7 -> 0 +samq0615 samequantum -7E-3 -7E-3 -> 1 +samq0616 samequantum -7E-3 -0E-3 -> 1 +samq0617 samequantum -7E-3 -0 -> 0 +samq0618 samequantum -7E-3 -0E+3 -> 0 +samq0619 samequantum -7E-3 0E-3 -> 1 +samq0620 samequantum -7E-3 0 -> 0 +samq0621 samequantum -7E-3 0E+3 -> 0 +samq0622 samequantum -7E-3 7E-3 -> 1 +samq0623 samequantum -7E-3 7 -> 0 +samq0624 samequantum -7E-3 7E+3 -> 0 +samq0625 samequantum -7E-3 sNaN -> 0 + +samq0710 samequantum -0E-3 -Inf -> 0 +samq0711 samequantum -0E-3 Inf -> 0 +samq0712 samequantum -0E-3 NaN -> 0 +samq0713 samequantum -0E-3 -7E+3 -> 0 +samq0714 samequantum -0E-3 -7 -> 0 +samq0715 samequantum -0E-3 -7E-3 -> 1 +samq0716 samequantum -0E-3 -0E-3 -> 1 +samq0717 samequantum -0E-3 -0 -> 0 +samq0718 samequantum -0E-3 -0E+3 -> 0 +samq0719 samequantum -0E-3 0E-3 -> 1 +samq0720 samequantum -0E-3 0 -> 0 +samq0721 samequantum -0E-3 0E+3 -> 0 +samq0722 samequantum -0E-3 7E-3 -> 1 +samq0723 samequantum -0E-3 7 -> 0 +samq0724 samequantum -0E-3 7E+3 -> 0 +samq0725 samequantum -0E-3 sNaN -> 0 + +samq0810 samequantum -0 -Inf -> 0 +samq0811 samequantum -0 Inf -> 0 +samq0812 samequantum -0 NaN -> 0 +samq0813 samequantum -0 -7E+3 -> 0 +samq0814 samequantum -0 -7 -> 1 +samq0815 samequantum -0 -7E-3 -> 0 +samq0816 samequantum -0 -0E-3 -> 0 +samq0817 samequantum -0 -0 -> 1 +samq0818 samequantum -0 -0E+3 -> 0 +samq0819 samequantum -0 0E-3 -> 0 +samq0820 samequantum -0 0 -> 1 +samq0821 samequantum -0 0E+3 -> 0 +samq0822 samequantum -0 7E-3 -> 0 +samq0823 samequantum -0 7 -> 1 +samq0824 samequantum -0 7E+3 -> 0 +samq0825 samequantum -0 sNaN -> 0 + +samq0910 samequantum -0E+3 -Inf -> 0 +samq0911 samequantum -0E+3 Inf -> 0 +samq0912 samequantum -0E+3 NaN -> 0 +samq0913 samequantum -0E+3 -7E+3 -> 1 +samq0914 samequantum -0E+3 -7 -> 0 +samq0915 samequantum -0E+3 -7E-3 -> 0 +samq0916 samequantum -0E+3 -0E-3 -> 0 +samq0917 samequantum -0E+3 -0 -> 0 +samq0918 samequantum -0E+3 -0E+3 -> 1 +samq0919 samequantum -0E+3 0E-3 -> 0 +samq0920 samequantum -0E+3 0 -> 0 +samq0921 samequantum -0E+3 0E+3 -> 1 +samq0922 samequantum -0E+3 7E-3 -> 0 +samq0923 samequantum -0E+3 7 -> 0 +samq0924 samequantum -0E+3 7E+3 -> 1 +samq0925 samequantum -0E+3 sNaN -> 0 + +samq1110 samequantum 0E-3 -Inf -> 0 +samq1111 samequantum 0E-3 Inf -> 0 +samq1112 samequantum 0E-3 NaN -> 0 +samq1113 samequantum 0E-3 -7E+3 -> 0 +samq1114 samequantum 0E-3 -7 -> 0 +samq1115 samequantum 0E-3 -7E-3 -> 1 +samq1116 samequantum 0E-3 -0E-3 -> 1 +samq1117 samequantum 0E-3 -0 -> 0 +samq1118 samequantum 0E-3 -0E+3 -> 0 +samq1119 samequantum 0E-3 0E-3 -> 1 +samq1120 samequantum 0E-3 0 -> 0 +samq1121 samequantum 0E-3 0E+3 -> 0 +samq1122 samequantum 0E-3 7E-3 -> 1 +samq1123 samequantum 0E-3 7 -> 0 +samq1124 samequantum 0E-3 7E+3 -> 0 +samq1125 samequantum 0E-3 sNaN -> 0 + +samq1210 samequantum 0 -Inf -> 0 +samq1211 samequantum 0 Inf -> 0 +samq1212 samequantum 0 NaN -> 0 +samq1213 samequantum 0 -7E+3 -> 0 +samq1214 samequantum 0 -7 -> 1 +samq1215 samequantum 0 -7E-3 -> 0 +samq1216 samequantum 0 -0E-3 -> 0 +samq1217 samequantum 0 -0 -> 1 +samq1218 samequantum 0 -0E+3 -> 0 +samq1219 samequantum 0 0E-3 -> 0 +samq1220 samequantum 0 0 -> 1 +samq1221 samequantum 0 0E+3 -> 0 +samq1222 samequantum 0 7E-3 -> 0 +samq1223 samequantum 0 7 -> 1 +samq1224 samequantum 0 7E+3 -> 0 +samq1225 samequantum 0 sNaN -> 0 + +samq1310 samequantum 0E+3 -Inf -> 0 +samq1311 samequantum 0E+3 Inf -> 0 +samq1312 samequantum 0E+3 NaN -> 0 +samq1313 samequantum 0E+3 -7E+3 -> 1 +samq1314 samequantum 0E+3 -7 -> 0 +samq1315 samequantum 0E+3 -7E-3 -> 0 +samq1316 samequantum 0E+3 -0E-3 -> 0 +samq1317 samequantum 0E+3 -0 -> 0 +samq1318 samequantum 0E+3 -0E+3 -> 1 +samq1319 samequantum 0E+3 0E-3 -> 0 +samq1320 samequantum 0E+3 0 -> 0 +samq1321 samequantum 0E+3 0E+3 -> 1 +samq1322 samequantum 0E+3 7E-3 -> 0 +samq1323 samequantum 0E+3 7 -> 0 +samq1324 samequantum 0E+3 7E+3 -> 1 +samq1325 samequantum 0E+3 sNaN -> 0 + +samq1410 samequantum 7E-3 -Inf -> 0 +samq1411 samequantum 7E-3 Inf -> 0 +samq1412 samequantum 7E-3 NaN -> 0 +samq1413 samequantum 7E-3 -7E+3 -> 0 +samq1414 samequantum 7E-3 -7 -> 0 +samq1415 samequantum 7E-3 -7E-3 -> 1 +samq1416 samequantum 7E-3 -0E-3 -> 1 +samq1417 samequantum 7E-3 -0 -> 0 +samq1418 samequantum 7E-3 -0E+3 -> 0 +samq1419 samequantum 7E-3 0E-3 -> 1 +samq1420 samequantum 7E-3 0 -> 0 +samq1421 samequantum 7E-3 0E+3 -> 0 +samq1422 samequantum 7E-3 7E-3 -> 1 +samq1423 samequantum 7E-3 7 -> 0 +samq1424 samequantum 7E-3 7E+3 -> 0 +samq1425 samequantum 7E-3 sNaN -> 0 + +samq1510 samequantum 7 -Inf -> 0 +samq1511 samequantum 7 Inf -> 0 +samq1512 samequantum 7 NaN -> 0 +samq1513 samequantum 7 -7E+3 -> 0 +samq1514 samequantum 7 -7 -> 1 +samq1515 samequantum 7 -7E-3 -> 0 +samq1516 samequantum 7 -0E-3 -> 0 +samq1517 samequantum 7 -0 -> 1 +samq1518 samequantum 7 -0E+3 -> 0 +samq1519 samequantum 7 0E-3 -> 0 +samq1520 samequantum 7 0 -> 1 +samq1521 samequantum 7 0E+3 -> 0 +samq1522 samequantum 7 7E-3 -> 0 +samq1523 samequantum 7 7 -> 1 +samq1524 samequantum 7 7E+3 -> 0 +samq1525 samequantum 7 sNaN -> 0 + +samq1610 samequantum 7E+3 -Inf -> 0 +samq1611 samequantum 7E+3 Inf -> 0 +samq1612 samequantum 7E+3 NaN -> 0 +samq1613 samequantum 7E+3 -7E+3 -> 1 +samq1614 samequantum 7E+3 -7 -> 0 +samq1615 samequantum 7E+3 -7E-3 -> 0 +samq1616 samequantum 7E+3 -0E-3 -> 0 +samq1617 samequantum 7E+3 -0 -> 0 +samq1618 samequantum 7E+3 -0E+3 -> 1 +samq1619 samequantum 7E+3 0E-3 -> 0 +samq1620 samequantum 7E+3 0 -> 0 +samq1621 samequantum 7E+3 0E+3 -> 1 +samq1622 samequantum 7E+3 7E-3 -> 0 +samq1623 samequantum 7E+3 7 -> 0 +samq1624 samequantum 7E+3 7E+3 -> 1 +samq1625 samequantum 7E+3 sNaN -> 0 + +samq1710 samequantum sNaN -Inf -> 0 +samq1711 samequantum sNaN Inf -> 0 +samq1712 samequantum sNaN NaN -> 1 +samq1713 samequantum sNaN -7E+3 -> 0 +samq1714 samequantum sNaN -7 -> 0 +samq1715 samequantum sNaN -7E-3 -> 0 +samq1716 samequantum sNaN -0E-3 -> 0 +samq1717 samequantum sNaN -0 -> 0 +samq1718 samequantum sNaN -0E+3 -> 0 +samq1719 samequantum sNaN 0E-3 -> 0 +samq1720 samequantum sNaN 0 -> 0 +samq1721 samequantum sNaN 0E+3 -> 0 +samq1722 samequantum sNaN 7E-3 -> 0 +samq1723 samequantum sNaN 7 -> 0 +samq1724 samequantum sNaN 7E+3 -> 0 +samq1725 samequantum sNaN sNaN -> 1 +-- noisy NaNs +samq1730 samequantum sNaN3 sNaN3 -> 1 +samq1731 samequantum sNaN3 sNaN4 -> 1 +samq1732 samequantum NaN3 NaN3 -> 1 +samq1733 samequantum NaN3 NaN4 -> 1 +samq1734 samequantum sNaN3 3 -> 0 +samq1735 samequantum NaN3 3 -> 0 +samq1736 samequantum 4 sNaN4 -> 0 +samq1737 samequantum 3 NaN3 -> 0 +samq1738 samequantum Inf sNaN4 -> 0 +samq1739 samequantum -Inf NaN3 -> 0 + + + Added: sandbox/trunk/decimal-c/new_dt/squareroot.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/squareroot.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,2960 @@ +------------------------------------------------------------------------ +-- squareroot.decTest -- decimal square root -- +-- Copyright (c) IBM Corporation, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- basics +sqtx001 squareroot 1 -> 1 +sqtx002 squareroot -1 -> NaN Invalid_operation +sqtx003 squareroot 1.00 -> 1.0 +sqtx004 squareroot -1.00 -> NaN Invalid_operation +sqtx005 squareroot 0 -> 0 +sqtx006 squareroot 00.0 -> 0.0 +sqtx007 squareroot 0.00 -> 0.0 +sqtx008 squareroot 00.00 -> 0.0 +sqtx009 squareroot 00.000 -> 0.00 +sqtx010 squareroot 00.0000 -> 0.00 +sqtx011 squareroot 00 -> 0 + +sqtx012 squareroot -2 -> NaN Invalid_operation +sqtx013 squareroot 2 -> 1.41421356 Inexact Rounded +sqtx014 squareroot -2.00 -> NaN Invalid_operation +sqtx015 squareroot 2.00 -> 1.41421356 Inexact Rounded +sqtx016 squareroot -0 -> -0 +sqtx017 squareroot -0.0 -> -0.0 +sqtx018 squareroot -00.00 -> -0.0 +sqtx019 squareroot -00.000 -> -0.00 +sqtx020 squareroot -0.0000 -> -0.00 +sqtx021 squareroot -0E+9 -> -0E+4 +sqtx022 squareroot -0E+10 -> -0E+5 +sqtx023 squareroot -0E+11 -> -0E+5 +sqtx024 squareroot -0E+12 -> -0E+6 +sqtx025 squareroot -00 -> -0 +sqtx026 squareroot 0E+5 -> 0E+2 +sqtx027 squareroot 4.0 -> 2.0 +sqtx028 squareroot 4.00 -> 2.0 + +sqtx030 squareroot +0.1 -> 0.316227766 Inexact Rounded +sqtx031 squareroot -0.1 -> NaN Invalid_operation +sqtx032 squareroot +0.01 -> 0.1 +sqtx033 squareroot -0.01 -> NaN Invalid_operation +sqtx034 squareroot +0.001 -> 0.0316227766 Inexact Rounded +sqtx035 squareroot -0.001 -> NaN Invalid_operation +sqtx036 squareroot +0.000001 -> 0.001 +sqtx037 squareroot -0.000001 -> NaN Invalid_operation +sqtx038 squareroot +0.000000000001 -> 0.000001 +sqtx039 squareroot -0.000000000001 -> NaN Invalid_operation + +sqtx041 squareroot 1.1 -> 1.04880885 Inexact Rounded +sqtx042 squareroot 1.10 -> 1.04880885 Inexact Rounded +sqtx043 squareroot 1.100 -> 1.04880885 Inexact Rounded +sqtx044 squareroot 1.110 -> 1.05356538 Inexact Rounded +sqtx045 squareroot -1.1 -> NaN Invalid_operation +sqtx046 squareroot -1.10 -> NaN Invalid_operation +sqtx047 squareroot -1.100 -> NaN Invalid_operation +sqtx048 squareroot -1.110 -> NaN Invalid_operation +sqtx049 squareroot 9.9 -> 3.14642654 Inexact Rounded +sqtx050 squareroot 9.90 -> 3.14642654 Inexact Rounded +sqtx051 squareroot 9.900 -> 3.14642654 Inexact Rounded +sqtx052 squareroot 9.990 -> 3.16069613 Inexact Rounded +sqtx053 squareroot -9.9 -> NaN Invalid_operation +sqtx054 squareroot -9.90 -> NaN Invalid_operation +sqtx055 squareroot -9.900 -> NaN Invalid_operation +sqtx056 squareroot -9.990 -> NaN Invalid_operation + +sqtx060 squareroot 1 -> 1 +sqtx061 squareroot 1.0 -> 1.0 +sqtx062 squareroot 1.00 -> 1.0 +sqtx063 squareroot 10.0 -> 3.16227766 Inexact Rounded +sqtx064 squareroot 10.0 -> 3.16227766 Inexact Rounded +sqtx065 squareroot 10.0 -> 3.16227766 Inexact Rounded +sqtx066 squareroot 10.00 -> 3.16227766 Inexact Rounded +sqtx067 squareroot 100 -> 10 +sqtx068 squareroot 100.0 -> 10.0 +sqtx069 squareroot 100.00 -> 10.0 +sqtx070 squareroot 1.1000E+3 -> 33.1662479 Inexact Rounded +sqtx071 squareroot 1.10000E+3 -> 33.1662479 Inexact Rounded +sqtx072 squareroot -10.0 -> NaN Invalid_operation +sqtx073 squareroot -10.00 -> NaN Invalid_operation +sqtx074 squareroot -100.0 -> NaN Invalid_operation +sqtx075 squareroot -100.00 -> NaN Invalid_operation +sqtx076 squareroot -1.1000E+3 -> NaN Invalid_operation +sqtx077 squareroot -1.10000E+3 -> NaN Invalid_operation +sqtx078 squareroot 1.000 -> 1.00 +sqtx079 squareroot 1.0000 -> 1.00 + +-- famous squares +sqtx080 squareroot 1 -> 1 +sqtx081 squareroot 4 -> 2 +sqtx082 squareroot 9 -> 3 +sqtx083 squareroot 16 -> 4 +sqtx084 squareroot 25 -> 5 +sqtx085 squareroot 36 -> 6 +sqtx086 squareroot 49 -> 7 +sqtx087 squareroot 64 -> 8 +sqtx088 squareroot 81 -> 9 +sqtx089 squareroot 100 -> 10 +sqtx090 squareroot 121 -> 11 +sqtx091 squareroot 144 -> 12 +sqtx092 squareroot 169 -> 13 +sqtx093 squareroot 256 -> 16 +sqtx094 squareroot 1024 -> 32 +sqtx095 squareroot 4096 -> 64 +sqtx100 squareroot 0.01 -> 0.1 +sqtx101 squareroot 0.04 -> 0.2 +sqtx102 squareroot 0.09 -> 0.3 +sqtx103 squareroot 0.16 -> 0.4 +sqtx104 squareroot 0.25 -> 0.5 +sqtx105 squareroot 0.36 -> 0.6 +sqtx106 squareroot 0.49 -> 0.7 +sqtx107 squareroot 0.64 -> 0.8 +sqtx108 squareroot 0.81 -> 0.9 +sqtx109 squareroot 1.00 -> 1.0 +sqtx110 squareroot 1.21 -> 1.1 +sqtx111 squareroot 1.44 -> 1.2 +sqtx112 squareroot 1.69 -> 1.3 +sqtx113 squareroot 2.56 -> 1.6 +sqtx114 squareroot 10.24 -> 3.2 +sqtx115 squareroot 40.96 -> 6.4 + +-- Precision 1 squareroot tests [exhaustive, plus exponent adjusts] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 1 +sqtx1201 squareroot 0.1 -> 0.3 Inexact Rounded +sqtx1202 squareroot 0.01 -> 0.1 +sqtx1203 squareroot 1.0E-1 -> 0.3 Inexact Rounded +sqtx1204 squareroot 1.00E-2 -> 0.1 Rounded +sqtx1205 squareroot 1E-3 -> 0.03 Inexact Rounded +sqtx1206 squareroot 1E+1 -> 3 Inexact Rounded +sqtx1207 squareroot 1E+2 -> 1E+1 +sqtx1208 squareroot 1E+3 -> 3E+1 Inexact Rounded +sqtx1209 squareroot 0.2 -> 0.4 Inexact Rounded +sqtx1210 squareroot 0.02 -> 0.1 Inexact Rounded +sqtx1211 squareroot 2.0E-1 -> 0.4 Inexact Rounded +sqtx1212 squareroot 2.00E-2 -> 0.1 Inexact Rounded +sqtx1213 squareroot 2E-3 -> 0.04 Inexact Rounded +sqtx1214 squareroot 2E+1 -> 4 Inexact Rounded +sqtx1215 squareroot 2E+2 -> 1E+1 Inexact Rounded +sqtx1216 squareroot 2E+3 -> 4E+1 Inexact Rounded +sqtx1217 squareroot 0.3 -> 0.5 Inexact Rounded +sqtx1218 squareroot 0.03 -> 0.2 Inexact Rounded +sqtx1219 squareroot 3.0E-1 -> 0.5 Inexact Rounded +sqtx1220 squareroot 3.00E-2 -> 0.2 Inexact Rounded +sqtx1221 squareroot 3E-3 -> 0.05 Inexact Rounded +sqtx1222 squareroot 3E+1 -> 5 Inexact Rounded +sqtx1223 squareroot 3E+2 -> 2E+1 Inexact Rounded +sqtx1224 squareroot 3E+3 -> 5E+1 Inexact Rounded +sqtx1225 squareroot 0.4 -> 0.6 Inexact Rounded +sqtx1226 squareroot 0.04 -> 0.2 +sqtx1227 squareroot 4.0E-1 -> 0.6 Inexact Rounded +sqtx1228 squareroot 4.00E-2 -> 0.2 Rounded +sqtx1229 squareroot 4E-3 -> 0.06 Inexact Rounded +sqtx1230 squareroot 4E+1 -> 6 Inexact Rounded +sqtx1231 squareroot 4E+2 -> 2E+1 +sqtx1232 squareroot 4E+3 -> 6E+1 Inexact Rounded +sqtx1233 squareroot 0.5 -> 0.7 Inexact Rounded +sqtx1234 squareroot 0.05 -> 0.2 Inexact Rounded +sqtx1235 squareroot 5.0E-1 -> 0.7 Inexact Rounded +sqtx1236 squareroot 5.00E-2 -> 0.2 Inexact Rounded +sqtx1237 squareroot 5E-3 -> 0.07 Inexact Rounded +sqtx1238 squareroot 5E+1 -> 7 Inexact Rounded +sqtx1239 squareroot 5E+2 -> 2E+1 Inexact Rounded +sqtx1240 squareroot 5E+3 -> 7E+1 Inexact Rounded +sqtx1241 squareroot 0.6 -> 0.8 Inexact Rounded +sqtx1242 squareroot 0.06 -> 0.2 Inexact Rounded +sqtx1243 squareroot 6.0E-1 -> 0.8 Inexact Rounded +sqtx1244 squareroot 6.00E-2 -> 0.2 Inexact Rounded +sqtx1245 squareroot 6E-3 -> 0.08 Inexact Rounded +sqtx1246 squareroot 6E+1 -> 8 Inexact Rounded +sqtx1247 squareroot 6E+2 -> 2E+1 Inexact Rounded +sqtx1248 squareroot 6E+3 -> 8E+1 Inexact Rounded +sqtx1249 squareroot 0.7 -> 0.8 Inexact Rounded +sqtx1250 squareroot 0.07 -> 0.3 Inexact Rounded +sqtx1251 squareroot 7.0E-1 -> 0.8 Inexact Rounded +sqtx1252 squareroot 7.00E-2 -> 0.3 Inexact Rounded +sqtx1253 squareroot 7E-3 -> 0.08 Inexact Rounded +sqtx1254 squareroot 7E+1 -> 8 Inexact Rounded +sqtx1255 squareroot 7E+2 -> 3E+1 Inexact Rounded +sqtx1256 squareroot 7E+3 -> 8E+1 Inexact Rounded +sqtx1257 squareroot 0.8 -> 0.9 Inexact Rounded +sqtx1258 squareroot 0.08 -> 0.3 Inexact Rounded +sqtx1259 squareroot 8.0E-1 -> 0.9 Inexact Rounded +sqtx1260 squareroot 8.00E-2 -> 0.3 Inexact Rounded +sqtx1261 squareroot 8E-3 -> 0.09 Inexact Rounded +sqtx1262 squareroot 8E+1 -> 9 Inexact Rounded +sqtx1263 squareroot 8E+2 -> 3E+1 Inexact Rounded +sqtx1264 squareroot 8E+3 -> 9E+1 Inexact Rounded +sqtx1265 squareroot 0.9 -> 0.9 Inexact Rounded +sqtx1266 squareroot 0.09 -> 0.3 +sqtx1267 squareroot 9.0E-1 -> 0.9 Inexact Rounded +sqtx1268 squareroot 9.00E-2 -> 0.3 Rounded +sqtx1269 squareroot 9E-3 -> 0.09 Inexact Rounded +sqtx1270 squareroot 9E+1 -> 9 Inexact Rounded +sqtx1271 squareroot 9E+2 -> 3E+1 +sqtx1272 squareroot 9E+3 -> 9E+1 Inexact Rounded + +-- Precision 2 squareroot tests [exhaustive, plus exponent adjusts] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 2 +sqtx2201 squareroot 0.1 -> 0.32 Inexact Rounded +sqtx2202 squareroot 0.01 -> 0.1 +sqtx2203 squareroot 1.0E-1 -> 0.32 Inexact Rounded +sqtx2204 squareroot 1.00E-2 -> 0.10 +sqtx2205 squareroot 1E-3 -> 0.032 Inexact Rounded +sqtx2206 squareroot 1E+1 -> 3.2 Inexact Rounded +sqtx2207 squareroot 1E+2 -> 1E+1 +sqtx2208 squareroot 1E+3 -> 32 Inexact Rounded +sqtx2209 squareroot 0.2 -> 0.45 Inexact Rounded +sqtx2210 squareroot 0.02 -> 0.14 Inexact Rounded +sqtx2211 squareroot 2.0E-1 -> 0.45 Inexact Rounded +sqtx2212 squareroot 2.00E-2 -> 0.14 Inexact Rounded +sqtx2213 squareroot 2E-3 -> 0.045 Inexact Rounded +sqtx2214 squareroot 2E+1 -> 4.5 Inexact Rounded +sqtx2215 squareroot 2E+2 -> 14 Inexact Rounded +sqtx2216 squareroot 2E+3 -> 45 Inexact Rounded +sqtx2217 squareroot 0.3 -> 0.55 Inexact Rounded +sqtx2218 squareroot 0.03 -> 0.17 Inexact Rounded +sqtx2219 squareroot 3.0E-1 -> 0.55 Inexact Rounded +sqtx2220 squareroot 3.00E-2 -> 0.17 Inexact Rounded +sqtx2221 squareroot 3E-3 -> 0.055 Inexact Rounded +sqtx2222 squareroot 3E+1 -> 5.5 Inexact Rounded +sqtx2223 squareroot 3E+2 -> 17 Inexact Rounded +sqtx2224 squareroot 3E+3 -> 55 Inexact Rounded +sqtx2225 squareroot 0.4 -> 0.63 Inexact Rounded +sqtx2226 squareroot 0.04 -> 0.2 +sqtx2227 squareroot 4.0E-1 -> 0.63 Inexact Rounded +sqtx2228 squareroot 4.00E-2 -> 0.20 +sqtx2229 squareroot 4E-3 -> 0.063 Inexact Rounded +sqtx2230 squareroot 4E+1 -> 6.3 Inexact Rounded +sqtx2231 squareroot 4E+2 -> 2E+1 +sqtx2232 squareroot 4E+3 -> 63 Inexact Rounded +sqtx2233 squareroot 0.5 -> 0.71 Inexact Rounded +sqtx2234 squareroot 0.05 -> 0.22 Inexact Rounded +sqtx2235 squareroot 5.0E-1 -> 0.71 Inexact Rounded +sqtx2236 squareroot 5.00E-2 -> 0.22 Inexact Rounded +sqtx2237 squareroot 5E-3 -> 0.071 Inexact Rounded +sqtx2238 squareroot 5E+1 -> 7.1 Inexact Rounded +sqtx2239 squareroot 5E+2 -> 22 Inexact Rounded +sqtx2240 squareroot 5E+3 -> 71 Inexact Rounded +sqtx2241 squareroot 0.6 -> 0.77 Inexact Rounded +sqtx2242 squareroot 0.06 -> 0.24 Inexact Rounded +sqtx2243 squareroot 6.0E-1 -> 0.77 Inexact Rounded +sqtx2244 squareroot 6.00E-2 -> 0.24 Inexact Rounded +sqtx2245 squareroot 6E-3 -> 0.077 Inexact Rounded +sqtx2246 squareroot 6E+1 -> 7.7 Inexact Rounded +sqtx2247 squareroot 6E+2 -> 24 Inexact Rounded +sqtx2248 squareroot 6E+3 -> 77 Inexact Rounded +sqtx2249 squareroot 0.7 -> 0.84 Inexact Rounded +sqtx2250 squareroot 0.07 -> 0.26 Inexact Rounded +sqtx2251 squareroot 7.0E-1 -> 0.84 Inexact Rounded +sqtx2252 squareroot 7.00E-2 -> 0.26 Inexact Rounded +sqtx2253 squareroot 7E-3 -> 0.084 Inexact Rounded +sqtx2254 squareroot 7E+1 -> 8.4 Inexact Rounded +sqtx2255 squareroot 7E+2 -> 26 Inexact Rounded +sqtx2256 squareroot 7E+3 -> 84 Inexact Rounded +sqtx2257 squareroot 0.8 -> 0.89 Inexact Rounded +sqtx2258 squareroot 0.08 -> 0.28 Inexact Rounded +sqtx2259 squareroot 8.0E-1 -> 0.89 Inexact Rounded +sqtx2260 squareroot 8.00E-2 -> 0.28 Inexact Rounded +sqtx2261 squareroot 8E-3 -> 0.089 Inexact Rounded +sqtx2262 squareroot 8E+1 -> 8.9 Inexact Rounded +sqtx2263 squareroot 8E+2 -> 28 Inexact Rounded +sqtx2264 squareroot 8E+3 -> 89 Inexact Rounded +sqtx2265 squareroot 0.9 -> 0.95 Inexact Rounded +sqtx2266 squareroot 0.09 -> 0.3 +sqtx2267 squareroot 9.0E-1 -> 0.95 Inexact Rounded +sqtx2268 squareroot 9.00E-2 -> 0.30 +sqtx2269 squareroot 9E-3 -> 0.095 Inexact Rounded +sqtx2270 squareroot 9E+1 -> 9.5 Inexact Rounded +sqtx2271 squareroot 9E+2 -> 3E+1 +sqtx2272 squareroot 9E+3 -> 95 Inexact Rounded +sqtx2273 squareroot 0.10 -> 0.32 Inexact Rounded +sqtx2274 squareroot 0.010 -> 0.10 +sqtx2275 squareroot 10.0E-1 -> 1.0 +sqtx2276 squareroot 10.00E-2 -> 0.32 Inexact Rounded +sqtx2277 squareroot 10E-3 -> 0.10 +sqtx2278 squareroot 10E+1 -> 10 +sqtx2279 squareroot 10E+2 -> 32 Inexact Rounded +sqtx2280 squareroot 10E+3 -> 1.0E+2 +sqtx2281 squareroot 0.11 -> 0.33 Inexact Rounded +sqtx2282 squareroot 0.011 -> 0.10 Inexact Rounded +sqtx2283 squareroot 11.0E-1 -> 1.0 Inexact Rounded +sqtx2284 squareroot 11.00E-2 -> 0.33 Inexact Rounded +sqtx2285 squareroot 11E-3 -> 0.10 Inexact Rounded +sqtx2286 squareroot 11E+1 -> 10 Inexact Rounded +sqtx2287 squareroot 11E+2 -> 33 Inexact Rounded +sqtx2288 squareroot 11E+3 -> 1.0E+2 Inexact Rounded +sqtx2289 squareroot 0.12 -> 0.35 Inexact Rounded +sqtx2290 squareroot 0.012 -> 0.11 Inexact Rounded +sqtx2291 squareroot 12.0E-1 -> 1.1 Inexact Rounded +sqtx2292 squareroot 12.00E-2 -> 0.35 Inexact Rounded +sqtx2293 squareroot 12E-3 -> 0.11 Inexact Rounded +sqtx2294 squareroot 12E+1 -> 11 Inexact Rounded +sqtx2295 squareroot 12E+2 -> 35 Inexact Rounded +sqtx2296 squareroot 12E+3 -> 1.1E+2 Inexact Rounded +sqtx2297 squareroot 0.13 -> 0.36 Inexact Rounded +sqtx2298 squareroot 0.013 -> 0.11 Inexact Rounded +sqtx2299 squareroot 13.0E-1 -> 1.1 Inexact Rounded +sqtx2300 squareroot 13.00E-2 -> 0.36 Inexact Rounded +sqtx2301 squareroot 13E-3 -> 0.11 Inexact Rounded +sqtx2302 squareroot 13E+1 -> 11 Inexact Rounded +sqtx2303 squareroot 13E+2 -> 36 Inexact Rounded +sqtx2304 squareroot 13E+3 -> 1.1E+2 Inexact Rounded +sqtx2305 squareroot 0.14 -> 0.37 Inexact Rounded +sqtx2306 squareroot 0.014 -> 0.12 Inexact Rounded +sqtx2307 squareroot 14.0E-1 -> 1.2 Inexact Rounded +sqtx2308 squareroot 14.00E-2 -> 0.37 Inexact Rounded +sqtx2309 squareroot 14E-3 -> 0.12 Inexact Rounded +sqtx2310 squareroot 14E+1 -> 12 Inexact Rounded +sqtx2311 squareroot 14E+2 -> 37 Inexact Rounded +sqtx2312 squareroot 14E+3 -> 1.2E+2 Inexact Rounded +sqtx2313 squareroot 0.15 -> 0.39 Inexact Rounded +sqtx2314 squareroot 0.015 -> 0.12 Inexact Rounded +sqtx2315 squareroot 15.0E-1 -> 1.2 Inexact Rounded +sqtx2316 squareroot 15.00E-2 -> 0.39 Inexact Rounded +sqtx2317 squareroot 15E-3 -> 0.12 Inexact Rounded +sqtx2318 squareroot 15E+1 -> 12 Inexact Rounded +sqtx2319 squareroot 15E+2 -> 39 Inexact Rounded +sqtx2320 squareroot 15E+3 -> 1.2E+2 Inexact Rounded +sqtx2321 squareroot 0.16 -> 0.4 +sqtx2322 squareroot 0.016 -> 0.13 Inexact Rounded +sqtx2323 squareroot 16.0E-1 -> 1.3 Inexact Rounded +sqtx2324 squareroot 16.00E-2 -> 0.40 +sqtx2325 squareroot 16E-3 -> 0.13 Inexact Rounded +sqtx2326 squareroot 16E+1 -> 13 Inexact Rounded +sqtx2327 squareroot 16E+2 -> 4E+1 +sqtx2328 squareroot 16E+3 -> 1.3E+2 Inexact Rounded +sqtx2329 squareroot 0.17 -> 0.41 Inexact Rounded +sqtx2330 squareroot 0.017 -> 0.13 Inexact Rounded +sqtx2331 squareroot 17.0E-1 -> 1.3 Inexact Rounded +sqtx2332 squareroot 17.00E-2 -> 0.41 Inexact Rounded +sqtx2333 squareroot 17E-3 -> 0.13 Inexact Rounded +sqtx2334 squareroot 17E+1 -> 13 Inexact Rounded +sqtx2335 squareroot 17E+2 -> 41 Inexact Rounded +sqtx2336 squareroot 17E+3 -> 1.3E+2 Inexact Rounded +sqtx2337 squareroot 0.18 -> 0.42 Inexact Rounded +sqtx2338 squareroot 0.018 -> 0.13 Inexact Rounded +sqtx2339 squareroot 18.0E-1 -> 1.3 Inexact Rounded +sqtx2340 squareroot 18.00E-2 -> 0.42 Inexact Rounded +sqtx2341 squareroot 18E-3 -> 0.13 Inexact Rounded +sqtx2342 squareroot 18E+1 -> 13 Inexact Rounded +sqtx2343 squareroot 18E+2 -> 42 Inexact Rounded +sqtx2344 squareroot 18E+3 -> 1.3E+2 Inexact Rounded +sqtx2345 squareroot 0.19 -> 0.44 Inexact Rounded +sqtx2346 squareroot 0.019 -> 0.14 Inexact Rounded +sqtx2347 squareroot 19.0E-1 -> 1.4 Inexact Rounded +sqtx2348 squareroot 19.00E-2 -> 0.44 Inexact Rounded +sqtx2349 squareroot 19E-3 -> 0.14 Inexact Rounded +sqtx2350 squareroot 19E+1 -> 14 Inexact Rounded +sqtx2351 squareroot 19E+2 -> 44 Inexact Rounded +sqtx2352 squareroot 19E+3 -> 1.4E+2 Inexact Rounded +sqtx2353 squareroot 0.20 -> 0.45 Inexact Rounded +sqtx2354 squareroot 0.020 -> 0.14 Inexact Rounded +sqtx2355 squareroot 20.0E-1 -> 1.4 Inexact Rounded +sqtx2356 squareroot 20.00E-2 -> 0.45 Inexact Rounded +sqtx2357 squareroot 20E-3 -> 0.14 Inexact Rounded +sqtx2358 squareroot 20E+1 -> 14 Inexact Rounded +sqtx2359 squareroot 20E+2 -> 45 Inexact Rounded +sqtx2360 squareroot 20E+3 -> 1.4E+2 Inexact Rounded +sqtx2361 squareroot 0.21 -> 0.46 Inexact Rounded +sqtx2362 squareroot 0.021 -> 0.14 Inexact Rounded +sqtx2363 squareroot 21.0E-1 -> 1.4 Inexact Rounded +sqtx2364 squareroot 21.00E-2 -> 0.46 Inexact Rounded +sqtx2365 squareroot 21E-3 -> 0.14 Inexact Rounded +sqtx2366 squareroot 21E+1 -> 14 Inexact Rounded +sqtx2367 squareroot 21E+2 -> 46 Inexact Rounded +sqtx2368 squareroot 21E+3 -> 1.4E+2 Inexact Rounded +sqtx2369 squareroot 0.22 -> 0.47 Inexact Rounded +sqtx2370 squareroot 0.022 -> 0.15 Inexact Rounded +sqtx2371 squareroot 22.0E-1 -> 1.5 Inexact Rounded +sqtx2372 squareroot 22.00E-2 -> 0.47 Inexact Rounded +sqtx2373 squareroot 22E-3 -> 0.15 Inexact Rounded +sqtx2374 squareroot 22E+1 -> 15 Inexact Rounded +sqtx2375 squareroot 22E+2 -> 47 Inexact Rounded +sqtx2376 squareroot 22E+3 -> 1.5E+2 Inexact Rounded +sqtx2377 squareroot 0.23 -> 0.48 Inexact Rounded +sqtx2378 squareroot 0.023 -> 0.15 Inexact Rounded +sqtx2379 squareroot 23.0E-1 -> 1.5 Inexact Rounded +sqtx2380 squareroot 23.00E-2 -> 0.48 Inexact Rounded +sqtx2381 squareroot 23E-3 -> 0.15 Inexact Rounded +sqtx2382 squareroot 23E+1 -> 15 Inexact Rounded +sqtx2383 squareroot 23E+2 -> 48 Inexact Rounded +sqtx2384 squareroot 23E+3 -> 1.5E+2 Inexact Rounded +sqtx2385 squareroot 0.24 -> 0.49 Inexact Rounded +sqtx2386 squareroot 0.024 -> 0.15 Inexact Rounded +sqtx2387 squareroot 24.0E-1 -> 1.5 Inexact Rounded +sqtx2388 squareroot 24.00E-2 -> 0.49 Inexact Rounded +sqtx2389 squareroot 24E-3 -> 0.15 Inexact Rounded +sqtx2390 squareroot 24E+1 -> 15 Inexact Rounded +sqtx2391 squareroot 24E+2 -> 49 Inexact Rounded +sqtx2392 squareroot 24E+3 -> 1.5E+2 Inexact Rounded +sqtx2393 squareroot 0.25 -> 0.5 +sqtx2394 squareroot 0.025 -> 0.16 Inexact Rounded +sqtx2395 squareroot 25.0E-1 -> 1.6 Inexact Rounded +sqtx2396 squareroot 25.00E-2 -> 0.50 +sqtx2397 squareroot 25E-3 -> 0.16 Inexact Rounded +sqtx2398 squareroot 25E+1 -> 16 Inexact Rounded +sqtx2399 squareroot 25E+2 -> 5E+1 +sqtx2400 squareroot 25E+3 -> 1.6E+2 Inexact Rounded +sqtx2401 squareroot 0.26 -> 0.51 Inexact Rounded +sqtx2402 squareroot 0.026 -> 0.16 Inexact Rounded +sqtx2403 squareroot 26.0E-1 -> 1.6 Inexact Rounded +sqtx2404 squareroot 26.00E-2 -> 0.51 Inexact Rounded +sqtx2405 squareroot 26E-3 -> 0.16 Inexact Rounded +sqtx2406 squareroot 26E+1 -> 16 Inexact Rounded +sqtx2407 squareroot 26E+2 -> 51 Inexact Rounded +sqtx2408 squareroot 26E+3 -> 1.6E+2 Inexact Rounded +sqtx2409 squareroot 0.27 -> 0.52 Inexact Rounded +sqtx2410 squareroot 0.027 -> 0.16 Inexact Rounded +sqtx2411 squareroot 27.0E-1 -> 1.6 Inexact Rounded +sqtx2412 squareroot 27.00E-2 -> 0.52 Inexact Rounded +sqtx2413 squareroot 27E-3 -> 0.16 Inexact Rounded +sqtx2414 squareroot 27E+1 -> 16 Inexact Rounded +sqtx2415 squareroot 27E+2 -> 52 Inexact Rounded +sqtx2416 squareroot 27E+3 -> 1.6E+2 Inexact Rounded +sqtx2417 squareroot 0.28 -> 0.53 Inexact Rounded +sqtx2418 squareroot 0.028 -> 0.17 Inexact Rounded +sqtx2419 squareroot 28.0E-1 -> 1.7 Inexact Rounded +sqtx2420 squareroot 28.00E-2 -> 0.53 Inexact Rounded +sqtx2421 squareroot 28E-3 -> 0.17 Inexact Rounded +sqtx2422 squareroot 28E+1 -> 17 Inexact Rounded +sqtx2423 squareroot 28E+2 -> 53 Inexact Rounded +sqtx2424 squareroot 28E+3 -> 1.7E+2 Inexact Rounded +sqtx2425 squareroot 0.29 -> 0.54 Inexact Rounded +sqtx2426 squareroot 0.029 -> 0.17 Inexact Rounded +sqtx2427 squareroot 29.0E-1 -> 1.7 Inexact Rounded +sqtx2428 squareroot 29.00E-2 -> 0.54 Inexact Rounded +sqtx2429 squareroot 29E-3 -> 0.17 Inexact Rounded +sqtx2430 squareroot 29E+1 -> 17 Inexact Rounded +sqtx2431 squareroot 29E+2 -> 54 Inexact Rounded +sqtx2432 squareroot 29E+3 -> 1.7E+2 Inexact Rounded +sqtx2433 squareroot 0.30 -> 0.55 Inexact Rounded +sqtx2434 squareroot 0.030 -> 0.17 Inexact Rounded +sqtx2435 squareroot 30.0E-1 -> 1.7 Inexact Rounded +sqtx2436 squareroot 30.00E-2 -> 0.55 Inexact Rounded +sqtx2437 squareroot 30E-3 -> 0.17 Inexact Rounded +sqtx2438 squareroot 30E+1 -> 17 Inexact Rounded +sqtx2439 squareroot 30E+2 -> 55 Inexact Rounded +sqtx2440 squareroot 30E+3 -> 1.7E+2 Inexact Rounded +sqtx2441 squareroot 0.31 -> 0.56 Inexact Rounded +sqtx2442 squareroot 0.031 -> 0.18 Inexact Rounded +sqtx2443 squareroot 31.0E-1 -> 1.8 Inexact Rounded +sqtx2444 squareroot 31.00E-2 -> 0.56 Inexact Rounded +sqtx2445 squareroot 31E-3 -> 0.18 Inexact Rounded +sqtx2446 squareroot 31E+1 -> 18 Inexact Rounded +sqtx2447 squareroot 31E+2 -> 56 Inexact Rounded +sqtx2448 squareroot 31E+3 -> 1.8E+2 Inexact Rounded +sqtx2449 squareroot 0.32 -> 0.57 Inexact Rounded +sqtx2450 squareroot 0.032 -> 0.18 Inexact Rounded +sqtx2451 squareroot 32.0E-1 -> 1.8 Inexact Rounded +sqtx2452 squareroot 32.00E-2 -> 0.57 Inexact Rounded +sqtx2453 squareroot 32E-3 -> 0.18 Inexact Rounded +sqtx2454 squareroot 32E+1 -> 18 Inexact Rounded +sqtx2455 squareroot 32E+2 -> 57 Inexact Rounded +sqtx2456 squareroot 32E+3 -> 1.8E+2 Inexact Rounded +sqtx2457 squareroot 0.33 -> 0.57 Inexact Rounded +sqtx2458 squareroot 0.033 -> 0.18 Inexact Rounded +sqtx2459 squareroot 33.0E-1 -> 1.8 Inexact Rounded +sqtx2460 squareroot 33.00E-2 -> 0.57 Inexact Rounded +sqtx2461 squareroot 33E-3 -> 0.18 Inexact Rounded +sqtx2462 squareroot 33E+1 -> 18 Inexact Rounded +sqtx2463 squareroot 33E+2 -> 57 Inexact Rounded +sqtx2464 squareroot 33E+3 -> 1.8E+2 Inexact Rounded +sqtx2465 squareroot 0.34 -> 0.58 Inexact Rounded +sqtx2466 squareroot 0.034 -> 0.18 Inexact Rounded +sqtx2467 squareroot 34.0E-1 -> 1.8 Inexact Rounded +sqtx2468 squareroot 34.00E-2 -> 0.58 Inexact Rounded +sqtx2469 squareroot 34E-3 -> 0.18 Inexact Rounded +sqtx2470 squareroot 34E+1 -> 18 Inexact Rounded +sqtx2471 squareroot 34E+2 -> 58 Inexact Rounded +sqtx2472 squareroot 34E+3 -> 1.8E+2 Inexact Rounded +sqtx2473 squareroot 0.35 -> 0.59 Inexact Rounded +sqtx2474 squareroot 0.035 -> 0.19 Inexact Rounded +sqtx2475 squareroot 35.0E-1 -> 1.9 Inexact Rounded +sqtx2476 squareroot 35.00E-2 -> 0.59 Inexact Rounded +sqtx2477 squareroot 35E-3 -> 0.19 Inexact Rounded +sqtx2478 squareroot 35E+1 -> 19 Inexact Rounded +sqtx2479 squareroot 35E+2 -> 59 Inexact Rounded +sqtx2480 squareroot 35E+3 -> 1.9E+2 Inexact Rounded +sqtx2481 squareroot 0.36 -> 0.6 +sqtx2482 squareroot 0.036 -> 0.19 Inexact Rounded +sqtx2483 squareroot 36.0E-1 -> 1.9 Inexact Rounded +sqtx2484 squareroot 36.00E-2 -> 0.60 +sqtx2485 squareroot 36E-3 -> 0.19 Inexact Rounded +sqtx2486 squareroot 36E+1 -> 19 Inexact Rounded +sqtx2487 squareroot 36E+2 -> 6E+1 +sqtx2488 squareroot 36E+3 -> 1.9E+2 Inexact Rounded +sqtx2489 squareroot 0.37 -> 0.61 Inexact Rounded +sqtx2490 squareroot 0.037 -> 0.19 Inexact Rounded +sqtx2491 squareroot 37.0E-1 -> 1.9 Inexact Rounded +sqtx2492 squareroot 37.00E-2 -> 0.61 Inexact Rounded +sqtx2493 squareroot 37E-3 -> 0.19 Inexact Rounded +sqtx2494 squareroot 37E+1 -> 19 Inexact Rounded +sqtx2495 squareroot 37E+2 -> 61 Inexact Rounded +sqtx2496 squareroot 37E+3 -> 1.9E+2 Inexact Rounded +sqtx2497 squareroot 0.38 -> 0.62 Inexact Rounded +sqtx2498 squareroot 0.038 -> 0.19 Inexact Rounded +sqtx2499 squareroot 38.0E-1 -> 1.9 Inexact Rounded +sqtx2500 squareroot 38.00E-2 -> 0.62 Inexact Rounded +sqtx2501 squareroot 38E-3 -> 0.19 Inexact Rounded +sqtx2502 squareroot 38E+1 -> 19 Inexact Rounded +sqtx2503 squareroot 38E+2 -> 62 Inexact Rounded +sqtx2504 squareroot 38E+3 -> 1.9E+2 Inexact Rounded +sqtx2505 squareroot 0.39 -> 0.62 Inexact Rounded +sqtx2506 squareroot 0.039 -> 0.20 Inexact Rounded +sqtx2507 squareroot 39.0E-1 -> 2.0 Inexact Rounded +sqtx2508 squareroot 39.00E-2 -> 0.62 Inexact Rounded +sqtx2509 squareroot 39E-3 -> 0.20 Inexact Rounded +sqtx2510 squareroot 39E+1 -> 20 Inexact Rounded +sqtx2511 squareroot 39E+2 -> 62 Inexact Rounded +sqtx2512 squareroot 39E+3 -> 2.0E+2 Inexact Rounded +sqtx2513 squareroot 0.40 -> 0.63 Inexact Rounded +sqtx2514 squareroot 0.040 -> 0.20 +sqtx2515 squareroot 40.0E-1 -> 2.0 +sqtx2516 squareroot 40.00E-2 -> 0.63 Inexact Rounded +sqtx2517 squareroot 40E-3 -> 0.20 +sqtx2518 squareroot 40E+1 -> 20 +sqtx2519 squareroot 40E+2 -> 63 Inexact Rounded +sqtx2520 squareroot 40E+3 -> 2.0E+2 +sqtx2521 squareroot 0.41 -> 0.64 Inexact Rounded +sqtx2522 squareroot 0.041 -> 0.20 Inexact Rounded +sqtx2523 squareroot 41.0E-1 -> 2.0 Inexact Rounded +sqtx2524 squareroot 41.00E-2 -> 0.64 Inexact Rounded +sqtx2525 squareroot 41E-3 -> 0.20 Inexact Rounded +sqtx2526 squareroot 41E+1 -> 20 Inexact Rounded +sqtx2527 squareroot 41E+2 -> 64 Inexact Rounded +sqtx2528 squareroot 41E+3 -> 2.0E+2 Inexact Rounded +sqtx2529 squareroot 0.42 -> 0.65 Inexact Rounded +sqtx2530 squareroot 0.042 -> 0.20 Inexact Rounded +sqtx2531 squareroot 42.0E-1 -> 2.0 Inexact Rounded +sqtx2532 squareroot 42.00E-2 -> 0.65 Inexact Rounded +sqtx2533 squareroot 42E-3 -> 0.20 Inexact Rounded +sqtx2534 squareroot 42E+1 -> 20 Inexact Rounded +sqtx2535 squareroot 42E+2 -> 65 Inexact Rounded +sqtx2536 squareroot 42E+3 -> 2.0E+2 Inexact Rounded +sqtx2537 squareroot 0.43 -> 0.66 Inexact Rounded +sqtx2538 squareroot 0.043 -> 0.21 Inexact Rounded +sqtx2539 squareroot 43.0E-1 -> 2.1 Inexact Rounded +sqtx2540 squareroot 43.00E-2 -> 0.66 Inexact Rounded +sqtx2541 squareroot 43E-3 -> 0.21 Inexact Rounded +sqtx2542 squareroot 43E+1 -> 21 Inexact Rounded +sqtx2543 squareroot 43E+2 -> 66 Inexact Rounded +sqtx2544 squareroot 43E+3 -> 2.1E+2 Inexact Rounded +sqtx2545 squareroot 0.44 -> 0.66 Inexact Rounded +sqtx2546 squareroot 0.044 -> 0.21 Inexact Rounded +sqtx2547 squareroot 44.0E-1 -> 2.1 Inexact Rounded +sqtx2548 squareroot 44.00E-2 -> 0.66 Inexact Rounded +sqtx2549 squareroot 44E-3 -> 0.21 Inexact Rounded +sqtx2550 squareroot 44E+1 -> 21 Inexact Rounded +sqtx2551 squareroot 44E+2 -> 66 Inexact Rounded +sqtx2552 squareroot 44E+3 -> 2.1E+2 Inexact Rounded +sqtx2553 squareroot 0.45 -> 0.67 Inexact Rounded +sqtx2554 squareroot 0.045 -> 0.21 Inexact Rounded +sqtx2555 squareroot 45.0E-1 -> 2.1 Inexact Rounded +sqtx2556 squareroot 45.00E-2 -> 0.67 Inexact Rounded +sqtx2557 squareroot 45E-3 -> 0.21 Inexact Rounded +sqtx2558 squareroot 45E+1 -> 21 Inexact Rounded +sqtx2559 squareroot 45E+2 -> 67 Inexact Rounded +sqtx2560 squareroot 45E+3 -> 2.1E+2 Inexact Rounded +sqtx2561 squareroot 0.46 -> 0.68 Inexact Rounded +sqtx2562 squareroot 0.046 -> 0.21 Inexact Rounded +sqtx2563 squareroot 46.0E-1 -> 2.1 Inexact Rounded +sqtx2564 squareroot 46.00E-2 -> 0.68 Inexact Rounded +sqtx2565 squareroot 46E-3 -> 0.21 Inexact Rounded +sqtx2566 squareroot 46E+1 -> 21 Inexact Rounded +sqtx2567 squareroot 46E+2 -> 68 Inexact Rounded +sqtx2568 squareroot 46E+3 -> 2.1E+2 Inexact Rounded +sqtx2569 squareroot 0.47 -> 0.69 Inexact Rounded +sqtx2570 squareroot 0.047 -> 0.22 Inexact Rounded +sqtx2571 squareroot 47.0E-1 -> 2.2 Inexact Rounded +sqtx2572 squareroot 47.00E-2 -> 0.69 Inexact Rounded +sqtx2573 squareroot 47E-3 -> 0.22 Inexact Rounded +sqtx2574 squareroot 47E+1 -> 22 Inexact Rounded +sqtx2575 squareroot 47E+2 -> 69 Inexact Rounded +sqtx2576 squareroot 47E+3 -> 2.2E+2 Inexact Rounded +sqtx2577 squareroot 0.48 -> 0.69 Inexact Rounded +sqtx2578 squareroot 0.048 -> 0.22 Inexact Rounded +sqtx2579 squareroot 48.0E-1 -> 2.2 Inexact Rounded +sqtx2580 squareroot 48.00E-2 -> 0.69 Inexact Rounded +sqtx2581 squareroot 48E-3 -> 0.22 Inexact Rounded +sqtx2582 squareroot 48E+1 -> 22 Inexact Rounded +sqtx2583 squareroot 48E+2 -> 69 Inexact Rounded +sqtx2584 squareroot 48E+3 -> 2.2E+2 Inexact Rounded +sqtx2585 squareroot 0.49 -> 0.7 +sqtx2586 squareroot 0.049 -> 0.22 Inexact Rounded +sqtx2587 squareroot 49.0E-1 -> 2.2 Inexact Rounded +sqtx2588 squareroot 49.00E-2 -> 0.70 +sqtx2589 squareroot 49E-3 -> 0.22 Inexact Rounded +sqtx2590 squareroot 49E+1 -> 22 Inexact Rounded +sqtx2591 squareroot 49E+2 -> 7E+1 +sqtx2592 squareroot 49E+3 -> 2.2E+2 Inexact Rounded +sqtx2593 squareroot 0.50 -> 0.71 Inexact Rounded +sqtx2594 squareroot 0.050 -> 0.22 Inexact Rounded +sqtx2595 squareroot 50.0E-1 -> 2.2 Inexact Rounded +sqtx2596 squareroot 50.00E-2 -> 0.71 Inexact Rounded +sqtx2597 squareroot 50E-3 -> 0.22 Inexact Rounded +sqtx2598 squareroot 50E+1 -> 22 Inexact Rounded +sqtx2599 squareroot 50E+2 -> 71 Inexact Rounded +sqtx2600 squareroot 50E+3 -> 2.2E+2 Inexact Rounded +sqtx2601 squareroot 0.51 -> 0.71 Inexact Rounded +sqtx2602 squareroot 0.051 -> 0.23 Inexact Rounded +sqtx2603 squareroot 51.0E-1 -> 2.3 Inexact Rounded +sqtx2604 squareroot 51.00E-2 -> 0.71 Inexact Rounded +sqtx2605 squareroot 51E-3 -> 0.23 Inexact Rounded +sqtx2606 squareroot 51E+1 -> 23 Inexact Rounded +sqtx2607 squareroot 51E+2 -> 71 Inexact Rounded +sqtx2608 squareroot 51E+3 -> 2.3E+2 Inexact Rounded +sqtx2609 squareroot 0.52 -> 0.72 Inexact Rounded +sqtx2610 squareroot 0.052 -> 0.23 Inexact Rounded +sqtx2611 squareroot 52.0E-1 -> 2.3 Inexact Rounded +sqtx2612 squareroot 52.00E-2 -> 0.72 Inexact Rounded +sqtx2613 squareroot 52E-3 -> 0.23 Inexact Rounded +sqtx2614 squareroot 52E+1 -> 23 Inexact Rounded +sqtx2615 squareroot 52E+2 -> 72 Inexact Rounded +sqtx2616 squareroot 52E+3 -> 2.3E+2 Inexact Rounded +sqtx2617 squareroot 0.53 -> 0.73 Inexact Rounded +sqtx2618 squareroot 0.053 -> 0.23 Inexact Rounded +sqtx2619 squareroot 53.0E-1 -> 2.3 Inexact Rounded +sqtx2620 squareroot 53.00E-2 -> 0.73 Inexact Rounded +sqtx2621 squareroot 53E-3 -> 0.23 Inexact Rounded +sqtx2622 squareroot 53E+1 -> 23 Inexact Rounded +sqtx2623 squareroot 53E+2 -> 73 Inexact Rounded +sqtx2624 squareroot 53E+3 -> 2.3E+2 Inexact Rounded +sqtx2625 squareroot 0.54 -> 0.73 Inexact Rounded +sqtx2626 squareroot 0.054 -> 0.23 Inexact Rounded +sqtx2627 squareroot 54.0E-1 -> 2.3 Inexact Rounded +sqtx2628 squareroot 54.00E-2 -> 0.73 Inexact Rounded +sqtx2629 squareroot 54E-3 -> 0.23 Inexact Rounded +sqtx2630 squareroot 54E+1 -> 23 Inexact Rounded +sqtx2631 squareroot 54E+2 -> 73 Inexact Rounded +sqtx2632 squareroot 54E+3 -> 2.3E+2 Inexact Rounded +sqtx2633 squareroot 0.55 -> 0.74 Inexact Rounded +sqtx2634 squareroot 0.055 -> 0.23 Inexact Rounded +sqtx2635 squareroot 55.0E-1 -> 2.3 Inexact Rounded +sqtx2636 squareroot 55.00E-2 -> 0.74 Inexact Rounded +sqtx2637 squareroot 55E-3 -> 0.23 Inexact Rounded +sqtx2638 squareroot 55E+1 -> 23 Inexact Rounded +sqtx2639 squareroot 55E+2 -> 74 Inexact Rounded +sqtx2640 squareroot 55E+3 -> 2.3E+2 Inexact Rounded +sqtx2641 squareroot 0.56 -> 0.75 Inexact Rounded +sqtx2642 squareroot 0.056 -> 0.24 Inexact Rounded +sqtx2643 squareroot 56.0E-1 -> 2.4 Inexact Rounded +sqtx2644 squareroot 56.00E-2 -> 0.75 Inexact Rounded +sqtx2645 squareroot 56E-3 -> 0.24 Inexact Rounded +sqtx2646 squareroot 56E+1 -> 24 Inexact Rounded +sqtx2647 squareroot 56E+2 -> 75 Inexact Rounded +sqtx2648 squareroot 56E+3 -> 2.4E+2 Inexact Rounded +sqtx2649 squareroot 0.57 -> 0.75 Inexact Rounded +sqtx2650 squareroot 0.057 -> 0.24 Inexact Rounded +sqtx2651 squareroot 57.0E-1 -> 2.4 Inexact Rounded +sqtx2652 squareroot 57.00E-2 -> 0.75 Inexact Rounded +sqtx2653 squareroot 57E-3 -> 0.24 Inexact Rounded +sqtx2654 squareroot 57E+1 -> 24 Inexact Rounded +sqtx2655 squareroot 57E+2 -> 75 Inexact Rounded +sqtx2656 squareroot 57E+3 -> 2.4E+2 Inexact Rounded +sqtx2657 squareroot 0.58 -> 0.76 Inexact Rounded +sqtx2658 squareroot 0.058 -> 0.24 Inexact Rounded +sqtx2659 squareroot 58.0E-1 -> 2.4 Inexact Rounded +sqtx2660 squareroot 58.00E-2 -> 0.76 Inexact Rounded +sqtx2661 squareroot 58E-3 -> 0.24 Inexact Rounded +sqtx2662 squareroot 58E+1 -> 24 Inexact Rounded +sqtx2663 squareroot 58E+2 -> 76 Inexact Rounded +sqtx2664 squareroot 58E+3 -> 2.4E+2 Inexact Rounded +sqtx2665 squareroot 0.59 -> 0.77 Inexact Rounded +sqtx2666 squareroot 0.059 -> 0.24 Inexact Rounded +sqtx2667 squareroot 59.0E-1 -> 2.4 Inexact Rounded +sqtx2668 squareroot 59.00E-2 -> 0.77 Inexact Rounded +sqtx2669 squareroot 59E-3 -> 0.24 Inexact Rounded +sqtx2670 squareroot 59E+1 -> 24 Inexact Rounded +sqtx2671 squareroot 59E+2 -> 77 Inexact Rounded +sqtx2672 squareroot 59E+3 -> 2.4E+2 Inexact Rounded +sqtx2673 squareroot 0.60 -> 0.77 Inexact Rounded +sqtx2674 squareroot 0.060 -> 0.24 Inexact Rounded +sqtx2675 squareroot 60.0E-1 -> 2.4 Inexact Rounded +sqtx2676 squareroot 60.00E-2 -> 0.77 Inexact Rounded +sqtx2677 squareroot 60E-3 -> 0.24 Inexact Rounded +sqtx2678 squareroot 60E+1 -> 24 Inexact Rounded +sqtx2679 squareroot 60E+2 -> 77 Inexact Rounded +sqtx2680 squareroot 60E+3 -> 2.4E+2 Inexact Rounded +sqtx2681 squareroot 0.61 -> 0.78 Inexact Rounded +sqtx2682 squareroot 0.061 -> 0.25 Inexact Rounded +sqtx2683 squareroot 61.0E-1 -> 2.5 Inexact Rounded +sqtx2684 squareroot 61.00E-2 -> 0.78 Inexact Rounded +sqtx2685 squareroot 61E-3 -> 0.25 Inexact Rounded +sqtx2686 squareroot 61E+1 -> 25 Inexact Rounded +sqtx2687 squareroot 61E+2 -> 78 Inexact Rounded +sqtx2688 squareroot 61E+3 -> 2.5E+2 Inexact Rounded +sqtx2689 squareroot 0.62 -> 0.79 Inexact Rounded +sqtx2690 squareroot 0.062 -> 0.25 Inexact Rounded +sqtx2691 squareroot 62.0E-1 -> 2.5 Inexact Rounded +sqtx2692 squareroot 62.00E-2 -> 0.79 Inexact Rounded +sqtx2693 squareroot 62E-3 -> 0.25 Inexact Rounded +sqtx2694 squareroot 62E+1 -> 25 Inexact Rounded +sqtx2695 squareroot 62E+2 -> 79 Inexact Rounded +sqtx2696 squareroot 62E+3 -> 2.5E+2 Inexact Rounded +sqtx2697 squareroot 0.63 -> 0.79 Inexact Rounded +sqtx2698 squareroot 0.063 -> 0.25 Inexact Rounded +sqtx2699 squareroot 63.0E-1 -> 2.5 Inexact Rounded +sqtx2700 squareroot 63.00E-2 -> 0.79 Inexact Rounded +sqtx2701 squareroot 63E-3 -> 0.25 Inexact Rounded +sqtx2702 squareroot 63E+1 -> 25 Inexact Rounded +sqtx2703 squareroot 63E+2 -> 79 Inexact Rounded +sqtx2704 squareroot 63E+3 -> 2.5E+2 Inexact Rounded +sqtx2705 squareroot 0.64 -> 0.8 +sqtx2706 squareroot 0.064 -> 0.25 Inexact Rounded +sqtx2707 squareroot 64.0E-1 -> 2.5 Inexact Rounded +sqtx2708 squareroot 64.00E-2 -> 0.80 +sqtx2709 squareroot 64E-3 -> 0.25 Inexact Rounded +sqtx2710 squareroot 64E+1 -> 25 Inexact Rounded +sqtx2711 squareroot 64E+2 -> 8E+1 +sqtx2712 squareroot 64E+3 -> 2.5E+2 Inexact Rounded +sqtx2713 squareroot 0.65 -> 0.81 Inexact Rounded +sqtx2714 squareroot 0.065 -> 0.25 Inexact Rounded +sqtx2715 squareroot 65.0E-1 -> 2.5 Inexact Rounded +sqtx2716 squareroot 65.00E-2 -> 0.81 Inexact Rounded +sqtx2717 squareroot 65E-3 -> 0.25 Inexact Rounded +sqtx2718 squareroot 65E+1 -> 25 Inexact Rounded +sqtx2719 squareroot 65E+2 -> 81 Inexact Rounded +sqtx2720 squareroot 65E+3 -> 2.5E+2 Inexact Rounded +sqtx2721 squareroot 0.66 -> 0.81 Inexact Rounded +sqtx2722 squareroot 0.066 -> 0.26 Inexact Rounded +sqtx2723 squareroot 66.0E-1 -> 2.6 Inexact Rounded +sqtx2724 squareroot 66.00E-2 -> 0.81 Inexact Rounded +sqtx2725 squareroot 66E-3 -> 0.26 Inexact Rounded +sqtx2726 squareroot 66E+1 -> 26 Inexact Rounded +sqtx2727 squareroot 66E+2 -> 81 Inexact Rounded +sqtx2728 squareroot 66E+3 -> 2.6E+2 Inexact Rounded +sqtx2729 squareroot 0.67 -> 0.82 Inexact Rounded +sqtx2730 squareroot 0.067 -> 0.26 Inexact Rounded +sqtx2731 squareroot 67.0E-1 -> 2.6 Inexact Rounded +sqtx2732 squareroot 67.00E-2 -> 0.82 Inexact Rounded +sqtx2733 squareroot 67E-3 -> 0.26 Inexact Rounded +sqtx2734 squareroot 67E+1 -> 26 Inexact Rounded +sqtx2735 squareroot 67E+2 -> 82 Inexact Rounded +sqtx2736 squareroot 67E+3 -> 2.6E+2 Inexact Rounded +sqtx2737 squareroot 0.68 -> 0.82 Inexact Rounded +sqtx2738 squareroot 0.068 -> 0.26 Inexact Rounded +sqtx2739 squareroot 68.0E-1 -> 2.6 Inexact Rounded +sqtx2740 squareroot 68.00E-2 -> 0.82 Inexact Rounded +sqtx2741 squareroot 68E-3 -> 0.26 Inexact Rounded +sqtx2742 squareroot 68E+1 -> 26 Inexact Rounded +sqtx2743 squareroot 68E+2 -> 82 Inexact Rounded +sqtx2744 squareroot 68E+3 -> 2.6E+2 Inexact Rounded +sqtx2745 squareroot 0.69 -> 0.83 Inexact Rounded +sqtx2746 squareroot 0.069 -> 0.26 Inexact Rounded +sqtx2747 squareroot 69.0E-1 -> 2.6 Inexact Rounded +sqtx2748 squareroot 69.00E-2 -> 0.83 Inexact Rounded +sqtx2749 squareroot 69E-3 -> 0.26 Inexact Rounded +sqtx2750 squareroot 69E+1 -> 26 Inexact Rounded +sqtx2751 squareroot 69E+2 -> 83 Inexact Rounded +sqtx2752 squareroot 69E+3 -> 2.6E+2 Inexact Rounded +sqtx2753 squareroot 0.70 -> 0.84 Inexact Rounded +sqtx2754 squareroot 0.070 -> 0.26 Inexact Rounded +sqtx2755 squareroot 70.0E-1 -> 2.6 Inexact Rounded +sqtx2756 squareroot 70.00E-2 -> 0.84 Inexact Rounded +sqtx2757 squareroot 70E-3 -> 0.26 Inexact Rounded +sqtx2758 squareroot 70E+1 -> 26 Inexact Rounded +sqtx2759 squareroot 70E+2 -> 84 Inexact Rounded +sqtx2760 squareroot 70E+3 -> 2.6E+2 Inexact Rounded +sqtx2761 squareroot 0.71 -> 0.84 Inexact Rounded +sqtx2762 squareroot 0.071 -> 0.27 Inexact Rounded +sqtx2763 squareroot 71.0E-1 -> 2.7 Inexact Rounded +sqtx2764 squareroot 71.00E-2 -> 0.84 Inexact Rounded +sqtx2765 squareroot 71E-3 -> 0.27 Inexact Rounded +sqtx2766 squareroot 71E+1 -> 27 Inexact Rounded +sqtx2767 squareroot 71E+2 -> 84 Inexact Rounded +sqtx2768 squareroot 71E+3 -> 2.7E+2 Inexact Rounded +sqtx2769 squareroot 0.72 -> 0.85 Inexact Rounded +sqtx2770 squareroot 0.072 -> 0.27 Inexact Rounded +sqtx2771 squareroot 72.0E-1 -> 2.7 Inexact Rounded +sqtx2772 squareroot 72.00E-2 -> 0.85 Inexact Rounded +sqtx2773 squareroot 72E-3 -> 0.27 Inexact Rounded +sqtx2774 squareroot 72E+1 -> 27 Inexact Rounded +sqtx2775 squareroot 72E+2 -> 85 Inexact Rounded +sqtx2776 squareroot 72E+3 -> 2.7E+2 Inexact Rounded +sqtx2777 squareroot 0.73 -> 0.85 Inexact Rounded +sqtx2778 squareroot 0.073 -> 0.27 Inexact Rounded +sqtx2779 squareroot 73.0E-1 -> 2.7 Inexact Rounded +sqtx2780 squareroot 73.00E-2 -> 0.85 Inexact Rounded +sqtx2781 squareroot 73E-3 -> 0.27 Inexact Rounded +sqtx2782 squareroot 73E+1 -> 27 Inexact Rounded +sqtx2783 squareroot 73E+2 -> 85 Inexact Rounded +sqtx2784 squareroot 73E+3 -> 2.7E+2 Inexact Rounded +sqtx2785 squareroot 0.74 -> 0.86 Inexact Rounded +sqtx2786 squareroot 0.074 -> 0.27 Inexact Rounded +sqtx2787 squareroot 74.0E-1 -> 2.7 Inexact Rounded +sqtx2788 squareroot 74.00E-2 -> 0.86 Inexact Rounded +sqtx2789 squareroot 74E-3 -> 0.27 Inexact Rounded +sqtx2790 squareroot 74E+1 -> 27 Inexact Rounded +sqtx2791 squareroot 74E+2 -> 86 Inexact Rounded +sqtx2792 squareroot 74E+3 -> 2.7E+2 Inexact Rounded +sqtx2793 squareroot 0.75 -> 0.87 Inexact Rounded +sqtx2794 squareroot 0.075 -> 0.27 Inexact Rounded +sqtx2795 squareroot 75.0E-1 -> 2.7 Inexact Rounded +sqtx2796 squareroot 75.00E-2 -> 0.87 Inexact Rounded +sqtx2797 squareroot 75E-3 -> 0.27 Inexact Rounded +sqtx2798 squareroot 75E+1 -> 27 Inexact Rounded +sqtx2799 squareroot 75E+2 -> 87 Inexact Rounded +sqtx2800 squareroot 75E+3 -> 2.7E+2 Inexact Rounded +sqtx2801 squareroot 0.76 -> 0.87 Inexact Rounded +sqtx2802 squareroot 0.076 -> 0.28 Inexact Rounded +sqtx2803 squareroot 76.0E-1 -> 2.8 Inexact Rounded +sqtx2804 squareroot 76.00E-2 -> 0.87 Inexact Rounded +sqtx2805 squareroot 76E-3 -> 0.28 Inexact Rounded +sqtx2806 squareroot 76E+1 -> 28 Inexact Rounded +sqtx2807 squareroot 76E+2 -> 87 Inexact Rounded +sqtx2808 squareroot 76E+3 -> 2.8E+2 Inexact Rounded +sqtx2809 squareroot 0.77 -> 0.88 Inexact Rounded +sqtx2810 squareroot 0.077 -> 0.28 Inexact Rounded +sqtx2811 squareroot 77.0E-1 -> 2.8 Inexact Rounded +sqtx2812 squareroot 77.00E-2 -> 0.88 Inexact Rounded +sqtx2813 squareroot 77E-3 -> 0.28 Inexact Rounded +sqtx2814 squareroot 77E+1 -> 28 Inexact Rounded +sqtx2815 squareroot 77E+2 -> 88 Inexact Rounded +sqtx2816 squareroot 77E+3 -> 2.8E+2 Inexact Rounded +sqtx2817 squareroot 0.78 -> 0.88 Inexact Rounded +sqtx2818 squareroot 0.078 -> 0.28 Inexact Rounded +sqtx2819 squareroot 78.0E-1 -> 2.8 Inexact Rounded +sqtx2820 squareroot 78.00E-2 -> 0.88 Inexact Rounded +sqtx2821 squareroot 78E-3 -> 0.28 Inexact Rounded +sqtx2822 squareroot 78E+1 -> 28 Inexact Rounded +sqtx2823 squareroot 78E+2 -> 88 Inexact Rounded +sqtx2824 squareroot 78E+3 -> 2.8E+2 Inexact Rounded +sqtx2825 squareroot 0.79 -> 0.89 Inexact Rounded +sqtx2826 squareroot 0.079 -> 0.28 Inexact Rounded +sqtx2827 squareroot 79.0E-1 -> 2.8 Inexact Rounded +sqtx2828 squareroot 79.00E-2 -> 0.89 Inexact Rounded +sqtx2829 squareroot 79E-3 -> 0.28 Inexact Rounded +sqtx2830 squareroot 79E+1 -> 28 Inexact Rounded +sqtx2831 squareroot 79E+2 -> 89 Inexact Rounded +sqtx2832 squareroot 79E+3 -> 2.8E+2 Inexact Rounded +sqtx2833 squareroot 0.80 -> 0.89 Inexact Rounded +sqtx2834 squareroot 0.080 -> 0.28 Inexact Rounded +sqtx2835 squareroot 80.0E-1 -> 2.8 Inexact Rounded +sqtx2836 squareroot 80.00E-2 -> 0.89 Inexact Rounded +sqtx2837 squareroot 80E-3 -> 0.28 Inexact Rounded +sqtx2838 squareroot 80E+1 -> 28 Inexact Rounded +sqtx2839 squareroot 80E+2 -> 89 Inexact Rounded +sqtx2840 squareroot 80E+3 -> 2.8E+2 Inexact Rounded +sqtx2841 squareroot 0.81 -> 0.9 +sqtx2842 squareroot 0.081 -> 0.28 Inexact Rounded +sqtx2843 squareroot 81.0E-1 -> 2.8 Inexact Rounded +sqtx2844 squareroot 81.00E-2 -> 0.90 +sqtx2845 squareroot 81E-3 -> 0.28 Inexact Rounded +sqtx2846 squareroot 81E+1 -> 28 Inexact Rounded +sqtx2847 squareroot 81E+2 -> 9E+1 +sqtx2848 squareroot 81E+3 -> 2.8E+2 Inexact Rounded +sqtx2849 squareroot 0.82 -> 0.91 Inexact Rounded +sqtx2850 squareroot 0.082 -> 0.29 Inexact Rounded +sqtx2851 squareroot 82.0E-1 -> 2.9 Inexact Rounded +sqtx2852 squareroot 82.00E-2 -> 0.91 Inexact Rounded +sqtx2853 squareroot 82E-3 -> 0.29 Inexact Rounded +sqtx2854 squareroot 82E+1 -> 29 Inexact Rounded +sqtx2855 squareroot 82E+2 -> 91 Inexact Rounded +sqtx2856 squareroot 82E+3 -> 2.9E+2 Inexact Rounded +sqtx2857 squareroot 0.83 -> 0.91 Inexact Rounded +sqtx2858 squareroot 0.083 -> 0.29 Inexact Rounded +sqtx2859 squareroot 83.0E-1 -> 2.9 Inexact Rounded +sqtx2860 squareroot 83.00E-2 -> 0.91 Inexact Rounded +sqtx2861 squareroot 83E-3 -> 0.29 Inexact Rounded +sqtx2862 squareroot 83E+1 -> 29 Inexact Rounded +sqtx2863 squareroot 83E+2 -> 91 Inexact Rounded +sqtx2864 squareroot 83E+3 -> 2.9E+2 Inexact Rounded +sqtx2865 squareroot 0.84 -> 0.92 Inexact Rounded +sqtx2866 squareroot 0.084 -> 0.29 Inexact Rounded +sqtx2867 squareroot 84.0E-1 -> 2.9 Inexact Rounded +sqtx2868 squareroot 84.00E-2 -> 0.92 Inexact Rounded +sqtx2869 squareroot 84E-3 -> 0.29 Inexact Rounded +sqtx2870 squareroot 84E+1 -> 29 Inexact Rounded +sqtx2871 squareroot 84E+2 -> 92 Inexact Rounded +sqtx2872 squareroot 84E+3 -> 2.9E+2 Inexact Rounded +sqtx2873 squareroot 0.85 -> 0.92 Inexact Rounded +sqtx2874 squareroot 0.085 -> 0.29 Inexact Rounded +sqtx2875 squareroot 85.0E-1 -> 2.9 Inexact Rounded +sqtx2876 squareroot 85.00E-2 -> 0.92 Inexact Rounded +sqtx2877 squareroot 85E-3 -> 0.29 Inexact Rounded +sqtx2878 squareroot 85E+1 -> 29 Inexact Rounded +sqtx2879 squareroot 85E+2 -> 92 Inexact Rounded +sqtx2880 squareroot 85E+3 -> 2.9E+2 Inexact Rounded +sqtx2881 squareroot 0.86 -> 0.93 Inexact Rounded +sqtx2882 squareroot 0.086 -> 0.29 Inexact Rounded +sqtx2883 squareroot 86.0E-1 -> 2.9 Inexact Rounded +sqtx2884 squareroot 86.00E-2 -> 0.93 Inexact Rounded +sqtx2885 squareroot 86E-3 -> 0.29 Inexact Rounded +sqtx2886 squareroot 86E+1 -> 29 Inexact Rounded +sqtx2887 squareroot 86E+2 -> 93 Inexact Rounded +sqtx2888 squareroot 86E+3 -> 2.9E+2 Inexact Rounded +sqtx2889 squareroot 0.87 -> 0.93 Inexact Rounded +sqtx2890 squareroot 0.087 -> 0.29 Inexact Rounded +sqtx2891 squareroot 87.0E-1 -> 2.9 Inexact Rounded +sqtx2892 squareroot 87.00E-2 -> 0.93 Inexact Rounded +sqtx2893 squareroot 87E-3 -> 0.29 Inexact Rounded +sqtx2894 squareroot 87E+1 -> 29 Inexact Rounded +sqtx2895 squareroot 87E+2 -> 93 Inexact Rounded +sqtx2896 squareroot 87E+3 -> 2.9E+2 Inexact Rounded +sqtx2897 squareroot 0.88 -> 0.94 Inexact Rounded +sqtx2898 squareroot 0.088 -> 0.30 Inexact Rounded +sqtx2899 squareroot 88.0E-1 -> 3.0 Inexact Rounded +sqtx2900 squareroot 88.00E-2 -> 0.94 Inexact Rounded +sqtx2901 squareroot 88E-3 -> 0.30 Inexact Rounded +sqtx2902 squareroot 88E+1 -> 30 Inexact Rounded +sqtx2903 squareroot 88E+2 -> 94 Inexact Rounded +sqtx2904 squareroot 88E+3 -> 3.0E+2 Inexact Rounded +sqtx2905 squareroot 0.89 -> 0.94 Inexact Rounded +sqtx2906 squareroot 0.089 -> 0.30 Inexact Rounded +sqtx2907 squareroot 89.0E-1 -> 3.0 Inexact Rounded +sqtx2908 squareroot 89.00E-2 -> 0.94 Inexact Rounded +sqtx2909 squareroot 89E-3 -> 0.30 Inexact Rounded +sqtx2910 squareroot 89E+1 -> 30 Inexact Rounded +sqtx2911 squareroot 89E+2 -> 94 Inexact Rounded +sqtx2912 squareroot 89E+3 -> 3.0E+2 Inexact Rounded +sqtx2913 squareroot 0.90 -> 0.95 Inexact Rounded +sqtx2914 squareroot 0.090 -> 0.30 +sqtx2915 squareroot 90.0E-1 -> 3.0 +sqtx2916 squareroot 90.00E-2 -> 0.95 Inexact Rounded +sqtx2917 squareroot 90E-3 -> 0.30 +sqtx2918 squareroot 90E+1 -> 30 +sqtx2919 squareroot 90E+2 -> 95 Inexact Rounded +sqtx2920 squareroot 90E+3 -> 3.0E+2 +sqtx2921 squareroot 0.91 -> 0.95 Inexact Rounded +sqtx2922 squareroot 0.091 -> 0.30 Inexact Rounded +sqtx2923 squareroot 91.0E-1 -> 3.0 Inexact Rounded +sqtx2924 squareroot 91.00E-2 -> 0.95 Inexact Rounded +sqtx2925 squareroot 91E-3 -> 0.30 Inexact Rounded +sqtx2926 squareroot 91E+1 -> 30 Inexact Rounded +sqtx2927 squareroot 91E+2 -> 95 Inexact Rounded +sqtx2928 squareroot 91E+3 -> 3.0E+2 Inexact Rounded +sqtx2929 squareroot 0.92 -> 0.96 Inexact Rounded +sqtx2930 squareroot 0.092 -> 0.30 Inexact Rounded +sqtx2931 squareroot 92.0E-1 -> 3.0 Inexact Rounded +sqtx2932 squareroot 92.00E-2 -> 0.96 Inexact Rounded +sqtx2933 squareroot 92E-3 -> 0.30 Inexact Rounded +sqtx2934 squareroot 92E+1 -> 30 Inexact Rounded +sqtx2935 squareroot 92E+2 -> 96 Inexact Rounded +sqtx2936 squareroot 92E+3 -> 3.0E+2 Inexact Rounded +sqtx2937 squareroot 0.93 -> 0.96 Inexact Rounded +sqtx2938 squareroot 0.093 -> 0.30 Inexact Rounded +sqtx2939 squareroot 93.0E-1 -> 3.0 Inexact Rounded +sqtx2940 squareroot 93.00E-2 -> 0.96 Inexact Rounded +sqtx2941 squareroot 93E-3 -> 0.30 Inexact Rounded +sqtx2942 squareroot 93E+1 -> 30 Inexact Rounded +sqtx2943 squareroot 93E+2 -> 96 Inexact Rounded +sqtx2944 squareroot 93E+3 -> 3.0E+2 Inexact Rounded +sqtx2945 squareroot 0.94 -> 0.97 Inexact Rounded +sqtx2946 squareroot 0.094 -> 0.31 Inexact Rounded +sqtx2947 squareroot 94.0E-1 -> 3.1 Inexact Rounded +sqtx2948 squareroot 94.00E-2 -> 0.97 Inexact Rounded +sqtx2949 squareroot 94E-3 -> 0.31 Inexact Rounded +sqtx2950 squareroot 94E+1 -> 31 Inexact Rounded +sqtx2951 squareroot 94E+2 -> 97 Inexact Rounded +sqtx2952 squareroot 94E+3 -> 3.1E+2 Inexact Rounded +sqtx2953 squareroot 0.95 -> 0.97 Inexact Rounded +sqtx2954 squareroot 0.095 -> 0.31 Inexact Rounded +sqtx2955 squareroot 95.0E-1 -> 3.1 Inexact Rounded +sqtx2956 squareroot 95.00E-2 -> 0.97 Inexact Rounded +sqtx2957 squareroot 95E-3 -> 0.31 Inexact Rounded +sqtx2958 squareroot 95E+1 -> 31 Inexact Rounded +sqtx2959 squareroot 95E+2 -> 97 Inexact Rounded +sqtx2960 squareroot 95E+3 -> 3.1E+2 Inexact Rounded +sqtx2961 squareroot 0.96 -> 0.98 Inexact Rounded +sqtx2962 squareroot 0.096 -> 0.31 Inexact Rounded +sqtx2963 squareroot 96.0E-1 -> 3.1 Inexact Rounded +sqtx2964 squareroot 96.00E-2 -> 0.98 Inexact Rounded +sqtx2965 squareroot 96E-3 -> 0.31 Inexact Rounded +sqtx2966 squareroot 96E+1 -> 31 Inexact Rounded +sqtx2967 squareroot 96E+2 -> 98 Inexact Rounded +sqtx2968 squareroot 96E+3 -> 3.1E+2 Inexact Rounded +sqtx2969 squareroot 0.97 -> 0.98 Inexact Rounded +sqtx2970 squareroot 0.097 -> 0.31 Inexact Rounded +sqtx2971 squareroot 97.0E-1 -> 3.1 Inexact Rounded +sqtx2972 squareroot 97.00E-2 -> 0.98 Inexact Rounded +sqtx2973 squareroot 97E-3 -> 0.31 Inexact Rounded +sqtx2974 squareroot 97E+1 -> 31 Inexact Rounded +sqtx2975 squareroot 97E+2 -> 98 Inexact Rounded +sqtx2976 squareroot 97E+3 -> 3.1E+2 Inexact Rounded +sqtx2977 squareroot 0.98 -> 0.99 Inexact Rounded +sqtx2978 squareroot 0.098 -> 0.31 Inexact Rounded +sqtx2979 squareroot 98.0E-1 -> 3.1 Inexact Rounded +sqtx2980 squareroot 98.00E-2 -> 0.99 Inexact Rounded +sqtx2981 squareroot 98E-3 -> 0.31 Inexact Rounded +sqtx2982 squareroot 98E+1 -> 31 Inexact Rounded +sqtx2983 squareroot 98E+2 -> 99 Inexact Rounded +sqtx2984 squareroot 98E+3 -> 3.1E+2 Inexact Rounded +sqtx2985 squareroot 0.99 -> 0.99 Inexact Rounded +sqtx2986 squareroot 0.099 -> 0.31 Inexact Rounded +sqtx2987 squareroot 99.0E-1 -> 3.1 Inexact Rounded +sqtx2988 squareroot 99.00E-2 -> 0.99 Inexact Rounded +sqtx2989 squareroot 99E-3 -> 0.31 Inexact Rounded +sqtx2990 squareroot 99E+1 -> 31 Inexact Rounded +sqtx2991 squareroot 99E+2 -> 99 Inexact Rounded +sqtx2992 squareroot 99E+3 -> 3.1E+2 Inexact Rounded + +-- Precision 3 squareroot tests [exhaustive, f and f/10] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 3 +sqtx3001 squareroot 0.1 -> 0.316 Inexact Rounded +sqtx3002 squareroot 0.01 -> 0.1 +sqtx3003 squareroot 0.2 -> 0.447 Inexact Rounded +sqtx3004 squareroot 0.02 -> 0.141 Inexact Rounded +sqtx3005 squareroot 0.3 -> 0.548 Inexact Rounded +sqtx3006 squareroot 0.03 -> 0.173 Inexact Rounded +sqtx3007 squareroot 0.4 -> 0.632 Inexact Rounded +sqtx3008 squareroot 0.04 -> 0.2 +sqtx3009 squareroot 0.5 -> 0.707 Inexact Rounded +sqtx3010 squareroot 0.05 -> 0.224 Inexact Rounded +sqtx3011 squareroot 0.6 -> 0.775 Inexact Rounded +sqtx3012 squareroot 0.06 -> 0.245 Inexact Rounded +sqtx3013 squareroot 0.7 -> 0.837 Inexact Rounded +sqtx3014 squareroot 0.07 -> 0.265 Inexact Rounded +sqtx3015 squareroot 0.8 -> 0.894 Inexact Rounded +sqtx3016 squareroot 0.08 -> 0.283 Inexact Rounded +sqtx3017 squareroot 0.9 -> 0.949 Inexact Rounded +sqtx3018 squareroot 0.09 -> 0.3 +sqtx3019 squareroot 0.11 -> 0.332 Inexact Rounded +sqtx3020 squareroot 0.011 -> 0.105 Inexact Rounded +sqtx3021 squareroot 0.12 -> 0.346 Inexact Rounded +sqtx3022 squareroot 0.012 -> 0.110 Inexact Rounded +sqtx3023 squareroot 0.13 -> 0.361 Inexact Rounded +sqtx3024 squareroot 0.013 -> 0.114 Inexact Rounded +sqtx3025 squareroot 0.14 -> 0.374 Inexact Rounded +sqtx3026 squareroot 0.014 -> 0.118 Inexact Rounded +sqtx3027 squareroot 0.15 -> 0.387 Inexact Rounded +sqtx3028 squareroot 0.015 -> 0.122 Inexact Rounded +sqtx3029 squareroot 0.16 -> 0.4 +sqtx3030 squareroot 0.016 -> 0.126 Inexact Rounded +sqtx3031 squareroot 0.17 -> 0.412 Inexact Rounded +sqtx3032 squareroot 0.017 -> 0.130 Inexact Rounded +sqtx3033 squareroot 0.18 -> 0.424 Inexact Rounded +sqtx3034 squareroot 0.018 -> 0.134 Inexact Rounded +sqtx3035 squareroot 0.19 -> 0.436 Inexact Rounded +sqtx3036 squareroot 0.019 -> 0.138 Inexact Rounded +sqtx3037 squareroot 0.21 -> 0.458 Inexact Rounded +sqtx3038 squareroot 0.021 -> 0.145 Inexact Rounded +sqtx3039 squareroot 0.22 -> 0.469 Inexact Rounded +sqtx3040 squareroot 0.022 -> 0.148 Inexact Rounded +sqtx3041 squareroot 0.23 -> 0.480 Inexact Rounded +sqtx3042 squareroot 0.023 -> 0.152 Inexact Rounded +sqtx3043 squareroot 0.24 -> 0.490 Inexact Rounded +sqtx3044 squareroot 0.024 -> 0.155 Inexact Rounded +sqtx3045 squareroot 0.25 -> 0.5 +sqtx3046 squareroot 0.025 -> 0.158 Inexact Rounded +sqtx3047 squareroot 0.26 -> 0.510 Inexact Rounded +sqtx3048 squareroot 0.026 -> 0.161 Inexact Rounded +sqtx3049 squareroot 0.27 -> 0.520 Inexact Rounded +sqtx3050 squareroot 0.027 -> 0.164 Inexact Rounded +sqtx3051 squareroot 0.28 -> 0.529 Inexact Rounded +sqtx3052 squareroot 0.028 -> 0.167 Inexact Rounded +sqtx3053 squareroot 0.29 -> 0.539 Inexact Rounded +sqtx3054 squareroot 0.029 -> 0.170 Inexact Rounded +sqtx3055 squareroot 0.31 -> 0.557 Inexact Rounded +sqtx3056 squareroot 0.031 -> 0.176 Inexact Rounded +sqtx3057 squareroot 0.32 -> 0.566 Inexact Rounded +sqtx3058 squareroot 0.032 -> 0.179 Inexact Rounded +sqtx3059 squareroot 0.33 -> 0.574 Inexact Rounded +sqtx3060 squareroot 0.033 -> 0.182 Inexact Rounded +sqtx3061 squareroot 0.34 -> 0.583 Inexact Rounded +sqtx3062 squareroot 0.034 -> 0.184 Inexact Rounded +sqtx3063 squareroot 0.35 -> 0.592 Inexact Rounded +sqtx3064 squareroot 0.035 -> 0.187 Inexact Rounded +sqtx3065 squareroot 0.36 -> 0.6 +sqtx3066 squareroot 0.036 -> 0.190 Inexact Rounded +sqtx3067 squareroot 0.37 -> 0.608 Inexact Rounded +sqtx3068 squareroot 0.037 -> 0.192 Inexact Rounded +sqtx3069 squareroot 0.38 -> 0.616 Inexact Rounded +sqtx3070 squareroot 0.038 -> 0.195 Inexact Rounded +sqtx3071 squareroot 0.39 -> 0.624 Inexact Rounded +sqtx3072 squareroot 0.039 -> 0.197 Inexact Rounded +sqtx3073 squareroot 0.41 -> 0.640 Inexact Rounded +sqtx3074 squareroot 0.041 -> 0.202 Inexact Rounded +sqtx3075 squareroot 0.42 -> 0.648 Inexact Rounded +sqtx3076 squareroot 0.042 -> 0.205 Inexact Rounded +sqtx3077 squareroot 0.43 -> 0.656 Inexact Rounded +sqtx3078 squareroot 0.043 -> 0.207 Inexact Rounded +sqtx3079 squareroot 0.44 -> 0.663 Inexact Rounded +sqtx3080 squareroot 0.044 -> 0.210 Inexact Rounded +sqtx3081 squareroot 0.45 -> 0.671 Inexact Rounded +sqtx3082 squareroot 0.045 -> 0.212 Inexact Rounded +sqtx3083 squareroot 0.46 -> 0.678 Inexact Rounded +sqtx3084 squareroot 0.046 -> 0.214 Inexact Rounded +sqtx3085 squareroot 0.47 -> 0.686 Inexact Rounded +sqtx3086 squareroot 0.047 -> 0.217 Inexact Rounded +sqtx3087 squareroot 0.48 -> 0.693 Inexact Rounded +sqtx3088 squareroot 0.048 -> 0.219 Inexact Rounded +sqtx3089 squareroot 0.49 -> 0.7 +sqtx3090 squareroot 0.049 -> 0.221 Inexact Rounded +sqtx3091 squareroot 0.51 -> 0.714 Inexact Rounded +sqtx3092 squareroot 0.051 -> 0.226 Inexact Rounded +sqtx3093 squareroot 0.52 -> 0.721 Inexact Rounded +sqtx3094 squareroot 0.052 -> 0.228 Inexact Rounded +sqtx3095 squareroot 0.53 -> 0.728 Inexact Rounded +sqtx3096 squareroot 0.053 -> 0.230 Inexact Rounded +sqtx3097 squareroot 0.54 -> 0.735 Inexact Rounded +sqtx3098 squareroot 0.054 -> 0.232 Inexact Rounded +sqtx3099 squareroot 0.55 -> 0.742 Inexact Rounded +sqtx3100 squareroot 0.055 -> 0.235 Inexact Rounded +sqtx3101 squareroot 0.56 -> 0.748 Inexact Rounded +sqtx3102 squareroot 0.056 -> 0.237 Inexact Rounded +sqtx3103 squareroot 0.57 -> 0.755 Inexact Rounded +sqtx3104 squareroot 0.057 -> 0.239 Inexact Rounded +sqtx3105 squareroot 0.58 -> 0.762 Inexact Rounded +sqtx3106 squareroot 0.058 -> 0.241 Inexact Rounded +sqtx3107 squareroot 0.59 -> 0.768 Inexact Rounded +sqtx3108 squareroot 0.059 -> 0.243 Inexact Rounded +sqtx3109 squareroot 0.61 -> 0.781 Inexact Rounded +sqtx3110 squareroot 0.061 -> 0.247 Inexact Rounded +sqtx3111 squareroot 0.62 -> 0.787 Inexact Rounded +sqtx3112 squareroot 0.062 -> 0.249 Inexact Rounded +sqtx3113 squareroot 0.63 -> 0.794 Inexact Rounded +sqtx3114 squareroot 0.063 -> 0.251 Inexact Rounded +sqtx3115 squareroot 0.64 -> 0.8 +sqtx3116 squareroot 0.064 -> 0.253 Inexact Rounded +sqtx3117 squareroot 0.65 -> 0.806 Inexact Rounded +sqtx3118 squareroot 0.065 -> 0.255 Inexact Rounded +sqtx3119 squareroot 0.66 -> 0.812 Inexact Rounded +sqtx3120 squareroot 0.066 -> 0.257 Inexact Rounded +sqtx3121 squareroot 0.67 -> 0.819 Inexact Rounded +sqtx3122 squareroot 0.067 -> 0.259 Inexact Rounded +sqtx3123 squareroot 0.68 -> 0.825 Inexact Rounded +sqtx3124 squareroot 0.068 -> 0.261 Inexact Rounded +sqtx3125 squareroot 0.69 -> 0.831 Inexact Rounded +sqtx3126 squareroot 0.069 -> 0.263 Inexact Rounded +sqtx3127 squareroot 0.71 -> 0.843 Inexact Rounded +sqtx3128 squareroot 0.071 -> 0.266 Inexact Rounded +sqtx3129 squareroot 0.72 -> 0.849 Inexact Rounded +sqtx3130 squareroot 0.072 -> 0.268 Inexact Rounded +sqtx3131 squareroot 0.73 -> 0.854 Inexact Rounded +sqtx3132 squareroot 0.073 -> 0.270 Inexact Rounded +sqtx3133 squareroot 0.74 -> 0.860 Inexact Rounded +sqtx3134 squareroot 0.074 -> 0.272 Inexact Rounded +sqtx3135 squareroot 0.75 -> 0.866 Inexact Rounded +sqtx3136 squareroot 0.075 -> 0.274 Inexact Rounded +sqtx3137 squareroot 0.76 -> 0.872 Inexact Rounded +sqtx3138 squareroot 0.076 -> 0.276 Inexact Rounded +sqtx3139 squareroot 0.77 -> 0.877 Inexact Rounded +sqtx3140 squareroot 0.077 -> 0.277 Inexact Rounded +sqtx3141 squareroot 0.78 -> 0.883 Inexact Rounded +sqtx3142 squareroot 0.078 -> 0.279 Inexact Rounded +sqtx3143 squareroot 0.79 -> 0.889 Inexact Rounded +sqtx3144 squareroot 0.079 -> 0.281 Inexact Rounded +sqtx3145 squareroot 0.81 -> 0.9 +sqtx3146 squareroot 0.081 -> 0.285 Inexact Rounded +sqtx3147 squareroot 0.82 -> 0.906 Inexact Rounded +sqtx3148 squareroot 0.082 -> 0.286 Inexact Rounded +sqtx3149 squareroot 0.83 -> 0.911 Inexact Rounded +sqtx3150 squareroot 0.083 -> 0.288 Inexact Rounded +sqtx3151 squareroot 0.84 -> 0.917 Inexact Rounded +sqtx3152 squareroot 0.084 -> 0.290 Inexact Rounded +sqtx3153 squareroot 0.85 -> 0.922 Inexact Rounded +sqtx3154 squareroot 0.085 -> 0.292 Inexact Rounded +sqtx3155 squareroot 0.86 -> 0.927 Inexact Rounded +sqtx3156 squareroot 0.086 -> 0.293 Inexact Rounded +sqtx3157 squareroot 0.87 -> 0.933 Inexact Rounded +sqtx3158 squareroot 0.087 -> 0.295 Inexact Rounded +sqtx3159 squareroot 0.88 -> 0.938 Inexact Rounded +sqtx3160 squareroot 0.088 -> 0.297 Inexact Rounded +sqtx3161 squareroot 0.89 -> 0.943 Inexact Rounded +sqtx3162 squareroot 0.089 -> 0.298 Inexact Rounded +sqtx3163 squareroot 0.91 -> 0.954 Inexact Rounded +sqtx3164 squareroot 0.091 -> 0.302 Inexact Rounded +sqtx3165 squareroot 0.92 -> 0.959 Inexact Rounded +sqtx3166 squareroot 0.092 -> 0.303 Inexact Rounded +sqtx3167 squareroot 0.93 -> 0.964 Inexact Rounded +sqtx3168 squareroot 0.093 -> 0.305 Inexact Rounded +sqtx3169 squareroot 0.94 -> 0.970 Inexact Rounded +sqtx3170 squareroot 0.094 -> 0.307 Inexact Rounded +sqtx3171 squareroot 0.95 -> 0.975 Inexact Rounded +sqtx3172 squareroot 0.095 -> 0.308 Inexact Rounded +sqtx3173 squareroot 0.96 -> 0.980 Inexact Rounded +sqtx3174 squareroot 0.096 -> 0.310 Inexact Rounded +sqtx3175 squareroot 0.97 -> 0.985 Inexact Rounded +sqtx3176 squareroot 0.097 -> 0.311 Inexact Rounded +sqtx3177 squareroot 0.98 -> 0.990 Inexact Rounded +sqtx3178 squareroot 0.098 -> 0.313 Inexact Rounded +sqtx3179 squareroot 0.99 -> 0.995 Inexact Rounded +sqtx3180 squareroot 0.099 -> 0.315 Inexact Rounded +sqtx3181 squareroot 0.101 -> 0.318 Inexact Rounded +sqtx3182 squareroot 0.0101 -> 0.100 Inexact Rounded +sqtx3183 squareroot 0.102 -> 0.319 Inexact Rounded +sqtx3184 squareroot 0.0102 -> 0.101 Inexact Rounded +sqtx3185 squareroot 0.103 -> 0.321 Inexact Rounded +sqtx3186 squareroot 0.0103 -> 0.101 Inexact Rounded +sqtx3187 squareroot 0.104 -> 0.322 Inexact Rounded +sqtx3188 squareroot 0.0104 -> 0.102 Inexact Rounded +sqtx3189 squareroot 0.105 -> 0.324 Inexact Rounded +sqtx3190 squareroot 0.0105 -> 0.102 Inexact Rounded +sqtx3191 squareroot 0.106 -> 0.326 Inexact Rounded +sqtx3192 squareroot 0.0106 -> 0.103 Inexact Rounded +sqtx3193 squareroot 0.107 -> 0.327 Inexact Rounded +sqtx3194 squareroot 0.0107 -> 0.103 Inexact Rounded +sqtx3195 squareroot 0.108 -> 0.329 Inexact Rounded +sqtx3196 squareroot 0.0108 -> 0.104 Inexact Rounded +sqtx3197 squareroot 0.109 -> 0.330 Inexact Rounded +sqtx3198 squareroot 0.0109 -> 0.104 Inexact Rounded +sqtx3199 squareroot 0.111 -> 0.333 Inexact Rounded +sqtx3200 squareroot 0.0111 -> 0.105 Inexact Rounded +sqtx3201 squareroot 0.112 -> 0.335 Inexact Rounded +sqtx3202 squareroot 0.0112 -> 0.106 Inexact Rounded +sqtx3203 squareroot 0.113 -> 0.336 Inexact Rounded +sqtx3204 squareroot 0.0113 -> 0.106 Inexact Rounded +sqtx3205 squareroot 0.114 -> 0.338 Inexact Rounded +sqtx3206 squareroot 0.0114 -> 0.107 Inexact Rounded +sqtx3207 squareroot 0.115 -> 0.339 Inexact Rounded +sqtx3208 squareroot 0.0115 -> 0.107 Inexact Rounded +sqtx3209 squareroot 0.116 -> 0.341 Inexact Rounded +sqtx3210 squareroot 0.0116 -> 0.108 Inexact Rounded +sqtx3211 squareroot 0.117 -> 0.342 Inexact Rounded +sqtx3212 squareroot 0.0117 -> 0.108 Inexact Rounded +sqtx3213 squareroot 0.118 -> 0.344 Inexact Rounded +sqtx3214 squareroot 0.0118 -> 0.109 Inexact Rounded +sqtx3215 squareroot 0.119 -> 0.345 Inexact Rounded +sqtx3216 squareroot 0.0119 -> 0.109 Inexact Rounded +sqtx3217 squareroot 0.121 -> 0.348 Inexact Rounded +sqtx3218 squareroot 0.0121 -> 0.11 +sqtx3219 squareroot 0.122 -> 0.349 Inexact Rounded +sqtx3220 squareroot 0.0122 -> 0.110 Inexact Rounded +sqtx3221 squareroot 0.123 -> 0.351 Inexact Rounded +sqtx3222 squareroot 0.0123 -> 0.111 Inexact Rounded +sqtx3223 squareroot 0.124 -> 0.352 Inexact Rounded +sqtx3224 squareroot 0.0124 -> 0.111 Inexact Rounded +sqtx3225 squareroot 0.125 -> 0.354 Inexact Rounded +sqtx3226 squareroot 0.0125 -> 0.112 Inexact Rounded +sqtx3227 squareroot 0.126 -> 0.355 Inexact Rounded +sqtx3228 squareroot 0.0126 -> 0.112 Inexact Rounded +sqtx3229 squareroot 0.127 -> 0.356 Inexact Rounded +sqtx3230 squareroot 0.0127 -> 0.113 Inexact Rounded +sqtx3231 squareroot 0.128 -> 0.358 Inexact Rounded +sqtx3232 squareroot 0.0128 -> 0.113 Inexact Rounded +sqtx3233 squareroot 0.129 -> 0.359 Inexact Rounded +sqtx3234 squareroot 0.0129 -> 0.114 Inexact Rounded +sqtx3235 squareroot 0.131 -> 0.362 Inexact Rounded +sqtx3236 squareroot 0.0131 -> 0.114 Inexact Rounded +sqtx3237 squareroot 0.132 -> 0.363 Inexact Rounded +sqtx3238 squareroot 0.0132 -> 0.115 Inexact Rounded +sqtx3239 squareroot 0.133 -> 0.365 Inexact Rounded +sqtx3240 squareroot 0.0133 -> 0.115 Inexact Rounded +sqtx3241 squareroot 0.134 -> 0.366 Inexact Rounded +sqtx3242 squareroot 0.0134 -> 0.116 Inexact Rounded +sqtx3243 squareroot 0.135 -> 0.367 Inexact Rounded +sqtx3244 squareroot 0.0135 -> 0.116 Inexact Rounded +sqtx3245 squareroot 0.136 -> 0.369 Inexact Rounded +sqtx3246 squareroot 0.0136 -> 0.117 Inexact Rounded +sqtx3247 squareroot 0.137 -> 0.370 Inexact Rounded +sqtx3248 squareroot 0.0137 -> 0.117 Inexact Rounded +sqtx3249 squareroot 0.138 -> 0.371 Inexact Rounded +sqtx3250 squareroot 0.0138 -> 0.117 Inexact Rounded +sqtx3251 squareroot 0.139 -> 0.373 Inexact Rounded +sqtx3252 squareroot 0.0139 -> 0.118 Inexact Rounded +sqtx3253 squareroot 0.141 -> 0.375 Inexact Rounded +sqtx3254 squareroot 0.0141 -> 0.119 Inexact Rounded +sqtx3255 squareroot 0.142 -> 0.377 Inexact Rounded +sqtx3256 squareroot 0.0142 -> 0.119 Inexact Rounded +sqtx3257 squareroot 0.143 -> 0.378 Inexact Rounded +sqtx3258 squareroot 0.0143 -> 0.120 Inexact Rounded +sqtx3259 squareroot 0.144 -> 0.379 Inexact Rounded +sqtx3260 squareroot 0.0144 -> 0.12 +sqtx3261 squareroot 0.145 -> 0.381 Inexact Rounded +sqtx3262 squareroot 0.0145 -> 0.120 Inexact Rounded +sqtx3263 squareroot 0.146 -> 0.382 Inexact Rounded +sqtx3264 squareroot 0.0146 -> 0.121 Inexact Rounded +sqtx3265 squareroot 0.147 -> 0.383 Inexact Rounded +sqtx3266 squareroot 0.0147 -> 0.121 Inexact Rounded +sqtx3267 squareroot 0.148 -> 0.385 Inexact Rounded +sqtx3268 squareroot 0.0148 -> 0.122 Inexact Rounded +sqtx3269 squareroot 0.149 -> 0.386 Inexact Rounded +sqtx3270 squareroot 0.0149 -> 0.122 Inexact Rounded +sqtx3271 squareroot 0.151 -> 0.389 Inexact Rounded +sqtx3272 squareroot 0.0151 -> 0.123 Inexact Rounded +sqtx3273 squareroot 0.152 -> 0.390 Inexact Rounded +sqtx3274 squareroot 0.0152 -> 0.123 Inexact Rounded +sqtx3275 squareroot 0.153 -> 0.391 Inexact Rounded +sqtx3276 squareroot 0.0153 -> 0.124 Inexact Rounded +sqtx3277 squareroot 0.154 -> 0.392 Inexact Rounded +sqtx3278 squareroot 0.0154 -> 0.124 Inexact Rounded +sqtx3279 squareroot 0.155 -> 0.394 Inexact Rounded +sqtx3280 squareroot 0.0155 -> 0.124 Inexact Rounded +sqtx3281 squareroot 0.156 -> 0.395 Inexact Rounded +sqtx3282 squareroot 0.0156 -> 0.125 Inexact Rounded +sqtx3283 squareroot 0.157 -> 0.396 Inexact Rounded +sqtx3284 squareroot 0.0157 -> 0.125 Inexact Rounded +sqtx3285 squareroot 0.158 -> 0.397 Inexact Rounded +sqtx3286 squareroot 0.0158 -> 0.126 Inexact Rounded +sqtx3287 squareroot 0.159 -> 0.399 Inexact Rounded +sqtx3288 squareroot 0.0159 -> 0.126 Inexact Rounded +sqtx3289 squareroot 0.161 -> 0.401 Inexact Rounded +sqtx3290 squareroot 0.0161 -> 0.127 Inexact Rounded +sqtx3291 squareroot 0.162 -> 0.402 Inexact Rounded +sqtx3292 squareroot 0.0162 -> 0.127 Inexact Rounded +sqtx3293 squareroot 0.163 -> 0.404 Inexact Rounded +sqtx3294 squareroot 0.0163 -> 0.128 Inexact Rounded +sqtx3295 squareroot 0.164 -> 0.405 Inexact Rounded +sqtx3296 squareroot 0.0164 -> 0.128 Inexact Rounded +sqtx3297 squareroot 0.165 -> 0.406 Inexact Rounded +sqtx3298 squareroot 0.0165 -> 0.128 Inexact Rounded +sqtx3299 squareroot 0.166 -> 0.407 Inexact Rounded +sqtx3300 squareroot 0.0166 -> 0.129 Inexact Rounded +sqtx3301 squareroot 0.167 -> 0.409 Inexact Rounded +sqtx3302 squareroot 0.0167 -> 0.129 Inexact Rounded +sqtx3303 squareroot 0.168 -> 0.410 Inexact Rounded +sqtx3304 squareroot 0.0168 -> 0.130 Inexact Rounded +sqtx3305 squareroot 0.169 -> 0.411 Inexact Rounded +sqtx3306 squareroot 0.0169 -> 0.13 +sqtx3307 squareroot 0.171 -> 0.414 Inexact Rounded +sqtx3308 squareroot 0.0171 -> 0.131 Inexact Rounded +sqtx3309 squareroot 0.172 -> 0.415 Inexact Rounded +sqtx3310 squareroot 0.0172 -> 0.131 Inexact Rounded +sqtx3311 squareroot 0.173 -> 0.416 Inexact Rounded +sqtx3312 squareroot 0.0173 -> 0.132 Inexact Rounded +sqtx3313 squareroot 0.174 -> 0.417 Inexact Rounded +sqtx3314 squareroot 0.0174 -> 0.132 Inexact Rounded +sqtx3315 squareroot 0.175 -> 0.418 Inexact Rounded +sqtx3316 squareroot 0.0175 -> 0.132 Inexact Rounded +sqtx3317 squareroot 0.176 -> 0.420 Inexact Rounded +sqtx3318 squareroot 0.0176 -> 0.133 Inexact Rounded +sqtx3319 squareroot 0.177 -> 0.421 Inexact Rounded +sqtx3320 squareroot 0.0177 -> 0.133 Inexact Rounded +sqtx3321 squareroot 0.178 -> 0.422 Inexact Rounded +sqtx3322 squareroot 0.0178 -> 0.133 Inexact Rounded +sqtx3323 squareroot 0.179 -> 0.423 Inexact Rounded +sqtx3324 squareroot 0.0179 -> 0.134 Inexact Rounded +sqtx3325 squareroot 0.181 -> 0.425 Inexact Rounded +sqtx3326 squareroot 0.0181 -> 0.135 Inexact Rounded +sqtx3327 squareroot 0.182 -> 0.427 Inexact Rounded +sqtx3328 squareroot 0.0182 -> 0.135 Inexact Rounded +sqtx3329 squareroot 0.183 -> 0.428 Inexact Rounded +sqtx3330 squareroot 0.0183 -> 0.135 Inexact Rounded +sqtx3331 squareroot 0.184 -> 0.429 Inexact Rounded +sqtx3332 squareroot 0.0184 -> 0.136 Inexact Rounded +sqtx3333 squareroot 0.185 -> 0.430 Inexact Rounded +sqtx3334 squareroot 0.0185 -> 0.136 Inexact Rounded +sqtx3335 squareroot 0.186 -> 0.431 Inexact Rounded +sqtx3336 squareroot 0.0186 -> 0.136 Inexact Rounded +sqtx3337 squareroot 0.187 -> 0.432 Inexact Rounded +sqtx3338 squareroot 0.0187 -> 0.137 Inexact Rounded +sqtx3339 squareroot 0.188 -> 0.434 Inexact Rounded +sqtx3340 squareroot 0.0188 -> 0.137 Inexact Rounded +sqtx3341 squareroot 0.189 -> 0.435 Inexact Rounded +sqtx3342 squareroot 0.0189 -> 0.137 Inexact Rounded +sqtx3343 squareroot 0.191 -> 0.437 Inexact Rounded +sqtx3344 squareroot 0.0191 -> 0.138 Inexact Rounded +sqtx3345 squareroot 0.192 -> 0.438 Inexact Rounded +sqtx3346 squareroot 0.0192 -> 0.139 Inexact Rounded +sqtx3347 squareroot 0.193 -> 0.439 Inexact Rounded +sqtx3348 squareroot 0.0193 -> 0.139 Inexact Rounded +sqtx3349 squareroot 0.194 -> 0.440 Inexact Rounded +sqtx3350 squareroot 0.0194 -> 0.139 Inexact Rounded +sqtx3351 squareroot 0.195 -> 0.442 Inexact Rounded +sqtx3352 squareroot 0.0195 -> 0.140 Inexact Rounded +sqtx3353 squareroot 0.196 -> 0.443 Inexact Rounded +sqtx3354 squareroot 0.0196 -> 0.14 +sqtx3355 squareroot 0.197 -> 0.444 Inexact Rounded +sqtx3356 squareroot 0.0197 -> 0.140 Inexact Rounded +sqtx3357 squareroot 0.198 -> 0.445 Inexact Rounded +sqtx3358 squareroot 0.0198 -> 0.141 Inexact Rounded +sqtx3359 squareroot 0.199 -> 0.446 Inexact Rounded +sqtx3360 squareroot 0.0199 -> 0.141 Inexact Rounded +sqtx3361 squareroot 0.201 -> 0.448 Inexact Rounded +sqtx3362 squareroot 0.0201 -> 0.142 Inexact Rounded +sqtx3363 squareroot 0.202 -> 0.449 Inexact Rounded +sqtx3364 squareroot 0.0202 -> 0.142 Inexact Rounded +sqtx3365 squareroot 0.203 -> 0.451 Inexact Rounded +sqtx3366 squareroot 0.0203 -> 0.142 Inexact Rounded +sqtx3367 squareroot 0.204 -> 0.452 Inexact Rounded +sqtx3368 squareroot 0.0204 -> 0.143 Inexact Rounded +sqtx3369 squareroot 0.205 -> 0.453 Inexact Rounded +sqtx3370 squareroot 0.0205 -> 0.143 Inexact Rounded +sqtx3371 squareroot 0.206 -> 0.454 Inexact Rounded +sqtx3372 squareroot 0.0206 -> 0.144 Inexact Rounded +sqtx3373 squareroot 0.207 -> 0.455 Inexact Rounded +sqtx3374 squareroot 0.0207 -> 0.144 Inexact Rounded +sqtx3375 squareroot 0.208 -> 0.456 Inexact Rounded +sqtx3376 squareroot 0.0208 -> 0.144 Inexact Rounded +sqtx3377 squareroot 0.209 -> 0.457 Inexact Rounded +sqtx3378 squareroot 0.0209 -> 0.145 Inexact Rounded +sqtx3379 squareroot 0.211 -> 0.459 Inexact Rounded +sqtx3380 squareroot 0.0211 -> 0.145 Inexact Rounded +sqtx3381 squareroot 0.212 -> 0.460 Inexact Rounded +sqtx3382 squareroot 0.0212 -> 0.146 Inexact Rounded +sqtx3383 squareroot 0.213 -> 0.462 Inexact Rounded +sqtx3384 squareroot 0.0213 -> 0.146 Inexact Rounded +sqtx3385 squareroot 0.214 -> 0.463 Inexact Rounded +sqtx3386 squareroot 0.0214 -> 0.146 Inexact Rounded +sqtx3387 squareroot 0.215 -> 0.464 Inexact Rounded +sqtx3388 squareroot 0.0215 -> 0.147 Inexact Rounded +sqtx3389 squareroot 0.216 -> 0.465 Inexact Rounded +sqtx3390 squareroot 0.0216 -> 0.147 Inexact Rounded +sqtx3391 squareroot 0.217 -> 0.466 Inexact Rounded +sqtx3392 squareroot 0.0217 -> 0.147 Inexact Rounded +sqtx3393 squareroot 0.218 -> 0.467 Inexact Rounded +sqtx3394 squareroot 0.0218 -> 0.148 Inexact Rounded +sqtx3395 squareroot 0.219 -> 0.468 Inexact Rounded +sqtx3396 squareroot 0.0219 -> 0.148 Inexact Rounded +sqtx3397 squareroot 0.221 -> 0.470 Inexact Rounded +sqtx3398 squareroot 0.0221 -> 0.149 Inexact Rounded +sqtx3399 squareroot 0.222 -> 0.471 Inexact Rounded +sqtx3400 squareroot 0.0222 -> 0.149 Inexact Rounded +sqtx3401 squareroot 0.223 -> 0.472 Inexact Rounded +sqtx3402 squareroot 0.0223 -> 0.149 Inexact Rounded +sqtx3403 squareroot 0.224 -> 0.473 Inexact Rounded +sqtx3404 squareroot 0.0224 -> 0.150 Inexact Rounded +sqtx3405 squareroot 0.225 -> 0.474 Inexact Rounded +sqtx3406 squareroot 0.0225 -> 0.15 +sqtx3407 squareroot 0.226 -> 0.475 Inexact Rounded +sqtx3408 squareroot 0.0226 -> 0.150 Inexact Rounded +sqtx3409 squareroot 0.227 -> 0.476 Inexact Rounded +sqtx3410 squareroot 0.0227 -> 0.151 Inexact Rounded +sqtx3411 squareroot 0.228 -> 0.477 Inexact Rounded +sqtx3412 squareroot 0.0228 -> 0.151 Inexact Rounded +sqtx3413 squareroot 0.229 -> 0.479 Inexact Rounded +sqtx3414 squareroot 0.0229 -> 0.151 Inexact Rounded +sqtx3415 squareroot 0.231 -> 0.481 Inexact Rounded +sqtx3416 squareroot 0.0231 -> 0.152 Inexact Rounded +sqtx3417 squareroot 0.232 -> 0.482 Inexact Rounded +sqtx3418 squareroot 0.0232 -> 0.152 Inexact Rounded +sqtx3419 squareroot 0.233 -> 0.483 Inexact Rounded +sqtx3420 squareroot 0.0233 -> 0.153 Inexact Rounded +sqtx3421 squareroot 0.234 -> 0.484 Inexact Rounded +sqtx3422 squareroot 0.0234 -> 0.153 Inexact Rounded +sqtx3423 squareroot 0.235 -> 0.485 Inexact Rounded +sqtx3424 squareroot 0.0235 -> 0.153 Inexact Rounded +sqtx3425 squareroot 0.236 -> 0.486 Inexact Rounded +sqtx3426 squareroot 0.0236 -> 0.154 Inexact Rounded +sqtx3427 squareroot 0.237 -> 0.487 Inexact Rounded +sqtx3428 squareroot 0.0237 -> 0.154 Inexact Rounded +sqtx3429 squareroot 0.238 -> 0.488 Inexact Rounded +sqtx3430 squareroot 0.0238 -> 0.154 Inexact Rounded +sqtx3431 squareroot 0.239 -> 0.489 Inexact Rounded +sqtx3432 squareroot 0.0239 -> 0.155 Inexact Rounded +sqtx3433 squareroot 0.241 -> 0.491 Inexact Rounded +sqtx3434 squareroot 0.0241 -> 0.155 Inexact Rounded +sqtx3435 squareroot 0.242 -> 0.492 Inexact Rounded +sqtx3436 squareroot 0.0242 -> 0.156 Inexact Rounded +sqtx3437 squareroot 0.243 -> 0.493 Inexact Rounded +sqtx3438 squareroot 0.0243 -> 0.156 Inexact Rounded +sqtx3439 squareroot 0.244 -> 0.494 Inexact Rounded +sqtx3440 squareroot 0.0244 -> 0.156 Inexact Rounded +sqtx3441 squareroot 0.245 -> 0.495 Inexact Rounded +sqtx3442 squareroot 0.0245 -> 0.157 Inexact Rounded +sqtx3443 squareroot 0.246 -> 0.496 Inexact Rounded +sqtx3444 squareroot 0.0246 -> 0.157 Inexact Rounded +sqtx3445 squareroot 0.247 -> 0.497 Inexact Rounded +sqtx3446 squareroot 0.0247 -> 0.157 Inexact Rounded +sqtx3447 squareroot 0.248 -> 0.498 Inexact Rounded +sqtx3448 squareroot 0.0248 -> 0.157 Inexact Rounded +sqtx3449 squareroot 0.249 -> 0.499 Inexact Rounded +sqtx3450 squareroot 0.0249 -> 0.158 Inexact Rounded +sqtx3451 squareroot 0.251 -> 0.501 Inexact Rounded +sqtx3452 squareroot 0.0251 -> 0.158 Inexact Rounded +sqtx3453 squareroot 0.252 -> 0.502 Inexact Rounded +sqtx3454 squareroot 0.0252 -> 0.159 Inexact Rounded +sqtx3455 squareroot 0.253 -> 0.503 Inexact Rounded +sqtx3456 squareroot 0.0253 -> 0.159 Inexact Rounded +sqtx3457 squareroot 0.254 -> 0.504 Inexact Rounded +sqtx3458 squareroot 0.0254 -> 0.159 Inexact Rounded +sqtx3459 squareroot 0.255 -> 0.505 Inexact Rounded +sqtx3460 squareroot 0.0255 -> 0.160 Inexact Rounded +sqtx3461 squareroot 0.256 -> 0.506 Inexact Rounded +sqtx3462 squareroot 0.0256 -> 0.16 +sqtx3463 squareroot 0.257 -> 0.507 Inexact Rounded +sqtx3464 squareroot 0.0257 -> 0.160 Inexact Rounded +sqtx3465 squareroot 0.258 -> 0.508 Inexact Rounded +sqtx3466 squareroot 0.0258 -> 0.161 Inexact Rounded +sqtx3467 squareroot 0.259 -> 0.509 Inexact Rounded +sqtx3468 squareroot 0.0259 -> 0.161 Inexact Rounded +sqtx3469 squareroot 0.261 -> 0.511 Inexact Rounded +sqtx3470 squareroot 0.0261 -> 0.162 Inexact Rounded +sqtx3471 squareroot 0.262 -> 0.512 Inexact Rounded +sqtx3472 squareroot 0.0262 -> 0.162 Inexact Rounded +sqtx3473 squareroot 0.263 -> 0.513 Inexact Rounded +sqtx3474 squareroot 0.0263 -> 0.162 Inexact Rounded +sqtx3475 squareroot 0.264 -> 0.514 Inexact Rounded +sqtx3476 squareroot 0.0264 -> 0.162 Inexact Rounded +sqtx3477 squareroot 0.265 -> 0.515 Inexact Rounded +sqtx3478 squareroot 0.0265 -> 0.163 Inexact Rounded +sqtx3479 squareroot 0.266 -> 0.516 Inexact Rounded +sqtx3480 squareroot 0.0266 -> 0.163 Inexact Rounded +sqtx3481 squareroot 0.267 -> 0.517 Inexact Rounded +sqtx3482 squareroot 0.0267 -> 0.163 Inexact Rounded +sqtx3483 squareroot 0.268 -> 0.518 Inexact Rounded +sqtx3484 squareroot 0.0268 -> 0.164 Inexact Rounded +sqtx3485 squareroot 0.269 -> 0.519 Inexact Rounded +sqtx3486 squareroot 0.0269 -> 0.164 Inexact Rounded +sqtx3487 squareroot 0.271 -> 0.521 Inexact Rounded +sqtx3488 squareroot 0.0271 -> 0.165 Inexact Rounded +sqtx3489 squareroot 0.272 -> 0.522 Inexact Rounded +sqtx3490 squareroot 0.0272 -> 0.165 Inexact Rounded +sqtx3491 squareroot 0.273 -> 0.522 Inexact Rounded +sqtx3492 squareroot 0.0273 -> 0.165 Inexact Rounded +sqtx3493 squareroot 0.274 -> 0.523 Inexact Rounded +sqtx3494 squareroot 0.0274 -> 0.166 Inexact Rounded +sqtx3495 squareroot 0.275 -> 0.524 Inexact Rounded +sqtx3496 squareroot 0.0275 -> 0.166 Inexact Rounded +sqtx3497 squareroot 0.276 -> 0.525 Inexact Rounded +sqtx3498 squareroot 0.0276 -> 0.166 Inexact Rounded +sqtx3499 squareroot 0.277 -> 0.526 Inexact Rounded +sqtx3500 squareroot 0.0277 -> 0.166 Inexact Rounded +sqtx3501 squareroot 0.278 -> 0.527 Inexact Rounded +sqtx3502 squareroot 0.0278 -> 0.167 Inexact Rounded +sqtx3503 squareroot 0.279 -> 0.528 Inexact Rounded +sqtx3504 squareroot 0.0279 -> 0.167 Inexact Rounded +sqtx3505 squareroot 0.281 -> 0.530 Inexact Rounded +sqtx3506 squareroot 0.0281 -> 0.168 Inexact Rounded +sqtx3507 squareroot 0.282 -> 0.531 Inexact Rounded +sqtx3508 squareroot 0.0282 -> 0.168 Inexact Rounded +sqtx3509 squareroot 0.283 -> 0.532 Inexact Rounded +sqtx3510 squareroot 0.0283 -> 0.168 Inexact Rounded +sqtx3511 squareroot 0.284 -> 0.533 Inexact Rounded +sqtx3512 squareroot 0.0284 -> 0.169 Inexact Rounded +sqtx3513 squareroot 0.285 -> 0.534 Inexact Rounded +sqtx3514 squareroot 0.0285 -> 0.169 Inexact Rounded +sqtx3515 squareroot 0.286 -> 0.535 Inexact Rounded +sqtx3516 squareroot 0.0286 -> 0.169 Inexact Rounded +sqtx3517 squareroot 0.287 -> 0.536 Inexact Rounded +sqtx3518 squareroot 0.0287 -> 0.169 Inexact Rounded +sqtx3519 squareroot 0.288 -> 0.537 Inexact Rounded +sqtx3520 squareroot 0.0288 -> 0.170 Inexact Rounded +sqtx3521 squareroot 0.289 -> 0.538 Inexact Rounded +sqtx3522 squareroot 0.0289 -> 0.17 +sqtx3523 squareroot 0.291 -> 0.539 Inexact Rounded +sqtx3524 squareroot 0.0291 -> 0.171 Inexact Rounded +sqtx3525 squareroot 0.292 -> 0.540 Inexact Rounded +sqtx3526 squareroot 0.0292 -> 0.171 Inexact Rounded +sqtx3527 squareroot 0.293 -> 0.541 Inexact Rounded +sqtx3528 squareroot 0.0293 -> 0.171 Inexact Rounded +sqtx3529 squareroot 0.294 -> 0.542 Inexact Rounded +sqtx3530 squareroot 0.0294 -> 0.171 Inexact Rounded +sqtx3531 squareroot 0.295 -> 0.543 Inexact Rounded +sqtx3532 squareroot 0.0295 -> 0.172 Inexact Rounded +sqtx3533 squareroot 0.296 -> 0.544 Inexact Rounded +sqtx3534 squareroot 0.0296 -> 0.172 Inexact Rounded +sqtx3535 squareroot 0.297 -> 0.545 Inexact Rounded +sqtx3536 squareroot 0.0297 -> 0.172 Inexact Rounded +sqtx3537 squareroot 0.298 -> 0.546 Inexact Rounded +sqtx3538 squareroot 0.0298 -> 0.173 Inexact Rounded +sqtx3539 squareroot 0.299 -> 0.547 Inexact Rounded +sqtx3540 squareroot 0.0299 -> 0.173 Inexact Rounded +sqtx3541 squareroot 0.301 -> 0.549 Inexact Rounded +sqtx3542 squareroot 0.0301 -> 0.173 Inexact Rounded +sqtx3543 squareroot 0.302 -> 0.550 Inexact Rounded +sqtx3544 squareroot 0.0302 -> 0.174 Inexact Rounded +sqtx3545 squareroot 0.303 -> 0.550 Inexact Rounded +sqtx3546 squareroot 0.0303 -> 0.174 Inexact Rounded +sqtx3547 squareroot 0.304 -> 0.551 Inexact Rounded +sqtx3548 squareroot 0.0304 -> 0.174 Inexact Rounded +sqtx3549 squareroot 0.305 -> 0.552 Inexact Rounded +sqtx3550 squareroot 0.0305 -> 0.175 Inexact Rounded +sqtx3551 squareroot 0.306 -> 0.553 Inexact Rounded +sqtx3552 squareroot 0.0306 -> 0.175 Inexact Rounded +sqtx3553 squareroot 0.307 -> 0.554 Inexact Rounded +sqtx3554 squareroot 0.0307 -> 0.175 Inexact Rounded +sqtx3555 squareroot 0.308 -> 0.555 Inexact Rounded +sqtx3556 squareroot 0.0308 -> 0.175 Inexact Rounded +sqtx3557 squareroot 0.309 -> 0.556 Inexact Rounded +sqtx3558 squareroot 0.0309 -> 0.176 Inexact Rounded +sqtx3559 squareroot 0.311 -> 0.558 Inexact Rounded +sqtx3560 squareroot 0.0311 -> 0.176 Inexact Rounded +sqtx3561 squareroot 0.312 -> 0.559 Inexact Rounded +sqtx3562 squareroot 0.0312 -> 0.177 Inexact Rounded +sqtx3563 squareroot 0.313 -> 0.559 Inexact Rounded +sqtx3564 squareroot 0.0313 -> 0.177 Inexact Rounded +sqtx3565 squareroot 0.314 -> 0.560 Inexact Rounded +sqtx3566 squareroot 0.0314 -> 0.177 Inexact Rounded +sqtx3567 squareroot 0.315 -> 0.561 Inexact Rounded +sqtx3568 squareroot 0.0315 -> 0.177 Inexact Rounded +sqtx3569 squareroot 0.316 -> 0.562 Inexact Rounded +sqtx3570 squareroot 0.0316 -> 0.178 Inexact Rounded +sqtx3571 squareroot 0.317 -> 0.563 Inexact Rounded +sqtx3572 squareroot 0.0317 -> 0.178 Inexact Rounded +sqtx3573 squareroot 0.318 -> 0.564 Inexact Rounded +sqtx3574 squareroot 0.0318 -> 0.178 Inexact Rounded +sqtx3575 squareroot 0.319 -> 0.565 Inexact Rounded +sqtx3576 squareroot 0.0319 -> 0.179 Inexact Rounded +sqtx3577 squareroot 0.321 -> 0.567 Inexact Rounded +sqtx3578 squareroot 0.0321 -> 0.179 Inexact Rounded +sqtx3579 squareroot 0.322 -> 0.567 Inexact Rounded +sqtx3580 squareroot 0.0322 -> 0.179 Inexact Rounded +sqtx3581 squareroot 0.323 -> 0.568 Inexact Rounded +sqtx3582 squareroot 0.0323 -> 0.180 Inexact Rounded +sqtx3583 squareroot 0.324 -> 0.569 Inexact Rounded +sqtx3584 squareroot 0.0324 -> 0.18 +sqtx3585 squareroot 0.325 -> 0.570 Inexact Rounded +sqtx3586 squareroot 0.0325 -> 0.180 Inexact Rounded +sqtx3587 squareroot 0.326 -> 0.571 Inexact Rounded +sqtx3588 squareroot 0.0326 -> 0.181 Inexact Rounded +sqtx3589 squareroot 0.327 -> 0.572 Inexact Rounded +sqtx3590 squareroot 0.0327 -> 0.181 Inexact Rounded +sqtx3591 squareroot 0.328 -> 0.573 Inexact Rounded +sqtx3592 squareroot 0.0328 -> 0.181 Inexact Rounded +sqtx3593 squareroot 0.329 -> 0.574 Inexact Rounded +sqtx3594 squareroot 0.0329 -> 0.181 Inexact Rounded +sqtx3595 squareroot 0.331 -> 0.575 Inexact Rounded +sqtx3596 squareroot 0.0331 -> 0.182 Inexact Rounded +sqtx3597 squareroot 0.332 -> 0.576 Inexact Rounded +sqtx3598 squareroot 0.0332 -> 0.182 Inexact Rounded +sqtx3599 squareroot 0.333 -> 0.577 Inexact Rounded +sqtx3600 squareroot 0.0333 -> 0.182 Inexact Rounded +sqtx3601 squareroot 0.334 -> 0.578 Inexact Rounded +sqtx3602 squareroot 0.0334 -> 0.183 Inexact Rounded +sqtx3603 squareroot 0.335 -> 0.579 Inexact Rounded +sqtx3604 squareroot 0.0335 -> 0.183 Inexact Rounded +sqtx3605 squareroot 0.336 -> 0.580 Inexact Rounded +sqtx3606 squareroot 0.0336 -> 0.183 Inexact Rounded +sqtx3607 squareroot 0.337 -> 0.581 Inexact Rounded +sqtx3608 squareroot 0.0337 -> 0.184 Inexact Rounded +sqtx3609 squareroot 0.338 -> 0.581 Inexact Rounded +sqtx3610 squareroot 0.0338 -> 0.184 Inexact Rounded +sqtx3611 squareroot 0.339 -> 0.582 Inexact Rounded +sqtx3612 squareroot 0.0339 -> 0.184 Inexact Rounded +sqtx3613 squareroot 0.341 -> 0.584 Inexact Rounded +sqtx3614 squareroot 0.0341 -> 0.185 Inexact Rounded +sqtx3615 squareroot 0.342 -> 0.585 Inexact Rounded +sqtx3616 squareroot 0.0342 -> 0.185 Inexact Rounded +sqtx3617 squareroot 0.343 -> 0.586 Inexact Rounded +sqtx3618 squareroot 0.0343 -> 0.185 Inexact Rounded +sqtx3619 squareroot 0.344 -> 0.587 Inexact Rounded +sqtx3620 squareroot 0.0344 -> 0.185 Inexact Rounded +sqtx3621 squareroot 0.345 -> 0.587 Inexact Rounded +sqtx3622 squareroot 0.0345 -> 0.186 Inexact Rounded +sqtx3623 squareroot 0.346 -> 0.588 Inexact Rounded +sqtx3624 squareroot 0.0346 -> 0.186 Inexact Rounded +sqtx3625 squareroot 0.347 -> 0.589 Inexact Rounded +sqtx3626 squareroot 0.0347 -> 0.186 Inexact Rounded +sqtx3627 squareroot 0.348 -> 0.590 Inexact Rounded +sqtx3628 squareroot 0.0348 -> 0.187 Inexact Rounded +sqtx3629 squareroot 0.349 -> 0.591 Inexact Rounded +sqtx3630 squareroot 0.0349 -> 0.187 Inexact Rounded +sqtx3631 squareroot 0.351 -> 0.592 Inexact Rounded +sqtx3632 squareroot 0.0351 -> 0.187 Inexact Rounded +sqtx3633 squareroot 0.352 -> 0.593 Inexact Rounded +sqtx3634 squareroot 0.0352 -> 0.188 Inexact Rounded +sqtx3635 squareroot 0.353 -> 0.594 Inexact Rounded +sqtx3636 squareroot 0.0353 -> 0.188 Inexact Rounded +sqtx3637 squareroot 0.354 -> 0.595 Inexact Rounded +sqtx3638 squareroot 0.0354 -> 0.188 Inexact Rounded +sqtx3639 squareroot 0.355 -> 0.596 Inexact Rounded +sqtx3640 squareroot 0.0355 -> 0.188 Inexact Rounded +sqtx3641 squareroot 0.356 -> 0.597 Inexact Rounded +sqtx3642 squareroot 0.0356 -> 0.189 Inexact Rounded +sqtx3643 squareroot 0.357 -> 0.597 Inexact Rounded +sqtx3644 squareroot 0.0357 -> 0.189 Inexact Rounded +sqtx3645 squareroot 0.358 -> 0.598 Inexact Rounded +sqtx3646 squareroot 0.0358 -> 0.189 Inexact Rounded +sqtx3647 squareroot 0.359 -> 0.599 Inexact Rounded +sqtx3648 squareroot 0.0359 -> 0.189 Inexact Rounded +sqtx3649 squareroot 0.361 -> 0.601 Inexact Rounded +sqtx3650 squareroot 0.0361 -> 0.19 +sqtx3651 squareroot 0.362 -> 0.602 Inexact Rounded +sqtx3652 squareroot 0.0362 -> 0.190 Inexact Rounded +sqtx3653 squareroot 0.363 -> 0.602 Inexact Rounded +sqtx3654 squareroot 0.0363 -> 0.191 Inexact Rounded +sqtx3655 squareroot 0.364 -> 0.603 Inexact Rounded +sqtx3656 squareroot 0.0364 -> 0.191 Inexact Rounded +sqtx3657 squareroot 0.365 -> 0.604 Inexact Rounded +sqtx3658 squareroot 0.0365 -> 0.191 Inexact Rounded +sqtx3659 squareroot 0.366 -> 0.605 Inexact Rounded +sqtx3660 squareroot 0.0366 -> 0.191 Inexact Rounded +sqtx3661 squareroot 0.367 -> 0.606 Inexact Rounded +sqtx3662 squareroot 0.0367 -> 0.192 Inexact Rounded +sqtx3663 squareroot 0.368 -> 0.607 Inexact Rounded +sqtx3664 squareroot 0.0368 -> 0.192 Inexact Rounded +sqtx3665 squareroot 0.369 -> 0.607 Inexact Rounded +sqtx3666 squareroot 0.0369 -> 0.192 Inexact Rounded +sqtx3667 squareroot 0.371 -> 0.609 Inexact Rounded +sqtx3668 squareroot 0.0371 -> 0.193 Inexact Rounded +sqtx3669 squareroot 0.372 -> 0.610 Inexact Rounded +sqtx3670 squareroot 0.0372 -> 0.193 Inexact Rounded +sqtx3671 squareroot 0.373 -> 0.611 Inexact Rounded +sqtx3672 squareroot 0.0373 -> 0.193 Inexact Rounded +sqtx3673 squareroot 0.374 -> 0.612 Inexact Rounded +sqtx3674 squareroot 0.0374 -> 0.193 Inexact Rounded +sqtx3675 squareroot 0.375 -> 0.612 Inexact Rounded +sqtx3676 squareroot 0.0375 -> 0.194 Inexact Rounded +sqtx3677 squareroot 0.376 -> 0.613 Inexact Rounded +sqtx3678 squareroot 0.0376 -> 0.194 Inexact Rounded +sqtx3679 squareroot 0.377 -> 0.614 Inexact Rounded +sqtx3680 squareroot 0.0377 -> 0.194 Inexact Rounded +sqtx3681 squareroot 0.378 -> 0.615 Inexact Rounded +sqtx3682 squareroot 0.0378 -> 0.194 Inexact Rounded +sqtx3683 squareroot 0.379 -> 0.616 Inexact Rounded +sqtx3684 squareroot 0.0379 -> 0.195 Inexact Rounded +sqtx3685 squareroot 0.381 -> 0.617 Inexact Rounded +sqtx3686 squareroot 0.0381 -> 0.195 Inexact Rounded +sqtx3687 squareroot 0.382 -> 0.618 Inexact Rounded +sqtx3688 squareroot 0.0382 -> 0.195 Inexact Rounded +sqtx3689 squareroot 0.383 -> 0.619 Inexact Rounded +sqtx3690 squareroot 0.0383 -> 0.196 Inexact Rounded +sqtx3691 squareroot 0.384 -> 0.620 Inexact Rounded +sqtx3692 squareroot 0.0384 -> 0.196 Inexact Rounded +sqtx3693 squareroot 0.385 -> 0.620 Inexact Rounded +sqtx3694 squareroot 0.0385 -> 0.196 Inexact Rounded +sqtx3695 squareroot 0.386 -> 0.621 Inexact Rounded +sqtx3696 squareroot 0.0386 -> 0.196 Inexact Rounded +sqtx3697 squareroot 0.387 -> 0.622 Inexact Rounded +sqtx3698 squareroot 0.0387 -> 0.197 Inexact Rounded +sqtx3699 squareroot 0.388 -> 0.623 Inexact Rounded +sqtx3700 squareroot 0.0388 -> 0.197 Inexact Rounded +sqtx3701 squareroot 0.389 -> 0.624 Inexact Rounded +sqtx3702 squareroot 0.0389 -> 0.197 Inexact Rounded +sqtx3703 squareroot 0.391 -> 0.625 Inexact Rounded +sqtx3704 squareroot 0.0391 -> 0.198 Inexact Rounded +sqtx3705 squareroot 0.392 -> 0.626 Inexact Rounded +sqtx3706 squareroot 0.0392 -> 0.198 Inexact Rounded +sqtx3707 squareroot 0.393 -> 0.627 Inexact Rounded +sqtx3708 squareroot 0.0393 -> 0.198 Inexact Rounded +sqtx3709 squareroot 0.394 -> 0.628 Inexact Rounded +sqtx3710 squareroot 0.0394 -> 0.198 Inexact Rounded +sqtx3711 squareroot 0.395 -> 0.628 Inexact Rounded +sqtx3712 squareroot 0.0395 -> 0.199 Inexact Rounded +sqtx3713 squareroot 0.396 -> 0.629 Inexact Rounded +sqtx3714 squareroot 0.0396 -> 0.199 Inexact Rounded +sqtx3715 squareroot 0.397 -> 0.630 Inexact Rounded +sqtx3716 squareroot 0.0397 -> 0.199 Inexact Rounded +sqtx3717 squareroot 0.398 -> 0.631 Inexact Rounded +sqtx3718 squareroot 0.0398 -> 0.199 Inexact Rounded +sqtx3719 squareroot 0.399 -> 0.632 Inexact Rounded +sqtx3720 squareroot 0.0399 -> 0.200 Inexact Rounded +sqtx3721 squareroot 0.401 -> 0.633 Inexact Rounded +sqtx3722 squareroot 0.0401 -> 0.200 Inexact Rounded +sqtx3723 squareroot 0.402 -> 0.634 Inexact Rounded +sqtx3724 squareroot 0.0402 -> 0.200 Inexact Rounded +sqtx3725 squareroot 0.403 -> 0.635 Inexact Rounded +sqtx3726 squareroot 0.0403 -> 0.201 Inexact Rounded +sqtx3727 squareroot 0.404 -> 0.636 Inexact Rounded +sqtx3728 squareroot 0.0404 -> 0.201 Inexact Rounded +sqtx3729 squareroot 0.405 -> 0.636 Inexact Rounded +sqtx3730 squareroot 0.0405 -> 0.201 Inexact Rounded +sqtx3731 squareroot 0.406 -> 0.637 Inexact Rounded +sqtx3732 squareroot 0.0406 -> 0.201 Inexact Rounded +sqtx3733 squareroot 0.407 -> 0.638 Inexact Rounded +sqtx3734 squareroot 0.0407 -> 0.202 Inexact Rounded +sqtx3735 squareroot 0.408 -> 0.639 Inexact Rounded +sqtx3736 squareroot 0.0408 -> 0.202 Inexact Rounded +sqtx3737 squareroot 0.409 -> 0.640 Inexact Rounded +sqtx3738 squareroot 0.0409 -> 0.202 Inexact Rounded +sqtx3739 squareroot 0.411 -> 0.641 Inexact Rounded +sqtx3740 squareroot 0.0411 -> 0.203 Inexact Rounded +sqtx3741 squareroot 0.412 -> 0.642 Inexact Rounded +sqtx3742 squareroot 0.0412 -> 0.203 Inexact Rounded +sqtx3743 squareroot 0.413 -> 0.643 Inexact Rounded +sqtx3744 squareroot 0.0413 -> 0.203 Inexact Rounded +sqtx3745 squareroot 0.414 -> 0.643 Inexact Rounded +sqtx3746 squareroot 0.0414 -> 0.203 Inexact Rounded +sqtx3747 squareroot 0.415 -> 0.644 Inexact Rounded +sqtx3748 squareroot 0.0415 -> 0.204 Inexact Rounded +sqtx3749 squareroot 0.416 -> 0.645 Inexact Rounded +sqtx3750 squareroot 0.0416 -> 0.204 Inexact Rounded +sqtx3751 squareroot 0.417 -> 0.646 Inexact Rounded +sqtx3752 squareroot 0.0417 -> 0.204 Inexact Rounded +sqtx3753 squareroot 0.418 -> 0.647 Inexact Rounded +sqtx3754 squareroot 0.0418 -> 0.204 Inexact Rounded +sqtx3755 squareroot 0.419 -> 0.647 Inexact Rounded +sqtx3756 squareroot 0.0419 -> 0.205 Inexact Rounded +sqtx3757 squareroot 0.421 -> 0.649 Inexact Rounded +sqtx3758 squareroot 0.0421 -> 0.205 Inexact Rounded +sqtx3759 squareroot 0.422 -> 0.650 Inexact Rounded +sqtx3760 squareroot 0.0422 -> 0.205 Inexact Rounded +sqtx3761 squareroot 0.423 -> 0.650 Inexact Rounded +sqtx3762 squareroot 0.0423 -> 0.206 Inexact Rounded +sqtx3763 squareroot 0.424 -> 0.651 Inexact Rounded +sqtx3764 squareroot 0.0424 -> 0.206 Inexact Rounded +sqtx3765 squareroot 0.425 -> 0.652 Inexact Rounded +sqtx3766 squareroot 0.0425 -> 0.206 Inexact Rounded +sqtx3767 squareroot 0.426 -> 0.653 Inexact Rounded +sqtx3768 squareroot 0.0426 -> 0.206 Inexact Rounded +sqtx3769 squareroot 0.427 -> 0.653 Inexact Rounded +sqtx3770 squareroot 0.0427 -> 0.207 Inexact Rounded +sqtx3771 squareroot 0.428 -> 0.654 Inexact Rounded +sqtx3772 squareroot 0.0428 -> 0.207 Inexact Rounded +sqtx3773 squareroot 0.429 -> 0.655 Inexact Rounded +sqtx3774 squareroot 0.0429 -> 0.207 Inexact Rounded +sqtx3775 squareroot 0.431 -> 0.657 Inexact Rounded +sqtx3776 squareroot 0.0431 -> 0.208 Inexact Rounded +sqtx3777 squareroot 0.432 -> 0.657 Inexact Rounded +sqtx3778 squareroot 0.0432 -> 0.208 Inexact Rounded +sqtx3779 squareroot 0.433 -> 0.658 Inexact Rounded +sqtx3780 squareroot 0.0433 -> 0.208 Inexact Rounded +sqtx3781 squareroot 0.434 -> 0.659 Inexact Rounded +sqtx3782 squareroot 0.0434 -> 0.208 Inexact Rounded +sqtx3783 squareroot 0.435 -> 0.660 Inexact Rounded +sqtx3784 squareroot 0.0435 -> 0.209 Inexact Rounded +sqtx3785 squareroot 0.436 -> 0.660 Inexact Rounded +sqtx3786 squareroot 0.0436 -> 0.209 Inexact Rounded +sqtx3787 squareroot 0.437 -> 0.661 Inexact Rounded +sqtx3788 squareroot 0.0437 -> 0.209 Inexact Rounded +sqtx3789 squareroot 0.438 -> 0.662 Inexact Rounded +sqtx3790 squareroot 0.0438 -> 0.209 Inexact Rounded +sqtx3791 squareroot 0.439 -> 0.663 Inexact Rounded +sqtx3792 squareroot 0.0439 -> 0.210 Inexact Rounded +sqtx3793 squareroot 0.441 -> 0.664 Inexact Rounded +sqtx3794 squareroot 0.0441 -> 0.21 +sqtx3795 squareroot 0.442 -> 0.665 Inexact Rounded +sqtx3796 squareroot 0.0442 -> 0.210 Inexact Rounded +sqtx3797 squareroot 0.443 -> 0.666 Inexact Rounded +sqtx3798 squareroot 0.0443 -> 0.210 Inexact Rounded +sqtx3799 squareroot 0.444 -> 0.666 Inexact Rounded +sqtx3800 squareroot 0.0444 -> 0.211 Inexact Rounded +sqtx3801 squareroot 0.445 -> 0.667 Inexact Rounded +sqtx3802 squareroot 0.0445 -> 0.211 Inexact Rounded +sqtx3803 squareroot 0.446 -> 0.668 Inexact Rounded +sqtx3804 squareroot 0.0446 -> 0.211 Inexact Rounded +sqtx3805 squareroot 0.447 -> 0.669 Inexact Rounded +sqtx3806 squareroot 0.0447 -> 0.211 Inexact Rounded +sqtx3807 squareroot 0.448 -> 0.669 Inexact Rounded +sqtx3808 squareroot 0.0448 -> 0.212 Inexact Rounded +sqtx3809 squareroot 0.449 -> 0.670 Inexact Rounded +sqtx3810 squareroot 0.0449 -> 0.212 Inexact Rounded +sqtx3811 squareroot 0.451 -> 0.672 Inexact Rounded +sqtx3812 squareroot 0.0451 -> 0.212 Inexact Rounded +sqtx3813 squareroot 0.452 -> 0.672 Inexact Rounded +sqtx3814 squareroot 0.0452 -> 0.213 Inexact Rounded +sqtx3815 squareroot 0.453 -> 0.673 Inexact Rounded +sqtx3816 squareroot 0.0453 -> 0.213 Inexact Rounded +sqtx3817 squareroot 0.454 -> 0.674 Inexact Rounded +sqtx3818 squareroot 0.0454 -> 0.213 Inexact Rounded +sqtx3819 squareroot 0.455 -> 0.675 Inexact Rounded +sqtx3820 squareroot 0.0455 -> 0.213 Inexact Rounded +sqtx3821 squareroot 0.456 -> 0.675 Inexact Rounded +sqtx3822 squareroot 0.0456 -> 0.214 Inexact Rounded +sqtx3823 squareroot 0.457 -> 0.676 Inexact Rounded +sqtx3824 squareroot 0.0457 -> 0.214 Inexact Rounded +sqtx3825 squareroot 0.458 -> 0.677 Inexact Rounded +sqtx3826 squareroot 0.0458 -> 0.214 Inexact Rounded +sqtx3827 squareroot 0.459 -> 0.677 Inexact Rounded +sqtx3828 squareroot 0.0459 -> 0.214 Inexact Rounded +sqtx3829 squareroot 0.461 -> 0.679 Inexact Rounded +sqtx3830 squareroot 0.0461 -> 0.215 Inexact Rounded +sqtx3831 squareroot 0.462 -> 0.680 Inexact Rounded +sqtx3832 squareroot 0.0462 -> 0.215 Inexact Rounded +sqtx3833 squareroot 0.463 -> 0.680 Inexact Rounded +sqtx3834 squareroot 0.0463 -> 0.215 Inexact Rounded +sqtx3835 squareroot 0.464 -> 0.681 Inexact Rounded +sqtx3836 squareroot 0.0464 -> 0.215 Inexact Rounded +sqtx3837 squareroot 0.465 -> 0.682 Inexact Rounded +sqtx3838 squareroot 0.0465 -> 0.216 Inexact Rounded +sqtx3839 squareroot 0.466 -> 0.683 Inexact Rounded +sqtx3840 squareroot 0.0466 -> 0.216 Inexact Rounded +sqtx3841 squareroot 0.467 -> 0.683 Inexact Rounded +sqtx3842 squareroot 0.0467 -> 0.216 Inexact Rounded +sqtx3843 squareroot 0.468 -> 0.684 Inexact Rounded +sqtx3844 squareroot 0.0468 -> 0.216 Inexact Rounded +sqtx3845 squareroot 0.469 -> 0.685 Inexact Rounded +sqtx3846 squareroot 0.0469 -> 0.217 Inexact Rounded +sqtx3847 squareroot 0.471 -> 0.686 Inexact Rounded +sqtx3848 squareroot 0.0471 -> 0.217 Inexact Rounded +sqtx3849 squareroot 0.472 -> 0.687 Inexact Rounded +sqtx3850 squareroot 0.0472 -> 0.217 Inexact Rounded +sqtx3851 squareroot 0.473 -> 0.688 Inexact Rounded +sqtx3852 squareroot 0.0473 -> 0.217 Inexact Rounded +sqtx3853 squareroot 0.474 -> 0.688 Inexact Rounded +sqtx3854 squareroot 0.0474 -> 0.218 Inexact Rounded +sqtx3855 squareroot 0.475 -> 0.689 Inexact Rounded +sqtx3856 squareroot 0.0475 -> 0.218 Inexact Rounded +sqtx3857 squareroot 0.476 -> 0.690 Inexact Rounded +sqtx3858 squareroot 0.0476 -> 0.218 Inexact Rounded +sqtx3859 squareroot 0.477 -> 0.691 Inexact Rounded +sqtx3860 squareroot 0.0477 -> 0.218 Inexact Rounded +sqtx3861 squareroot 0.478 -> 0.691 Inexact Rounded +sqtx3862 squareroot 0.0478 -> 0.219 Inexact Rounded +sqtx3863 squareroot 0.479 -> 0.692 Inexact Rounded +sqtx3864 squareroot 0.0479 -> 0.219 Inexact Rounded +sqtx3865 squareroot 0.481 -> 0.694 Inexact Rounded +sqtx3866 squareroot 0.0481 -> 0.219 Inexact Rounded +sqtx3867 squareroot 0.482 -> 0.694 Inexact Rounded +sqtx3868 squareroot 0.0482 -> 0.220 Inexact Rounded +sqtx3869 squareroot 0.483 -> 0.695 Inexact Rounded +sqtx3870 squareroot 0.0483 -> 0.220 Inexact Rounded +sqtx3871 squareroot 0.484 -> 0.696 Inexact Rounded +sqtx3872 squareroot 0.0484 -> 0.22 +sqtx3873 squareroot 0.485 -> 0.696 Inexact Rounded +sqtx3874 squareroot 0.0485 -> 0.220 Inexact Rounded +sqtx3875 squareroot 0.486 -> 0.697 Inexact Rounded +sqtx3876 squareroot 0.0486 -> 0.220 Inexact Rounded +sqtx3877 squareroot 0.487 -> 0.698 Inexact Rounded +sqtx3878 squareroot 0.0487 -> 0.221 Inexact Rounded +sqtx3879 squareroot 0.488 -> 0.699 Inexact Rounded +sqtx3880 squareroot 0.0488 -> 0.221 Inexact Rounded +sqtx3881 squareroot 0.489 -> 0.699 Inexact Rounded +sqtx3882 squareroot 0.0489 -> 0.221 Inexact Rounded +sqtx3883 squareroot 0.491 -> 0.701 Inexact Rounded +sqtx3884 squareroot 0.0491 -> 0.222 Inexact Rounded +sqtx3885 squareroot 0.492 -> 0.701 Inexact Rounded +sqtx3886 squareroot 0.0492 -> 0.222 Inexact Rounded +sqtx3887 squareroot 0.493 -> 0.702 Inexact Rounded +sqtx3888 squareroot 0.0493 -> 0.222 Inexact Rounded +sqtx3889 squareroot 0.494 -> 0.703 Inexact Rounded +sqtx3890 squareroot 0.0494 -> 0.222 Inexact Rounded +sqtx3891 squareroot 0.495 -> 0.704 Inexact Rounded +sqtx3892 squareroot 0.0495 -> 0.222 Inexact Rounded +sqtx3893 squareroot 0.496 -> 0.704 Inexact Rounded +sqtx3894 squareroot 0.0496 -> 0.223 Inexact Rounded +sqtx3895 squareroot 0.497 -> 0.705 Inexact Rounded +sqtx3896 squareroot 0.0497 -> 0.223 Inexact Rounded +sqtx3897 squareroot 0.498 -> 0.706 Inexact Rounded +sqtx3898 squareroot 0.0498 -> 0.223 Inexact Rounded +sqtx3899 squareroot 0.499 -> 0.706 Inexact Rounded +sqtx3900 squareroot 0.0499 -> 0.223 Inexact Rounded +sqtx3901 squareroot 0.501 -> 0.708 Inexact Rounded +sqtx3902 squareroot 0.0501 -> 0.224 Inexact Rounded +sqtx3903 squareroot 0.502 -> 0.709 Inexact Rounded +sqtx3904 squareroot 0.0502 -> 0.224 Inexact Rounded +sqtx3905 squareroot 0.503 -> 0.709 Inexact Rounded +sqtx3906 squareroot 0.0503 -> 0.224 Inexact Rounded +sqtx3907 squareroot 0.504 -> 0.710 Inexact Rounded +sqtx3908 squareroot 0.0504 -> 0.224 Inexact Rounded +sqtx3909 squareroot 0.505 -> 0.711 Inexact Rounded +sqtx3910 squareroot 0.0505 -> 0.225 Inexact Rounded +sqtx3911 squareroot 0.506 -> 0.711 Inexact Rounded +sqtx3912 squareroot 0.0506 -> 0.225 Inexact Rounded +sqtx3913 squareroot 0.507 -> 0.712 Inexact Rounded +sqtx3914 squareroot 0.0507 -> 0.225 Inexact Rounded +sqtx3915 squareroot 0.508 -> 0.713 Inexact Rounded +sqtx3916 squareroot 0.0508 -> 0.225 Inexact Rounded +sqtx3917 squareroot 0.509 -> 0.713 Inexact Rounded +sqtx3918 squareroot 0.0509 -> 0.226 Inexact Rounded +sqtx3919 squareroot 0.511 -> 0.715 Inexact Rounded +sqtx3920 squareroot 0.0511 -> 0.226 Inexact Rounded +sqtx3921 squareroot 0.512 -> 0.716 Inexact Rounded +sqtx3922 squareroot 0.0512 -> 0.226 Inexact Rounded +sqtx3923 squareroot 0.513 -> 0.716 Inexact Rounded +sqtx3924 squareroot 0.0513 -> 0.226 Inexact Rounded +sqtx3925 squareroot 0.514 -> 0.717 Inexact Rounded +sqtx3926 squareroot 0.0514 -> 0.227 Inexact Rounded +sqtx3927 squareroot 0.515 -> 0.718 Inexact Rounded +sqtx3928 squareroot 0.0515 -> 0.227 Inexact Rounded +sqtx3929 squareroot 0.516 -> 0.718 Inexact Rounded +sqtx3930 squareroot 0.0516 -> 0.227 Inexact Rounded +sqtx3931 squareroot 0.517 -> 0.719 Inexact Rounded +sqtx3932 squareroot 0.0517 -> 0.227 Inexact Rounded +sqtx3933 squareroot 0.518 -> 0.720 Inexact Rounded +sqtx3934 squareroot 0.0518 -> 0.228 Inexact Rounded +sqtx3935 squareroot 0.519 -> 0.720 Inexact Rounded +sqtx3936 squareroot 0.0519 -> 0.228 Inexact Rounded +sqtx3937 squareroot 0.521 -> 0.722 Inexact Rounded +sqtx3938 squareroot 0.0521 -> 0.228 Inexact Rounded +sqtx3939 squareroot 0.522 -> 0.722 Inexact Rounded +sqtx3940 squareroot 0.0522 -> 0.228 Inexact Rounded +sqtx3941 squareroot 0.523 -> 0.723 Inexact Rounded +sqtx3942 squareroot 0.0523 -> 0.229 Inexact Rounded +sqtx3943 squareroot 0.524 -> 0.724 Inexact Rounded +sqtx3944 squareroot 0.0524 -> 0.229 Inexact Rounded +sqtx3945 squareroot 0.525 -> 0.725 Inexact Rounded +sqtx3946 squareroot 0.0525 -> 0.229 Inexact Rounded +sqtx3947 squareroot 0.526 -> 0.725 Inexact Rounded +sqtx3948 squareroot 0.0526 -> 0.229 Inexact Rounded +sqtx3949 squareroot 0.527 -> 0.726 Inexact Rounded +sqtx3950 squareroot 0.0527 -> 0.230 Inexact Rounded +sqtx3951 squareroot 0.528 -> 0.727 Inexact Rounded +sqtx3952 squareroot 0.0528 -> 0.230 Inexact Rounded +sqtx3953 squareroot 0.529 -> 0.727 Inexact Rounded +sqtx3954 squareroot 0.0529 -> 0.23 +sqtx3955 squareroot 0.531 -> 0.729 Inexact Rounded +sqtx3956 squareroot 0.0531 -> 0.230 Inexact Rounded +sqtx3957 squareroot 0.532 -> 0.729 Inexact Rounded +sqtx3958 squareroot 0.0532 -> 0.231 Inexact Rounded +sqtx3959 squareroot 0.533 -> 0.730 Inexact Rounded +sqtx3960 squareroot 0.0533 -> 0.231 Inexact Rounded +sqtx3961 squareroot 0.534 -> 0.731 Inexact Rounded +sqtx3962 squareroot 0.0534 -> 0.231 Inexact Rounded +sqtx3963 squareroot 0.535 -> 0.731 Inexact Rounded +sqtx3964 squareroot 0.0535 -> 0.231 Inexact Rounded +sqtx3965 squareroot 0.536 -> 0.732 Inexact Rounded +sqtx3966 squareroot 0.0536 -> 0.232 Inexact Rounded +sqtx3967 squareroot 0.537 -> 0.733 Inexact Rounded +sqtx3968 squareroot 0.0537 -> 0.232 Inexact Rounded +sqtx3969 squareroot 0.538 -> 0.733 Inexact Rounded +sqtx3970 squareroot 0.0538 -> 0.232 Inexact Rounded +sqtx3971 squareroot 0.539 -> 0.734 Inexact Rounded +sqtx3972 squareroot 0.0539 -> 0.232 Inexact Rounded +sqtx3973 squareroot 0.541 -> 0.736 Inexact Rounded +sqtx3974 squareroot 0.0541 -> 0.233 Inexact Rounded +sqtx3975 squareroot 0.542 -> 0.736 Inexact Rounded +sqtx3976 squareroot 0.0542 -> 0.233 Inexact Rounded +sqtx3977 squareroot 0.543 -> 0.737 Inexact Rounded +sqtx3978 squareroot 0.0543 -> 0.233 Inexact Rounded +sqtx3979 squareroot 0.544 -> 0.738 Inexact Rounded +sqtx3980 squareroot 0.0544 -> 0.233 Inexact Rounded +sqtx3981 squareroot 0.545 -> 0.738 Inexact Rounded +sqtx3982 squareroot 0.0545 -> 0.233 Inexact Rounded +sqtx3983 squareroot 0.546 -> 0.739 Inexact Rounded +sqtx3984 squareroot 0.0546 -> 0.234 Inexact Rounded +sqtx3985 squareroot 0.547 -> 0.740 Inexact Rounded +sqtx3986 squareroot 0.0547 -> 0.234 Inexact Rounded +sqtx3987 squareroot 0.548 -> 0.740 Inexact Rounded +sqtx3988 squareroot 0.0548 -> 0.234 Inexact Rounded +sqtx3989 squareroot 0.549 -> 0.741 Inexact Rounded +sqtx3990 squareroot 0.0549 -> 0.234 Inexact Rounded +sqtx3991 squareroot 0.551 -> 0.742 Inexact Rounded +sqtx3992 squareroot 0.0551 -> 0.235 Inexact Rounded +sqtx3993 squareroot 0.552 -> 0.743 Inexact Rounded +sqtx3994 squareroot 0.0552 -> 0.235 Inexact Rounded +sqtx3995 squareroot 0.553 -> 0.744 Inexact Rounded +sqtx3996 squareroot 0.0553 -> 0.235 Inexact Rounded +sqtx3997 squareroot 0.554 -> 0.744 Inexact Rounded +sqtx3998 squareroot 0.0554 -> 0.235 Inexact Rounded +sqtx3999 squareroot 0.555 -> 0.745 Inexact Rounded +sqtx4000 squareroot 0.0555 -> 0.236 Inexact Rounded +sqtx4001 squareroot 0.556 -> 0.746 Inexact Rounded +sqtx4002 squareroot 0.0556 -> 0.236 Inexact Rounded +sqtx4003 squareroot 0.557 -> 0.746 Inexact Rounded +sqtx4004 squareroot 0.0557 -> 0.236 Inexact Rounded +sqtx4005 squareroot 0.558 -> 0.747 Inexact Rounded +sqtx4006 squareroot 0.0558 -> 0.236 Inexact Rounded +sqtx4007 squareroot 0.559 -> 0.748 Inexact Rounded +sqtx4008 squareroot 0.0559 -> 0.236 Inexact Rounded +sqtx4009 squareroot 0.561 -> 0.749 Inexact Rounded +sqtx4010 squareroot 0.0561 -> 0.237 Inexact Rounded +sqtx4011 squareroot 0.562 -> 0.750 Inexact Rounded +sqtx4012 squareroot 0.0562 -> 0.237 Inexact Rounded +sqtx4013 squareroot 0.563 -> 0.750 Inexact Rounded +sqtx4014 squareroot 0.0563 -> 0.237 Inexact Rounded +sqtx4015 squareroot 0.564 -> 0.751 Inexact Rounded +sqtx4016 squareroot 0.0564 -> 0.237 Inexact Rounded +sqtx4017 squareroot 0.565 -> 0.752 Inexact Rounded +sqtx4018 squareroot 0.0565 -> 0.238 Inexact Rounded +sqtx4019 squareroot 0.566 -> 0.752 Inexact Rounded +sqtx4020 squareroot 0.0566 -> 0.238 Inexact Rounded +sqtx4021 squareroot 0.567 -> 0.753 Inexact Rounded +sqtx4022 squareroot 0.0567 -> 0.238 Inexact Rounded +sqtx4023 squareroot 0.568 -> 0.754 Inexact Rounded +sqtx4024 squareroot 0.0568 -> 0.238 Inexact Rounded +sqtx4025 squareroot 0.569 -> 0.754 Inexact Rounded +sqtx4026 squareroot 0.0569 -> 0.239 Inexact Rounded +sqtx4027 squareroot 0.571 -> 0.756 Inexact Rounded +sqtx4028 squareroot 0.0571 -> 0.239 Inexact Rounded +sqtx4029 squareroot 0.572 -> 0.756 Inexact Rounded +sqtx4030 squareroot 0.0572 -> 0.239 Inexact Rounded +sqtx4031 squareroot 0.573 -> 0.757 Inexact Rounded +sqtx4032 squareroot 0.0573 -> 0.239 Inexact Rounded +sqtx4033 squareroot 0.574 -> 0.758 Inexact Rounded +sqtx4034 squareroot 0.0574 -> 0.240 Inexact Rounded +sqtx4035 squareroot 0.575 -> 0.758 Inexact Rounded +sqtx4036 squareroot 0.0575 -> 0.240 Inexact Rounded +sqtx4037 squareroot 0.576 -> 0.759 Inexact Rounded +sqtx4038 squareroot 0.0576 -> 0.24 +sqtx4039 squareroot 0.577 -> 0.760 Inexact Rounded +sqtx4040 squareroot 0.0577 -> 0.240 Inexact Rounded +sqtx4041 squareroot 0.578 -> 0.760 Inexact Rounded +sqtx4042 squareroot 0.0578 -> 0.240 Inexact Rounded +sqtx4043 squareroot 0.579 -> 0.761 Inexact Rounded +sqtx4044 squareroot 0.0579 -> 0.241 Inexact Rounded +sqtx4045 squareroot 0.581 -> 0.762 Inexact Rounded +sqtx4046 squareroot 0.0581 -> 0.241 Inexact Rounded +sqtx4047 squareroot 0.582 -> 0.763 Inexact Rounded +sqtx4048 squareroot 0.0582 -> 0.241 Inexact Rounded +sqtx4049 squareroot 0.583 -> 0.764 Inexact Rounded +sqtx4050 squareroot 0.0583 -> 0.241 Inexact Rounded +sqtx4051 squareroot 0.584 -> 0.764 Inexact Rounded +sqtx4052 squareroot 0.0584 -> 0.242 Inexact Rounded +sqtx4053 squareroot 0.585 -> 0.765 Inexact Rounded +sqtx4054 squareroot 0.0585 -> 0.242 Inexact Rounded +sqtx4055 squareroot 0.586 -> 0.766 Inexact Rounded +sqtx4056 squareroot 0.0586 -> 0.242 Inexact Rounded +sqtx4057 squareroot 0.587 -> 0.766 Inexact Rounded +sqtx4058 squareroot 0.0587 -> 0.242 Inexact Rounded +sqtx4059 squareroot 0.588 -> 0.767 Inexact Rounded +sqtx4060 squareroot 0.0588 -> 0.242 Inexact Rounded +sqtx4061 squareroot 0.589 -> 0.767 Inexact Rounded +sqtx4062 squareroot 0.0589 -> 0.243 Inexact Rounded +sqtx4063 squareroot 0.591 -> 0.769 Inexact Rounded +sqtx4064 squareroot 0.0591 -> 0.243 Inexact Rounded +sqtx4065 squareroot 0.592 -> 0.769 Inexact Rounded +sqtx4066 squareroot 0.0592 -> 0.243 Inexact Rounded +sqtx4067 squareroot 0.593 -> 0.770 Inexact Rounded +sqtx4068 squareroot 0.0593 -> 0.244 Inexact Rounded +sqtx4069 squareroot 0.594 -> 0.771 Inexact Rounded +sqtx4070 squareroot 0.0594 -> 0.244 Inexact Rounded +sqtx4071 squareroot 0.595 -> 0.771 Inexact Rounded +sqtx4072 squareroot 0.0595 -> 0.244 Inexact Rounded +sqtx4073 squareroot 0.596 -> 0.772 Inexact Rounded +sqtx4074 squareroot 0.0596 -> 0.244 Inexact Rounded +sqtx4075 squareroot 0.597 -> 0.773 Inexact Rounded +sqtx4076 squareroot 0.0597 -> 0.244 Inexact Rounded +sqtx4077 squareroot 0.598 -> 0.773 Inexact Rounded +sqtx4078 squareroot 0.0598 -> 0.245 Inexact Rounded +sqtx4079 squareroot 0.599 -> 0.774 Inexact Rounded +sqtx4080 squareroot 0.0599 -> 0.245 Inexact Rounded +sqtx4081 squareroot 0.601 -> 0.775 Inexact Rounded +sqtx4082 squareroot 0.0601 -> 0.245 Inexact Rounded +sqtx4083 squareroot 0.602 -> 0.776 Inexact Rounded +sqtx4084 squareroot 0.0602 -> 0.245 Inexact Rounded +sqtx4085 squareroot 0.603 -> 0.777 Inexact Rounded +sqtx4086 squareroot 0.0603 -> 0.246 Inexact Rounded +sqtx4087 squareroot 0.604 -> 0.777 Inexact Rounded +sqtx4088 squareroot 0.0604 -> 0.246 Inexact Rounded +sqtx4089 squareroot 0.605 -> 0.778 Inexact Rounded +sqtx4090 squareroot 0.0605 -> 0.246 Inexact Rounded +sqtx4091 squareroot 0.606 -> 0.778 Inexact Rounded +sqtx4092 squareroot 0.0606 -> 0.246 Inexact Rounded +sqtx4093 squareroot 0.607 -> 0.779 Inexact Rounded +sqtx4094 squareroot 0.0607 -> 0.246 Inexact Rounded +sqtx4095 squareroot 0.608 -> 0.780 Inexact Rounded +sqtx4096 squareroot 0.0608 -> 0.247 Inexact Rounded +sqtx4097 squareroot 0.609 -> 0.780 Inexact Rounded +sqtx4098 squareroot 0.0609 -> 0.247 Inexact Rounded +sqtx4099 squareroot 0.611 -> 0.782 Inexact Rounded +sqtx4100 squareroot 0.0611 -> 0.247 Inexact Rounded +sqtx4101 squareroot 0.612 -> 0.782 Inexact Rounded +sqtx4102 squareroot 0.0612 -> 0.247 Inexact Rounded +sqtx4103 squareroot 0.613 -> 0.783 Inexact Rounded +sqtx4104 squareroot 0.0613 -> 0.248 Inexact Rounded +sqtx4105 squareroot 0.614 -> 0.784 Inexact Rounded +sqtx4106 squareroot 0.0614 -> 0.248 Inexact Rounded +sqtx4107 squareroot 0.615 -> 0.784 Inexact Rounded +sqtx4108 squareroot 0.0615 -> 0.248 Inexact Rounded +sqtx4109 squareroot 0.616 -> 0.785 Inexact Rounded +sqtx4110 squareroot 0.0616 -> 0.248 Inexact Rounded +sqtx4111 squareroot 0.617 -> 0.785 Inexact Rounded +sqtx4112 squareroot 0.0617 -> 0.248 Inexact Rounded +sqtx4113 squareroot 0.618 -> 0.786 Inexact Rounded +sqtx4114 squareroot 0.0618 -> 0.249 Inexact Rounded +sqtx4115 squareroot 0.619 -> 0.787 Inexact Rounded +sqtx4116 squareroot 0.0619 -> 0.249 Inexact Rounded +sqtx4117 squareroot 0.621 -> 0.788 Inexact Rounded +sqtx4118 squareroot 0.0621 -> 0.249 Inexact Rounded +sqtx4119 squareroot 0.622 -> 0.789 Inexact Rounded +sqtx4120 squareroot 0.0622 -> 0.249 Inexact Rounded +sqtx4121 squareroot 0.623 -> 0.789 Inexact Rounded +sqtx4122 squareroot 0.0623 -> 0.250 Inexact Rounded +sqtx4123 squareroot 0.624 -> 0.790 Inexact Rounded +sqtx4124 squareroot 0.0624 -> 0.250 Inexact Rounded +sqtx4125 squareroot 0.625 -> 0.791 Inexact Rounded +sqtx4126 squareroot 0.0625 -> 0.25 +sqtx4127 squareroot 0.626 -> 0.791 Inexact Rounded +sqtx4128 squareroot 0.0626 -> 0.250 Inexact Rounded +sqtx4129 squareroot 0.627 -> 0.792 Inexact Rounded +sqtx4130 squareroot 0.0627 -> 0.250 Inexact Rounded +sqtx4131 squareroot 0.628 -> 0.792 Inexact Rounded +sqtx4132 squareroot 0.0628 -> 0.251 Inexact Rounded +sqtx4133 squareroot 0.629 -> 0.793 Inexact Rounded +sqtx4134 squareroot 0.0629 -> 0.251 Inexact Rounded +sqtx4135 squareroot 0.631 -> 0.794 Inexact Rounded +sqtx4136 squareroot 0.0631 -> 0.251 Inexact Rounded +sqtx4137 squareroot 0.632 -> 0.795 Inexact Rounded +sqtx4138 squareroot 0.0632 -> 0.251 Inexact Rounded +sqtx4139 squareroot 0.633 -> 0.796 Inexact Rounded +sqtx4140 squareroot 0.0633 -> 0.252 Inexact Rounded +sqtx4141 squareroot 0.634 -> 0.796 Inexact Rounded +sqtx4142 squareroot 0.0634 -> 0.252 Inexact Rounded +sqtx4143 squareroot 0.635 -> 0.797 Inexact Rounded +sqtx4144 squareroot 0.0635 -> 0.252 Inexact Rounded +sqtx4145 squareroot 0.636 -> 0.797 Inexact Rounded +sqtx4146 squareroot 0.0636 -> 0.252 Inexact Rounded +sqtx4147 squareroot 0.637 -> 0.798 Inexact Rounded +sqtx4148 squareroot 0.0637 -> 0.252 Inexact Rounded +sqtx4149 squareroot 0.638 -> 0.799 Inexact Rounded +sqtx4150 squareroot 0.0638 -> 0.253 Inexact Rounded +sqtx4151 squareroot 0.639 -> 0.799 Inexact Rounded +sqtx4152 squareroot 0.0639 -> 0.253 Inexact Rounded +sqtx4153 squareroot 0.641 -> 0.801 Inexact Rounded +sqtx4154 squareroot 0.0641 -> 0.253 Inexact Rounded +sqtx4155 squareroot 0.642 -> 0.801 Inexact Rounded +sqtx4156 squareroot 0.0642 -> 0.253 Inexact Rounded +sqtx4157 squareroot 0.643 -> 0.802 Inexact Rounded +sqtx4158 squareroot 0.0643 -> 0.254 Inexact Rounded +sqtx4159 squareroot 0.644 -> 0.802 Inexact Rounded +sqtx4160 squareroot 0.0644 -> 0.254 Inexact Rounded +sqtx4161 squareroot 0.645 -> 0.803 Inexact Rounded +sqtx4162 squareroot 0.0645 -> 0.254 Inexact Rounded +sqtx4163 squareroot 0.646 -> 0.804 Inexact Rounded +sqtx4164 squareroot 0.0646 -> 0.254 Inexact Rounded +sqtx4165 squareroot 0.647 -> 0.804 Inexact Rounded +sqtx4166 squareroot 0.0647 -> 0.254 Inexact Rounded +sqtx4167 squareroot 0.648 -> 0.805 Inexact Rounded +sqtx4168 squareroot 0.0648 -> 0.255 Inexact Rounded +sqtx4169 squareroot 0.649 -> 0.806 Inexact Rounded +sqtx4170 squareroot 0.0649 -> 0.255 Inexact Rounded +sqtx4171 squareroot 0.651 -> 0.807 Inexact Rounded +sqtx4172 squareroot 0.0651 -> 0.255 Inexact Rounded +sqtx4173 squareroot 0.652 -> 0.807 Inexact Rounded +sqtx4174 squareroot 0.0652 -> 0.255 Inexact Rounded +sqtx4175 squareroot 0.653 -> 0.808 Inexact Rounded +sqtx4176 squareroot 0.0653 -> 0.256 Inexact Rounded +sqtx4177 squareroot 0.654 -> 0.809 Inexact Rounded +sqtx4178 squareroot 0.0654 -> 0.256 Inexact Rounded +sqtx4179 squareroot 0.655 -> 0.809 Inexact Rounded +sqtx4180 squareroot 0.0655 -> 0.256 Inexact Rounded +sqtx4181 squareroot 0.656 -> 0.810 Inexact Rounded +sqtx4182 squareroot 0.0656 -> 0.256 Inexact Rounded +sqtx4183 squareroot 0.657 -> 0.811 Inexact Rounded +sqtx4184 squareroot 0.0657 -> 0.256 Inexact Rounded +sqtx4185 squareroot 0.658 -> 0.811 Inexact Rounded +sqtx4186 squareroot 0.0658 -> 0.257 Inexact Rounded +sqtx4187 squareroot 0.659 -> 0.812 Inexact Rounded +sqtx4188 squareroot 0.0659 -> 0.257 Inexact Rounded +sqtx4189 squareroot 0.661 -> 0.813 Inexact Rounded +sqtx4190 squareroot 0.0661 -> 0.257 Inexact Rounded +sqtx4191 squareroot 0.662 -> 0.814 Inexact Rounded +sqtx4192 squareroot 0.0662 -> 0.257 Inexact Rounded +sqtx4193 squareroot 0.663 -> 0.814 Inexact Rounded +sqtx4194 squareroot 0.0663 -> 0.257 Inexact Rounded +sqtx4195 squareroot 0.664 -> 0.815 Inexact Rounded +sqtx4196 squareroot 0.0664 -> 0.258 Inexact Rounded +sqtx4197 squareroot 0.665 -> 0.815 Inexact Rounded +sqtx4198 squareroot 0.0665 -> 0.258 Inexact Rounded +sqtx4199 squareroot 0.666 -> 0.816 Inexact Rounded +sqtx4200 squareroot 0.0666 -> 0.258 Inexact Rounded +sqtx4201 squareroot 0.667 -> 0.817 Inexact Rounded +sqtx4202 squareroot 0.0667 -> 0.258 Inexact Rounded +sqtx4203 squareroot 0.668 -> 0.817 Inexact Rounded +sqtx4204 squareroot 0.0668 -> 0.258 Inexact Rounded +sqtx4205 squareroot 0.669 -> 0.818 Inexact Rounded +sqtx4206 squareroot 0.0669 -> 0.259 Inexact Rounded +sqtx4207 squareroot 0.671 -> 0.819 Inexact Rounded +sqtx4208 squareroot 0.0671 -> 0.259 Inexact Rounded +sqtx4209 squareroot 0.672 -> 0.820 Inexact Rounded +sqtx4210 squareroot 0.0672 -> 0.259 Inexact Rounded +sqtx4211 squareroot 0.673 -> 0.820 Inexact Rounded +sqtx4212 squareroot 0.0673 -> 0.259 Inexact Rounded +sqtx4213 squareroot 0.674 -> 0.821 Inexact Rounded +sqtx4214 squareroot 0.0674 -> 0.260 Inexact Rounded +sqtx4215 squareroot 0.675 -> 0.822 Inexact Rounded +sqtx4216 squareroot 0.0675 -> 0.260 Inexact Rounded +sqtx4217 squareroot 0.676 -> 0.822 Inexact Rounded +sqtx4218 squareroot 0.0676 -> 0.26 +sqtx4219 squareroot 0.677 -> 0.823 Inexact Rounded +sqtx4220 squareroot 0.0677 -> 0.260 Inexact Rounded +sqtx4221 squareroot 0.678 -> 0.823 Inexact Rounded +sqtx4222 squareroot 0.0678 -> 0.260 Inexact Rounded +sqtx4223 squareroot 0.679 -> 0.824 Inexact Rounded +sqtx4224 squareroot 0.0679 -> 0.261 Inexact Rounded +sqtx4225 squareroot 0.681 -> 0.825 Inexact Rounded +sqtx4226 squareroot 0.0681 -> 0.261 Inexact Rounded +sqtx4227 squareroot 0.682 -> 0.826 Inexact Rounded +sqtx4228 squareroot 0.0682 -> 0.261 Inexact Rounded +sqtx4229 squareroot 0.683 -> 0.826 Inexact Rounded +sqtx4230 squareroot 0.0683 -> 0.261 Inexact Rounded +sqtx4231 squareroot 0.684 -> 0.827 Inexact Rounded +sqtx4232 squareroot 0.0684 -> 0.262 Inexact Rounded +sqtx4233 squareroot 0.685 -> 0.828 Inexact Rounded +sqtx4234 squareroot 0.0685 -> 0.262 Inexact Rounded +sqtx4235 squareroot 0.686 -> 0.828 Inexact Rounded +sqtx4236 squareroot 0.0686 -> 0.262 Inexact Rounded +sqtx4237 squareroot 0.687 -> 0.829 Inexact Rounded +sqtx4238 squareroot 0.0687 -> 0.262 Inexact Rounded +sqtx4239 squareroot 0.688 -> 0.829 Inexact Rounded +sqtx4240 squareroot 0.0688 -> 0.262 Inexact Rounded +sqtx4241 squareroot 0.689 -> 0.830 Inexact Rounded +sqtx4242 squareroot 0.0689 -> 0.262 Inexact Rounded +sqtx4243 squareroot 0.691 -> 0.831 Inexact Rounded +sqtx4244 squareroot 0.0691 -> 0.263 Inexact Rounded +sqtx4245 squareroot 0.692 -> 0.832 Inexact Rounded +sqtx4246 squareroot 0.0692 -> 0.263 Inexact Rounded +sqtx4247 squareroot 0.693 -> 0.832 Inexact Rounded +sqtx4248 squareroot 0.0693 -> 0.263 Inexact Rounded +sqtx4249 squareroot 0.694 -> 0.833 Inexact Rounded +sqtx4250 squareroot 0.0694 -> 0.263 Inexact Rounded +sqtx4251 squareroot 0.695 -> 0.834 Inexact Rounded +sqtx4252 squareroot 0.0695 -> 0.264 Inexact Rounded +sqtx4253 squareroot 0.696 -> 0.834 Inexact Rounded +sqtx4254 squareroot 0.0696 -> 0.264 Inexact Rounded +sqtx4255 squareroot 0.697 -> 0.835 Inexact Rounded +sqtx4256 squareroot 0.0697 -> 0.264 Inexact Rounded +sqtx4257 squareroot 0.698 -> 0.835 Inexact Rounded +sqtx4258 squareroot 0.0698 -> 0.264 Inexact Rounded +sqtx4259 squareroot 0.699 -> 0.836 Inexact Rounded +sqtx4260 squareroot 0.0699 -> 0.264 Inexact Rounded +sqtx4261 squareroot 0.701 -> 0.837 Inexact Rounded +sqtx4262 squareroot 0.0701 -> 0.265 Inexact Rounded +sqtx4263 squareroot 0.702 -> 0.838 Inexact Rounded +sqtx4264 squareroot 0.0702 -> 0.265 Inexact Rounded +sqtx4265 squareroot 0.703 -> 0.838 Inexact Rounded +sqtx4266 squareroot 0.0703 -> 0.265 Inexact Rounded +sqtx4267 squareroot 0.704 -> 0.839 Inexact Rounded +sqtx4268 squareroot 0.0704 -> 0.265 Inexact Rounded +sqtx4269 squareroot 0.705 -> 0.840 Inexact Rounded +sqtx4270 squareroot 0.0705 -> 0.266 Inexact Rounded +sqtx4271 squareroot 0.706 -> 0.840 Inexact Rounded +sqtx4272 squareroot 0.0706 -> 0.266 Inexact Rounded +sqtx4273 squareroot 0.707 -> 0.841 Inexact Rounded +sqtx4274 squareroot 0.0707 -> 0.266 Inexact Rounded +sqtx4275 squareroot 0.708 -> 0.841 Inexact Rounded +sqtx4276 squareroot 0.0708 -> 0.266 Inexact Rounded +sqtx4277 squareroot 0.709 -> 0.842 Inexact Rounded +sqtx4278 squareroot 0.0709 -> 0.266 Inexact Rounded +sqtx4279 squareroot 0.711 -> 0.843 Inexact Rounded +sqtx4280 squareroot 0.0711 -> 0.267 Inexact Rounded +sqtx4281 squareroot 0.712 -> 0.844 Inexact Rounded +sqtx4282 squareroot 0.0712 -> 0.267 Inexact Rounded +sqtx4283 squareroot 0.713 -> 0.844 Inexact Rounded +sqtx4284 squareroot 0.0713 -> 0.267 Inexact Rounded +sqtx4285 squareroot 0.714 -> 0.845 Inexact Rounded +sqtx4286 squareroot 0.0714 -> 0.267 Inexact Rounded +sqtx4287 squareroot 0.715 -> 0.846 Inexact Rounded +sqtx4288 squareroot 0.0715 -> 0.267 Inexact Rounded +sqtx4289 squareroot 0.716 -> 0.846 Inexact Rounded +sqtx4290 squareroot 0.0716 -> 0.268 Inexact Rounded +sqtx4291 squareroot 0.717 -> 0.847 Inexact Rounded +sqtx4292 squareroot 0.0717 -> 0.268 Inexact Rounded +sqtx4293 squareroot 0.718 -> 0.847 Inexact Rounded +sqtx4294 squareroot 0.0718 -> 0.268 Inexact Rounded +sqtx4295 squareroot 0.719 -> 0.848 Inexact Rounded +sqtx4296 squareroot 0.0719 -> 0.268 Inexact Rounded +sqtx4297 squareroot 0.721 -> 0.849 Inexact Rounded +sqtx4298 squareroot 0.0721 -> 0.269 Inexact Rounded +sqtx4299 squareroot 0.722 -> 0.850 Inexact Rounded +sqtx4300 squareroot 0.0722 -> 0.269 Inexact Rounded +sqtx4301 squareroot 0.723 -> 0.850 Inexact Rounded +sqtx4302 squareroot 0.0723 -> 0.269 Inexact Rounded +sqtx4303 squareroot 0.724 -> 0.851 Inexact Rounded +sqtx4304 squareroot 0.0724 -> 0.269 Inexact Rounded +sqtx4305 squareroot 0.725 -> 0.851 Inexact Rounded +sqtx4306 squareroot 0.0725 -> 0.269 Inexact Rounded +sqtx4307 squareroot 0.726 -> 0.852 Inexact Rounded +sqtx4308 squareroot 0.0726 -> 0.269 Inexact Rounded +sqtx4309 squareroot 0.727 -> 0.853 Inexact Rounded +sqtx4310 squareroot 0.0727 -> 0.270 Inexact Rounded +sqtx4311 squareroot 0.728 -> 0.853 Inexact Rounded +sqtx4312 squareroot 0.0728 -> 0.270 Inexact Rounded +sqtx4313 squareroot 0.729 -> 0.854 Inexact Rounded +sqtx4314 squareroot 0.0729 -> 0.27 +sqtx4315 squareroot 0.731 -> 0.855 Inexact Rounded +sqtx4316 squareroot 0.0731 -> 0.270 Inexact Rounded +sqtx4317 squareroot 0.732 -> 0.856 Inexact Rounded +sqtx4318 squareroot 0.0732 -> 0.271 Inexact Rounded +sqtx4319 squareroot 0.733 -> 0.856 Inexact Rounded +sqtx4320 squareroot 0.0733 -> 0.271 Inexact Rounded +sqtx4321 squareroot 0.734 -> 0.857 Inexact Rounded +sqtx4322 squareroot 0.0734 -> 0.271 Inexact Rounded +sqtx4323 squareroot 0.735 -> 0.857 Inexact Rounded +sqtx4324 squareroot 0.0735 -> 0.271 Inexact Rounded +sqtx4325 squareroot 0.736 -> 0.858 Inexact Rounded +sqtx4326 squareroot 0.0736 -> 0.271 Inexact Rounded +sqtx4327 squareroot 0.737 -> 0.858 Inexact Rounded +sqtx4328 squareroot 0.0737 -> 0.271 Inexact Rounded +sqtx4329 squareroot 0.738 -> 0.859 Inexact Rounded +sqtx4330 squareroot 0.0738 -> 0.272 Inexact Rounded +sqtx4331 squareroot 0.739 -> 0.860 Inexact Rounded +sqtx4332 squareroot 0.0739 -> 0.272 Inexact Rounded +sqtx4333 squareroot 0.741 -> 0.861 Inexact Rounded +sqtx4334 squareroot 0.0741 -> 0.272 Inexact Rounded +sqtx4335 squareroot 0.742 -> 0.861 Inexact Rounded +sqtx4336 squareroot 0.0742 -> 0.272 Inexact Rounded +sqtx4337 squareroot 0.743 -> 0.862 Inexact Rounded +sqtx4338 squareroot 0.0743 -> 0.273 Inexact Rounded +sqtx4339 squareroot 0.744 -> 0.863 Inexact Rounded +sqtx4340 squareroot 0.0744 -> 0.273 Inexact Rounded +sqtx4341 squareroot 0.745 -> 0.863 Inexact Rounded +sqtx4342 squareroot 0.0745 -> 0.273 Inexact Rounded +sqtx4343 squareroot 0.746 -> 0.864 Inexact Rounded +sqtx4344 squareroot 0.0746 -> 0.273 Inexact Rounded +sqtx4345 squareroot 0.747 -> 0.864 Inexact Rounded +sqtx4346 squareroot 0.0747 -> 0.273 Inexact Rounded +sqtx4347 squareroot 0.748 -> 0.865 Inexact Rounded +sqtx4348 squareroot 0.0748 -> 0.273 Inexact Rounded +sqtx4349 squareroot 0.749 -> 0.865 Inexact Rounded +sqtx4350 squareroot 0.0749 -> 0.274 Inexact Rounded +sqtx4351 squareroot 0.751 -> 0.867 Inexact Rounded +sqtx4352 squareroot 0.0751 -> 0.274 Inexact Rounded +sqtx4353 squareroot 0.752 -> 0.867 Inexact Rounded +sqtx4354 squareroot 0.0752 -> 0.274 Inexact Rounded +sqtx4355 squareroot 0.753 -> 0.868 Inexact Rounded +sqtx4356 squareroot 0.0753 -> 0.274 Inexact Rounded +sqtx4357 squareroot 0.754 -> 0.868 Inexact Rounded +sqtx4358 squareroot 0.0754 -> 0.275 Inexact Rounded +sqtx4359 squareroot 0.755 -> 0.869 Inexact Rounded +sqtx4360 squareroot 0.0755 -> 0.275 Inexact Rounded +sqtx4361 squareroot 0.756 -> 0.869 Inexact Rounded +sqtx4362 squareroot 0.0756 -> 0.275 Inexact Rounded +sqtx4363 squareroot 0.757 -> 0.870 Inexact Rounded +sqtx4364 squareroot 0.0757 -> 0.275 Inexact Rounded +sqtx4365 squareroot 0.758 -> 0.871 Inexact Rounded +sqtx4366 squareroot 0.0758 -> 0.275 Inexact Rounded +sqtx4367 squareroot 0.759 -> 0.871 Inexact Rounded +sqtx4368 squareroot 0.0759 -> 0.275 Inexact Rounded +sqtx4369 squareroot 0.761 -> 0.872 Inexact Rounded +sqtx4370 squareroot 0.0761 -> 0.276 Inexact Rounded +sqtx4371 squareroot 0.762 -> 0.873 Inexact Rounded +sqtx4372 squareroot 0.0762 -> 0.276 Inexact Rounded +sqtx4373 squareroot 0.763 -> 0.873 Inexact Rounded +sqtx4374 squareroot 0.0763 -> 0.276 Inexact Rounded +sqtx4375 squareroot 0.764 -> 0.874 Inexact Rounded +sqtx4376 squareroot 0.0764 -> 0.276 Inexact Rounded +sqtx4377 squareroot 0.765 -> 0.875 Inexact Rounded +sqtx4378 squareroot 0.0765 -> 0.277 Inexact Rounded +sqtx4379 squareroot 0.766 -> 0.875 Inexact Rounded +sqtx4380 squareroot 0.0766 -> 0.277 Inexact Rounded +sqtx4381 squareroot 0.767 -> 0.876 Inexact Rounded +sqtx4382 squareroot 0.0767 -> 0.277 Inexact Rounded +sqtx4383 squareroot 0.768 -> 0.876 Inexact Rounded +sqtx4384 squareroot 0.0768 -> 0.277 Inexact Rounded +sqtx4385 squareroot 0.769 -> 0.877 Inexact Rounded +sqtx4386 squareroot 0.0769 -> 0.277 Inexact Rounded +sqtx4387 squareroot 0.771 -> 0.878 Inexact Rounded +sqtx4388 squareroot 0.0771 -> 0.278 Inexact Rounded +sqtx4389 squareroot 0.772 -> 0.879 Inexact Rounded +sqtx4390 squareroot 0.0772 -> 0.278 Inexact Rounded +sqtx4391 squareroot 0.773 -> 0.879 Inexact Rounded +sqtx4392 squareroot 0.0773 -> 0.278 Inexact Rounded +sqtx4393 squareroot 0.774 -> 0.880 Inexact Rounded +sqtx4394 squareroot 0.0774 -> 0.278 Inexact Rounded +sqtx4395 squareroot 0.775 -> 0.880 Inexact Rounded +sqtx4396 squareroot 0.0775 -> 0.278 Inexact Rounded +sqtx4397 squareroot 0.776 -> 0.881 Inexact Rounded +sqtx4398 squareroot 0.0776 -> 0.279 Inexact Rounded +sqtx4399 squareroot 0.777 -> 0.881 Inexact Rounded +sqtx4400 squareroot 0.0777 -> 0.279 Inexact Rounded +sqtx4401 squareroot 0.778 -> 0.882 Inexact Rounded +sqtx4402 squareroot 0.0778 -> 0.279 Inexact Rounded +sqtx4403 squareroot 0.779 -> 0.883 Inexact Rounded +sqtx4404 squareroot 0.0779 -> 0.279 Inexact Rounded +sqtx4405 squareroot 0.781 -> 0.884 Inexact Rounded +sqtx4406 squareroot 0.0781 -> 0.279 Inexact Rounded +sqtx4407 squareroot 0.782 -> 0.884 Inexact Rounded +sqtx4408 squareroot 0.0782 -> 0.280 Inexact Rounded +sqtx4409 squareroot 0.783 -> 0.885 Inexact Rounded +sqtx4410 squareroot 0.0783 -> 0.280 Inexact Rounded +sqtx4411 squareroot 0.784 -> 0.885 Inexact Rounded +sqtx4412 squareroot 0.0784 -> 0.28 +sqtx4413 squareroot 0.785 -> 0.886 Inexact Rounded +sqtx4414 squareroot 0.0785 -> 0.280 Inexact Rounded +sqtx4415 squareroot 0.786 -> 0.887 Inexact Rounded +sqtx4416 squareroot 0.0786 -> 0.280 Inexact Rounded +sqtx4417 squareroot 0.787 -> 0.887 Inexact Rounded +sqtx4418 squareroot 0.0787 -> 0.281 Inexact Rounded +sqtx4419 squareroot 0.788 -> 0.888 Inexact Rounded +sqtx4420 squareroot 0.0788 -> 0.281 Inexact Rounded +sqtx4421 squareroot 0.789 -> 0.888 Inexact Rounded +sqtx4422 squareroot 0.0789 -> 0.281 Inexact Rounded +sqtx4423 squareroot 0.791 -> 0.889 Inexact Rounded +sqtx4424 squareroot 0.0791 -> 0.281 Inexact Rounded +sqtx4425 squareroot 0.792 -> 0.890 Inexact Rounded +sqtx4426 squareroot 0.0792 -> 0.281 Inexact Rounded +sqtx4427 squareroot 0.793 -> 0.891 Inexact Rounded +sqtx4428 squareroot 0.0793 -> 0.282 Inexact Rounded +sqtx4429 squareroot 0.794 -> 0.891 Inexact Rounded +sqtx4430 squareroot 0.0794 -> 0.282 Inexact Rounded +sqtx4431 squareroot 0.795 -> 0.892 Inexact Rounded +sqtx4432 squareroot 0.0795 -> 0.282 Inexact Rounded +sqtx4433 squareroot 0.796 -> 0.892 Inexact Rounded +sqtx4434 squareroot 0.0796 -> 0.282 Inexact Rounded +sqtx4435 squareroot 0.797 -> 0.893 Inexact Rounded +sqtx4436 squareroot 0.0797 -> 0.282 Inexact Rounded +sqtx4437 squareroot 0.798 -> 0.893 Inexact Rounded +sqtx4438 squareroot 0.0798 -> 0.282 Inexact Rounded +sqtx4439 squareroot 0.799 -> 0.894 Inexact Rounded +sqtx4440 squareroot 0.0799 -> 0.283 Inexact Rounded +sqtx4441 squareroot 0.801 -> 0.895 Inexact Rounded +sqtx4442 squareroot 0.0801 -> 0.283 Inexact Rounded +sqtx4443 squareroot 0.802 -> 0.896 Inexact Rounded +sqtx4444 squareroot 0.0802 -> 0.283 Inexact Rounded +sqtx4445 squareroot 0.803 -> 0.896 Inexact Rounded +sqtx4446 squareroot 0.0803 -> 0.283 Inexact Rounded +sqtx4447 squareroot 0.804 -> 0.897 Inexact Rounded +sqtx4448 squareroot 0.0804 -> 0.284 Inexact Rounded +sqtx4449 squareroot 0.805 -> 0.897 Inexact Rounded +sqtx4450 squareroot 0.0805 -> 0.284 Inexact Rounded +sqtx4451 squareroot 0.806 -> 0.898 Inexact Rounded +sqtx4452 squareroot 0.0806 -> 0.284 Inexact Rounded +sqtx4453 squareroot 0.807 -> 0.898 Inexact Rounded +sqtx4454 squareroot 0.0807 -> 0.284 Inexact Rounded +sqtx4455 squareroot 0.808 -> 0.899 Inexact Rounded +sqtx4456 squareroot 0.0808 -> 0.284 Inexact Rounded +sqtx4457 squareroot 0.809 -> 0.899 Inexact Rounded +sqtx4458 squareroot 0.0809 -> 0.284 Inexact Rounded +sqtx4459 squareroot 0.811 -> 0.901 Inexact Rounded +sqtx4460 squareroot 0.0811 -> 0.285 Inexact Rounded +sqtx4461 squareroot 0.812 -> 0.901 Inexact Rounded +sqtx4462 squareroot 0.0812 -> 0.285 Inexact Rounded +sqtx4463 squareroot 0.813 -> 0.902 Inexact Rounded +sqtx4464 squareroot 0.0813 -> 0.285 Inexact Rounded +sqtx4465 squareroot 0.814 -> 0.902 Inexact Rounded +sqtx4466 squareroot 0.0814 -> 0.285 Inexact Rounded +sqtx4467 squareroot 0.815 -> 0.903 Inexact Rounded +sqtx4468 squareroot 0.0815 -> 0.285 Inexact Rounded +sqtx4469 squareroot 0.816 -> 0.903 Inexact Rounded +sqtx4470 squareroot 0.0816 -> 0.286 Inexact Rounded +sqtx4471 squareroot 0.817 -> 0.904 Inexact Rounded +sqtx4472 squareroot 0.0817 -> 0.286 Inexact Rounded +sqtx4473 squareroot 0.818 -> 0.904 Inexact Rounded +sqtx4474 squareroot 0.0818 -> 0.286 Inexact Rounded +sqtx4475 squareroot 0.819 -> 0.905 Inexact Rounded +sqtx4476 squareroot 0.0819 -> 0.286 Inexact Rounded +sqtx4477 squareroot 0.821 -> 0.906 Inexact Rounded +sqtx4478 squareroot 0.0821 -> 0.287 Inexact Rounded +sqtx4479 squareroot 0.822 -> 0.907 Inexact Rounded +sqtx4480 squareroot 0.0822 -> 0.287 Inexact Rounded +sqtx4481 squareroot 0.823 -> 0.907 Inexact Rounded +sqtx4482 squareroot 0.0823 -> 0.287 Inexact Rounded +sqtx4483 squareroot 0.824 -> 0.908 Inexact Rounded +sqtx4484 squareroot 0.0824 -> 0.287 Inexact Rounded +sqtx4485 squareroot 0.825 -> 0.908 Inexact Rounded +sqtx4486 squareroot 0.0825 -> 0.287 Inexact Rounded +sqtx4487 squareroot 0.826 -> 0.909 Inexact Rounded +sqtx4488 squareroot 0.0826 -> 0.287 Inexact Rounded +sqtx4489 squareroot 0.827 -> 0.909 Inexact Rounded +sqtx4490 squareroot 0.0827 -> 0.288 Inexact Rounded +sqtx4491 squareroot 0.828 -> 0.910 Inexact Rounded +sqtx4492 squareroot 0.0828 -> 0.288 Inexact Rounded +sqtx4493 squareroot 0.829 -> 0.910 Inexact Rounded +sqtx4494 squareroot 0.0829 -> 0.288 Inexact Rounded +sqtx4495 squareroot 0.831 -> 0.912 Inexact Rounded +sqtx4496 squareroot 0.0831 -> 0.288 Inexact Rounded +sqtx4497 squareroot 0.832 -> 0.912 Inexact Rounded +sqtx4498 squareroot 0.0832 -> 0.288 Inexact Rounded +sqtx4499 squareroot 0.833 -> 0.913 Inexact Rounded +sqtx4500 squareroot 0.0833 -> 0.289 Inexact Rounded +sqtx4501 squareroot 0.834 -> 0.913 Inexact Rounded +sqtx4502 squareroot 0.0834 -> 0.289 Inexact Rounded +sqtx4503 squareroot 0.835 -> 0.914 Inexact Rounded +sqtx4504 squareroot 0.0835 -> 0.289 Inexact Rounded +sqtx4505 squareroot 0.836 -> 0.914 Inexact Rounded +sqtx4506 squareroot 0.0836 -> 0.289 Inexact Rounded +sqtx4507 squareroot 0.837 -> 0.915 Inexact Rounded +sqtx4508 squareroot 0.0837 -> 0.289 Inexact Rounded +sqtx4509 squareroot 0.838 -> 0.915 Inexact Rounded +sqtx4510 squareroot 0.0838 -> 0.289 Inexact Rounded +sqtx4511 squareroot 0.839 -> 0.916 Inexact Rounded +sqtx4512 squareroot 0.0839 -> 0.290 Inexact Rounded +sqtx4513 squareroot 0.841 -> 0.917 Inexact Rounded +sqtx4514 squareroot 0.0841 -> 0.29 +sqtx4515 squareroot 0.842 -> 0.918 Inexact Rounded +sqtx4516 squareroot 0.0842 -> 0.290 Inexact Rounded +sqtx4517 squareroot 0.843 -> 0.918 Inexact Rounded +sqtx4518 squareroot 0.0843 -> 0.290 Inexact Rounded +sqtx4519 squareroot 0.844 -> 0.919 Inexact Rounded +sqtx4520 squareroot 0.0844 -> 0.291 Inexact Rounded +sqtx4521 squareroot 0.845 -> 0.919 Inexact Rounded +sqtx4522 squareroot 0.0845 -> 0.291 Inexact Rounded +sqtx4523 squareroot 0.846 -> 0.920 Inexact Rounded +sqtx4524 squareroot 0.0846 -> 0.291 Inexact Rounded +sqtx4525 squareroot 0.847 -> 0.920 Inexact Rounded +sqtx4526 squareroot 0.0847 -> 0.291 Inexact Rounded +sqtx4527 squareroot 0.848 -> 0.921 Inexact Rounded +sqtx4528 squareroot 0.0848 -> 0.291 Inexact Rounded +sqtx4529 squareroot 0.849 -> 0.921 Inexact Rounded +sqtx4530 squareroot 0.0849 -> 0.291 Inexact Rounded +sqtx4531 squareroot 0.851 -> 0.922 Inexact Rounded +sqtx4532 squareroot 0.0851 -> 0.292 Inexact Rounded +sqtx4533 squareroot 0.852 -> 0.923 Inexact Rounded +sqtx4534 squareroot 0.0852 -> 0.292 Inexact Rounded +sqtx4535 squareroot 0.853 -> 0.924 Inexact Rounded +sqtx4536 squareroot 0.0853 -> 0.292 Inexact Rounded +sqtx4537 squareroot 0.854 -> 0.924 Inexact Rounded +sqtx4538 squareroot 0.0854 -> 0.292 Inexact Rounded +sqtx4539 squareroot 0.855 -> 0.925 Inexact Rounded +sqtx4540 squareroot 0.0855 -> 0.292 Inexact Rounded +sqtx4541 squareroot 0.856 -> 0.925 Inexact Rounded +sqtx4542 squareroot 0.0856 -> 0.293 Inexact Rounded +sqtx4543 squareroot 0.857 -> 0.926 Inexact Rounded +sqtx4544 squareroot 0.0857 -> 0.293 Inexact Rounded +sqtx4545 squareroot 0.858 -> 0.926 Inexact Rounded +sqtx4546 squareroot 0.0858 -> 0.293 Inexact Rounded +sqtx4547 squareroot 0.859 -> 0.927 Inexact Rounded +sqtx4548 squareroot 0.0859 -> 0.293 Inexact Rounded +sqtx4549 squareroot 0.861 -> 0.928 Inexact Rounded +sqtx4550 squareroot 0.0861 -> 0.293 Inexact Rounded +sqtx4551 squareroot 0.862 -> 0.928 Inexact Rounded +sqtx4552 squareroot 0.0862 -> 0.294 Inexact Rounded +sqtx4553 squareroot 0.863 -> 0.929 Inexact Rounded +sqtx4554 squareroot 0.0863 -> 0.294 Inexact Rounded +sqtx4555 squareroot 0.864 -> 0.930 Inexact Rounded +sqtx4556 squareroot 0.0864 -> 0.294 Inexact Rounded +sqtx4557 squareroot 0.865 -> 0.930 Inexact Rounded +sqtx4558 squareroot 0.0865 -> 0.294 Inexact Rounded +sqtx4559 squareroot 0.866 -> 0.931 Inexact Rounded +sqtx4560 squareroot 0.0866 -> 0.294 Inexact Rounded +sqtx4561 squareroot 0.867 -> 0.931 Inexact Rounded +sqtx4562 squareroot 0.0867 -> 0.294 Inexact Rounded +sqtx4563 squareroot 0.868 -> 0.932 Inexact Rounded +sqtx4564 squareroot 0.0868 -> 0.295 Inexact Rounded +sqtx4565 squareroot 0.869 -> 0.932 Inexact Rounded +sqtx4566 squareroot 0.0869 -> 0.295 Inexact Rounded +sqtx4567 squareroot 0.871 -> 0.933 Inexact Rounded +sqtx4568 squareroot 0.0871 -> 0.295 Inexact Rounded +sqtx4569 squareroot 0.872 -> 0.934 Inexact Rounded +sqtx4570 squareroot 0.0872 -> 0.295 Inexact Rounded +sqtx4571 squareroot 0.873 -> 0.934 Inexact Rounded +sqtx4572 squareroot 0.0873 -> 0.295 Inexact Rounded +sqtx4573 squareroot 0.874 -> 0.935 Inexact Rounded +sqtx4574 squareroot 0.0874 -> 0.296 Inexact Rounded +sqtx4575 squareroot 0.875 -> 0.935 Inexact Rounded +sqtx4576 squareroot 0.0875 -> 0.296 Inexact Rounded +sqtx4577 squareroot 0.876 -> 0.936 Inexact Rounded +sqtx4578 squareroot 0.0876 -> 0.296 Inexact Rounded +sqtx4579 squareroot 0.877 -> 0.936 Inexact Rounded +sqtx4580 squareroot 0.0877 -> 0.296 Inexact Rounded +sqtx4581 squareroot 0.878 -> 0.937 Inexact Rounded +sqtx4582 squareroot 0.0878 -> 0.296 Inexact Rounded +sqtx4583 squareroot 0.879 -> 0.938 Inexact Rounded +sqtx4584 squareroot 0.0879 -> 0.296 Inexact Rounded +sqtx4585 squareroot 0.881 -> 0.939 Inexact Rounded +sqtx4586 squareroot 0.0881 -> 0.297 Inexact Rounded +sqtx4587 squareroot 0.882 -> 0.939 Inexact Rounded +sqtx4588 squareroot 0.0882 -> 0.297 Inexact Rounded +sqtx4589 squareroot 0.883 -> 0.940 Inexact Rounded +sqtx4590 squareroot 0.0883 -> 0.297 Inexact Rounded +sqtx4591 squareroot 0.884 -> 0.940 Inexact Rounded +sqtx4592 squareroot 0.0884 -> 0.297 Inexact Rounded +sqtx4593 squareroot 0.885 -> 0.941 Inexact Rounded +sqtx4594 squareroot 0.0885 -> 0.297 Inexact Rounded +sqtx4595 squareroot 0.886 -> 0.941 Inexact Rounded +sqtx4596 squareroot 0.0886 -> 0.298 Inexact Rounded +sqtx4597 squareroot 0.887 -> 0.942 Inexact Rounded +sqtx4598 squareroot 0.0887 -> 0.298 Inexact Rounded +sqtx4599 squareroot 0.888 -> 0.942 Inexact Rounded +sqtx4600 squareroot 0.0888 -> 0.298 Inexact Rounded +sqtx4601 squareroot 0.889 -> 0.943 Inexact Rounded +sqtx4602 squareroot 0.0889 -> 0.298 Inexact Rounded +sqtx4603 squareroot 0.891 -> 0.944 Inexact Rounded +sqtx4604 squareroot 0.0891 -> 0.298 Inexact Rounded +sqtx4605 squareroot 0.892 -> 0.944 Inexact Rounded +sqtx4606 squareroot 0.0892 -> 0.299 Inexact Rounded +sqtx4607 squareroot 0.893 -> 0.945 Inexact Rounded +sqtx4608 squareroot 0.0893 -> 0.299 Inexact Rounded +sqtx4609 squareroot 0.894 -> 0.946 Inexact Rounded +sqtx4610 squareroot 0.0894 -> 0.299 Inexact Rounded +sqtx4611 squareroot 0.895 -> 0.946 Inexact Rounded +sqtx4612 squareroot 0.0895 -> 0.299 Inexact Rounded +sqtx4613 squareroot 0.896 -> 0.947 Inexact Rounded +sqtx4614 squareroot 0.0896 -> 0.299 Inexact Rounded +sqtx4615 squareroot 0.897 -> 0.947 Inexact Rounded +sqtx4616 squareroot 0.0897 -> 0.299 Inexact Rounded +sqtx4617 squareroot 0.898 -> 0.948 Inexact Rounded +sqtx4618 squareroot 0.0898 -> 0.300 Inexact Rounded +sqtx4619 squareroot 0.899 -> 0.948 Inexact Rounded +sqtx4620 squareroot 0.0899 -> 0.300 Inexact Rounded +sqtx4621 squareroot 0.901 -> 0.949 Inexact Rounded +sqtx4622 squareroot 0.0901 -> 0.300 Inexact Rounded +sqtx4623 squareroot 0.902 -> 0.950 Inexact Rounded +sqtx4624 squareroot 0.0902 -> 0.300 Inexact Rounded +sqtx4625 squareroot 0.903 -> 0.950 Inexact Rounded +sqtx4626 squareroot 0.0903 -> 0.300 Inexact Rounded +sqtx4627 squareroot 0.904 -> 0.951 Inexact Rounded +sqtx4628 squareroot 0.0904 -> 0.301 Inexact Rounded +sqtx4629 squareroot 0.905 -> 0.951 Inexact Rounded +sqtx4630 squareroot 0.0905 -> 0.301 Inexact Rounded +sqtx4631 squareroot 0.906 -> 0.952 Inexact Rounded +sqtx4632 squareroot 0.0906 -> 0.301 Inexact Rounded +sqtx4633 squareroot 0.907 -> 0.952 Inexact Rounded +sqtx4634 squareroot 0.0907 -> 0.301 Inexact Rounded +sqtx4635 squareroot 0.908 -> 0.953 Inexact Rounded +sqtx4636 squareroot 0.0908 -> 0.301 Inexact Rounded +sqtx4637 squareroot 0.909 -> 0.953 Inexact Rounded +sqtx4638 squareroot 0.0909 -> 0.301 Inexact Rounded +sqtx4639 squareroot 0.911 -> 0.954 Inexact Rounded +sqtx4640 squareroot 0.0911 -> 0.302 Inexact Rounded +sqtx4641 squareroot 0.912 -> 0.955 Inexact Rounded +sqtx4642 squareroot 0.0912 -> 0.302 Inexact Rounded +sqtx4643 squareroot 0.913 -> 0.956 Inexact Rounded +sqtx4644 squareroot 0.0913 -> 0.302 Inexact Rounded +sqtx4645 squareroot 0.914 -> 0.956 Inexact Rounded +sqtx4646 squareroot 0.0914 -> 0.302 Inexact Rounded +sqtx4647 squareroot 0.915 -> 0.957 Inexact Rounded +sqtx4648 squareroot 0.0915 -> 0.302 Inexact Rounded +sqtx4649 squareroot 0.916 -> 0.957 Inexact Rounded +sqtx4650 squareroot 0.0916 -> 0.303 Inexact Rounded +sqtx4651 squareroot 0.917 -> 0.958 Inexact Rounded +sqtx4652 squareroot 0.0917 -> 0.303 Inexact Rounded +sqtx4653 squareroot 0.918 -> 0.958 Inexact Rounded +sqtx4654 squareroot 0.0918 -> 0.303 Inexact Rounded +sqtx4655 squareroot 0.919 -> 0.959 Inexact Rounded +sqtx4656 squareroot 0.0919 -> 0.303 Inexact Rounded +sqtx4657 squareroot 0.921 -> 0.960 Inexact Rounded +sqtx4658 squareroot 0.0921 -> 0.303 Inexact Rounded +sqtx4659 squareroot 0.922 -> 0.960 Inexact Rounded +sqtx4660 squareroot 0.0922 -> 0.304 Inexact Rounded +sqtx4661 squareroot 0.923 -> 0.961 Inexact Rounded +sqtx4662 squareroot 0.0923 -> 0.304 Inexact Rounded +sqtx4663 squareroot 0.924 -> 0.961 Inexact Rounded +sqtx4664 squareroot 0.0924 -> 0.304 Inexact Rounded +sqtx4665 squareroot 0.925 -> 0.962 Inexact Rounded +sqtx4666 squareroot 0.0925 -> 0.304 Inexact Rounded +sqtx4667 squareroot 0.926 -> 0.962 Inexact Rounded +sqtx4668 squareroot 0.0926 -> 0.304 Inexact Rounded +sqtx4669 squareroot 0.927 -> 0.963 Inexact Rounded +sqtx4670 squareroot 0.0927 -> 0.304 Inexact Rounded +sqtx4671 squareroot 0.928 -> 0.963 Inexact Rounded +sqtx4672 squareroot 0.0928 -> 0.305 Inexact Rounded +sqtx4673 squareroot 0.929 -> 0.964 Inexact Rounded +sqtx4674 squareroot 0.0929 -> 0.305 Inexact Rounded +sqtx4675 squareroot 0.931 -> 0.965 Inexact Rounded +sqtx4676 squareroot 0.0931 -> 0.305 Inexact Rounded +sqtx4677 squareroot 0.932 -> 0.965 Inexact Rounded +sqtx4678 squareroot 0.0932 -> 0.305 Inexact Rounded +sqtx4679 squareroot 0.933 -> 0.966 Inexact Rounded +sqtx4680 squareroot 0.0933 -> 0.305 Inexact Rounded +sqtx4681 squareroot 0.934 -> 0.966 Inexact Rounded +sqtx4682 squareroot 0.0934 -> 0.306 Inexact Rounded +sqtx4683 squareroot 0.935 -> 0.967 Inexact Rounded +sqtx4684 squareroot 0.0935 -> 0.306 Inexact Rounded +sqtx4685 squareroot 0.936 -> 0.967 Inexact Rounded +sqtx4686 squareroot 0.0936 -> 0.306 Inexact Rounded +sqtx4687 squareroot 0.937 -> 0.968 Inexact Rounded +sqtx4688 squareroot 0.0937 -> 0.306 Inexact Rounded +sqtx4689 squareroot 0.938 -> 0.969 Inexact Rounded +sqtx4690 squareroot 0.0938 -> 0.306 Inexact Rounded +sqtx4691 squareroot 0.939 -> 0.969 Inexact Rounded +sqtx4692 squareroot 0.0939 -> 0.306 Inexact Rounded +sqtx4693 squareroot 0.941 -> 0.970 Inexact Rounded +sqtx4694 squareroot 0.0941 -> 0.307 Inexact Rounded +sqtx4695 squareroot 0.942 -> 0.971 Inexact Rounded +sqtx4696 squareroot 0.0942 -> 0.307 Inexact Rounded +sqtx4697 squareroot 0.943 -> 0.971 Inexact Rounded +sqtx4698 squareroot 0.0943 -> 0.307 Inexact Rounded +sqtx4699 squareroot 0.944 -> 0.972 Inexact Rounded +sqtx4700 squareroot 0.0944 -> 0.307 Inexact Rounded +sqtx4701 squareroot 0.945 -> 0.972 Inexact Rounded +sqtx4702 squareroot 0.0945 -> 0.307 Inexact Rounded +sqtx4703 squareroot 0.946 -> 0.973 Inexact Rounded +sqtx4704 squareroot 0.0946 -> 0.308 Inexact Rounded +sqtx4705 squareroot 0.947 -> 0.973 Inexact Rounded +sqtx4706 squareroot 0.0947 -> 0.308 Inexact Rounded +sqtx4707 squareroot 0.948 -> 0.974 Inexact Rounded +sqtx4708 squareroot 0.0948 -> 0.308 Inexact Rounded +sqtx4709 squareroot 0.949 -> 0.974 Inexact Rounded +sqtx4710 squareroot 0.0949 -> 0.308 Inexact Rounded +sqtx4711 squareroot 0.951 -> 0.975 Inexact Rounded +sqtx4712 squareroot 0.0951 -> 0.308 Inexact Rounded +sqtx4713 squareroot 0.952 -> 0.976 Inexact Rounded +sqtx4714 squareroot 0.0952 -> 0.309 Inexact Rounded +sqtx4715 squareroot 0.953 -> 0.976 Inexact Rounded +sqtx4716 squareroot 0.0953 -> 0.309 Inexact Rounded +sqtx4717 squareroot 0.954 -> 0.977 Inexact Rounded +sqtx4718 squareroot 0.0954 -> 0.309 Inexact Rounded +sqtx4719 squareroot 0.955 -> 0.977 Inexact Rounded +sqtx4720 squareroot 0.0955 -> 0.309 Inexact Rounded +sqtx4721 squareroot 0.956 -> 0.978 Inexact Rounded +sqtx4722 squareroot 0.0956 -> 0.309 Inexact Rounded +sqtx4723 squareroot 0.957 -> 0.978 Inexact Rounded +sqtx4724 squareroot 0.0957 -> 0.309 Inexact Rounded +sqtx4725 squareroot 0.958 -> 0.979 Inexact Rounded +sqtx4726 squareroot 0.0958 -> 0.310 Inexact Rounded +sqtx4727 squareroot 0.959 -> 0.979 Inexact Rounded +sqtx4728 squareroot 0.0959 -> 0.310 Inexact Rounded +sqtx4729 squareroot 0.961 -> 0.980 Inexact Rounded +sqtx4730 squareroot 0.0961 -> 0.31 +sqtx4731 squareroot 0.962 -> 0.981 Inexact Rounded +sqtx4732 squareroot 0.0962 -> 0.310 Inexact Rounded +sqtx4733 squareroot 0.963 -> 0.981 Inexact Rounded +sqtx4734 squareroot 0.0963 -> 0.310 Inexact Rounded +sqtx4735 squareroot 0.964 -> 0.982 Inexact Rounded +sqtx4736 squareroot 0.0964 -> 0.310 Inexact Rounded +sqtx4737 squareroot 0.965 -> 0.982 Inexact Rounded +sqtx4738 squareroot 0.0965 -> 0.311 Inexact Rounded +sqtx4739 squareroot 0.966 -> 0.983 Inexact Rounded +sqtx4740 squareroot 0.0966 -> 0.311 Inexact Rounded +sqtx4741 squareroot 0.967 -> 0.983 Inexact Rounded +sqtx4742 squareroot 0.0967 -> 0.311 Inexact Rounded +sqtx4743 squareroot 0.968 -> 0.984 Inexact Rounded +sqtx4744 squareroot 0.0968 -> 0.311 Inexact Rounded +sqtx4745 squareroot 0.969 -> 0.984 Inexact Rounded +sqtx4746 squareroot 0.0969 -> 0.311 Inexact Rounded +sqtx4747 squareroot 0.971 -> 0.985 Inexact Rounded +sqtx4748 squareroot 0.0971 -> 0.312 Inexact Rounded +sqtx4749 squareroot 0.972 -> 0.986 Inexact Rounded +sqtx4750 squareroot 0.0972 -> 0.312 Inexact Rounded +sqtx4751 squareroot 0.973 -> 0.986 Inexact Rounded +sqtx4752 squareroot 0.0973 -> 0.312 Inexact Rounded +sqtx4753 squareroot 0.974 -> 0.987 Inexact Rounded +sqtx4754 squareroot 0.0974 -> 0.312 Inexact Rounded +sqtx4755 squareroot 0.975 -> 0.987 Inexact Rounded +sqtx4756 squareroot 0.0975 -> 0.312 Inexact Rounded +sqtx4757 squareroot 0.976 -> 0.988 Inexact Rounded +sqtx4758 squareroot 0.0976 -> 0.312 Inexact Rounded +sqtx4759 squareroot 0.977 -> 0.988 Inexact Rounded +sqtx4760 squareroot 0.0977 -> 0.313 Inexact Rounded +sqtx4761 squareroot 0.978 -> 0.989 Inexact Rounded +sqtx4762 squareroot 0.0978 -> 0.313 Inexact Rounded +sqtx4763 squareroot 0.979 -> 0.989 Inexact Rounded +sqtx4764 squareroot 0.0979 -> 0.313 Inexact Rounded +sqtx4765 squareroot 0.981 -> 0.990 Inexact Rounded +sqtx4766 squareroot 0.0981 -> 0.313 Inexact Rounded +sqtx4767 squareroot 0.982 -> 0.991 Inexact Rounded +sqtx4768 squareroot 0.0982 -> 0.313 Inexact Rounded +sqtx4769 squareroot 0.983 -> 0.991 Inexact Rounded +sqtx4770 squareroot 0.0983 -> 0.314 Inexact Rounded +sqtx4771 squareroot 0.984 -> 0.992 Inexact Rounded +sqtx4772 squareroot 0.0984 -> 0.314 Inexact Rounded +sqtx4773 squareroot 0.985 -> 0.992 Inexact Rounded +sqtx4774 squareroot 0.0985 -> 0.314 Inexact Rounded +sqtx4775 squareroot 0.986 -> 0.993 Inexact Rounded +sqtx4776 squareroot 0.0986 -> 0.314 Inexact Rounded +sqtx4777 squareroot 0.987 -> 0.993 Inexact Rounded +sqtx4778 squareroot 0.0987 -> 0.314 Inexact Rounded +sqtx4779 squareroot 0.988 -> 0.994 Inexact Rounded +sqtx4780 squareroot 0.0988 -> 0.314 Inexact Rounded +sqtx4781 squareroot 0.989 -> 0.994 Inexact Rounded +sqtx4782 squareroot 0.0989 -> 0.314 Inexact Rounded +sqtx4783 squareroot 0.991 -> 0.995 Inexact Rounded +sqtx4784 squareroot 0.0991 -> 0.315 Inexact Rounded +sqtx4785 squareroot 0.992 -> 0.996 Inexact Rounded +sqtx4786 squareroot 0.0992 -> 0.315 Inexact Rounded +sqtx4787 squareroot 0.993 -> 0.996 Inexact Rounded +sqtx4788 squareroot 0.0993 -> 0.315 Inexact Rounded +sqtx4789 squareroot 0.994 -> 0.997 Inexact Rounded +sqtx4790 squareroot 0.0994 -> 0.315 Inexact Rounded +sqtx4791 squareroot 0.995 -> 0.997 Inexact Rounded +sqtx4792 squareroot 0.0995 -> 0.315 Inexact Rounded +sqtx4793 squareroot 0.996 -> 0.998 Inexact Rounded +sqtx4794 squareroot 0.0996 -> 0.316 Inexact Rounded +sqtx4795 squareroot 0.997 -> 0.998 Inexact Rounded +sqtx4796 squareroot 0.0997 -> 0.316 Inexact Rounded +sqtx4797 squareroot 0.998 -> 0.999 Inexact Rounded +sqtx4798 squareroot 0.0998 -> 0.316 Inexact Rounded +sqtx4799 squareroot 0.999 -> 0.999 Inexact Rounded +sqtx4800 squareroot 0.0999 -> 0.316 Inexact Rounded + +-- A group of precision 4 tests where Hull & Abrham adjustments are +-- needed in some cases (both up and down) [see Hull1985b] +rounding: half_even +maxExponent: 999 +minexponent: -999 +precision: 4 +sqtx5001 squareroot 0.0118 -> 0.1086 Inexact Rounded +sqtx5002 squareroot 0.119 -> 0.3450 Inexact Rounded +sqtx5003 squareroot 0.0119 -> 0.1091 Inexact Rounded +sqtx5004 squareroot 0.121 -> 0.3479 Inexact Rounded +sqtx5005 squareroot 0.0121 -> 0.11 +sqtx5006 squareroot 0.122 -> 0.3493 Inexact Rounded +sqtx5007 squareroot 0.0122 -> 0.1105 Inexact Rounded +sqtx5008 squareroot 0.123 -> 0.3507 Inexact Rounded +sqtx5009 squareroot 0.494 -> 0.7029 Inexact Rounded +sqtx5010 squareroot 0.0669 -> 0.2587 Inexact Rounded +sqtx5011 squareroot 0.9558 -> 0.9777 Inexact Rounded +sqtx5012 squareroot 0.9348 -> 0.9669 Inexact Rounded +sqtx5013 squareroot 0.9345 -> 0.9667 Inexact Rounded +sqtx5014 squareroot 0.09345 -> 0.3057 Inexact Rounded +sqtx5015 squareroot 0.9346 -> 0.9667 Inexact Rounded +sqtx5016 squareroot 0.09346 -> 0.3057 Inexact Rounded +sqtx5017 squareroot 0.9347 -> 0.9668 Inexact Rounded + +-- examples from decArith +precision: 9 +sqtx700 squareroot 0 -> '0' +sqtx701 squareroot -0 -> '-0' +sqtx702 squareroot 0.39 -> 0.624499800 Inexact Rounded +sqtx703 squareroot 100 -> '10' +sqtx704 squareroot 1.00 -> '1.0' +sqtx705 squareroot 7 -> '2.64575131' Inexact Rounded +sqtx706 squareroot 10 -> 3.16227766 Inexact Rounded + +-- some one-offs +precision: 9 +sqtx711 squareroot 0.1 -> 0.316227766 Inexact Rounded +sqtx712 squareroot 0.2 -> 0.447213595 Inexact Rounded +sqtx713 squareroot 0.3 -> 0.547722558 Inexact Rounded +sqtx714 squareroot 0.4 -> 0.632455532 Inexact Rounded +sqtx715 squareroot 0.5 -> 0.707106781 Inexact Rounded +sqtx716 squareroot 0.6 -> 0.774596669 Inexact Rounded +sqtx717 squareroot 0.7 -> 0.836660027 Inexact Rounded +sqtx718 squareroot 0.8 -> 0.894427191 Inexact Rounded +sqtx719 squareroot 0.9 -> 0.948683298 Inexact Rounded +precision: 10 -- note no normalizatoin here +sqtx720 squareroot +0.1 -> 0.3162277660 Inexact Rounded +precision: 11 +sqtx721 squareroot +0.1 -> 0.31622776602 Inexact Rounded +precision: 12 +sqtx722 squareroot +0.1 -> 0.316227766017 Inexact Rounded +precision: 9 +sqtx723 squareroot 0.39 -> 0.624499800 Inexact Rounded +precision: 15 +sqtx724 squareroot 0.39 -> 0.624499799839840 Inexact Rounded + +-- discussion cases +precision: 7 +sqtx731 squareroot 9 -> 3 +sqtx732 squareroot 100 -> 10 +sqtx733 squareroot 123 -> 11.09054 Inexact Rounded +sqtx734 squareroot 144 -> 12 +sqtx735 squareroot 156 -> 12.49000 Inexact Rounded +sqtx736 squareroot 10000 -> 100 + +-- values close to overflow (if there were input rounding) +maxexponent: 99 +minexponent: -99 +precision: 5 +sqtx760 squareroot 9.9997E+99 -> 9.9998E+49 Inexact Rounded +sqtx761 squareroot 9.9998E+99 -> 9.9999E+49 Inexact Rounded +sqtx762 squareroot 9.9999E+99 -> 9.9999E+49 Inexact Rounded +sqtx763 squareroot 9.99991E+99 -> 1.0000E+50 Inexact Rounded +sqtx764 squareroot 9.99994E+99 -> 1.0000E+50 Inexact Rounded +sqtx765 squareroot 9.99995E+99 -> 1.0000E+50 Inexact Rounded +sqtx766 squareroot 9.99999E+99 -> 1.0000E+50 Inexact Rounded +precision: 9 +sqtx770 squareroot 9.9997E+99 -> 9.99985000E+49 Inexact Rounded +sqtx771 squareroot 9.9998E+99 -> 9.99990000E+49 Inexact Rounded +sqtx772 squareroot 9.9999E+99 -> 9.99995000E+49 Inexact Rounded +sqtx773 squareroot 9.99991E+99 -> 9.99995500E+49 Inexact Rounded +sqtx774 squareroot 9.99994E+99 -> 9.99997000E+49 Inexact Rounded +sqtx775 squareroot 9.99995E+99 -> 9.99997500E+49 Inexact Rounded +sqtx776 squareroot 9.99999E+99 -> 9.99999500E+49 Inexact Rounded +precision: 20 +sqtx780 squareroot 9.9997E+99 -> '9.9998499988749831247E+49' Inexact Rounded +sqtx781 squareroot 9.9998E+99 -> '9.9998999994999949999E+49' Inexact Rounded +sqtx782 squareroot 9.9999E+99 -> '9.9999499998749993750E+49' Inexact Rounded +sqtx783 squareroot 9.99991E+99 -> '9.9999549998987495444E+49' Inexact Rounded +sqtx784 squareroot 9.99994E+99 -> '9.9999699999549998650E+49' Inexact Rounded +sqtx785 squareroot 9.99995E+99 -> '9.9999749999687499219E+49' Inexact Rounded +sqtx786 squareroot 9.99999E+99 -> '9.9999949999987499994E+49' Inexact Rounded + +-- subnormals and underflows [these can only result when eMax is < digits+1] +-- Etiny = -(Emax + (precision-1)) +-- start with subnormal operands and normal results +maxexponent: 9 +minexponent: -9 +precision: 9 -- Etiny=-17 +sqtx800 squareroot 1E-17 -> 3.16227766E-9 Inexact Rounded +sqtx801 squareroot 10E-17 -> 1.0E-8 +precision: 10 -- Etiny=-18 +sqtx802 squareroot 10E-18 -> 3.162277660E-9 Inexact Rounded +sqtx803 squareroot 1E-18 -> 1E-9 + +precision: 11 -- Etiny=-19 +sqtx804 squareroot 1E-19 -> 3.162277660E-10 Underflow Subnormal Inexact Rounded +sqtx805 squareroot 10E-19 -> 1.0E-9 -- exact +precision: 12 -- Etiny=-20 +sqtx806 squareroot 10E-20 -> 3.1622776602E-10 Underflow Subnormal Inexact Rounded +sqtx807 squareroot 1E-20 -> 1E-10 Subnormal -- exact Subnormal case + +precision: 13 -- Etiny=-21 +sqtx808 squareroot 1E-21 -> 3.1622776602E-11 Underflow Subnormal Inexact Rounded +sqtx809 squareroot 10E-21 -> 1.0E-10 Subnormal -- exact Subnormal case +precision: 14 -- Etiny=-22 +sqtx810 squareroot 1E-21 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded +sqtx811 squareroot 10E-22 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded +sqtx812 squareroot 1E-22 -> 1E-11 Subnormal -- exact Subnormal case + + +-- special values +maxexponent: 999 +minexponent: -999 +sqtx820 squareroot Inf -> Infinity +sqtx821 squareroot -Inf -> NaN Invalid_operation +sqtx822 squareroot NaN -> NaN +sqtx823 squareroot sNaN -> NaN Invalid_operation +-- propagating NaNs +sqtx824 squareroot sNaN123 -> NaN123 Invalid_operation +sqtx825 squareroot -sNaN321 -> -NaN321 Invalid_operation +sqtx826 squareroot NaN456 -> NaN456 +sqtx827 squareroot -NaN654 -> -NaN654 +sqtx828 squareroot NaN1 -> NaN1 + +-- Null test +sqtx900 squareroot # -> NaN Invalid_operation Added: sandbox/trunk/decimal-c/new_dt/subtract.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/subtract.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,873 @@ +------------------------------------------------------------------------ +-- subtract.decTest -- decimal subtraction -- +-- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 384 +minexponent: -383 + +-- [first group are 'quick confidence check'] +subx001 subtract 0 0 -> '0' +subx002 subtract 1 1 -> '0' +subx003 subtract 1 2 -> '-1' +subx004 subtract 2 1 -> '1' +subx005 subtract 2 2 -> '0' +subx006 subtract 3 2 -> '1' +subx007 subtract 2 3 -> '-1' + +subx011 subtract -0 0 -> '-0' +subx012 subtract -1 1 -> '-2' +subx013 subtract -1 2 -> '-3' +subx014 subtract -2 1 -> '-3' +subx015 subtract -2 2 -> '-4' +subx016 subtract -3 2 -> '-5' +subx017 subtract -2 3 -> '-5' + +subx021 subtract 0 -0 -> '0' +subx022 subtract 1 -1 -> '2' +subx023 subtract 1 -2 -> '3' +subx024 subtract 2 -1 -> '3' +subx025 subtract 2 -2 -> '4' +subx026 subtract 3 -2 -> '5' +subx027 subtract 2 -3 -> '5' + +subx030 subtract 11 1 -> 10 +subx031 subtract 10 1 -> 9 +subx032 subtract 9 1 -> 8 +subx033 subtract 1 1 -> 0 +subx034 subtract 0 1 -> -1 +subx035 subtract -1 1 -> -2 +subx036 subtract -9 1 -> -10 +subx037 subtract -10 1 -> -11 +subx038 subtract -11 1 -> -12 + +subx040 subtract '5.75' '3.3' -> '2.45' +subx041 subtract '5' '-3' -> '8' +subx042 subtract '-5' '-3' -> '-2' +subx043 subtract '-7' '2.5' -> '-9.5' +subx044 subtract '0.7' '0.3' -> '0.4' +subx045 subtract '1.3' '0.3' -> '1.0' +subx046 subtract '1.25' '1.25' -> '0.00' + +subx050 subtract '1.23456789' '1.00000000' -> '0.23456789' +subx051 subtract '1.23456789' '1.00000089' -> '0.23456700' +subx052 subtract '0.5555555559' '0.0000000001' -> '0.555555556' Inexact Rounded +subx053 subtract '0.5555555559' '0.0000000005' -> '0.555555555' Inexact Rounded +subx054 subtract '0.4444444444' '0.1111111111' -> '0.333333333' Inexact Rounded +subx055 subtract '1.0000000000' '0.00000001' -> '0.999999990' Rounded +subx056 subtract '0.4444444444999' '0' -> '0.444444444' Inexact Rounded +subx057 subtract '0.4444444445000' '0' -> '0.444444445' Inexact Rounded + +subx060 subtract '70' '10000e+9' -> '-1.00000000E+13' Inexact Rounded +subx061 subtract '700' '10000e+9' -> '-1.00000000E+13' Inexact Rounded +subx062 subtract '7000' '10000e+9' -> '-9.99999999E+12' Inexact Rounded +subx063 subtract '70000' '10000e+9' -> '-9.99999993E+12' Rounded +subx064 subtract '700000' '10000e+9' -> '-9.99999930E+12' Rounded + -- symmetry: +subx065 subtract '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded +subx066 subtract '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded +subx067 subtract '10000e+9' '7000' -> '9.99999999E+12' Inexact Rounded +subx068 subtract '10000e+9' '70000' -> '9.99999993E+12' Rounded +subx069 subtract '10000e+9' '700000' -> '9.99999930E+12' Rounded + + -- change precision +subx080 subtract '10000e+9' '70000' -> '9.99999993E+12' Rounded +precision: 6 +subx081 subtract '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded +precision: 9 + + -- some of the next group are really constructor tests +subx090 subtract '00.0' '0.0' -> '0.0' +subx091 subtract '00.0' '0.00' -> '0.00' +subx092 subtract '0.00' '00.0' -> '0.00' +subx093 subtract '00.0' '0.00' -> '0.00' +subx094 subtract '0.00' '00.0' -> '0.00' +subx095 subtract '3' '.3' -> '2.7' +subx096 subtract '3.' '.3' -> '2.7' +subx097 subtract '3.0' '.3' -> '2.7' +subx098 subtract '3.00' '.3' -> '2.70' +subx099 subtract '3' '3' -> '0' +subx100 subtract '3' '+3' -> '0' +subx101 subtract '3' '-3' -> '6' +subx102 subtract '3' '0.3' -> '2.7' +subx103 subtract '3.' '0.3' -> '2.7' +subx104 subtract '3.0' '0.3' -> '2.7' +subx105 subtract '3.00' '0.3' -> '2.70' +subx106 subtract '3' '3.0' -> '0.0' +subx107 subtract '3' '+3.0' -> '0.0' +subx108 subtract '3' '-3.0' -> '6.0' + +-- the above all from add; massaged and extended. Now some new ones... +-- [particularly important for comparisons] +-- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7 +-- with input rounding. +subx120 subtract '10.23456784' '10.23456789' -> '-5E-8' +subx121 subtract '10.23456785' '10.23456789' -> '-4E-8' +subx122 subtract '10.23456786' '10.23456789' -> '-3E-8' +subx123 subtract '10.23456787' '10.23456789' -> '-2E-8' +subx124 subtract '10.23456788' '10.23456789' -> '-1E-8' +subx125 subtract '10.23456789' '10.23456789' -> '0E-8' +subx126 subtract '10.23456790' '10.23456789' -> '1E-8' +subx127 subtract '10.23456791' '10.23456789' -> '2E-8' +subx128 subtract '10.23456792' '10.23456789' -> '3E-8' +subx129 subtract '10.23456793' '10.23456789' -> '4E-8' +subx130 subtract '10.23456794' '10.23456789' -> '5E-8' +subx131 subtract '10.23456781' '10.23456786' -> '-5E-8' +subx132 subtract '10.23456782' '10.23456786' -> '-4E-8' +subx133 subtract '10.23456783' '10.23456786' -> '-3E-8' +subx134 subtract '10.23456784' '10.23456786' -> '-2E-8' +subx135 subtract '10.23456785' '10.23456786' -> '-1E-8' +subx136 subtract '10.23456786' '10.23456786' -> '0E-8' +subx137 subtract '10.23456787' '10.23456786' -> '1E-8' +subx138 subtract '10.23456788' '10.23456786' -> '2E-8' +subx139 subtract '10.23456789' '10.23456786' -> '3E-8' +subx140 subtract '10.23456790' '10.23456786' -> '4E-8' +subx141 subtract '10.23456791' '10.23456786' -> '5E-8' +subx142 subtract '1' '0.999999999' -> '1E-9' +subx143 subtract '0.999999999' '1' -> '-1E-9' +subx144 subtract '-10.23456780' '-10.23456786' -> '6E-8' +subx145 subtract '-10.23456790' '-10.23456786' -> '-4E-8' +subx146 subtract '-10.23456791' '-10.23456786' -> '-5E-8' + +precision: 3 +subx150 subtract '12345678900000' '9999999999999' -> 2.35E+12 Inexact Rounded +subx151 subtract '9999999999999' '12345678900000' -> -2.35E+12 Inexact Rounded +precision: 6 +subx152 subtract '12345678900000' '9999999999999' -> 2.34568E+12 Inexact Rounded +subx153 subtract '9999999999999' '12345678900000' -> -2.34568E+12 Inexact Rounded +precision: 9 +subx154 subtract '12345678900000' '9999999999999' -> 2.34567890E+12 Inexact Rounded +subx155 subtract '9999999999999' '12345678900000' -> -2.34567890E+12 Inexact Rounded +precision: 12 +subx156 subtract '12345678900000' '9999999999999' -> 2.34567890000E+12 Inexact Rounded +subx157 subtract '9999999999999' '12345678900000' -> -2.34567890000E+12 Inexact Rounded +precision: 15 +subx158 subtract '12345678900000' '9999999999999' -> 2345678900001 +subx159 subtract '9999999999999' '12345678900000' -> -2345678900001 +precision: 9 + +-- additional scaled arithmetic tests [0.97 problem] +subx160 subtract '0' '.1' -> '-0.1' +subx161 subtract '00' '.97983' -> '-0.97983' +subx162 subtract '0' '.9' -> '-0.9' +subx163 subtract '0' '0.102' -> '-0.102' +subx164 subtract '0' '.4' -> '-0.4' +subx165 subtract '0' '.307' -> '-0.307' +subx166 subtract '0' '.43822' -> '-0.43822' +subx167 subtract '0' '.911' -> '-0.911' +subx168 subtract '.0' '.02' -> '-0.02' +subx169 subtract '00' '.392' -> '-0.392' +subx170 subtract '0' '.26' -> '-0.26' +subx171 subtract '0' '0.51' -> '-0.51' +subx172 subtract '0' '.2234' -> '-0.2234' +subx173 subtract '0' '.2' -> '-0.2' +subx174 subtract '.0' '.0008' -> '-0.0008' +-- 0. on left +subx180 subtract '0.0' '-.1' -> '0.1' +subx181 subtract '0.00' '-.97983' -> '0.97983' +subx182 subtract '0.0' '-.9' -> '0.9' +subx183 subtract '0.0' '-0.102' -> '0.102' +subx184 subtract '0.0' '-.4' -> '0.4' +subx185 subtract '0.0' '-.307' -> '0.307' +subx186 subtract '0.0' '-.43822' -> '0.43822' +subx187 subtract '0.0' '-.911' -> '0.911' +subx188 subtract '0.0' '-.02' -> '0.02' +subx189 subtract '0.00' '-.392' -> '0.392' +subx190 subtract '0.0' '-.26' -> '0.26' +subx191 subtract '0.0' '-0.51' -> '0.51' +subx192 subtract '0.0' '-.2234' -> '0.2234' +subx193 subtract '0.0' '-.2' -> '0.2' +subx194 subtract '0.0' '-.0008' -> '0.0008' +-- negatives of same +subx200 subtract '0' '-.1' -> '0.1' +subx201 subtract '00' '-.97983' -> '0.97983' +subx202 subtract '0' '-.9' -> '0.9' +subx203 subtract '0' '-0.102' -> '0.102' +subx204 subtract '0' '-.4' -> '0.4' +subx205 subtract '0' '-.307' -> '0.307' +subx206 subtract '0' '-.43822' -> '0.43822' +subx207 subtract '0' '-.911' -> '0.911' +subx208 subtract '.0' '-.02' -> '0.02' +subx209 subtract '00' '-.392' -> '0.392' +subx210 subtract '0' '-.26' -> '0.26' +subx211 subtract '0' '-0.51' -> '0.51' +subx212 subtract '0' '-.2234' -> '0.2234' +subx213 subtract '0' '-.2' -> '0.2' +subx214 subtract '.0' '-.0008' -> '0.0008' + +-- more fixed, LHS swaps [really the same as testcases under add] +subx220 subtract '-56267E-12' 0 -> '-5.6267E-8' +subx221 subtract '-56267E-11' 0 -> '-5.6267E-7' +subx222 subtract '-56267E-10' 0 -> '-0.0000056267' +subx223 subtract '-56267E-9' 0 -> '-0.000056267' +subx224 subtract '-56267E-8' 0 -> '-0.00056267' +subx225 subtract '-56267E-7' 0 -> '-0.0056267' +subx226 subtract '-56267E-6' 0 -> '-0.056267' +subx227 subtract '-56267E-5' 0 -> '-0.56267' +subx228 subtract '-56267E-2' 0 -> '-562.67' +subx229 subtract '-56267E-1' 0 -> '-5626.7' +subx230 subtract '-56267E-0' 0 -> '-56267' +-- symmetry ... +subx240 subtract 0 '-56267E-12' -> '5.6267E-8' +subx241 subtract 0 '-56267E-11' -> '5.6267E-7' +subx242 subtract 0 '-56267E-10' -> '0.0000056267' +subx243 subtract 0 '-56267E-9' -> '0.000056267' +subx244 subtract 0 '-56267E-8' -> '0.00056267' +subx245 subtract 0 '-56267E-7' -> '0.0056267' +subx246 subtract 0 '-56267E-6' -> '0.056267' +subx247 subtract 0 '-56267E-5' -> '0.56267' +subx248 subtract 0 '-56267E-2' -> '562.67' +subx249 subtract 0 '-56267E-1' -> '5626.7' +subx250 subtract 0 '-56267E-0' -> '56267' + +-- now some more from the 'new' add +precision: 9 +subx301 subtract '1.23456789' '1.00000000' -> '0.23456789' +subx302 subtract '1.23456789' '1.00000011' -> '0.23456778' + +subx311 subtract '0.4444444444' '0.5555555555' -> '-0.111111111' Inexact Rounded +subx312 subtract '0.4444444440' '0.5555555555' -> '-0.111111112' Inexact Rounded +subx313 subtract '0.4444444444' '0.5555555550' -> '-0.111111111' Inexact Rounded +subx314 subtract '0.44444444449' '0' -> '0.444444444' Inexact Rounded +subx315 subtract '0.444444444499' '0' -> '0.444444444' Inexact Rounded +subx316 subtract '0.4444444444999' '0' -> '0.444444444' Inexact Rounded +subx317 subtract '0.4444444445000' '0' -> '0.444444445' Inexact Rounded +subx318 subtract '0.4444444445001' '0' -> '0.444444445' Inexact Rounded +subx319 subtract '0.444444444501' '0' -> '0.444444445' Inexact Rounded +subx320 subtract '0.44444444451' '0' -> '0.444444445' Inexact Rounded + +-- some carrying effects +subx321 subtract '0.9998' '0.0000' -> '0.9998' +subx322 subtract '0.9998' '0.0001' -> '0.9997' +subx323 subtract '0.9998' '0.0002' -> '0.9996' +subx324 subtract '0.9998' '0.0003' -> '0.9995' +subx325 subtract '0.9998' '-0.0000' -> '0.9998' +subx326 subtract '0.9998' '-0.0001' -> '0.9999' +subx327 subtract '0.9998' '-0.0002' -> '1.0000' +subx328 subtract '0.9998' '-0.0003' -> '1.0001' + +subx330 subtract '70' '10000e+9' -> '-1.00000000E+13' Inexact Rounded +subx331 subtract '700' '10000e+9' -> '-1.00000000E+13' Inexact Rounded +subx332 subtract '7000' '10000e+9' -> '-9.99999999E+12' Inexact Rounded +subx333 subtract '70000' '10000e+9' -> '-9.99999993E+12' Rounded +subx334 subtract '700000' '10000e+9' -> '-9.99999930E+12' Rounded +subx335 subtract '7000000' '10000e+9' -> '-9.99999300E+12' Rounded +-- symmetry: +subx340 subtract '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded +subx341 subtract '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded +subx342 subtract '10000e+9' '7000' -> '9.99999999E+12' Inexact Rounded +subx343 subtract '10000e+9' '70000' -> '9.99999993E+12' Rounded +subx344 subtract '10000e+9' '700000' -> '9.99999930E+12' Rounded +subx345 subtract '10000e+9' '7000000' -> '9.99999300E+12' Rounded + +-- same, higher precision +precision: 15 +subx346 subtract '10000e+9' '7' -> '9999999999993' +subx347 subtract '10000e+9' '70' -> '9999999999930' +subx348 subtract '10000e+9' '700' -> '9999999999300' +subx349 subtract '10000e+9' '7000' -> '9999999993000' +subx350 subtract '10000e+9' '70000' -> '9999999930000' +subx351 subtract '10000e+9' '700000' -> '9999999300000' +subx352 subtract '7' '10000e+9' -> '-9999999999993' +subx353 subtract '70' '10000e+9' -> '-9999999999930' +subx354 subtract '700' '10000e+9' -> '-9999999999300' +subx355 subtract '7000' '10000e+9' -> '-9999999993000' +subx356 subtract '70000' '10000e+9' -> '-9999999930000' +subx357 subtract '700000' '10000e+9' -> '-9999999300000' + +-- zero preservation +precision: 6 +subx360 subtract '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded +subx361 subtract 1 '0.0001' -> '0.9999' +subx362 subtract 1 '0.00001' -> '0.99999' +subx363 subtract 1 '0.000001' -> '0.999999' +subx364 subtract 1 '0.0000001' -> '1.00000' Inexact Rounded +subx365 subtract 1 '0.00000001' -> '1.00000' Inexact Rounded + +-- some funny zeros [in case of bad signum] +subx370 subtract 1 0 -> 1 +subx371 subtract 1 0. -> 1 +subx372 subtract 1 .0 -> 1.0 +subx373 subtract 1 0.0 -> 1.0 +subx374 subtract 0 1 -> -1 +subx375 subtract 0. 1 -> -1 +subx376 subtract .0 1 -> -1.0 +subx377 subtract 0.0 1 -> -1.0 + +precision: 9 + +-- leading 0 digit before round +subx910 subtract -103519362 -51897955.3 -> -51621406.7 +subx911 subtract 159579.444 89827.5229 -> 69751.9211 + +subx920 subtract 333.123456 33.1234566 -> 299.999999 Inexact Rounded +subx921 subtract 333.123456 33.1234565 -> 300.000000 Inexact Rounded +subx922 subtract 133.123456 33.1234565 -> 99.9999995 +subx923 subtract 133.123456 33.1234564 -> 99.9999996 +subx924 subtract 133.123456 33.1234540 -> 100.000002 Rounded +subx925 subtract 133.123456 43.1234560 -> 90.0000000 +subx926 subtract 133.123456 43.1234561 -> 89.9999999 +subx927 subtract 133.123456 43.1234566 -> 89.9999994 +subx928 subtract 101.123456 91.1234566 -> 9.9999994 +subx929 subtract 101.123456 99.1234566 -> 1.9999994 + +-- more of the same; probe for cluster boundary problems +precision: 1 +subx930 subtract 11 2 -> 9 +precision: 2 +subx932 subtract 101 2 -> 99 +precision: 3 +subx934 subtract 101 2.1 -> 98.9 +subx935 subtract 101 92.01 -> 8.99 +precision: 4 +subx936 subtract 101 2.01 -> 98.99 +subx937 subtract 101 92.01 -> 8.99 +subx938 subtract 101 92.006 -> 8.994 +precision: 5 +subx939 subtract 101 2.001 -> 98.999 +subx940 subtract 101 92.001 -> 8.999 +subx941 subtract 101 92.0006 -> 8.9994 +precision: 6 +subx942 subtract 101 2.0001 -> 98.9999 +subx943 subtract 101 92.0001 -> 8.9999 +subx944 subtract 101 92.00006 -> 8.99994 +precision: 7 +subx945 subtract 101 2.00001 -> 98.99999 +subx946 subtract 101 92.00001 -> 8.99999 +subx947 subtract 101 92.000006 -> 8.999994 +precision: 8 +subx948 subtract 101 2.000001 -> 98.999999 +subx949 subtract 101 92.000001 -> 8.999999 +subx950 subtract 101 92.0000006 -> 8.9999994 +precision: 9 +subx951 subtract 101 2.0000001 -> 98.9999999 +subx952 subtract 101 92.0000001 -> 8.9999999 +subx953 subtract 101 92.00000006 -> 8.99999994 + +precision: 9 + +-- more LHS swaps [were fixed] +subx390 subtract '-56267E-10' 0 -> '-0.0000056267' +subx391 subtract '-56267E-6' 0 -> '-0.056267' +subx392 subtract '-56267E-5' 0 -> '-0.56267' +subx393 subtract '-56267E-4' 0 -> '-5.6267' +subx394 subtract '-56267E-3' 0 -> '-56.267' +subx395 subtract '-56267E-2' 0 -> '-562.67' +subx396 subtract '-56267E-1' 0 -> '-5626.7' +subx397 subtract '-56267E-0' 0 -> '-56267' +subx398 subtract '-5E-10' 0 -> '-5E-10' +subx399 subtract '-5E-7' 0 -> '-5E-7' +subx400 subtract '-5E-6' 0 -> '-0.000005' +subx401 subtract '-5E-5' 0 -> '-0.00005' +subx402 subtract '-5E-4' 0 -> '-0.0005' +subx403 subtract '-5E-1' 0 -> '-0.5' +subx404 subtract '-5E0' 0 -> '-5' +subx405 subtract '-5E1' 0 -> '-50' +subx406 subtract '-5E5' 0 -> '-500000' +subx407 subtract '-5E8' 0 -> '-500000000' +subx408 subtract '-5E9' 0 -> '-5.00000000E+9' Rounded +subx409 subtract '-5E10' 0 -> '-5.00000000E+10' Rounded +subx410 subtract '-5E11' 0 -> '-5.00000000E+11' Rounded +subx411 subtract '-5E100' 0 -> '-5.00000000E+100' Rounded + +-- more RHS swaps [were fixed] +subx420 subtract 0 '-56267E-10' -> '0.0000056267' +subx421 subtract 0 '-56267E-6' -> '0.056267' +subx422 subtract 0 '-56267E-5' -> '0.56267' +subx423 subtract 0 '-56267E-4' -> '5.6267' +subx424 subtract 0 '-56267E-3' -> '56.267' +subx425 subtract 0 '-56267E-2' -> '562.67' +subx426 subtract 0 '-56267E-1' -> '5626.7' +subx427 subtract 0 '-56267E-0' -> '56267' +subx428 subtract 0 '-5E-10' -> '5E-10' +subx429 subtract 0 '-5E-7' -> '5E-7' +subx430 subtract 0 '-5E-6' -> '0.000005' +subx431 subtract 0 '-5E-5' -> '0.00005' +subx432 subtract 0 '-5E-4' -> '0.0005' +subx433 subtract 0 '-5E-1' -> '0.5' +subx434 subtract 0 '-5E0' -> '5' +subx435 subtract 0 '-5E1' -> '50' +subx436 subtract 0 '-5E5' -> '500000' +subx437 subtract 0 '-5E8' -> '500000000' +subx438 subtract 0 '-5E9' -> '5.00000000E+9' Rounded +subx439 subtract 0 '-5E10' -> '5.00000000E+10' Rounded +subx440 subtract 0 '-5E11' -> '5.00000000E+11' Rounded +subx441 subtract 0 '-5E100' -> '5.00000000E+100' Rounded + + +-- try borderline precision, with carries, etc. +precision: 15 +subx461 subtract '1E+12' '1' -> '999999999999' +subx462 subtract '1E+12' '-1.11' -> '1000000000001.11' +subx463 subtract '1.11' '-1E+12' -> '1000000000001.11' +subx464 subtract '-1' '-1E+12' -> '999999999999' +subx465 subtract '7E+12' '1' -> '6999999999999' +subx466 subtract '7E+12' '-1.11' -> '7000000000001.11' +subx467 subtract '1.11' '-7E+12' -> '7000000000001.11' +subx468 subtract '-1' '-7E+12' -> '6999999999999' + +-- 123456789012345 123456789012345 1 23456789012345 +subx470 subtract '0.444444444444444' '-0.555555555555563' -> '1.00000000000001' Inexact Rounded +subx471 subtract '0.444444444444444' '-0.555555555555562' -> '1.00000000000001' Inexact Rounded +subx472 subtract '0.444444444444444' '-0.555555555555561' -> '1.00000000000001' Inexact Rounded +subx473 subtract '0.444444444444444' '-0.555555555555560' -> '1.00000000000000' Inexact Rounded +subx474 subtract '0.444444444444444' '-0.555555555555559' -> '1.00000000000000' Inexact Rounded +subx475 subtract '0.444444444444444' '-0.555555555555558' -> '1.00000000000000' Inexact Rounded +subx476 subtract '0.444444444444444' '-0.555555555555557' -> '1.00000000000000' Inexact Rounded +subx477 subtract '0.444444444444444' '-0.555555555555556' -> '1.00000000000000' Rounded +subx478 subtract '0.444444444444444' '-0.555555555555555' -> '0.999999999999999' +subx479 subtract '0.444444444444444' '-0.555555555555554' -> '0.999999999999998' +subx480 subtract '0.444444444444444' '-0.555555555555553' -> '0.999999999999997' +subx481 subtract '0.444444444444444' '-0.555555555555552' -> '0.999999999999996' +subx482 subtract '0.444444444444444' '-0.555555555555551' -> '0.999999999999995' +subx483 subtract '0.444444444444444' '-0.555555555555550' -> '0.999999999999994' + +-- and some more, including residue effects and different roundings +precision: 9 +rounding: half_up +subx500 subtract '123456789' 0 -> '123456789' +subx501 subtract '123456789' 0.000000001 -> '123456789' Inexact Rounded +subx502 subtract '123456789' 0.000001 -> '123456789' Inexact Rounded +subx503 subtract '123456789' 0.1 -> '123456789' Inexact Rounded +subx504 subtract '123456789' 0.4 -> '123456789' Inexact Rounded +subx505 subtract '123456789' 0.49 -> '123456789' Inexact Rounded +subx506 subtract '123456789' 0.499999 -> '123456789' Inexact Rounded +subx507 subtract '123456789' 0.499999999 -> '123456789' Inexact Rounded +subx508 subtract '123456789' 0.5 -> '123456789' Inexact Rounded +subx509 subtract '123456789' 0.500000001 -> '123456788' Inexact Rounded +subx510 subtract '123456789' 0.500001 -> '123456788' Inexact Rounded +subx511 subtract '123456789' 0.51 -> '123456788' Inexact Rounded +subx512 subtract '123456789' 0.6 -> '123456788' Inexact Rounded +subx513 subtract '123456789' 0.9 -> '123456788' Inexact Rounded +subx514 subtract '123456789' 0.99999 -> '123456788' Inexact Rounded +subx515 subtract '123456789' 0.999999999 -> '123456788' Inexact Rounded +subx516 subtract '123456789' 1 -> '123456788' +subx517 subtract '123456789' 1.000000001 -> '123456788' Inexact Rounded +subx518 subtract '123456789' 1.00001 -> '123456788' Inexact Rounded +subx519 subtract '123456789' 1.1 -> '123456788' Inexact Rounded + +rounding: half_even +subx520 subtract '123456789' 0 -> '123456789' +subx521 subtract '123456789' 0.000000001 -> '123456789' Inexact Rounded +subx522 subtract '123456789' 0.000001 -> '123456789' Inexact Rounded +subx523 subtract '123456789' 0.1 -> '123456789' Inexact Rounded +subx524 subtract '123456789' 0.4 -> '123456789' Inexact Rounded +subx525 subtract '123456789' 0.49 -> '123456789' Inexact Rounded +subx526 subtract '123456789' 0.499999 -> '123456789' Inexact Rounded +subx527 subtract '123456789' 0.499999999 -> '123456789' Inexact Rounded +subx528 subtract '123456789' 0.5 -> '123456788' Inexact Rounded +subx529 subtract '123456789' 0.500000001 -> '123456788' Inexact Rounded +subx530 subtract '123456789' 0.500001 -> '123456788' Inexact Rounded +subx531 subtract '123456789' 0.51 -> '123456788' Inexact Rounded +subx532 subtract '123456789' 0.6 -> '123456788' Inexact Rounded +subx533 subtract '123456789' 0.9 -> '123456788' Inexact Rounded +subx534 subtract '123456789' 0.99999 -> '123456788' Inexact Rounded +subx535 subtract '123456789' 0.999999999 -> '123456788' Inexact Rounded +subx536 subtract '123456789' 1 -> '123456788' +subx537 subtract '123456789' 1.00000001 -> '123456788' Inexact Rounded +subx538 subtract '123456789' 1.00001 -> '123456788' Inexact Rounded +subx539 subtract '123456789' 1.1 -> '123456788' Inexact Rounded +-- critical few with even bottom digit... +subx540 subtract '123456788' 0.499999999 -> '123456788' Inexact Rounded +subx541 subtract '123456788' 0.5 -> '123456788' Inexact Rounded +subx542 subtract '123456788' 0.500000001 -> '123456787' Inexact Rounded + +rounding: down +subx550 subtract '123456789' 0 -> '123456789' +subx551 subtract '123456789' 0.000000001 -> '123456788' Inexact Rounded +subx552 subtract '123456789' 0.000001 -> '123456788' Inexact Rounded +subx553 subtract '123456789' 0.1 -> '123456788' Inexact Rounded +subx554 subtract '123456789' 0.4 -> '123456788' Inexact Rounded +subx555 subtract '123456789' 0.49 -> '123456788' Inexact Rounded +subx556 subtract '123456789' 0.499999 -> '123456788' Inexact Rounded +subx557 subtract '123456789' 0.499999999 -> '123456788' Inexact Rounded +subx558 subtract '123456789' 0.5 -> '123456788' Inexact Rounded +subx559 subtract '123456789' 0.500000001 -> '123456788' Inexact Rounded +subx560 subtract '123456789' 0.500001 -> '123456788' Inexact Rounded +subx561 subtract '123456789' 0.51 -> '123456788' Inexact Rounded +subx562 subtract '123456789' 0.6 -> '123456788' Inexact Rounded +subx563 subtract '123456789' 0.9 -> '123456788' Inexact Rounded +subx564 subtract '123456789' 0.99999 -> '123456788' Inexact Rounded +subx565 subtract '123456789' 0.999999999 -> '123456788' Inexact Rounded +subx566 subtract '123456789' 1 -> '123456788' +subx567 subtract '123456789' 1.00000001 -> '123456787' Inexact Rounded +subx568 subtract '123456789' 1.00001 -> '123456787' Inexact Rounded +subx569 subtract '123456789' 1.1 -> '123456787' Inexact Rounded + +-- symmetry... +rounding: half_up +subx600 subtract 0 '123456789' -> '-123456789' +subx601 subtract 0.000000001 '123456789' -> '-123456789' Inexact Rounded +subx602 subtract 0.000001 '123456789' -> '-123456789' Inexact Rounded +subx603 subtract 0.1 '123456789' -> '-123456789' Inexact Rounded +subx604 subtract 0.4 '123456789' -> '-123456789' Inexact Rounded +subx605 subtract 0.49 '123456789' -> '-123456789' Inexact Rounded +subx606 subtract 0.499999 '123456789' -> '-123456789' Inexact Rounded +subx607 subtract 0.499999999 '123456789' -> '-123456789' Inexact Rounded +subx608 subtract 0.5 '123456789' -> '-123456789' Inexact Rounded +subx609 subtract 0.500000001 '123456789' -> '-123456788' Inexact Rounded +subx610 subtract 0.500001 '123456789' -> '-123456788' Inexact Rounded +subx611 subtract 0.51 '123456789' -> '-123456788' Inexact Rounded +subx612 subtract 0.6 '123456789' -> '-123456788' Inexact Rounded +subx613 subtract 0.9 '123456789' -> '-123456788' Inexact Rounded +subx614 subtract 0.99999 '123456789' -> '-123456788' Inexact Rounded +subx615 subtract 0.999999999 '123456789' -> '-123456788' Inexact Rounded +subx616 subtract 1 '123456789' -> '-123456788' +subx617 subtract 1.000000001 '123456789' -> '-123456788' Inexact Rounded +subx618 subtract 1.00001 '123456789' -> '-123456788' Inexact Rounded +subx619 subtract 1.1 '123456789' -> '-123456788' Inexact Rounded + +rounding: half_even +subx620 subtract 0 '123456789' -> '-123456789' +subx621 subtract 0.000000001 '123456789' -> '-123456789' Inexact Rounded +subx622 subtract 0.000001 '123456789' -> '-123456789' Inexact Rounded +subx623 subtract 0.1 '123456789' -> '-123456789' Inexact Rounded +subx624 subtract 0.4 '123456789' -> '-123456789' Inexact Rounded +subx625 subtract 0.49 '123456789' -> '-123456789' Inexact Rounded +subx626 subtract 0.499999 '123456789' -> '-123456789' Inexact Rounded +subx627 subtract 0.499999999 '123456789' -> '-123456789' Inexact Rounded +subx628 subtract 0.5 '123456789' -> '-123456788' Inexact Rounded +subx629 subtract 0.500000001 '123456789' -> '-123456788' Inexact Rounded +subx630 subtract 0.500001 '123456789' -> '-123456788' Inexact Rounded +subx631 subtract 0.51 '123456789' -> '-123456788' Inexact Rounded +subx632 subtract 0.6 '123456789' -> '-123456788' Inexact Rounded +subx633 subtract 0.9 '123456789' -> '-123456788' Inexact Rounded +subx634 subtract 0.99999 '123456789' -> '-123456788' Inexact Rounded +subx635 subtract 0.999999999 '123456789' -> '-123456788' Inexact Rounded +subx636 subtract 1 '123456789' -> '-123456788' +subx637 subtract 1.00000001 '123456789' -> '-123456788' Inexact Rounded +subx638 subtract 1.00001 '123456789' -> '-123456788' Inexact Rounded +subx639 subtract 1.1 '123456789' -> '-123456788' Inexact Rounded +-- critical few with even bottom digit... +subx640 subtract 0.499999999 '123456788' -> '-123456788' Inexact Rounded +subx641 subtract 0.5 '123456788' -> '-123456788' Inexact Rounded +subx642 subtract 0.500000001 '123456788' -> '-123456787' Inexact Rounded + +rounding: down +subx650 subtract 0 '123456789' -> '-123456789' +subx651 subtract 0.000000001 '123456789' -> '-123456788' Inexact Rounded +subx652 subtract 0.000001 '123456789' -> '-123456788' Inexact Rounded +subx653 subtract 0.1 '123456789' -> '-123456788' Inexact Rounded +subx654 subtract 0.4 '123456789' -> '-123456788' Inexact Rounded +subx655 subtract 0.49 '123456789' -> '-123456788' Inexact Rounded +subx656 subtract 0.499999 '123456789' -> '-123456788' Inexact Rounded +subx657 subtract 0.499999999 '123456789' -> '-123456788' Inexact Rounded +subx658 subtract 0.5 '123456789' -> '-123456788' Inexact Rounded +subx659 subtract 0.500000001 '123456789' -> '-123456788' Inexact Rounded +subx660 subtract 0.500001 '123456789' -> '-123456788' Inexact Rounded +subx661 subtract 0.51 '123456789' -> '-123456788' Inexact Rounded +subx662 subtract 0.6 '123456789' -> '-123456788' Inexact Rounded +subx663 subtract 0.9 '123456789' -> '-123456788' Inexact Rounded +subx664 subtract 0.99999 '123456789' -> '-123456788' Inexact Rounded +subx665 subtract 0.999999999 '123456789' -> '-123456788' Inexact Rounded +subx666 subtract 1 '123456789' -> '-123456788' +subx667 subtract 1.00000001 '123456789' -> '-123456787' Inexact Rounded +subx668 subtract 1.00001 '123456789' -> '-123456787' Inexact Rounded +subx669 subtract 1.1 '123456789' -> '-123456787' Inexact Rounded + + +-- lots of leading zeros in intermediate result, and showing effects of +-- input rounding would have affected the following +precision: 9 +rounding: half_up +subx670 subtract '123456789' '123456788.1' -> 0.9 +subx671 subtract '123456789' '123456788.9' -> 0.1 +subx672 subtract '123456789' '123456789.1' -> -0.1 +subx673 subtract '123456789' '123456789.5' -> -0.5 +subx674 subtract '123456789' '123456789.9' -> -0.9 + +rounding: half_even +subx680 subtract '123456789' '123456788.1' -> 0.9 +subx681 subtract '123456789' '123456788.9' -> 0.1 +subx682 subtract '123456789' '123456789.1' -> -0.1 +subx683 subtract '123456789' '123456789.5' -> -0.5 +subx684 subtract '123456789' '123456789.9' -> -0.9 + +subx685 subtract '123456788' '123456787.1' -> 0.9 +subx686 subtract '123456788' '123456787.9' -> 0.1 +subx687 subtract '123456788' '123456788.1' -> -0.1 +subx688 subtract '123456788' '123456788.5' -> -0.5 +subx689 subtract '123456788' '123456788.9' -> -0.9 + +rounding: down +subx690 subtract '123456789' '123456788.1' -> 0.9 +subx691 subtract '123456789' '123456788.9' -> 0.1 +subx692 subtract '123456789' '123456789.1' -> -0.1 +subx693 subtract '123456789' '123456789.5' -> -0.5 +subx694 subtract '123456789' '123456789.9' -> -0.9 + +-- input preparation tests +rounding: half_up +precision: 3 + +subx700 subtract '12345678900000' -9999999999999 -> '2.23E+13' Inexact Rounded +subx701 subtract '9999999999999' -12345678900000 -> '2.23E+13' Inexact Rounded +subx702 subtract '12E+3' '-3456' -> '1.55E+4' Inexact Rounded +subx703 subtract '12E+3' '-3446' -> '1.54E+4' Inexact Rounded +subx704 subtract '12E+3' '-3454' -> '1.55E+4' Inexact Rounded +subx705 subtract '12E+3' '-3444' -> '1.54E+4' Inexact Rounded + +subx706 subtract '3456' '-12E+3' -> '1.55E+4' Inexact Rounded +subx707 subtract '3446' '-12E+3' -> '1.54E+4' Inexact Rounded +subx708 subtract '3454' '-12E+3' -> '1.55E+4' Inexact Rounded +subx709 subtract '3444' '-12E+3' -> '1.54E+4' Inexact Rounded + +-- overflow and underflow tests [subnormals now possible] +maxexponent: 999999999 +minexponent: -999999999 +precision: 9 +rounding: down +subx710 subtract 1E+999999999 -9E+999999999 -> 9.99999999E+999999999 Overflow Inexact Rounded +subx711 subtract 9E+999999999 -1E+999999999 -> 9.99999999E+999999999 Overflow Inexact Rounded +rounding: half_up +subx712 subtract 1E+999999999 -9E+999999999 -> Infinity Overflow Inexact Rounded +subx713 subtract 9E+999999999 -1E+999999999 -> Infinity Overflow Inexact Rounded +subx714 subtract -1.1E-999999999 -1E-999999999 -> -1E-1000000000 Subnormal +subx715 subtract 1E-999999999 +1.1e-999999999 -> -1E-1000000000 Subnormal +subx716 subtract -1E+999999999 +9E+999999999 -> -Infinity Overflow Inexact Rounded +subx717 subtract -9E+999999999 +1E+999999999 -> -Infinity Overflow Inexact Rounded +subx718 subtract +1.1E-999999999 +1E-999999999 -> 1E-1000000000 Subnormal +subx719 subtract -1E-999999999 -1.1e-999999999 -> 1E-1000000000 Subnormal + +precision: 3 +subx720 subtract 1 9.999E+999999999 -> -Infinity Inexact Overflow Rounded +subx721 subtract 1 -9.999E+999999999 -> Infinity Inexact Overflow Rounded +subx722 subtract 9.999E+999999999 1 -> Infinity Inexact Overflow Rounded +subx723 subtract -9.999E+999999999 1 -> -Infinity Inexact Overflow Rounded +subx724 subtract 1 9.999E+999999999 -> -Infinity Inexact Overflow Rounded +subx725 subtract 1 -9.999E+999999999 -> Infinity Inexact Overflow Rounded +subx726 subtract 9.999E+999999999 1 -> Infinity Inexact Overflow Rounded +subx727 subtract -9.999E+999999999 1 -> -Infinity Inexact Overflow Rounded + +-- [more below] + +-- long operand checks +maxexponent: 999 +minexponent: -999 +precision: 9 +sub731 subtract 12345678000 0 -> 1.23456780E+10 Rounded +sub732 subtract 0 12345678000 -> -1.23456780E+10 Rounded +sub733 subtract 1234567800 0 -> 1.23456780E+9 Rounded +sub734 subtract 0 1234567800 -> -1.23456780E+9 Rounded +sub735 subtract 1234567890 0 -> 1.23456789E+9 Rounded +sub736 subtract 0 1234567890 -> -1.23456789E+9 Rounded +sub737 subtract 1234567891 0 -> 1.23456789E+9 Inexact Rounded +sub738 subtract 0 1234567891 -> -1.23456789E+9 Inexact Rounded +sub739 subtract 12345678901 0 -> 1.23456789E+10 Inexact Rounded +sub740 subtract 0 12345678901 -> -1.23456789E+10 Inexact Rounded +sub741 subtract 1234567896 0 -> 1.23456790E+9 Inexact Rounded +sub742 subtract 0 1234567896 -> -1.23456790E+9 Inexact Rounded + +precision: 15 +sub751 subtract 12345678000 0 -> 12345678000 +sub752 subtract 0 12345678000 -> -12345678000 +sub753 subtract 1234567800 0 -> 1234567800 +sub754 subtract 0 1234567800 -> -1234567800 +sub755 subtract 1234567890 0 -> 1234567890 +sub756 subtract 0 1234567890 -> -1234567890 +sub757 subtract 1234567891 0 -> 1234567891 +sub758 subtract 0 1234567891 -> -1234567891 +sub759 subtract 12345678901 0 -> 12345678901 +sub760 subtract 0 12345678901 -> -12345678901 +sub761 subtract 1234567896 0 -> 1234567896 +sub762 subtract 0 1234567896 -> -1234567896 + +-- Specials +subx780 subtract -Inf Inf -> -Infinity +subx781 subtract -Inf 1000 -> -Infinity +subx782 subtract -Inf 1 -> -Infinity +subx783 subtract -Inf -0 -> -Infinity +subx784 subtract -Inf -1 -> -Infinity +subx785 subtract -Inf -1000 -> -Infinity +subx787 subtract -1000 Inf -> -Infinity +subx788 subtract -Inf Inf -> -Infinity +subx789 subtract -1 Inf -> -Infinity +subx790 subtract 0 Inf -> -Infinity +subx791 subtract 1 Inf -> -Infinity +subx792 subtract 1000 Inf -> -Infinity + +subx800 subtract Inf Inf -> NaN Invalid_operation +subx801 subtract Inf 1000 -> Infinity +subx802 subtract Inf 1 -> Infinity +subx803 subtract Inf 0 -> Infinity +subx804 subtract Inf -0 -> Infinity +subx805 subtract Inf -1 -> Infinity +subx806 subtract Inf -1000 -> Infinity +subx807 subtract Inf -Inf -> Infinity +subx808 subtract -1000 -Inf -> Infinity +subx809 subtract -Inf -Inf -> NaN Invalid_operation +subx810 subtract -1 -Inf -> Infinity +subx811 subtract -0 -Inf -> Infinity +subx812 subtract 0 -Inf -> Infinity +subx813 subtract 1 -Inf -> Infinity +subx814 subtract 1000 -Inf -> Infinity +subx815 subtract Inf -Inf -> Infinity + +subx821 subtract NaN Inf -> NaN +subx822 subtract -NaN 1000 -> -NaN +subx823 subtract NaN 1 -> NaN +subx824 subtract NaN 0 -> NaN +subx825 subtract NaN -0 -> NaN +subx826 subtract NaN -1 -> NaN +subx827 subtract NaN -1000 -> NaN +subx828 subtract NaN -Inf -> NaN +subx829 subtract -NaN NaN -> -NaN +subx830 subtract -Inf NaN -> NaN +subx831 subtract -1000 NaN -> NaN +subx832 subtract -1 NaN -> NaN +subx833 subtract -0 NaN -> NaN +subx834 subtract 0 NaN -> NaN +subx835 subtract 1 NaN -> NaN +subx836 subtract 1000 -NaN -> -NaN +subx837 subtract Inf NaN -> NaN + +subx841 subtract sNaN Inf -> NaN Invalid_operation +subx842 subtract -sNaN 1000 -> -NaN Invalid_operation +subx843 subtract sNaN 1 -> NaN Invalid_operation +subx844 subtract sNaN 0 -> NaN Invalid_operation +subx845 subtract sNaN -0 -> NaN Invalid_operation +subx846 subtract sNaN -1 -> NaN Invalid_operation +subx847 subtract sNaN -1000 -> NaN Invalid_operation +subx848 subtract sNaN NaN -> NaN Invalid_operation +subx849 subtract sNaN sNaN -> NaN Invalid_operation +subx850 subtract NaN sNaN -> NaN Invalid_operation +subx851 subtract -Inf -sNaN -> -NaN Invalid_operation +subx852 subtract -1000 sNaN -> NaN Invalid_operation +subx853 subtract -1 sNaN -> NaN Invalid_operation +subx854 subtract -0 sNaN -> NaN Invalid_operation +subx855 subtract 0 sNaN -> NaN Invalid_operation +subx856 subtract 1 sNaN -> NaN Invalid_operation +subx857 subtract 1000 sNaN -> NaN Invalid_operation +subx858 subtract Inf sNaN -> NaN Invalid_operation +subx859 subtract NaN sNaN -> NaN Invalid_operation + +-- propagating NaNs +subx861 subtract NaN01 -Inf -> NaN1 +subx862 subtract -NaN02 -1000 -> -NaN2 +subx863 subtract NaN03 1000 -> NaN3 +subx864 subtract NaN04 Inf -> NaN4 +subx865 subtract NaN05 NaN61 -> NaN5 +subx866 subtract -Inf -NaN71 -> -NaN71 +subx867 subtract -1000 NaN81 -> NaN81 +subx868 subtract 1000 NaN91 -> NaN91 +subx869 subtract Inf NaN101 -> NaN101 +subx871 subtract sNaN011 -Inf -> NaN11 Invalid_operation +subx872 subtract sNaN012 -1000 -> NaN12 Invalid_operation +subx873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation +subx874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation +subx875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation +subx876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation +subx877 subtract -Inf sNaN201 -> NaN201 Invalid_operation +subx878 subtract -1000 sNaN211 -> NaN211 Invalid_operation +subx879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation +subx880 subtract Inf sNaN231 -> NaN231 Invalid_operation +subx881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation + +-- edge case spills +subx901 subtract 2.E-3 1.002 -> -1.000 +subx902 subtract 2.0E-3 1.002 -> -1.0000 +subx903 subtract 2.00E-3 1.0020 -> -1.00000 +subx904 subtract 2.000E-3 1.00200 -> -1.000000 +subx905 subtract 2.0000E-3 1.002000 -> -1.0000000 +subx906 subtract 2.00000E-3 1.0020000 -> -1.00000000 +subx907 subtract 2.000000E-3 1.00200000 -> -1.000000000 +subx908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000 + +-- subnormals and underflows +precision: 3 +maxexponent: 999 +minexponent: -999 +subx1010 subtract 0 1.00E-999 -> -1.00E-999 +subx1011 subtract 0 0.1E-999 -> -1E-1000 Subnormal +subx1012 subtract 0 0.10E-999 -> -1.0E-1000 Subnormal +subx1013 subtract 0 0.100E-999 -> -1.0E-1000 Subnormal Rounded +subx1014 subtract 0 0.01E-999 -> -1E-1001 Subnormal +-- next is rounded to Emin +subx1015 subtract 0 0.999E-999 -> -1.00E-999 Inexact Rounded Subnormal Underflow +subx1016 subtract 0 0.099E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +subx1017 subtract 0 0.009E-999 -> -1E-1001 Inexact Rounded Subnormal Underflow +subx1018 subtract 0 0.001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +subx1019 subtract 0 0.0009E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +subx1020 subtract 0 0.0001E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped + +subx1030 subtract 0 -1.00E-999 -> 1.00E-999 +subx1031 subtract 0 -0.1E-999 -> 1E-1000 Subnormal +subx1032 subtract 0 -0.10E-999 -> 1.0E-1000 Subnormal +subx1033 subtract 0 -0.100E-999 -> 1.0E-1000 Subnormal Rounded +subx1034 subtract 0 -0.01E-999 -> 1E-1001 Subnormal +-- next is rounded to Emin +subx1035 subtract 0 -0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow +subx1036 subtract 0 -0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow +subx1037 subtract 0 -0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow +subx1038 subtract 0 -0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +subx1039 subtract 0 -0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped +subx1040 subtract 0 -0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped + +-- some non-zero subnormal subtracts +-- subx1056 is a tricky case +rounding: half_up +subx1050 subtract 1.00E-999 0.1E-999 -> 9.0E-1000 Subnormal +subx1051 subtract 0.1E-999 0.1E-999 -> 0E-1000 +subx1052 subtract 0.10E-999 0.1E-999 -> 0E-1001 +subx1053 subtract 0.100E-999 0.1E-999 -> 0E-1001 Clamped +subx1054 subtract 0.01E-999 0.1E-999 -> -9E-1001 Subnormal +subx1055 subtract 0.999E-999 0.1E-999 -> 9.0E-1000 Inexact Rounded Subnormal Underflow +subx1056 subtract 0.099E-999 0.1E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped +subx1057 subtract 0.009E-999 0.1E-999 -> -9E-1001 Inexact Rounded Subnormal Underflow +subx1058 subtract 0.001E-999 0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +subx1059 subtract 0.0009E-999 0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow +subx1060 subtract 0.0001E-999 0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow + + +-- check for double-rounded subnormals +precision: 5 +maxexponent: 79 +minexponent: -79 +subx1101 subtract 0 1.52444E-80 -> -1.524E-80 Inexact Rounded Subnormal Underflow +subx1102 subtract 0 1.52445E-80 -> -1.524E-80 Inexact Rounded Subnormal Underflow +subx1103 subtract 0 1.52446E-80 -> -1.524E-80 Inexact Rounded Subnormal Underflow +subx1104 subtract 1.52444E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow +subx1105 subtract 1.52445E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow +subx1106 subtract 1.52446E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow + +subx1111 subtract 1.2345678E-80 1.2345671E-80 -> 0E-83 Inexact Rounded Subnormal Underflow Clamped +subx1112 subtract 1.2345678E-80 1.2345618E-80 -> 0E-83 Inexact Rounded Subnormal Underflow Clamped +subx1113 subtract 1.2345678E-80 1.2345178E-80 -> 0E-83 Inexact Rounded Subnormal Underflow Clamped +subx1114 subtract 1.2345678E-80 1.2341678E-80 -> 0E-83 Inexact Rounded Subnormal Underflow Clamped +subx1115 subtract 1.2345678E-80 1.2315678E-80 -> 3E-83 Rounded Subnormal +subx1116 subtract 1.2345678E-80 1.2145678E-80 -> 2.0E-82 Rounded Subnormal +subx1117 subtract 1.2345678E-80 1.1345678E-80 -> 1.00E-81 Rounded Subnormal +subx1118 subtract 1.2345678E-80 0.2345678E-80 -> 1.000E-80 Rounded Subnormal + +precision: 34 +rounding: half_up +maxExponent: 6144 +minExponent: -6143 +-- Examples from SQL proposal (Krishna Kulkarni) +subx1125 subtract 130E-2 120E-2 -> 0.10 +subx1126 subtract 130E-2 12E-1 -> 0.10 +subx1127 subtract 130E-2 1E0 -> 0.30 +subx1128 subtract 1E2 1E4 -> -9.9E+3 + +-- Null tests +subx9990 subtract 10 # -> NaN Invalid_operation +subx9991 subtract # 10 -> NaN Invalid_operation Added: sandbox/trunk/decimal-c/new_dt/testall.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/testall.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,63 @@ +------------------------------------------------------------------------ +-- testall.decTest -- run all general decimal arithmetic testcases -- +-- Copyright (c) IBM Corporation, 1981, 2004. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- core tests (using Extended: 1) -------------------------------------- +dectest: base +dectest: abs +dectest: add +dectest: clamp +dectest: compare +dectest: comparetotal +dectest: divide +dectest: divideint +dectest: exp +dectest: inexact +dectest: ln +dectest: log10 +dectest: max +dectest: min +dectest: minus +dectest: multiply +dectest: normalize +dectest: plus +dectest: power +dectest: powersqrt +dectest: quantize +dectest: randoms +dectest: remainder +dectest: remaindernear +dectest: rescale -- [obsolete] +dectest: rounding +dectest: samequantum +dectest: squareroot +dectest: subtract +dectest: tointegral +dectest: trim + +-- The next are for the Strawman 4d concrete representations +dectest: decimal32 +dectest: decimal64 +dectest: decimal128 + + +-- General 31->33-digit boundary tests +dectest: randombound32 + Added: sandbox/trunk/decimal-c/new_dt/tointegral.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/tointegral.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,176 @@ +------------------------------------------------------------------------ +-- tointegral.decTest -- round decimal to integral value -- +-- Copyright (c) IBM Corporation, 2001, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +-- This set of tests tests the extended specification 'round-to-integral +-- value' operation (from IEEE 854, later modified in 754r). +-- All non-zero results are defined as being those from either copy or +-- quantize, so those are assumed to have been tested. +-- Note that 754r requires that Inexact not be set, and we similarly +-- assume Rounded is not set. + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minExponent: -999 + +intx001 tointegral 0 -> 0 +intx002 tointegral 0.0 -> 0 +intx003 tointegral 0.1 -> 0 +intx004 tointegral 0.2 -> 0 +intx005 tointegral 0.3 -> 0 +intx006 tointegral 0.4 -> 0 +intx007 tointegral 0.5 -> 1 +intx008 tointegral 0.6 -> 1 +intx009 tointegral 0.7 -> 1 +intx010 tointegral 0.8 -> 1 +intx011 tointegral 0.9 -> 1 +intx012 tointegral 1 -> 1 +intx013 tointegral 1.0 -> 1 +intx014 tointegral 1.1 -> 1 +intx015 tointegral 1.2 -> 1 +intx016 tointegral 1.3 -> 1 +intx017 tointegral 1.4 -> 1 +intx018 tointegral 1.5 -> 2 +intx019 tointegral 1.6 -> 2 +intx020 tointegral 1.7 -> 2 +intx021 tointegral 1.8 -> 2 +intx022 tointegral 1.9 -> 2 +-- negatives +intx031 tointegral -0 -> -0 +intx032 tointegral -0.0 -> -0 +intx033 tointegral -0.1 -> -0 +intx034 tointegral -0.2 -> -0 +intx035 tointegral -0.3 -> -0 +intx036 tointegral -0.4 -> -0 +intx037 tointegral -0.5 -> -1 +intx038 tointegral -0.6 -> -1 +intx039 tointegral -0.7 -> -1 +intx040 tointegral -0.8 -> -1 +intx041 tointegral -0.9 -> -1 +intx042 tointegral -1 -> -1 +intx043 tointegral -1.0 -> -1 +intx044 tointegral -1.1 -> -1 +intx045 tointegral -1.2 -> -1 +intx046 tointegral -1.3 -> -1 +intx047 tointegral -1.4 -> -1 +intx048 tointegral -1.5 -> -2 +intx049 tointegral -1.6 -> -2 +intx050 tointegral -1.7 -> -2 +intx051 tointegral -1.8 -> -2 +intx052 tointegral -1.9 -> -2 +-- next two would be NaN using quantize(x, 0) +intx053 tointegral 10E+30 -> 1.0E+31 +intx054 tointegral -10E+30 -> -1.0E+31 + +-- numbers around precision +precision: 9 +intx060 tointegral '56267E-10' -> '0' +intx061 tointegral '56267E-5' -> '1' +intx062 tointegral '56267E-2' -> '563' +intx063 tointegral '56267E-1' -> '5627' +intx065 tointegral '56267E-0' -> '56267' +intx066 tointegral '56267E+0' -> '56267' +intx067 tointegral '56267E+1' -> '5.6267E+5' +intx068 tointegral '56267E+2' -> '5.6267E+6' +intx069 tointegral '56267E+3' -> '5.6267E+7' +intx070 tointegral '56267E+4' -> '5.6267E+8' +intx071 tointegral '56267E+5' -> '5.6267E+9' +intx072 tointegral '56267E+6' -> '5.6267E+10' +intx073 tointegral '1.23E+96' -> '1.23E+96' +intx074 tointegral '1.23E+384' -> '1.23E+384' +intx075 tointegral '1.23E+999' -> '1.23E+999' + +intx080 tointegral '-56267E-10' -> '-0' +intx081 tointegral '-56267E-5' -> '-1' +intx082 tointegral '-56267E-2' -> '-563' +intx083 tointegral '-56267E-1' -> '-5627' +intx085 tointegral '-56267E-0' -> '-56267' +intx086 tointegral '-56267E+0' -> '-56267' +intx087 tointegral '-56267E+1' -> '-5.6267E+5' +intx088 tointegral '-56267E+2' -> '-5.6267E+6' +intx089 tointegral '-56267E+3' -> '-5.6267E+7' +intx090 tointegral '-56267E+4' -> '-5.6267E+8' +intx091 tointegral '-56267E+5' -> '-5.6267E+9' +intx092 tointegral '-56267E+6' -> '-5.6267E+10' +intx093 tointegral '-1.23E+96' -> '-1.23E+96' +intx094 tointegral '-1.23E+384' -> '-1.23E+384' +intx095 tointegral '-1.23E+999' -> '-1.23E+999' + +-- subnormal inputs +intx100 tointegral 1E-999 -> 0 +intx101 tointegral 0.1E-999 -> 0 +intx102 tointegral 0.01E-999 -> 0 +intx103 tointegral 0E-999 -> 0 + +-- specials and zeros +intx120 tointegral 'Inf' -> Infinity +intx121 tointegral '-Inf' -> -Infinity +intx122 tointegral NaN -> NaN +intx123 tointegral sNaN -> NaN Invalid_operation +intx124 tointegral 0 -> 0 +intx125 tointegral -0 -> -0 +intx126 tointegral 0.000 -> 0 +intx127 tointegral 0.00 -> 0 +intx128 tointegral 0.0 -> 0 +intx129 tointegral 0 -> 0 +intx130 tointegral 0E-3 -> 0 +intx131 tointegral 0E-2 -> 0 +intx132 tointegral 0E-1 -> 0 +intx133 tointegral 0E-0 -> 0 +intx134 tointegral 0E+1 -> 0E+1 +intx135 tointegral 0E+2 -> 0E+2 +intx136 tointegral 0E+3 -> 0E+3 +intx137 tointegral 0E+4 -> 0E+4 +intx138 tointegral 0E+5 -> 0E+5 +intx139 tointegral -0.000 -> -0 +intx140 tointegral -0.00 -> -0 +intx141 tointegral -0.0 -> -0 +intx142 tointegral -0 -> -0 +intx143 tointegral -0E-3 -> -0 +intx144 tointegral -0E-2 -> -0 +intx145 tointegral -0E-1 -> -0 +intx146 tointegral -0E-0 -> -0 +intx147 tointegral -0E+1 -> -0E+1 +intx148 tointegral -0E+2 -> -0E+2 +intx149 tointegral -0E+3 -> -0E+3 +intx150 tointegral -0E+4 -> -0E+4 +intx151 tointegral -0E+5 -> -0E+5 +-- propagating NaNs +intx152 tointegral NaN808 -> NaN808 +intx153 tointegral sNaN080 -> NaN80 Invalid_operation +intx154 tointegral -NaN808 -> -NaN808 +intx155 tointegral -sNaN080 -> -NaN80 Invalid_operation +intx156 tointegral -NaN -> -NaN +intx157 tointegral -sNaN -> -NaN Invalid_operation + +-- examples +rounding: half_up +precision: 9 +intx200 tointegral 2.1 -> 2 +intx201 tointegral 100 -> 100 +intx202 tointegral 100.0 -> 100 +intx203 tointegral 101.5 -> 102 +intx204 tointegral -101.5 -> -102 +intx205 tointegral 10E+5 -> 1.0E+6 +intx206 tointegral 7.89E+77 -> 7.89E+77 +intx207 tointegral -Inf -> -Infinity + Added: sandbox/trunk/decimal-c/new_dt/trim.decTest ============================================================================== --- (empty file) +++ sandbox/trunk/decimal-c/new_dt/trim.decTest Sat Aug 19 23:56:12 2006 @@ -0,0 +1,152 @@ +------------------------------------------------------------------------ +-- trim.decTest -- remove insignificant trailing zeros -- +-- Copyright (c) IBM Corporation, 2003. All rights reserved. -- +------------------------------------------------------------------------ +-- Please see the document "General Decimal Arithmetic Testcases" -- +-- at http://www2.hursley.ibm.com/decimal for the description of -- +-- these testcases. -- +-- -- +-- These testcases are experimental ('beta' versions), and they -- +-- may contain errors. They are offered on an as-is basis. In -- +-- particular, achieving the same results as the tests here is not -- +-- a guarantee that an implementation complies with any Standard -- +-- or specification. The tests are not exhaustive. -- +-- -- +-- Please send comments, suggestions, and corrections to the author: -- +-- Mike Cowlishaw, IBM Fellow -- +-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- +-- mfc at uk.ibm.com -- +------------------------------------------------------------------------ +version: 2.52 + +extended: 1 +precision: 9 +rounding: half_up +maxExponent: 999 +minexponent: -999 + +trmx001 trim '1' -> '1' +trmx002 trim '-1' -> '-1' +trmx003 trim '1.00' -> '1' +trmx004 trim '-1.00' -> '-1' +trmx005 trim '0' -> '0' +trmx006 trim '0.00' -> '0' +trmx007 trim '00.0' -> '0' +trmx008 trim '00.00' -> '0' +trmx009 trim '00' -> '0' + +trmx010 trim '-2' -> '-2' +trmx011 trim '2' -> '2' +trmx012 trim '-2.00' -> '-2' +trmx013 trim '2.00' -> '2' +trmx014 trim '-0' -> '-0' +trmx015 trim '-0.00' -> '-0' +trmx016 trim '-00.0' -> '-0' +trmx017 trim '-00.00' -> '-0' +trmx018 trim '-00' -> '-0' +trmx019 trim '0E+5' -> '0' +trmx020 trim '-0E+1' -> '-0' + +trmx030 trim '+0.1' -> '0.1' +trmx031 trim '-0.1' -> '-0.1' +trmx032 trim '+0.01' -> '0.01' +trmx033 trim '-0.01' -> '-0.01' +trmx034 trim '+0.001' -> '0.001' +trmx035 trim '-0.001' -> '-0.001' +trmx036 trim '+0.000001' -> '0.000001' +trmx037 trim '-0.000001' -> '-0.000001' +trmx038 trim '+0.000000000001' -> '1E-12' +trmx039 trim '-0.000000000001' -> '-1E-12' + +trmx041 trim 1.1 -> 1.1 +trmx042 trim 1.10 -> 1.1 +trmx043 trim 1.100 -> 1.1 +trmx044 trim 1.110 -> 1.11 +trmx045 trim -1.1 -> -1.1 +trmx046 trim -1.10 -> -1.1 +trmx047 trim -1.100 -> -1.1 +trmx048 trim -1.110 -> -1.11 +trmx049 trim 9.9 -> 9.9 +trmx050 trim 9.90 -> 9.9 +trmx051 trim 9.900 -> 9.9 +trmx052 trim 9.990 -> 9.99 +trmx053 trim -9.9 -> -9.9 +trmx054 trim -9.90 -> -9.9 +trmx055 trim -9.900 -> -9.9 +trmx056 trim -9.990 -> -9.99 + +-- some insignificant trailing fractional zeros +trmx060 trim 10.0 -> 10 +trmx061 trim 10.00 -> 10 +trmx062 trim 100.0 -> 100 +trmx063 trim 100.00 -> 100 +trmx064 trim 1.1000E+3 -> 1100 +trmx065 trim 1.10000E+3 -> 1100 +trmx066 trim -10.0 -> -10 +trmx067 trim -10.00 -> -10 +trmx068 trim -100.0 -> -100 +trmx069 trim -100.00 -> -100 +trmx070 trim -1.1000E+3 -> -1100 +trmx071 trim -1.10000E+3 -> -1100 + +-- some insignificant trailing zeros with positive exponent +trmx080 trim 10E+1 -> 1E+2 +trmx081 trim 100E+1 -> 1E+3 +trmx082 trim 1.0E+2 -> 1E+2 +trmx083 trim 1.0E+3 -> 1E+3 +trmx084 trim 1.1E+3 -> 1.1E+3 +trmx085 trim 1.00E+3 -> 1E+3 +trmx086 trim 1.10E+3 -> 1.1E+3 +trmx087 trim -10E+1 -> -1E+2 +trmx088 trim -100E+1 -> -1E+3 +trmx089 trim -1.0E+2 -> -1E+2 +trmx090 trim -1.0E+3 -> -1E+3 +trmx091 trim -1.1E+3 -> -1.1E+3 +trmx092 trim -1.00E+3 -> -1E+3 +trmx093 trim -1.10E+3 -> -1.1E+3 + +-- some significant trailing zeros +trmx100 trim 11 -> 11 +trmx101 trim 10 -> 10 +trmx102 trim 10. -> 10 +trmx103 trim 1.1E+1 -> 11 +trmx104 trim 1.0E+1 -> 10 +trmx105 trim 1.10E+2 -> 110 +trmx106 trim 1.00E+2 -> 100 +trmx107 trim 1.100E+3 -> 1100 +trmx108 trim 1.000E+3 -> 1000 +trmx109 trim 1.000000E+6 -> 1000000 +trmx110 trim -11 -> -11 +trmx111 trim -10 -> -10 +trmx112 trim -10. -> -10 +trmx113 trim -1.1E+1 -> -11 +trmx114 trim -1.0E+1 -> -10 +trmx115 trim -1.10E+2 -> -110 +trmx116 trim -1.00E+2 -> -100 +trmx117 trim -1.100E+3 -> -1100 +trmx118 trim -1.000E+3 -> -1000 +trmx119 trim -1.00000E+5 -> -100000 +trmx120 trim -1.000000E+6 -> -1000000 + +-- examples from decArith +trmx140 trim '2.1' -> '2.1' +trmx141 trim '-2.0' -> '-2' +trmx142 trim '1.200' -> '1.2' +trmx143 trim '-120' -> '-120' +trmx144 trim '120.00' -> '120' +trmx145 trim '0.00' -> '0' + +-- utilities pass through specials without raising exceptions +trmx320 trim 'Inf' -> 'Infinity' +trmx321 trim '-Inf' -> '-Infinity' +trmx322 trim NaN -> NaN +trmx323 trim sNaN -> sNaN +trmx324 trim NaN999 -> NaN999 +trmx325 trim sNaN777 -> sNaN777 +trmx326 trim -NaN -> -NaN +trmx327 trim -sNaN -> -sNaN +trmx328 trim -NaN999 -> -NaN999 +trmx329 trim -sNaN777 -> -sNaN777 + +-- Null test +trmx900 trim # -> NaN Invalid_operation From python-checkins at python.org Sun Aug 20 02:50:35 2006 From: python-checkins at python.org (mateusz.rukowicz) Date: Sun, 20 Aug 2006 02:50:35 +0200 (CEST) Subject: [Python-checkins] r51414 - sandbox/trunk/decimal-c/_decimal.c Message-ID: <20060820005035.7D31F1E4009@bag.python.org> Author: mateusz.rukowicz Date: Sun Aug 20 02:50:34 2006 New Revision: 51414 Modified: sandbox/trunk/decimal-c/_decimal.c Log: Now decimal compiles under Visual Studio, and passes all tests under windows. Modified: sandbox/trunk/decimal-c/_decimal.c ============================================================================== --- sandbox/trunk/decimal-c/_decimal.c (original) +++ sandbox/trunk/decimal-c/_decimal.c Sun Aug 20 02:50:34 2006 @@ -104,8 +104,8 @@ static void _limb_move_left(long *self, long limbs, long count) { - assert(count >= 0); long i; + assert(count >= 0); for (i = limbs - 1; i - count >= 0; i--) self[i] = self[i-count]; @@ -124,6 +124,8 @@ long new_mult = 1; long last_digit = 0; /* digit from start_pos -1 */ long i; + long diff; + long actual_limb; for (i = 0; i < new_digits; i += LOG) new[i/LOG] = 0; @@ -147,7 +149,7 @@ pos ++; } - long diff = start_pos; + diff = start_pos; while (diff < 0) /* put 0s to new */ { new[new_limb] = 0; @@ -161,16 +163,17 @@ } /* now we will just copy from self to digit */ - long actual_limb = self[self_limb]; + actual_limb = self[self_limb]; actual_limb /= self_mult; /* while don't go out of self and new */ while (pos < ndigits && pos - start_pos < new_digits) { + long x; if (self_mult == 1) actual_limb = self[self_limb]; - long x = actual_limb % 10; + x = actual_limb % 10; new[new_limb] += x * new_mult; new_mult *= 10; if (new_mult == BASE) @@ -215,13 +218,14 @@ long full_limb = 0; long mult = 1; long i; + long limbs; while(mult != BASE) { full_limb += x * mult; mult *= 10; } - long limbs = ndigits / LOG; + limbs = ndigits / LOG; for(i = 0;i= ndigits || i < 0) - return 0; long pos = ndigits - i - 1; long limb = pos / LOG; + long tmp; /* = self[limb]; */ pos %= LOG; - long tmp = self[limb]; - while(pos) - { + if (i >= ndigits || i < 0) + return 0; + + tmp = self[limb]; + while (pos) { tmp/=10; pos --; } @@ -261,8 +266,9 @@ { long limbs = (size + LOG -1)/ LOG; long slimbs; + long size_at_most; slimbs = _limb_size(self, limbs); - long size_at_most = slimbs * LOG; + size_at_most = slimbs * LOG; while(_limb_get_digit(self, size_at_most, 0) == 0 && size_at_most > 1) size_at_most --; @@ -349,6 +355,8 @@ long blimbs = (bsize + LOG -1)/LOG; long slimbs = (ssize + LOG -1)/LOG; long i; + long left_limbs; + long left_digits; for(i=0;iob_type, res); } -DECIMAL_BINARY_FUNC(comparetotal); +DECIMAL_BINARY_FUNC(comparetotal) static PyMethodDef decimal_methods[] = { {"comparetotal", (PyCFunction)decimal_comparetotal, @@ -5301,12 +5317,14 @@ _do_decimal_add(decimalobject *self, decimalobject *other, contextobject *ctx) { - assert(PyDecimal_Check(other)); - assert(PyDecimal_Check(self)); int shouldround, sign, negativezero = 0; exp_t exp, oexp; long prec,cmp; decimalobject *res, *res2, *ret, *o1, *o2; + decimalobject *tmp, *oother; + long numdigits; + assert(PyDecimal_Check(other)); + assert(PyDecimal_Check(self)); prec = ctx->prec; if (ISSPECIAL(self) || ISSPECIAL(other)) { @@ -5376,19 +5394,15 @@ } } - decimalobject *tmp; /* we borrow refference */ - decimalobject *oother; - long numdigits = exp_to_i(exp_sub(self->exp, other->exp)); + numdigits = exp_to_i(exp_sub(self->exp, other->exp)); - if(numdigits < 0) - { + if (numdigits < 0) { numdigits *= -1; tmp = other; oother = self; } - else - { + else { tmp = self; oother = other; } @@ -5708,6 +5722,7 @@ contextobject *ctx) { decimalobject *ret; + PyObject *seq; if (ISSPECIAL(self) || ISSPECIAL(other)) { decimalobject *nan; if (_check_nans(self, other, ctx, &nan)) @@ -5717,7 +5732,7 @@ if (decimal_nonzero(self) && !decimal_nonzero(other)) { return handle_InvalidOperation(self->ob_type, ctx, "x % 0", NULL); } - PyObject *seq = _do_decimal__divide(self, other, 3, ctx); + seq = _do_decimal__divide(self, other, 3, ctx); if (!seq) return NULL; @@ -5795,12 +5810,13 @@ { contextobject *ctx2; decimalobject *one; + PyObject *flags; ctx2 = context_copy(ctx); if (!ctx2) return NULL; - PyObject *flags = context_ignore_all_flags(ctx2); + flags = context_ignore_all_flags(ctx2); if (!flags){ Py_DECREF(ctx2); return NULL; @@ -5942,10 +5958,10 @@ /* non-integer case */ /* we calculate it using exp(ln(self) * other) */ if (use_exp) { - if (!check_ctx(self, ctx)) - return handle_InvalidContext(self->ob_type, ctx, NULL); decimalobject *tmp; contextobject *ctx2; + if (!check_ctx(self, ctx)) + return handle_InvalidContext(self->ob_type, ctx, NULL); ctx2 = context_shallow_copy(ctx); if (!ctx2) return NULL; @@ -6497,6 +6513,8 @@ decimalobject *new; long size = 0, i; char *start = NULL, *p; + long mult; + long limb; if (len < 3) return NULL; @@ -6548,8 +6566,8 @@ for(i=0;ilimb_count;i++) new->limbs[i] = 0; - long mult = 1; - long limb = 0; + mult = 1; + limb = 0; for(i = size -1; i>=0; i--) { assert(limb < new->limb_count); @@ -6578,11 +6596,24 @@ _decimal_fromliteralinfinity(PyTypeObject *type, char *str) { decimalobject *new; + long i; char **p = infinities; char sign = 0; + char *str2; + + str2 = (char*)malloc(strlen(str) + 1); + if (!str2) { + PyErr_NoMemory(); + return NULL; + } + + for (i = 0 ; i < strlen(str) ; i++) { + str2[i] = tolower(str[i]); + } + str2[strlen(str)] = '\0'; do { - if (strcasecmp(str, *p) == 0) { - if (str[0] == '-') + if (strcmp(str2, *p) == 0) { + if (str2[0] == '-') sign = SIGN_NEGINF; else sign = SIGN_POSINF; @@ -6594,8 +6625,10 @@ if (!new) return NULL; new->limbs[0] = 0; + free(str2); return new; } + free(str2); return NULL; } @@ -6616,6 +6649,7 @@ int any_digit = 0; char *c; long i; + long mult, limb; decimalobject *new; if(!len) @@ -6727,8 +6761,8 @@ return new; } - long mult = 1; /* now we just read integer till '\0' or 'e'/'E', dont care about '.' */ - long limb = 0; + mult = 1; /* now we just read integer till '\0' or 'e'/'E', dont care about '.' */ + limb = 0; for(c = last_digit; c >= first_digit; c--) { @@ -6831,6 +6865,7 @@ PyObject *tup, *digits, *digtup = NULL, *item; int sign; long i; + long mult, limb; exp_t exp; PyObject *tmp_exp; @@ -6868,13 +6903,14 @@ for(i = 0;i < new->limb_count;i++) new->limbs[i] = 0; - long mult = 1; - long limb = 0; + mult = 1; + limb = 0; new->limbs[0] = 0; for(i = new->ob_size-1; i>=0; i--) /* limb[0] keeps least significant limb */ { - item = PyTuple_GET_ITEM(digtup, i); long x; + item = PyTuple_GET_ITEM(digtup, i); + if(PyInt_Check(item)) x = PyInt_AsLong(item); else if (PyLong_Check(item)) { @@ -7008,11 +7044,12 @@ /* try buffer interface (e.g. strings and unicode) */ if (PyObject_AsCharBuffer(value, (const char **)&buffer, &buf_len) == 0) { + PyObject *res; if (buf_len > LONG_MAX) { PyErr_NoMemory(); return NULL; } - PyObject *res = (PyObject *)decimal_from_string(type, buffer, buf_len, ctx); + res = (PyObject *)decimal_from_string(type, buffer, buf_len, ctx); return res; } @@ -7554,9 +7591,9 @@ CONTEXT_UNARY_FUNC(sqrt, sqrt) CONTEXT_UNARY_FUNC(to_eng_string, to_eng_string) CONTEXT_UNARY_FUNC(exp, exp) -CONTEXT_UNARY_FUNC(ln, ln); -CONTEXT_UNARY_FUNC(log10, log10); -CONTEXT_BINARY_FUNC(comparetotal, comparetotal); +CONTEXT_UNARY_FUNC(ln, ln) +CONTEXT_UNARY_FUNC(log10, log10) +CONTEXT_BINARY_FUNC(comparetotal, comparetotal) /* Unfortunately, the following methods are non-standard and can't @@ -7567,6 +7604,8 @@ { static char *kwlist[] = {"a", 0}; decimalobject *a; + decimalobject *tmp; + PyObject *ret; if(!PyArg_ParseTupleAndKeywords(args, kwds, "O:_apply", kwlist, &a)) return NULL; @@ -7577,11 +7616,11 @@ return NULL; } - decimalobject *tmp = _decimal_fix(a, self); + tmp = _decimal_fix(a, self); if(!tmp) return NULL; - PyObject *ret = decimal_str(tmp); + ret = decimal_str(tmp); Py_DECREF(tmp); return ret; From python-checkins at python.org Sun Aug 20 15:15:40 2006 From: python-checkins at python.org (georg.brandl) Date: Sun, 20 Aug 2006 15:15:40 +0200 (CEST) Subject: [Python-checkins] r51416 - in python/trunk: Lib/test/test_urllib2.py Lib/urllib2.py Misc/NEWS Message-ID: <20060820131540.2B73B1E4002@bag.python.org> Author: georg.brandl Date: Sun Aug 20 15:15:39 2006 New Revision: 51416 Modified: python/trunk/Lib/test/test_urllib2.py python/trunk/Lib/urllib2.py python/trunk/Misc/NEWS Log: Patch #1542948: fix urllib2 header casing issue. With new test. Modified: python/trunk/Lib/test/test_urllib2.py ============================================================================== --- python/trunk/Lib/test/test_urllib2.py (original) +++ python/trunk/Lib/test/test_urllib2.py Sun Aug 20 15:15:39 2006 @@ -46,6 +46,69 @@ self.assertEquals(urllib2.parse_http_list(string), list) +def test_request_headers_dict(): + """ + The Request.headers dictionary is not a documented interface. It should + stay that way, because the complete set of headers are only accessible + through the .get_header(), .has_header(), .header_items() interface. + However, .headers pre-dates those methods, and so real code will be using + the dictionary. + + The introduction in 2.4 of those methods was a mistake for the same reason: + code that previously saw all (urllib2 user)-provided headers in .headers + now sees only a subset (and the function interface is ugly and incomplete). + A better change would have been to replace .headers dict with a dict + subclass (or UserDict.DictMixin instance?) that preserved the .headers + interface and also provided access to the "unredirected" headers. It's + probably too late to fix that, though. + + + Check .capitalize() case normalization: + + >>> url = "http://example.com" + >>> Request(url, headers={"Spam-eggs": "blah"}).headers["Spam-eggs"] + 'blah' + >>> Request(url, headers={"spam-EggS": "blah"}).headers["Spam-eggs"] + 'blah' + + Currently, Request(url, "Spam-eggs").headers["Spam-Eggs"] raises KeyError, + but that could be changed in future. + + """ + +def test_request_headers_methods(): + """ + Note the case normalization of header names here, to .capitalize()-case. + This should be preserved for backwards-compatibility. (In the HTTP case, + normalization to .title()-case is done by urllib2 before sending headers to + httplib). + + >>> url = "http://example.com" + >>> r = Request(url, headers={"Spam-eggs": "blah"}) + >>> r.has_header("Spam-eggs") + True + >>> r.header_items() + [('Spam-eggs', 'blah')] + >>> r.add_header("Foo-Bar", "baz") + >>> items = r.header_items() + >>> items.sort() + >>> items + [('Foo-bar', 'baz'), ('Spam-eggs', 'blah')] + + Note that e.g. r.has_header("spam-EggS") is currently False, and + r.get_header("spam-EggS") returns None, but that could be changed in + future. + + >>> r.has_header("Not-there") + False + >>> print r.get_header("Not-there") + None + >>> r.get_header("Not-there", "default") + 'default' + + """ + + def test_password_manager(self): """ >>> mgr = urllib2.HTTPPasswordMgr() @@ -676,11 +739,11 @@ r = MockResponse(200, "OK", {}, "") newreq = h.do_request_(req) if data is None: # GET - self.assert_("Content-Length" not in req.unredirected_hdrs) - self.assert_("Content-Type" not in req.unredirected_hdrs) + self.assert_("Content-length" not in req.unredirected_hdrs) + self.assert_("Content-type" not in req.unredirected_hdrs) else: # POST - self.assertEqual(req.unredirected_hdrs["Content-Length"], "0") - self.assertEqual(req.unredirected_hdrs["Content-Type"], + self.assertEqual(req.unredirected_hdrs["Content-length"], "0") + self.assertEqual(req.unredirected_hdrs["Content-type"], "application/x-www-form-urlencoded") # XXX the details of Host could be better tested self.assertEqual(req.unredirected_hdrs["Host"], "example.com") @@ -692,8 +755,8 @@ req.add_unredirected_header("Host", "baz") req.add_unredirected_header("Spam", "foo") newreq = h.do_request_(req) - self.assertEqual(req.unredirected_hdrs["Content-Length"], "foo") - self.assertEqual(req.unredirected_hdrs["Content-Type"], "bar") + self.assertEqual(req.unredirected_hdrs["Content-length"], "foo") + self.assertEqual(req.unredirected_hdrs["Content-type"], "bar") self.assertEqual(req.unredirected_hdrs["Host"], "baz") self.assertEqual(req.unredirected_hdrs["Spam"], "foo") @@ -847,7 +910,7 @@ 407, 'Proxy-Authenticate: Basic realm="%s"\r\n\r\n' % realm) opener.add_handler(auth_handler) opener.add_handler(http_handler) - self._test_basic_auth(opener, auth_handler, "Proxy-Authorization", + self._test_basic_auth(opener, auth_handler, "Proxy-authorization", realm, http_handler, password_manager, "http://acme.example.com:3128/protected", "proxy.example.com:3128", Modified: python/trunk/Lib/urllib2.py ============================================================================== --- python/trunk/Lib/urllib2.py (original) +++ python/trunk/Lib/urllib2.py Sun Aug 20 15:15:39 2006 @@ -263,11 +263,11 @@ def add_header(self, key, val): # useful for something like authentication - self.headers[key.title()] = val + self.headers[key.capitalize()] = val def add_unredirected_header(self, key, val): # will not be added to a redirected request - self.unredirected_hdrs[key.title()] = val + self.unredirected_hdrs[key.capitalize()] = val def has_header(self, header_name): return (header_name in self.headers or @@ -286,7 +286,7 @@ class OpenerDirector: def __init__(self): client_version = "Python-urllib/%s" % __version__ - self.addheaders = [('User-Agent', client_version)] + self.addheaders = [('User-agent', client_version)] # manage the individual handlers self.handlers = [] self.handle_open = {} @@ -675,7 +675,7 @@ if user and password: user_pass = '%s:%s' % (unquote(user), unquote(password)) creds = base64.encodestring(user_pass).strip() - req.add_header('Proxy-Authorization', 'Basic ' + creds) + req.add_header('Proxy-authorization', 'Basic ' + creds) hostport = unquote(hostport) req.set_proxy(hostport, proxy_type) if orig_type == proxy_type: @@ -819,7 +819,7 @@ class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): - auth_header = 'Proxy-Authorization' + auth_header = 'Proxy-authorization' def http_error_407(self, req, fp, code, msg, headers): # http_error_auth_reqed requires that there is no userinfo component in @@ -1022,20 +1022,20 @@ if request.has_data(): # POST data = request.get_data() - if not request.has_header('Content-Type'): + if not request.has_header('Content-type'): request.add_unredirected_header( - 'Content-Type', + 'Content-type', 'application/x-www-form-urlencoded') - if not request.has_header('Content-Length'): + if not request.has_header('Content-length'): request.add_unredirected_header( - 'Content-Length', '%d' % len(data)) + 'Content-length', '%d' % len(data)) scheme, sel = splittype(request.get_selector()) sel_host, sel_path = splithost(sel) if not request.has_header('Host'): request.add_unredirected_header('Host', sel_host or host) for name, value in self.parent.addheaders: - name = name.title() + name = name.capitalize() if not request.has_header(name): request.add_unredirected_header(name, value) @@ -1067,6 +1067,8 @@ # So make sure the connection gets closed after the (only) # request. headers["Connection"] = "close" + headers = dict( + (name.title(), val) for name, val in headers.items()) try: h.request(req.get_method(), req.get_selector(), req.data, headers) r = h.getresponse() @@ -1217,7 +1219,7 @@ modified = email.Utils.formatdate(stats.st_mtime, usegmt=True) mtype = mimetypes.guess_type(file)[0] headers = mimetools.Message(StringIO( - 'Content-Type: %s\nContent-Length: %d\nLast-Modified: %s\n' % + 'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' % (mtype or 'text/plain', size, modified))) if host: host, port = splitport(host) @@ -1272,9 +1274,9 @@ headers = "" mtype = mimetypes.guess_type(req.get_full_url())[0] if mtype: - headers += "Content-Type: %s\n" % mtype + headers += "Content-type: %s\n" % mtype if retrlen is not None and retrlen >= 0: - headers += "Content-Length: %d\n" % retrlen + headers += "Content-length: %d\n" % retrlen sf = StringIO(headers) headers = mimetools.Message(sf) return addinfourl(fp, headers, req.get_full_url()) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun Aug 20 15:15:39 2006 @@ -304,8 +304,8 @@ - Bug #978833: Really close underlying socket in _socketobject.close. -- Bug #1459963: urllib and urllib2 now normalize HTTP header names correctly - with title(). +- Bug #1459963: urllib and urllib2 now normalize HTTP header names with + title(). - Patch #1525766: In pkgutil.walk_packages, correctly pass the onerror callback to recursive calls and call it with the failing package name. From python-checkins at python.org Sun Aug 20 15:15:44 2006 From: python-checkins at python.org (georg.brandl) Date: Sun, 20 Aug 2006 15:15:44 +0200 (CEST) Subject: [Python-checkins] r51417 - in python/branches/release25-maint: Lib/test/test_urllib2.py Lib/urllib2.py Misc/NEWS Message-ID: <20060820131544.630F41E4002@bag.python.org> Author: georg.brandl Date: Sun Aug 20 15:15:43 2006 New Revision: 51417 Modified: python/branches/release25-maint/Lib/test/test_urllib2.py python/branches/release25-maint/Lib/urllib2.py python/branches/release25-maint/Misc/NEWS Log: Patch #1542948: fix urllib2 header casing issue. With new test. (backport from rev. 51416) Modified: python/branches/release25-maint/Lib/test/test_urllib2.py ============================================================================== --- python/branches/release25-maint/Lib/test/test_urllib2.py (original) +++ python/branches/release25-maint/Lib/test/test_urllib2.py Sun Aug 20 15:15:43 2006 @@ -46,6 +46,69 @@ self.assertEquals(urllib2.parse_http_list(string), list) +def test_request_headers_dict(): + """ + The Request.headers dictionary is not a documented interface. It should + stay that way, because the complete set of headers are only accessible + through the .get_header(), .has_header(), .header_items() interface. + However, .headers pre-dates those methods, and so real code will be using + the dictionary. + + The introduction in 2.4 of those methods was a mistake for the same reason: + code that previously saw all (urllib2 user)-provided headers in .headers + now sees only a subset (and the function interface is ugly and incomplete). + A better change would have been to replace .headers dict with a dict + subclass (or UserDict.DictMixin instance?) that preserved the .headers + interface and also provided access to the "unredirected" headers. It's + probably too late to fix that, though. + + + Check .capitalize() case normalization: + + >>> url = "http://example.com" + >>> Request(url, headers={"Spam-eggs": "blah"}).headers["Spam-eggs"] + 'blah' + >>> Request(url, headers={"spam-EggS": "blah"}).headers["Spam-eggs"] + 'blah' + + Currently, Request(url, "Spam-eggs").headers["Spam-Eggs"] raises KeyError, + but that could be changed in future. + + """ + +def test_request_headers_methods(): + """ + Note the case normalization of header names here, to .capitalize()-case. + This should be preserved for backwards-compatibility. (In the HTTP case, + normalization to .title()-case is done by urllib2 before sending headers to + httplib). + + >>> url = "http://example.com" + >>> r = Request(url, headers={"Spam-eggs": "blah"}) + >>> r.has_header("Spam-eggs") + True + >>> r.header_items() + [('Spam-eggs', 'blah')] + >>> r.add_header("Foo-Bar", "baz") + >>> items = r.header_items() + >>> items.sort() + >>> items + [('Foo-bar', 'baz'), ('Spam-eggs', 'blah')] + + Note that e.g. r.has_header("spam-EggS") is currently False, and + r.get_header("spam-EggS") returns None, but that could be changed in + future. + + >>> r.has_header("Not-there") + False + >>> print r.get_header("Not-there") + None + >>> r.get_header("Not-there", "default") + 'default' + + """ + + def test_password_manager(self): """ >>> mgr = urllib2.HTTPPasswordMgr() @@ -676,11 +739,11 @@ r = MockResponse(200, "OK", {}, "") newreq = h.do_request_(req) if data is None: # GET - self.assert_("Content-Length" not in req.unredirected_hdrs) - self.assert_("Content-Type" not in req.unredirected_hdrs) + self.assert_("Content-length" not in req.unredirected_hdrs) + self.assert_("Content-type" not in req.unredirected_hdrs) else: # POST - self.assertEqual(req.unredirected_hdrs["Content-Length"], "0") - self.assertEqual(req.unredirected_hdrs["Content-Type"], + self.assertEqual(req.unredirected_hdrs["Content-length"], "0") + self.assertEqual(req.unredirected_hdrs["Content-type"], "application/x-www-form-urlencoded") # XXX the details of Host could be better tested self.assertEqual(req.unredirected_hdrs["Host"], "example.com") @@ -692,8 +755,8 @@ req.add_unredirected_header("Host", "baz") req.add_unredirected_header("Spam", "foo") newreq = h.do_request_(req) - self.assertEqual(req.unredirected_hdrs["Content-Length"], "foo") - self.assertEqual(req.unredirected_hdrs["Content-Type"], "bar") + self.assertEqual(req.unredirected_hdrs["Content-length"], "foo") + self.assertEqual(req.unredirected_hdrs["Content-type"], "bar") self.assertEqual(req.unredirected_hdrs["Host"], "baz") self.assertEqual(req.unredirected_hdrs["Spam"], "foo") @@ -847,7 +910,7 @@ 407, 'Proxy-Authenticate: Basic realm="%s"\r\n\r\n' % realm) opener.add_handler(auth_handler) opener.add_handler(http_handler) - self._test_basic_auth(opener, auth_handler, "Proxy-Authorization", + self._test_basic_auth(opener, auth_handler, "Proxy-authorization", realm, http_handler, password_manager, "http://acme.example.com:3128/protected", "proxy.example.com:3128", Modified: python/branches/release25-maint/Lib/urllib2.py ============================================================================== --- python/branches/release25-maint/Lib/urllib2.py (original) +++ python/branches/release25-maint/Lib/urllib2.py Sun Aug 20 15:15:43 2006 @@ -263,11 +263,11 @@ def add_header(self, key, val): # useful for something like authentication - self.headers[key.title()] = val + self.headers[key.capitalize()] = val def add_unredirected_header(self, key, val): # will not be added to a redirected request - self.unredirected_hdrs[key.title()] = val + self.unredirected_hdrs[key.capitalize()] = val def has_header(self, header_name): return (header_name in self.headers or @@ -286,7 +286,7 @@ class OpenerDirector: def __init__(self): client_version = "Python-urllib/%s" % __version__ - self.addheaders = [('User-Agent', client_version)] + self.addheaders = [('User-agent', client_version)] # manage the individual handlers self.handlers = [] self.handle_open = {} @@ -675,7 +675,7 @@ if user and password: user_pass = '%s:%s' % (unquote(user), unquote(password)) creds = base64.encodestring(user_pass).strip() - req.add_header('Proxy-Authorization', 'Basic ' + creds) + req.add_header('Proxy-authorization', 'Basic ' + creds) hostport = unquote(hostport) req.set_proxy(hostport, proxy_type) if orig_type == proxy_type: @@ -819,7 +819,7 @@ class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): - auth_header = 'Proxy-Authorization' + auth_header = 'Proxy-authorization' def http_error_407(self, req, fp, code, msg, headers): # http_error_auth_reqed requires that there is no userinfo component in @@ -1022,20 +1022,20 @@ if request.has_data(): # POST data = request.get_data() - if not request.has_header('Content-Type'): + if not request.has_header('Content-type'): request.add_unredirected_header( - 'Content-Type', + 'Content-type', 'application/x-www-form-urlencoded') - if not request.has_header('Content-Length'): + if not request.has_header('Content-length'): request.add_unredirected_header( - 'Content-Length', '%d' % len(data)) + 'Content-length', '%d' % len(data)) scheme, sel = splittype(request.get_selector()) sel_host, sel_path = splithost(sel) if not request.has_header('Host'): request.add_unredirected_header('Host', sel_host or host) for name, value in self.parent.addheaders: - name = name.title() + name = name.capitalize() if not request.has_header(name): request.add_unredirected_header(name, value) @@ -1067,6 +1067,8 @@ # So make sure the connection gets closed after the (only) # request. headers["Connection"] = "close" + headers = dict( + (name.title(), val) for name, val in headers.items()) try: h.request(req.get_method(), req.get_selector(), req.data, headers) r = h.getresponse() @@ -1217,7 +1219,7 @@ modified = email.Utils.formatdate(stats.st_mtime, usegmt=True) mtype = mimetypes.guess_type(file)[0] headers = mimetools.Message(StringIO( - 'Content-Type: %s\nContent-Length: %d\nLast-Modified: %s\n' % + 'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' % (mtype or 'text/plain', size, modified))) if host: host, port = splitport(host) @@ -1272,9 +1274,9 @@ headers = "" mtype = mimetypes.guess_type(req.get_full_url())[0] if mtype: - headers += "Content-Type: %s\n" % mtype + headers += "Content-type: %s\n" % mtype if retrlen is not None and retrlen >= 0: - headers += "Content-Length: %d\n" % retrlen + headers += "Content-length: %d\n" % retrlen sf = StringIO(headers) headers = mimetools.Message(sf) return addinfourl(fp, headers, req.get_full_url()) Modified: python/branches/release25-maint/Misc/NEWS ============================================================================== --- python/branches/release25-maint/Misc/NEWS (original) +++ python/branches/release25-maint/Misc/NEWS Sun Aug 20 15:15:43 2006 @@ -290,8 +290,8 @@ - Bug #978833: Really close underlying socket in _socketobject.close. -- Bug #1459963: urllib and urllib2 now normalize HTTP header names correctly - with title(). +- Bug #1459963: urllib and urllib2 now normalize HTTP header names with + title(). - Patch #1525766: In pkgutil.walk_packages, correctly pass the onerror callback to recursive calls and call it with the failing package name. From python-checkins at python.org Mon Aug 21 17:49:33 2006 From: python-checkins at python.org (matt.fleming) Date: Mon, 21 Aug 2006 17:49:33 +0200 (CEST) Subject: [Python-checkins] r51427 - sandbox/trunk/pdb/patches sandbox/trunk/pdb/patches/01-08-06-pydb.diff sandbox/trunk/pdb/patches/01-08-06-pydb.diff2 sandbox/trunk/pdb/patches/01-08-06-sighandler.cmd sandbox/trunk/pdb/patches/01-08-06-sighandler.right sandbox/trunk/pdb/patches/04-07-06-patch.diff sandbox/trunk/pdb/patches/06-08-06-pydb.diff sandbox/trunk/pdb/patches/06-08-06-sighandler.cmd sandbox/trunk/pdb/patches/06-08-06-sighandler.right sandbox/trunk/pdb/patches/10-07-06-opts.diff sandbox/trunk/pdb/patches/11-08-06-pydb.diff sandbox/trunk/pdb/patches/11-08-06-sigtest.py.in sandbox/trunk/pdb/patches/11-08-06-sigtestexample.py sandbox/trunk/pdb/patches/20-08-06-threaddbg.patch sandbox/trunk/pdb/patches/24-07-06-pydb.diff sandbox/trunk/pdb/patches/24-07-06-pydb2.diff sandbox/trunk/pdb/patches/27-07-06-pydb.diff sandbox/trunk/pdb/patches/27-07-06-sighandler.py sandbox/trunk/pdb/patches/30-05-06-pdb.py sandbox/trunk/pdb/patches/31-07-06-fns.diff sandbox/trunk/pdb/patches/31-07-06-pydb.diff sandbox/trunk/pdb/patches/31-07-06-sig.diff sandbox/trunk/pdb/patches/31-07-06-sighandler.cmd sandbox/trunk/pdb/patches/31-07-06-sighandler.py sandbox/trunk/pdb/patches/31-07-06-sighandler.right sandbox/trunk/pdb/patches/31-07-06-test.py Message-ID: <20060821154933.BBE4F1E4009@bag.python.org> Author: matt.fleming Date: Mon Aug 21 17:49:31 2006 New Revision: 51427 Added: sandbox/trunk/pdb/patches/ sandbox/trunk/pdb/patches/01-08-06-pydb.diff sandbox/trunk/pdb/patches/01-08-06-pydb.diff2 sandbox/trunk/pdb/patches/01-08-06-sighandler.cmd sandbox/trunk/pdb/patches/01-08-06-sighandler.right sandbox/trunk/pdb/patches/04-07-06-patch.diff sandbox/trunk/pdb/patches/06-08-06-pydb.diff sandbox/trunk/pdb/patches/06-08-06-sighandler.cmd sandbox/trunk/pdb/patches/06-08-06-sighandler.right sandbox/trunk/pdb/patches/10-07-06-opts.diff sandbox/trunk/pdb/patches/11-08-06-pydb.diff sandbox/trunk/pdb/patches/11-08-06-sigtest.py.in sandbox/trunk/pdb/patches/11-08-06-sigtestexample.py sandbox/trunk/pdb/patches/20-08-06-threaddbg.patch sandbox/trunk/pdb/patches/24-07-06-pydb.diff sandbox/trunk/pdb/patches/24-07-06-pydb2.diff sandbox/trunk/pdb/patches/27-07-06-pydb.diff sandbox/trunk/pdb/patches/27-07-06-sighandler.py sandbox/trunk/pdb/patches/30-05-06-pdb.py sandbox/trunk/pdb/patches/31-07-06-fns.diff sandbox/trunk/pdb/patches/31-07-06-pydb.diff sandbox/trunk/pdb/patches/31-07-06-sig.diff sandbox/trunk/pdb/patches/31-07-06-sighandler.cmd sandbox/trunk/pdb/patches/31-07-06-sighandler.py sandbox/trunk/pdb/patches/31-07-06-sighandler.right sandbox/trunk/pdb/patches/31-07-06-test.py Log: Add the patches that I've produced over the summer, both for pydb and my mpdb code, just so the Google Gods can see all the stuff I've worked on for this project. Added: sandbox/trunk/pdb/patches/01-08-06-pydb.diff ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/01-08-06-pydb.diff Mon Aug 21 17:49:31 2006 @@ -0,0 +1,237 @@ +? t.py +? thread_script2.py +? tpdb.py +? tpdb2.py +? test/sighandler.cmd +? test/sighandler.right +Index: pydb/sighandler.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/sighandler.py,v +retrieving revision 1.4 +diff -u -r1.4 sighandler.py +--- pydb/sighandler.py 1 Aug 2006 15:10:04 -0000 1.4 ++++ pydb/sighandler.py 1 Aug 2006 16:53:53 -0000 +@@ -32,62 +32,24 @@ + """ + def __init__(self, pydb): + self.pydb = pydb +- # This list contains tuples made up of four items, one tuple for +- # every signal handler we've created. The tuples contain +- # (signal_num, stop, print, pass) +- self._sig_attr = [] +- self._sig_stop = [] +- self._sig_print = [] +- self._sig_pass = [] +- +- for sig in signal.__dict__.keys(): +- if sig.startswith('SIG') and '_' not in sig: +- self._sig_attr.append(sig) ++ self._sigs = {} + + # set up signal handling for some known signals +- # SIGKILL is non-maskable. Should we *really* include it here? +- fatal = ['SIGINT', 'SIGTRAP', 'SIGTERM', 'SIGQUIT', 'SIGILL', \ +- 'SIGKILL', 'SIGSTOP'] ++ fatal = ['SIGKILL', 'SIGSTOP'] + ignore= ['SIGALRM', 'SIGCHLD', 'SIGURG', 'SIGIO', 'SIGVTALRM' + 'SIGPROF', 'SIGWINCH', 'SIGPOLL', 'SIGWAITING', 'SIGLWP', +- 'SIGCANCEL'] +- for sig in self._sig_attr: +- if str(sig) not in fatal: +- num = lookup_signum(sig) +- if num: +- if str(sig) in ignore: +- self._set_sig(sig, (False, False, True)) +- else: +- self._set_sig(sig, (True, True, True)) +- signal.signal(num, self.handle) +- else: +- self._set_sig(sig, (False, False, True)) +- +- def _get_sig(self, name): +- st = name in self._sig_stop +- pr = name in self._sig_print +- pa = name in self._sig_pass +- return (st, pr, pa) +- +- def _set_sig(self, name, (st, pr, pa)): +- """Set the actions to be taken when a signal, specified by +- 'name', is received. +- """ +- if st: +- if name not in self._sig_stop: +- self._sig_stop.append(name) +- elif name in self._sig_stop: +- self._sig_stop.pop(self._sig_stop.index(name)) +- if pr: +- if name not in self._sig_print: +- self._sig_print.append(name) +- elif name in self._sig_print: +- self._sig_print.pop(self._sig_print.index(name)) +- if pa: +- if name not in self._sig_pass: +- self._sig_pass.append(name) +- elif name in self._sig_pass: +- self._sig_pass.pop(self._sig_pass.index(name)) ++ 'SIGCANCEL', 'SIGTRAP', 'SIGTERM', 'SIGQUIT', 'SIGILL', \ ++ 'SIGINT'] ++ for sig in signal.__dict__.keys(): ++ if sig.startswith('SIG') and '_' not in sig: ++ if str(sig) not in fatal: ++ num = lookup_signum(sig) ++ if num: ++ if str(sig) in ignore: ++ self._sigs[sig] = (False, False, True) ++ else: ++ self._sigs[sig] = (True, True, True) ++ signal.signal(num, self.handle) + + def info_signal(self, signame): + """Print information about a signal""" +@@ -98,18 +60,14 @@ + # This has come from pydb's info command + if len(signame) == 1: + self.pydb.msg(header) +- for sig in self._sig_attr: +- s = sig in self._sig_stop +- pr = sig in self._sig_print +- pa = sig in self._sig_pass +- self.pydb.msg(fmt % (sig,s,pr,pa)) ++ for sig in self._sigs.keys(): ++ st, pr, pa = self._sigs[sig] ++ self.pydb.msg(fmt % (sig, st, pr, pa)) + else: + self.info_signal(signame[1]) + return + +- s = signame in self._sig_stop +- pr = signame in self._sig_print +- pa = signame in self._sig_pass ++ s, pr, pa = self._sigs[signame] + self.pydb.msg(header) + self.pydb.msg(fmt % (signame, s, pr, pa)) + +@@ -121,74 +79,77 @@ + self.info_signal(['handle']) + return + args = arg.split() +- if args[0] in self._sig_attr: +- if len(args) == 1: +- self.info_signal(args[0]) +- return +- # multiple commands might be specified, i.e. 'nopass nostop' +- for attr in args[1:]: +- if attr.startswith('no'): +- on = False +- attr = attr[2:] +- else: +- on = True +- if attr.startswith('stop'): +- self.handle_stop(args[0], on) +- elif attr.startswith('print'): +- self.handle_print(args[0], on) +- elif attr.startswith('pass'): +- self.handle_pass(args[0], on) +- else: +- self.pydb.errmsg('Invalid arguments') ++ try: ++ self._sigs[args[0]] ++ except KeyError: ++ return ++ if len(args) == 1: ++ self.info_signal(args[0]) ++ return ++ # multiple commands might be specified, i.e. 'nopass nostop' ++ for attr in args[1:]: ++ if attr.startswith('no'): ++ on = False ++ attr = attr[2:] ++ else: ++ on = True ++ if attr.startswith('stop'): ++ self.handle_stop(args[0], on) ++ elif attr.startswith('print'): ++ self.handle_print(args[0], on) ++ elif attr.startswith('pass'): ++ self.handle_pass(args[0], on) ++ else: ++ self.pydb.errmsg('Invalid arguments') + +- def handle_stop(self, signum, change): ++ def handle_stop(self, signame, change): + """Change whether we stop or not when this signal is caught. + If 'change' is True your program will stop when this signal + happens.""" + if not isinstance(change, bool): + return +- old_attr = self._get_sig(signum) ++ old_attr = self._sigs[signame] + st, pr, pa = change, old_attr[1], old_attr[2] + if st: + pr = True +- self._set_sig(signum, (st, pr, pa)) ++ self._sigs[signame] = (st, pr, pa) + return change + +- def handle_pass(self, signum, change): ++ def handle_pass(self, signame, change): + """Change whether we pass this signal to the program (or not) + when this signal is caught. If change is True, Pydb should allow + your program to see this signal. + """ + if not isinstance(change, bool): + return +- old_attr = self._get_sig(signum) ++ old_attr = self._sigs[signame] + st, pr, pa = old_attr[0], old_attr[1], change +- self._set_sig(signum, (st, pr, pa)) ++ self._sigs[signame] = (st, pr, pa) + return change + + # ignore is a synonym for nopass and noignore is a synonym for pass +- def handle_ignore(self, signum, change): ++ def handle_ignore(self, signame, change): + if not isinstance(change, bool): + return + self.handle_pass(not change) + return change + +- def handle_print(self, signum, change): ++ def handle_print(self, signame, change): + """Change whether we print or not when this signal is caught.""" + if not isinstance(change, bool): + return +- old_attr = self._get_sig(signum) ++ old_attr = self._sigs[signame] + st, pr, pa = old_attr[0], change, old_attr[2] + if not change: + # noprint implies nostop + st = False +- self._set_sig(signum, (st, pr, pa)) ++ self._sigs[signame] = (st, pr, pa) + return change + + def handle(self, signum, frame): + """This method is called when a signal is received.""" + sig = lookup_signame(signum) +- st, pa, pr = self._get_sig(sig) ++ st, pa, pr = self._sigs[sig] + if pr: + self.pydb.msg('Program received signal %s' % sig) + if st: +Index: test/Makefile.am +=================================================================== +RCS file: /cvsroot/bashdb/pydb/test/Makefile.am,v +retrieving revision 1.17 +diff -u -r1.17 Makefile.am +--- test/Makefile.am 28 Jul 2006 00:47:47 -0000 1.17 ++++ test/Makefile.am 1 Aug 2006 16:53:53 -0000 +@@ -28,6 +28,8 @@ + run.right \ + run2.cmd \ + run2.right \ ++ sighandler.cmd \ ++ sighandle.right \ + test.py \ + trace-2.5.right \ + trace.py \ Added: sandbox/trunk/pdb/patches/01-08-06-pydb.diff2 ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/01-08-06-pydb.diff2 Mon Aug 21 17:49:31 2006 @@ -0,0 +1,255 @@ +? t.py +? thread_script2.py +? tpdb.py +? tpdb2.py +? test/sighandler.cmd +? test/sighandler.right +Index: pydb/sighandler.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/sighandler.py,v +retrieving revision 1.4 +diff -u -r1.4 sighandler.py +--- pydb/sighandler.py 1 Aug 2006 15:10:04 -0000 1.4 ++++ pydb/sighandler.py 1 Aug 2006 18:08:56 -0000 +@@ -18,6 +18,8 @@ + else: + return None + ++fatal_signals = ['SIGKILL', 'SIGSTOP'] ++ + class SigHandler: + + """Store information about what we do when we handle a signal, +@@ -32,62 +34,27 @@ + """ + def __init__(self, pydb): + self.pydb = pydb +- # This list contains tuples made up of four items, one tuple for +- # every signal handler we've created. The tuples contain +- # (signal_num, stop, print, pass) +- self._sig_attr = [] +- self._sig_stop = [] +- self._sig_print = [] +- self._sig_pass = [] +- +- for sig in signal.__dict__.keys(): +- if sig.startswith('SIG') and '_' not in sig: +- self._sig_attr.append(sig) ++ self._sigs = {} + + # set up signal handling for some known signals +- # SIGKILL is non-maskable. Should we *really* include it here? +- fatal = ['SIGINT', 'SIGTRAP', 'SIGTERM', 'SIGQUIT', 'SIGILL', \ +- 'SIGKILL', 'SIGSTOP'] + ignore= ['SIGALRM', 'SIGCHLD', 'SIGURG', 'SIGIO', 'SIGVTALRM' + 'SIGPROF', 'SIGWINCH', 'SIGPOLL', 'SIGWAITING', 'SIGLWP', +- 'SIGCANCEL'] +- for sig in self._sig_attr: +- if str(sig) not in fatal: +- num = lookup_signum(sig) +- if num: +- if str(sig) in ignore: +- self._set_sig(sig, (False, False, True)) +- else: +- self._set_sig(sig, (True, True, True)) +- signal.signal(num, self.handle) +- else: +- self._set_sig(sig, (False, False, True)) +- +- def _get_sig(self, name): +- st = name in self._sig_stop +- pr = name in self._sig_print +- pa = name in self._sig_pass +- return (st, pr, pa) +- +- def _set_sig(self, name, (st, pr, pa)): +- """Set the actions to be taken when a signal, specified by +- 'name', is received. +- """ +- if st: +- if name not in self._sig_stop: +- self._sig_stop.append(name) +- elif name in self._sig_stop: +- self._sig_stop.pop(self._sig_stop.index(name)) +- if pr: +- if name not in self._sig_print: +- self._sig_print.append(name) +- elif name in self._sig_print: +- self._sig_print.pop(self._sig_print.index(name)) +- if pa: +- if name not in self._sig_pass: +- self._sig_pass.append(name) +- elif name in self._sig_pass: +- self._sig_pass.pop(self._sig_pass.index(name)) ++ 'SIGCANCEL', 'SIGTRAP', 'SIGTERM', 'SIGQUIT', 'SIGILL', \ ++ 'SIGINT'] ++ for sig in signal.__dict__.keys(): ++ if sig.startswith('SIG') and '_' not in sig: ++ if str(sig) not in fatal_signals: ++ num = lookup_signum(sig) ++ if num: ++ if str(sig) in ignore: ++ self._sigs[sig] = (False, False, True) ++ else: ++ self._sigs[sig] = (True, True, True) ++ signal.signal(num, self.handle) ++ else: ++ # Make an entry in the _sig dict for these signals ++ # even though they cannot be ignored or caught. ++ self._sigs[sig] = (False, False, True) + + def info_signal(self, signame): + """Print information about a signal""" +@@ -98,18 +65,14 @@ + # This has come from pydb's info command + if len(signame) == 1: + self.pydb.msg(header) +- for sig in self._sig_attr: +- s = sig in self._sig_stop +- pr = sig in self._sig_print +- pa = sig in self._sig_pass +- self.pydb.msg(fmt % (sig,s,pr,pa)) ++ for sig in self._sigs.keys(): ++ st, pr, pa = self._sigs[sig] ++ self.pydb.msg(fmt % (sig, st, pr, pa)) + else: + self.info_signal(signame[1]) + return + +- s = signame in self._sig_stop +- pr = signame in self._sig_print +- pa = signame in self._sig_pass ++ s, pr, pa = self._sigs[signame] + self.pydb.msg(header) + self.pydb.msg(fmt % (signame, s, pr, pa)) + +@@ -121,74 +84,83 @@ + self.info_signal(['handle']) + return + args = arg.split() +- if args[0] in self._sig_attr: +- if len(args) == 1: +- self.info_signal(args[0]) +- return +- # multiple commands might be specified, i.e. 'nopass nostop' +- for attr in args[1:]: +- if attr.startswith('no'): +- on = False +- attr = attr[2:] +- else: +- on = True +- if attr.startswith('stop'): +- self.handle_stop(args[0], on) +- elif attr.startswith('print'): +- self.handle_print(args[0], on) +- elif attr.startswith('pass'): +- self.handle_pass(args[0], on) +- else: +- self.pydb.errmsg('Invalid arguments') ++ try: ++ self._sigs[args[0]] ++ except KeyError: ++ return ++ if len(args) == 1: ++ self.info_signal(args[0]) ++ return ++ ++ # We can display information about 'fatal' signals, but not ++ # change their actions. ++ if args[0] in fatal_signals: ++ return ++ ++ # multiple commands might be specified, i.e. 'nopass nostop' ++ for attr in args[1:]: ++ if attr.startswith('no'): ++ on = False ++ attr = attr[2:] ++ else: ++ on = True ++ if attr.startswith('stop'): ++ self.handle_stop(args[0], on) ++ elif attr.startswith('print'): ++ self.handle_print(args[0], on) ++ elif attr.startswith('pass'): ++ self.handle_pass(args[0], on) ++ else: ++ self.pydb.errmsg('Invalid arguments') + +- def handle_stop(self, signum, change): ++ def handle_stop(self, signame, change): + """Change whether we stop or not when this signal is caught. + If 'change' is True your program will stop when this signal + happens.""" + if not isinstance(change, bool): + return +- old_attr = self._get_sig(signum) ++ old_attr = self._sigs[signame] + st, pr, pa = change, old_attr[1], old_attr[2] + if st: + pr = True +- self._set_sig(signum, (st, pr, pa)) ++ self._sigs[signame] = (st, pr, pa) + return change + +- def handle_pass(self, signum, change): ++ def handle_pass(self, signame, change): + """Change whether we pass this signal to the program (or not) + when this signal is caught. If change is True, Pydb should allow + your program to see this signal. + """ + if not isinstance(change, bool): + return +- old_attr = self._get_sig(signum) ++ old_attr = self._sigs[signame] + st, pr, pa = old_attr[0], old_attr[1], change +- self._set_sig(signum, (st, pr, pa)) ++ self._sigs[signame] = (st, pr, pa) + return change + + # ignore is a synonym for nopass and noignore is a synonym for pass +- def handle_ignore(self, signum, change): ++ def handle_ignore(self, signame, change): + if not isinstance(change, bool): + return + self.handle_pass(not change) + return change + +- def handle_print(self, signum, change): ++ def handle_print(self, signame, change): + """Change whether we print or not when this signal is caught.""" + if not isinstance(change, bool): + return +- old_attr = self._get_sig(signum) ++ old_attr = self._sigs[signame] + st, pr, pa = old_attr[0], change, old_attr[2] + if not change: + # noprint implies nostop + st = False +- self._set_sig(signum, (st, pr, pa)) ++ self._sigs[signame] = (st, pr, pa) + return change + + def handle(self, signum, frame): + """This method is called when a signal is received.""" + sig = lookup_signame(signum) +- st, pa, pr = self._get_sig(sig) ++ st, pa, pr = self._sigs[sig] + if pr: + self.pydb.msg('Program received signal %s' % sig) + if st: +Index: test/Makefile.am +=================================================================== +RCS file: /cvsroot/bashdb/pydb/test/Makefile.am,v +retrieving revision 1.17 +diff -u -r1.17 Makefile.am +--- test/Makefile.am 28 Jul 2006 00:47:47 -0000 1.17 ++++ test/Makefile.am 1 Aug 2006 18:08:56 -0000 +@@ -28,6 +28,8 @@ + run.right \ + run2.cmd \ + run2.right \ ++ sighandler.cmd \ ++ sighandle.right \ + test.py \ + trace-2.5.right \ + trace.py \ Added: sandbox/trunk/pdb/patches/01-08-06-sighandler.cmd ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/01-08-06-sighandler.cmd Mon Aug 21 17:49:31 2006 @@ -0,0 +1,16 @@ +info signal +info handle +handle SIGINT +handle SIGINT stop pass noprint +handle SIGINT +handle SIGINT print +handle SIGINT +handle SIGINT nopass noprint nostop +handle SIGINT +info signal SIGINT +# try changing fatal signal handlers (which are unchangable) +handle SIGKILL stop +handle SIGKILL +handle SIGSTOP print +handle SIGSTOP +quit Added: sandbox/trunk/pdb/patches/01-08-06-sighandler.right ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/01-08-06-sighandler.right Mon Aug 21 17:49:31 2006 @@ -0,0 +1,91 @@ +Signal Stop Print Pass to program + +SIGHUP True True True +SIGSYS True True True +SIGQUIT False False True +SIGUSR1 True True True +SIGFPE True True True +SIGTSTP True True True +SIGWINCH False False True +SIGIOT True True True +SIGBUS True True True +SIGXCPU True True True +SIGCONT True True True +SIGPROF True True True +SIGKILL False False True +SIGSEGV True True True +SIGINT False False True +SIGIO False False True +SIGTRAP False False True +SIGILL False False True +SIGEMT True True True +SIGUSR2 True True True +SIGABRT True True True +SIGALRM False False True +SIGXFSZ True True True +SIGCHLD False False True +SIGPIPE True True True +SIGTERM False False True +SIGVTALRM True True True +SIGINFO True True True +SIGURG False False True +SIGPWR True True True +SIGSTOP False False True +SIGTTOU True True True +SIGTTIN True True True +Signal Stop Print Pass to program + +SIGHUP True True True +SIGSYS True True True +SIGQUIT False False True +SIGUSR1 True True True +SIGFPE True True True +SIGTSTP True True True +SIGWINCH False False True +SIGIOT True True True +SIGBUS True True True +SIGXCPU True True True +SIGCONT True True True +SIGPROF True True True +SIGKILL False False True +SIGSEGV True True True +SIGINT False False True +SIGIO False False True +SIGTRAP False False True +SIGILL False False True +SIGEMT True True True +SIGUSR2 True True True +SIGABRT True True True +SIGALRM False False True +SIGXFSZ True True True +SIGCHLD False False True +SIGPIPE True True True +SIGTERM False False True +SIGVTALRM True True True +SIGINFO True True True +SIGURG False False True +SIGPWR True True True +SIGSTOP False False True +SIGTTOU True True True +SIGTTIN True True True +Signal Stop Print Pass to program + +SIGINT False False True +Signal Stop Print Pass to program + +SIGINT False False True +Signal Stop Print Pass to program + +SIGINT False True True +Signal Stop Print Pass to program + +SIGINT False False False +Signal Stop Print Pass to program + +SIGINT False False False +Signal Stop Print Pass to program + +SIGKILL False False True +Signal Stop Print Pass to program + +SIGSTOP False False True Added: sandbox/trunk/pdb/patches/04-07-06-patch.diff ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/04-07-06-patch.diff Mon Aug 21 17:49:31 2006 @@ -0,0 +1,36 @@ +? configure.lineno +? patch.diff +Index: pydb/fns.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/fns.py,v +retrieving revision 1.8 +diff -u -r1.8 fns.py +--- pydb/fns.py 26 Jun 2006 12:30:18 -0000 1.8 ++++ pydb/fns.py 3 Jul 2006 23:41:40 -0000 +@@ -228,7 +228,9 @@ + + if opts.output: + try: +- sys.stdout = open(opts.output, 'w') ++ pydb.stdout = open(opts.output, 'w') ++ # XXX Redirecting sys.stdout is fine for debugging purposes ++ sys.stdout = pydb.stdout + except IOError, (errno, strerror): + print "I/O in opening debugger output file %s" % opts.output + print "error(%s): %s" % (errno, strerror) +Index: pydb/pydbcmd.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/pydbcmd.py,v +retrieving revision 1.20 +diff -u -r1.20 pydbcmd.py +--- pydb/pydbcmd.py 18 Jun 2006 22:40:10 -0000 1.20 ++++ pydb/pydbcmd.py 3 Jul 2006 23:41:40 -0000 +@@ -285,7 +285,7 @@ + do_print = not self.logging_redirect + if do_print: + if out is None: +- out = sys.stdout ++ out = self.stdout + print >> out, msg, + + def precmd(self, line): Added: sandbox/trunk/pdb/patches/06-08-06-pydb.diff ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/06-08-06-pydb.diff Mon Aug 21 17:49:31 2006 @@ -0,0 +1,255 @@ +? t.py +? thread_script2.py +? tpdb.py +? tpdb2.py +? test/sighandler.cmd +? test/sighandler.right +Index: pydb/sighandler.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/sighandler.py,v +retrieving revision 1.4 +diff -u -r1.4 sighandler.py +--- pydb/sighandler.py 1 Aug 2006 15:10:04 -0000 1.4 ++++ pydb/sighandler.py 1 Aug 2006 18:08:56 -0000 +@@ -18,6 +18,8 @@ + else: + return None + ++fatal_signals = ['SIGKILL', 'SIGSTOP'] ++ + class SigHandler: + + """Store information about what we do when we handle a signal, +@@ -32,62 +34,27 @@ + """ + def __init__(self, pydb): + self.pydb = pydb +- # This list contains tuples made up of four items, one tuple for +- # every signal handler we've created. The tuples contain +- # (signal_num, stop, print, pass) +- self._sig_attr = [] +- self._sig_stop = [] +- self._sig_print = [] +- self._sig_pass = [] +- +- for sig in signal.__dict__.keys(): +- if sig.startswith('SIG') and '_' not in sig: +- self._sig_attr.append(sig) ++ self._sigs = {} + + # set up signal handling for some known signals +- # SIGKILL is non-maskable. Should we *really* include it here? +- fatal = ['SIGINT', 'SIGTRAP', 'SIGTERM', 'SIGQUIT', 'SIGILL', \ +- 'SIGKILL', 'SIGSTOP'] + ignore= ['SIGALRM', 'SIGCHLD', 'SIGURG', 'SIGIO', 'SIGVTALRM' + 'SIGPROF', 'SIGWINCH', 'SIGPOLL', 'SIGWAITING', 'SIGLWP', +- 'SIGCANCEL'] +- for sig in self._sig_attr: +- if str(sig) not in fatal: +- num = lookup_signum(sig) +- if num: +- if str(sig) in ignore: +- self._set_sig(sig, (False, False, True)) +- else: +- self._set_sig(sig, (True, True, True)) +- signal.signal(num, self.handle) +- else: +- self._set_sig(sig, (False, False, True)) +- +- def _get_sig(self, name): +- st = name in self._sig_stop +- pr = name in self._sig_print +- pa = name in self._sig_pass +- return (st, pr, pa) +- +- def _set_sig(self, name, (st, pr, pa)): +- """Set the actions to be taken when a signal, specified by +- 'name', is received. +- """ +- if st: +- if name not in self._sig_stop: +- self._sig_stop.append(name) +- elif name in self._sig_stop: +- self._sig_stop.pop(self._sig_stop.index(name)) +- if pr: +- if name not in self._sig_print: +- self._sig_print.append(name) +- elif name in self._sig_print: +- self._sig_print.pop(self._sig_print.index(name)) +- if pa: +- if name not in self._sig_pass: +- self._sig_pass.append(name) +- elif name in self._sig_pass: +- self._sig_pass.pop(self._sig_pass.index(name)) ++ 'SIGCANCEL', 'SIGTRAP', 'SIGTERM', 'SIGQUIT', 'SIGILL', \ ++ 'SIGINT'] ++ for sig in signal.__dict__.keys(): ++ if sig.startswith('SIG') and '_' not in sig: ++ if str(sig) not in fatal_signals: ++ num = lookup_signum(sig) ++ if num: ++ if str(sig) in ignore: ++ self._sigs[sig] = (False, False, True) ++ else: ++ self._sigs[sig] = (True, True, True) ++ signal.signal(num, self.handle) ++ else: ++ # Make an entry in the _sig dict for these signals ++ # even though they cannot be ignored or caught. ++ self._sigs[sig] = (False, False, True) + + def info_signal(self, signame): + """Print information about a signal""" +@@ -98,18 +65,14 @@ + # This has come from pydb's info command + if len(signame) == 1: + self.pydb.msg(header) +- for sig in self._sig_attr: +- s = sig in self._sig_stop +- pr = sig in self._sig_print +- pa = sig in self._sig_pass +- self.pydb.msg(fmt % (sig,s,pr,pa)) ++ for sig in self._sigs.keys(): ++ st, pr, pa = self._sigs[sig] ++ self.pydb.msg(fmt % (sig, st, pr, pa)) + else: + self.info_signal(signame[1]) + return + +- s = signame in self._sig_stop +- pr = signame in self._sig_print +- pa = signame in self._sig_pass ++ s, pr, pa = self._sigs[signame] + self.pydb.msg(header) + self.pydb.msg(fmt % (signame, s, pr, pa)) + +@@ -121,74 +84,83 @@ + self.info_signal(['handle']) + return + args = arg.split() +- if args[0] in self._sig_attr: +- if len(args) == 1: +- self.info_signal(args[0]) +- return +- # multiple commands might be specified, i.e. 'nopass nostop' +- for attr in args[1:]: +- if attr.startswith('no'): +- on = False +- attr = attr[2:] +- else: +- on = True +- if attr.startswith('stop'): +- self.handle_stop(args[0], on) +- elif attr.startswith('print'): +- self.handle_print(args[0], on) +- elif attr.startswith('pass'): +- self.handle_pass(args[0], on) +- else: +- self.pydb.errmsg('Invalid arguments') ++ try: ++ self._sigs[args[0]] ++ except KeyError: ++ return ++ if len(args) == 1: ++ self.info_signal(args[0]) ++ return ++ ++ # We can display information about 'fatal' signals, but not ++ # change their actions. ++ if args[0] in fatal_signals: ++ return ++ ++ # multiple commands might be specified, i.e. 'nopass nostop' ++ for attr in args[1:]: ++ if attr.startswith('no'): ++ on = False ++ attr = attr[2:] ++ else: ++ on = True ++ if attr.startswith('stop'): ++ self.handle_stop(args[0], on) ++ elif attr.startswith('print'): ++ self.handle_print(args[0], on) ++ elif attr.startswith('pass'): ++ self.handle_pass(args[0], on) ++ else: ++ self.pydb.errmsg('Invalid arguments') + +- def handle_stop(self, signum, change): ++ def handle_stop(self, signame, change): + """Change whether we stop or not when this signal is caught. + If 'change' is True your program will stop when this signal + happens.""" + if not isinstance(change, bool): + return +- old_attr = self._get_sig(signum) ++ old_attr = self._sigs[signame] + st, pr, pa = change, old_attr[1], old_attr[2] + if st: + pr = True +- self._set_sig(signum, (st, pr, pa)) ++ self._sigs[signame] = (st, pr, pa) + return change + +- def handle_pass(self, signum, change): ++ def handle_pass(self, signame, change): + """Change whether we pass this signal to the program (or not) + when this signal is caught. If change is True, Pydb should allow + your program to see this signal. + """ + if not isinstance(change, bool): + return +- old_attr = self._get_sig(signum) ++ old_attr = self._sigs[signame] + st, pr, pa = old_attr[0], old_attr[1], change +- self._set_sig(signum, (st, pr, pa)) ++ self._sigs[signame] = (st, pr, pa) + return change + + # ignore is a synonym for nopass and noignore is a synonym for pass +- def handle_ignore(self, signum, change): ++ def handle_ignore(self, signame, change): + if not isinstance(change, bool): + return + self.handle_pass(not change) + return change + +- def handle_print(self, signum, change): ++ def handle_print(self, signame, change): + """Change whether we print or not when this signal is caught.""" + if not isinstance(change, bool): + return +- old_attr = self._get_sig(signum) ++ old_attr = self._sigs[signame] + st, pr, pa = old_attr[0], change, old_attr[2] + if not change: + # noprint implies nostop + st = False +- self._set_sig(signum, (st, pr, pa)) ++ self._sigs[signame] = (st, pr, pa) + return change + + def handle(self, signum, frame): + """This method is called when a signal is received.""" + sig = lookup_signame(signum) +- st, pa, pr = self._get_sig(sig) ++ st, pa, pr = self._sigs[sig] + if pr: + self.pydb.msg('Program received signal %s' % sig) + if st: +Index: test/Makefile.am +=================================================================== +RCS file: /cvsroot/bashdb/pydb/test/Makefile.am,v +retrieving revision 1.17 +diff -u -r1.17 Makefile.am +--- test/Makefile.am 28 Jul 2006 00:47:47 -0000 1.17 ++++ test/Makefile.am 1 Aug 2006 18:08:56 -0000 +@@ -28,6 +28,8 @@ + run.right \ + run2.cmd \ + run2.right \ ++ sighandler.cmd \ ++ sighandle.right \ + test.py \ + trace-2.5.right \ + trace.py \ Added: sandbox/trunk/pdb/patches/06-08-06-sighandler.cmd ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/06-08-06-sighandler.cmd Mon Aug 21 17:49:31 2006 @@ -0,0 +1,16 @@ +info signal +info handle +handle SIGINT +handle SIGINT stop pass noprint +handle SIGINT +handle SIGINT print +handle SIGINT +handle SIGINT nopass noprint nostop +handle SIGINT +info signal SIGINT +# try changing fatal signal handlers (which are unchangable) +handle SIGKILL stop +handle SIGKILL +handle SIGSTOP print +handle SIGSTOP +quit Added: sandbox/trunk/pdb/patches/06-08-06-sighandler.right ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/06-08-06-sighandler.right Mon Aug 21 17:49:31 2006 @@ -0,0 +1,91 @@ +Signal Stop Print Pass to program + +SIGHUP True True True +SIGSYS True True True +SIGQUIT False False True +SIGUSR1 True True True +SIGFPE True True True +SIGTSTP True True True +SIGWINCH False False True +SIGIOT True True True +SIGBUS True True True +SIGXCPU True True True +SIGCONT True True True +SIGPROF True True True +SIGKILL False False True +SIGSEGV True True True +SIGINT False False True +SIGIO False False True +SIGTRAP False False True +SIGILL False False True +SIGEMT True True True +SIGUSR2 True True True +SIGABRT True True True +SIGALRM False False True +SIGXFSZ True True True +SIGCHLD False False True +SIGPIPE True True True +SIGTERM False False True +SIGVTALRM True True True +SIGINFO True True True +SIGURG False False True +SIGPWR True True True +SIGSTOP False False True +SIGTTOU True True True +SIGTTIN True True True +Signal Stop Print Pass to program + +SIGHUP True True True +SIGSYS True True True +SIGQUIT False False True +SIGUSR1 True True True +SIGFPE True True True +SIGTSTP True True True +SIGWINCH False False True +SIGIOT True True True +SIGBUS True True True +SIGXCPU True True True +SIGCONT True True True +SIGPROF True True True +SIGKILL False False True +SIGSEGV True True True +SIGINT False False True +SIGIO False False True +SIGTRAP False False True +SIGILL False False True +SIGEMT True True True +SIGUSR2 True True True +SIGABRT True True True +SIGALRM False False True +SIGXFSZ True True True +SIGCHLD False False True +SIGPIPE True True True +SIGTERM False False True +SIGVTALRM True True True +SIGINFO True True True +SIGURG False False True +SIGPWR True True True +SIGSTOP False False True +SIGTTOU True True True +SIGTTIN True True True +Signal Stop Print Pass to program + +SIGINT False False True +Signal Stop Print Pass to program + +SIGINT False False True +Signal Stop Print Pass to program + +SIGINT False True True +Signal Stop Print Pass to program + +SIGINT False False False +Signal Stop Print Pass to program + +SIGINT False False False +Signal Stop Print Pass to program + +SIGKILL False False True +Signal Stop Print Pass to program + +SIGSTOP False False True Added: sandbox/trunk/pdb/patches/10-07-06-opts.diff ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/10-07-06-opts.diff Mon Aug 21 17:49:31 2006 @@ -0,0 +1,31 @@ +? configure.lineno +Index: pydb/fns.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/fns.py,v +retrieving revision 1.11 +diff -u -r1.11 fns.py +--- pydb/fns.py 4 Jul 2006 06:02:46 -0000 1.11 ++++ pydb/fns.py 10 Jul 2006 00:20:59 -0000 +@@ -147,12 +147,12 @@ + except KeyboardInterrupt: + pass + +-def process_options(pydb, debugger_name, program, pkg_version): ++def process_options(pydb, debugger_name, program, pkg_version, option_list): + usage_str="""%s [debugger-options] python-script [script-options...] + + Runs the extended python debugger""" % (program) + +- optparser = OptionParser(usage=usage_str, ++ optparser = OptionParser(usage=usage_str, option_list=option_list, + version="%%prog version %s" % pkg_version) + + optparser.add_option("-X", "--trace", dest="linetrace", +@@ -254,6 +254,7 @@ + opts.errors + print sys.exc_info()[0] + sys.exit(2) ++ return opts + + def search_file(filename, path, cdir): + """Return a full pathname for filename if we can find one. path Added: sandbox/trunk/pdb/patches/11-08-06-pydb.diff ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/11-08-06-pydb.diff Mon Aug 21 17:49:31 2006 @@ -0,0 +1,196 @@ +? pydb.diff +? pydb/.gdb.py.in.swp +? test/sigtest.py.in +? test/sigtestexample.py +Index: Makefile.am +=================================================================== +RCS file: /cvsroot/bashdb/pydb/Makefile.am,v +retrieving revision 1.33 +diff -u -r1.33 Makefile.am +--- Makefile.am 1 Aug 2006 14:46:19 -0000 1.33 ++++ Makefile.am 11 Aug 2006 15:36:47 -0000 +@@ -66,7 +66,7 @@ + -rm $(top_builddir)/pydb/*.pyc + + test: check +-check: pydb/pydb.py pydb/gdb.py test/test.py test/pm.py ++check: pydb/pydb.py pydb/gdb.py test/test.py test/pm.py test/sigtest.py + + # + # For the executable, we make a symbolic link to the python program, +Index: configure.ac +=================================================================== +RCS file: /cvsroot/bashdb/pydb/configure.ac,v +retrieving revision 1.35 +diff -u -r1.35 configure.ac +--- configure.ac 29 Jul 2006 08:09:31 -0000 1.35 ++++ configure.ac 11 Aug 2006 15:36:47 -0000 +@@ -126,6 +126,7 @@ + AC_CONFIG_FILES([test/except.py],[chmod +x test/except.py]) + AC_CONFIG_FILES([test/pm.py],[chmod +x test/pm.py]) + AC_CONFIG_FILES([test/settrace.py],[chmod +x test/settrace.py]) ++AC_CONFIG_FILES([test/sigtest.py], [chmod +x test/sigtest.py]) + AC_CONFIG_FILES([test/test.py],[chmod +x test/test.py]) + AC_CONFIG_FILES([test/trace.py],[chmod +x test/trace.py]) + +Index: pydb/gdb.py.in +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/gdb.py.in,v +retrieving revision 1.51 +diff -u -r1.51 gdb.py.in +--- pydb/gdb.py.in 8 Aug 2006 01:34:05 -0000 1.51 ++++ pydb/gdb.py.in 11 Aug 2006 15:36:49 -0000 +@@ -21,7 +21,7 @@ + from pydbcmd import Cmd + from pydbbdb import Bdb + +-from sighandler import SigHandler ++from sighandler import SigHandler, lookup_signame, lookup_signum + + class Restart(Exception): + """Causes a debugger to be restarted for the debugged Python program.""" +@@ -41,6 +41,7 @@ + + # set up signal handling + self._sig_handler = SigHandler(self) ++ self._reset_handler = None + + self.__init_info() + self.__init_set() +@@ -118,6 +119,23 @@ + except ImportError: + self.histfile = None + ++ def trace_dispatch(self, frame, event, arg): ++ for sig in self._sig_handler._sigs.keys(): ++ if self._sig_handler._sigs[sig][0] == True: ++ import signal ++ sig_num = lookup_signum(sig) ++ old_handler = signal.getsignal(sig_num) ++ if old_handler != self._sig_handler.handle: ++ # save the program's signal handler ++ self._sig_handler.old_handlers[sig_num] = old_handler ++ ++ # restore _our_ signal handler ++ signal.signal(sig_num, self._sig_handler.handle) ++ ++ Bdb.trace_dispatch(self, frame, event, arg) ++ return self.trace_dispatch ++ ++ + def __adjust_frame(self, pos, absolute_pos): + """Adjust stack frame by pos positions. If absolute_pos then + pos is an absolute number. Otherwise it is a relative number. +Index: pydb/sighandler.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/sighandler.py,v +retrieving revision 1.6 +diff -u -r1.6 sighandler.py +--- pydb/sighandler.py 8 Aug 2006 02:04:25 -0000 1.6 ++++ pydb/sighandler.py 11 Aug 2006 15:36:49 -0000 +@@ -7,9 +7,8 @@ + # - remove pychecker errors. + # - can remove signal handler altogether when + # ignore=True, print=False, pass=True +-# - write real regression tests. +-# + # ++# + import signal + + def lookup_signame(num): +@@ -44,6 +43,8 @@ + def __init__(self, pydb): + self.pydb = pydb + self._sigs = {} ++ ++ self.old_handlers = {} + + # set up signal handling for some known signals + ignore= ['SIGALRM', 'SIGCHLD', 'SIGURG', 'SIGIO', 'SIGVTALRM' +@@ -59,7 +60,8 @@ + self._sigs[sig] = (False, False, True) + else: + self._sigs[sig] = (True, True, True) +- signal.signal(num, self.handle) ++ old_handler = signal.signal(num, self.handle) ++ self.old_handlers[num] = old_handler + else: + # Make an entry in the _sig dict for these signals + # even though they cannot be ignored or caught. +@@ -93,9 +95,7 @@ + self.info_signal(['handle']) + return + args = arg.split() +- try: +- self._sigs[args[0]] +- except KeyError: ++ if not self._sigs.has_key(args[0]): + return + if len(args) == 1: + self.info_signal(args[0]) +@@ -131,6 +131,7 @@ + old_attr = self._sigs[signame] + st, pr, pa = change, old_attr[1], old_attr[2] + if st: ++ # stop keyword implies print + pr = True + self._sigs[signame] = (st, pr, pa) + return change +@@ -151,7 +152,7 @@ + def handle_ignore(self, signame, change): + if not isinstance(change, bool): + return +- self.handle_pass(not change) ++ self.handle_pass(signame, not change) + return change + + def handle_print(self, signame, change): +@@ -169,10 +170,17 @@ + def handle(self, signum, frame): + """This method is called when a signal is received.""" + sig = lookup_signame(signum) +- st, pa, pr = self._sigs[sig] ++ st, pr, pa = self._sigs[sig] + if pr: + self.pydb.msg('Program received signal %s' % sig) + if st: +- # XXX Rocky what's the best way to handle this? + self.pydb.use_rawinput = False ++ self.pydb.step_ignore = 1 + self.pydb.interaction(self.pydb.curframe, None) ++ if pa: ++ # pass the signal to the program by reinstating the old signal ++ # handler and send the signal to this process again ++ old_handler = self.old_handlers[signum] ++ signal.signal(signum, old_handler) ++ import os ++ os.kill(os.getpid(), signum) +Index: test/Makefile.am +=================================================================== +RCS file: /cvsroot/bashdb/pydb/test/Makefile.am,v +retrieving revision 1.18 +diff -u -r1.18 Makefile.am +--- test/Makefile.am 8 Aug 2006 01:34:06 -0000 1.18 ++++ test/Makefile.am 11 Aug 2006 15:36:49 -0000 +@@ -28,16 +28,16 @@ + run.right \ + run2.cmd \ + run2.right \ +- sighandler.cmd \ +- sighandle.right \ ++ sigtest.py \ ++ sigtestexample.py \ + test.py \ + trace-2.5.right \ + trace.py \ + trace.right + +-TESTS = test.py pm.py trace.py ++TESTS = test.py pm.py trace.py sigtest.py + + EXTRA_DIST = $(check_DATA) except.py.in pm.py.in \ +- settrace.py.in test.py.in trace.py.in ++ settrace.py.in test.py.in trace.py.in sigtest.py.in + + test: check Added: sandbox/trunk/pdb/patches/11-08-06-sigtest.py.in ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/11-08-06-sigtest.py.in Mon Aug 21 17:49:31 2006 @@ -0,0 +1,101 @@ +#!@PYTHON@ -t +# $Id$ +"Unit test for Extended Python debugger's signal handling commands " +import os, time, sys, unittest, signal + +top_builddir = "@top_builddir@" +if top_builddir[-1] != os.path.sep: + top_builddir += os.path.sep +sys.path.insert(0, os.path.join(top_builddir, 'pydb')) +top_srcdir = "@top_srcdir@" +if top_srcdir[-1] != os.path.sep: + top_srcdir += os.path.sep +sys.path.insert(0, os.path.join(top_srcdir, 'pydb')) + +import pydb + +builddir = "@builddir@" +if builddir[-1] != os.path.sep: + builddir += os.path.sep + +top_builddir = "@top_builddir@" +if top_builddir[-1] != os.path.sep: + top_builddir += os.path.sep + +srcdir = "@srcdir@" +if srcdir[-1] != os.path.sep: + srcdir += os.path.sep + +pydir = os.path.join(top_builddir, "pydb") +pydb_short = "pydb.py" +pydb_path = os.path.join(pydir, pydb_short) +outfile = 'sighandler.out' +program = 'sigtestexample.py' + +class SigTests(unittest.TestCase): + def tearDown(self): + try: + os.unlink(outfile) + except OSError: + pass + + def create_proc(self, cmds): + pid = os.spawnlp(os.P_NOWAIT, pydb_path, pydb_path, '-o', + outfile, '-e', '%s' % cmds, program) + time.sleep(1.0) + return pid + + def test_pass(self): + # Run pydb and turn on passing SIGUSR1 signal to the test programs' + # signal handler. + cmds = 'handle SIGUSR1 nostop;;step;;step' + + pid = self.create_proc(cmds) + + os.kill(pid, signal.SIGUSR1) + os.waitpid(pid, 0) + + + f = open('log', 'r') + line = f.readline() + f.close() + self.assertEqual(line, 'signal received\n') + os.unlink('log') + + f = open(outfile, 'r') + lines = f.readlines() + f.close() + self.assertFalse('Program received signal' in lines) + + def test_nopass(self): + # Run pydb and intercept the signal SIGUSR1 instead of passing it + # to the program. + cmds = 'handle SIGUSR1 nopass nostop' + + pid = self.create_proc(cmds) + + os.kill(pid, signal.SIGUSR1) + os.waitpid(pid, 0) + + f = open(outfile, 'r') + lines = f.readlines() + f.close() + + self.assertEqual(lines[1], 'Program received signal SIGUSR1\n') + + def test_noprint(self): + cmds = "handle SIGUSR1 noprint nopass" + pid = self.create_proc(cmds) + + os.kill(pid, signal.SIGUSR1) + os.waitpid(pid, 0) + + f = open(outfile, 'r') + lines = f.readlines() + f.close() + + self.assertFalse('Program received signal SIGUSR1\n' in lines) + self.assertRaises(IOError, open, 'log', 'r') + +if __name__ == '__main__': + unittest.main() Added: sandbox/trunk/pdb/patches/11-08-06-sigtestexample.py ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/11-08-06-sigtestexample.py Mon Aug 21 17:49:31 2006 @@ -0,0 +1,9 @@ +def func(num, f): + f = open('log', 'w+') + f.write('signal received\n') + f.close() + +import signal +signal.signal(signal.SIGUSR1, func) + +x = 2 Added: sandbox/trunk/pdb/patches/20-08-06-threaddbg.patch ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/20-08-06-threaddbg.patch Mon Aug 21 17:49:31 2006 @@ -0,0 +1,306 @@ +--- threaddbg.py 2006/08/07 02:25:13 1.3 ++++ threaddbg.py 2006/08/19 20:57:38 +@@ -9,9 +9,23 @@ + ### - + + import bdb, inspect, os, pydb, sys +- ++from bdb import Breakpoint, checkfuncname ++from pydb.pydbbdb import checkline + import thread, threading + ++class TBreakpoint(Breakpoint): ++ ++ """Per-thread Breakpoint class.""" ++ ++ next = 1 ++ bplist = {} ++ bpbynumber = [None] ++ ++ def __init__(self, file, line, temporary=0, cond=None, funcname=None, ++ threadname=None): ++ Breakpoint.__init__(self, file, line, temporary, cond, funcname) ++ self.threadname = threadname ++ + class threadDbg(pydb.Pdb): + + def __init__(self, completekey='tab', stdin=None, stdout=None): +@@ -20,6 +34,8 @@ + self.add_hook() + self.stack = self.curframe = self.botframe = None + ++ self.t_breaks = {'MainThread': {}} ++ + # desired_thread is the thread we want to switch to after issuing + # a "thread " command. + self.desired_thread=None +@@ -193,6 +209,7 @@ + # Record in my own table a list of thread names + if not thread_name in self.traced.keys(): + self.traced[thread_name] = thread.get_ident() ++ self.t_breaks[thread_name] = {} + + # See if there was a request to switch to a specific thread + while self.desired_thread not in (None, +@@ -205,11 +222,9 @@ + self.threading_lock.acquire() + + if self.desired_thread != None: +- print "Hey we just did a switch to %s!" % self.desired_thread + self.threading_cond.acquire() + self.threading_cond.notifyAll() + self.threading_cond.release() +- print "notify done from %s" % threading.currentThread().getName() + + self.desired_thread = None + +@@ -256,3 +271,249 @@ + statement = 'execfile( "%s")' % filename + self.run(statement, globals=globals_, locals=locals_) + ++ def info_breakpoints(self, arg): ++ threadname = threading.currentThread().getName() ++ if not self.breaks and not self.t_breaks[threadname]: ++ self.msg('No breakpoints') ++ return ++ ++ have_breaks = False ++ if self.breaks: ++ pydb.Pdb.info_breakpoints(self, arg) ++ have_breaks = True ++ if self.t_breaks[threadname]: ++ self.msg("\nThread-specific breakpoints:") ++ self.msg("Num Type Disp Enb Where Thread") ++ for bp in TBreakpoint.bpbynumber: ++ if bp: ++ self.tbpprint(bp) ++ else: ++ if not have_breaks: self.msg("No breakpoints.") ++ ++ info_breakpoints.__doc__ = pydb.Pdb.info_breakpoints.__doc__ ++ ++ def set_break(self, filename, lineno, temporary=0, cond=None, funcname=None, ++ threadname=None): ++ if threadname is None: ++ pydb.Pdb.set_break(self, filename, lineno, temporary, cond, funcname) ++ else: ++ filename = self.canonic(filename) ++ import linecache ++ line = linecache.getline(filename, lineno) ++ if not line: ++ return 'Line %s:%d does not exist' % (filename, lineno) ++ ++ if not filename in self.t_breaks: ++ self.t_breaks[threadname][filename] = [] ++ blist = self.t_breaks[threadname][filename] ++ if not lineno in blist: ++ blist.append(lineno) ++ bp = TBreakpoint(filename, lineno, temporary, cond, funcname, threadname) ++ ++ def do_break(self, arg, temporary=0): ++ if 'thread' not in arg: ++ # We only deal with thread-spefic breakpoints. pydb handles ++ # all others. ++ pydb.Pdb.do_break(self, arg) ++ return ++ ++ if not self.curframe: ++ self.msg("No stack.") ++ return ++ # Pull the 'thread' command and threadname out of the args ++ threadname = arg[arg.find('thread')+7:] ++ print threadname.__repr__() ++ arg = arg[:arg.find('thread')-1] ++ cond = None ++ funcname = None ++ if not arg: ++ if self.lineno is None: ++ lineno = max(1, inspect.getlineno(self.curframe)) ++ else: ++ lineno = self.lineno + 1 ++ filename = self.curframe.f_code.co_filename ++ else: ++ filename = None ++ lineno = None ++ comma = arg.find(',') ++ if comma > 0: ++ cond = arg[comma+1:].lstrip() ++ arg = arg[:comma].rstrip() ++ (funcname, filename, lineno) = self.parse_fileops(arg) ++ ++ if not filename: ++ filename = self.defaultFile() ++ ++ line = checkline(self, filename, lineno) ++ if line: ++ try: ++ err = self.set_break(filename, line, temporary, cond, funcname, threadname) ++ except TypeError: ++ err = self.set_break(filename, line, temporary, cond, threadname) ++ ++ if err: self.errmsg(err) ++ else: ++ bp = self.get_breaks(filename, line, threadname)[-1] ++ self.msg("Breakpoint %d set in file %s, line %d, thread %s." ++ % (bp.number, self.filename(bp.file), bp.line, bp.threadname)) ++ ++ do_break.__doc__ = pydb.Pdb.do_break.__doc__ ++ ++ # XXX This is an _exact_ copy of __parse_fileops from gdb.py ++ # It's only included because of the name mangling ++ def parse_fileops(self, arg): ++ colon = arg.find(':') ++ if colon >= 0: ++ filename = arg[:colon].rstrip() ++ f = self.lookupmodule(filename) ++ if not f: ++ self.errmsg("%s not found on sys.path" % ++ self.saferepr(filename)) ++ return (None, None, None) ++ else: ++ filename = f ++ arg = arg[colon+1:].lstrip() ++ try: ++ lineno = int(arg) ++ except TypeError: ++ self.errmsg("Bad lineno: %s", str(arg)) ++ return (None, filename, None) ++ return (None, filename, lineno) ++ else: ++ # no colon: can be lineno or function ++ return self.get_brkpt_lineno(arg) ++ ++ # Likewise, this method is only included because of the namespace mangling ++ def get_brkpt_lineno(self, arg): ++ funcname, filename = (None, None) ++ try: ++ lineno = int(arg) ++ filename = self.curframe.f_code.co_filename ++ except ValueError: ++ try: ++ func = eval(arg, self.curframe.f_globals, ++ self.curframe.f_locals) ++ except: ++ func = arg ++ try: ++ if hasattr(func, 'im_func'): ++ func = func.im_func ++ code = func.func_code ++ lineno = code.co_firstlineno ++ filename = code.co_filename ++ except: ++ (ok, filename, ln) = self.lineinfo(arg) ++ if not ok: ++ self.errmsg(('The specified object %s is not' ++ +' a fucntion, or not found' ++ +' along sys.path or not line given.') ++ % str(repr(arg))) ++ return (None, None, None) ++ funcname = ok ++ lineno = int(ln) ++ return (funcname, filename, lineno) ++ ++ def get_breaks(self, filename, lineno, threadname=None): ++ if threadname is None: ++ return pydb.Pdb.get_breaks(self, filename, lineno) ++ filename = self.canonic(filename) ++ return filename in self.t_breaks[threadname] and \ ++ lineno in self.t_breaks[threadname][filename] and \ ++ TBreakpoint.bplist[filename, lineno] or [] ++ ++ def tbpprint(self, bp, out=None): ++ if bp.temporary: ++ disp = 'del ' ++ else: ++ disp = 'keep ' ++ if bp.enabled: ++ disp = disp + 'y ' ++ else: ++ disp = disp + 'n ' ++ self.msg('%-4dbreakpoint %s at %s:%d in %s' % ++ (bp.number, disp, self.filename(bp.file), bp.line, bp.threadname), out) ++ if bp.cond: ++ self.msg('\tstop only if %s' % (bp.cond)) ++ if bp.ignore: ++ self.msg('\tignore next %d hits' % (bp.ignore), out) ++ if (bp.hits): ++ if (bp.hits > 1): ss = 's' ++ else: ss = '' ++ self.msg('\tbreakpoint already hit %d time%s' % ++ (bp.hits, ss), out) ++ ++ def break_here(self, frame): ++ if pydb.Pdb.break_here(self, frame): ++ return True ++ ++ threadname = threading.currentThread().getName() ++ filename = self.canonic(frame.f_code.co_filename) ++ if not filename in self.t_breaks[threadname]: ++ return False ++ lineno = frame.f_lineno ++ if not lineno in self.t_breaks[threadname][filename]: ++ # The line itself has no breakpoint, but maybe the line is the ++ # first line of a function with breakpoint set by function name. ++ lineno = frame.f_code.co_firstlineno ++ if not lineno in self.t_breaks[threadname][filename]: ++ return False ++ ++ # flag says ok to delete temp. bp ++ (bp, flag) = effective(filename, lineno, frame) ++ if bp: ++ self.currentbp = bp.number ++ if (flag and bp.temporary): ++ self.do_clear(str(bp.number)) ++ return True ++ else: ++ return False ++ ++def effective(file, line, frame): ++ """Determine which breakpoint for this file:line is to be acted upon. ++ ++ Called only if we know there is a bpt at this ++ location. Returns breakpoint that was triggered and a flag ++ that indicates if it is ok to delete a temporary bp. ++ ++ """ ++ possibles = TBreakpoint.bplist[file,line] ++ for i in range(0, len(possibles)): ++ b = possibles[i] ++ if b.enabled == 0: ++ continue ++ if not checkfuncname(b, frame): ++ continue ++ # Count every hit when bp is enabled ++ b.hits = b.hits + 1 ++ if not b.cond: ++ # If unconditional, and ignoring, ++ # go on to next, else break ++ if b.ignore > 0: ++ b.ignore = b.ignore -1 ++ continue ++ else: ++ # breakpoint and marker that's ok ++ # to delete if temporary ++ return (b,1) ++ else: ++ # Conditional bp. ++ # Ignore count applies only to those bpt hits where the ++ # condition evaluates to true. ++ try: ++ val = eval(b.cond, frame.f_globals, ++ frame.f_locals) ++ if val: ++ if b.ignore > 0: ++ b.ignore = b.ignore -1 ++ # continue ++ else: ++ return (b,1) ++ except: ++ # if eval fails, most conservative ++ # thing is to stop on breakpoint ++ # regardless of ignore count. ++ # Don't delete temporary, ++ # as another hint to user. ++ return (b,0) ++ return (None, None) ++ Added: sandbox/trunk/pdb/patches/24-07-06-pydb.diff ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/24-07-06-pydb.diff Mon Aug 21 17:49:31 2006 @@ -0,0 +1,221 @@ +? configure.lineno +Index: pydb/gdb.py.in +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/gdb.py.in,v +retrieving revision 1.41 +diff -u -r1.41 gdb.py.in +--- pydb/gdb.py.in 22 Jul 2006 22:39:18 -0000 1.41 ++++ pydb/gdb.py.in 24 Jul 2006 14:36:15 -0000 +@@ -258,7 +258,7 @@ + self.showcmds.add('args', self.show_args) + self.showcmds.add('basename', self.show_basename) + self.showcmds.add('cmdtrace', self.show_cmdtrace, 2) +- self.showcmds.add('commands', self.show_commands, 2) ++ self.showcmds.add('commands', self.show_commands, 2, False) + self.showcmds.add('history', self.show_history) + self.showcmds.add('interactive', self.show_interactive) + self.showcmds.add('linetrace', self.show_linetrace, 3) +@@ -1096,87 +1096,14 @@ + get info about just that subcommand.""" + + if not arg: +- self.help_info([]) ++ for subcommand in self.infocmds.list(): ++ self.msg_nocr("%s: " % subcommand) ++ self.do_info(subcommand) + return + +- arglist = arg.split() +- arg = arglist[0] +- frame=self.curframe +- if "args".startswith(arg): +- if not self.curframe: +- self.msg("No stack.") +- return +- self.info_args(None) +- elif "break".startswith(arg): +- # FIXME: Should split out the "info" part in args +- self.do_L(None) +- elif 'display'.startswith(arg): +- if not self.display.displayAll(): +- self.msg('There are no auto-display expressions now.') +- elif "globals".startswith(arg): +- if not frame: +- self.msg("No frame selected.") +- return +- self.msg("\n".join(["%s = %s" +- % (l, pprint.pformat(self.getval(l))) +- for l in frame.f_globals])) +- elif "line".startswith(arg) and len(arg) > 1: +- #info line identifier +- if not frame: +- self.msg("No line number information available.") +- return +- if len(arglist) == 2: +- # lineinfo returns (item, file, lineno) or (None,) +- answer = self.lineinfo(arglist[1]) +- if answer[0]: +- item, file, lineno = answer +- if not os.path.isfile(file): +- file = search_file(file, self.search_path, +- self.main_dirname) +- self.msg('Line %s of "%s" <%s>' % +- (lineno, file, item)) +- return +- #info line +- file=self.canonic_filename(frame) +- if not os.path.isfile(file): +- file = search_file(file, self.search_path, self.main_dirname) +- +- self.msg('Line %d of \"%s\" at instruction %d' % +- (inspect.getlineno(frame), +- self.filename(self.canonic_filename(frame)), +- self.curframe.f_lasti)) +- elif "locals".startswith(arg) and len(arg) > 1: +- if not frame: +- self.msg("No frame selected.") +- return +- self.msg("\n".join(["%s = %s" +- % (l, pprint.pformat(self.getval(l))) +- for l in frame.f_locals])) +- elif 'program'.startswith(arg): +- if not frame: +- self.msg("The program being debugged is not being run.") +- return +- if self.is_running(): +- self.msg('Program stopped.') +- if self.currentbp: +- self.msg('It stopped at breakpoint %d.' % self.currentbp) +- elif self.stop_reason == 'call': +- self.msg('It stopped at a call.') +- elif self.stop_reason == 'exception': +- self.msg('It stopped as a result of an exception.') +- elif self.stop_reason == 'return': +- self.msg('It stopped at a return.') +- else: +- self.msg("It stopped after stepping, next'ing or initial start.") +- return +- elif "source".startswith(arg): +- if not frame: +- self.msg("No current source file.") +- return +- self.msg('Current Python file is %s' % +- self.filename(self.canonic_filename(frame))) + else: +- self.undefined_cmd("info", arg) ++ args = arg.split() ++ self.infocmds.do(self, args[0], args) + + def info_break(self, arg): + """info break +Index: pydb/pydbcmd.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/pydbcmd.py,v +retrieving revision 1.23 +diff -u -r1.23 pydbcmd.py +--- pydb/pydbcmd.py 22 Jul 2006 22:39:18 -0000 1.23 ++++ pydb/pydbcmd.py 24 Jul 2006 14:36:15 -0000 +@@ -6,7 +6,7 @@ + of more oriented towards any gdb-like debugger. Also routines that need to + be changed from cmd are here. + """ +-import cmd, linecache, os, sys, types ++import cmd, linecache, os, pprint, sys, types + from fns import * + + # Interaction prompt line will separate file and call info from code +@@ -274,7 +274,7 @@ + self.commands_doprompt[self.commands_bnum] = False + self.cmdqueue = [] + return 1 +- return ++ return + + def info_args(self, arg): + """Argument variables of current stack frame""" +@@ -318,9 +318,9 @@ + if not self.curframe: + self.msg("No line number information available.") + return +- if len(arglist) == 2: ++ if len(arg) == 2: + # lineinfo returns (item, file, lineno) or (None,) +- answer = self.lineinfo(arglist[1]) ++ answer = self.lineinfo(arg[1]) + if answer[0]: + item, file, lineno = answer + if not os.path.isfile(file): +@@ -329,6 +329,14 @@ + self.msg('Line %s of "%s" <%s>' % + (lineno, file, item)) + return ++ file=self.canonic_filename(self.curframe) ++ if not os.path.isfile(file): ++ file = search_file(file, self.search_path, self.main_dirname) ++ ++ self.msg('Line %d of \"%s\" at instruction %d' % ++ (inspect.getlineno(self.curframe), ++ self.filename(self.canonic_filename(self.curframe)), ++ self.curframe.f_lasti)) + + def info_locals(self, arg): + """Local variables of current stack frame""" +@@ -362,7 +370,7 @@ + self.msg("No current source file.") + return + self.msg('Current Python file is %s' % +- self.filename(self.canonic_filename(frame))) ++ self.filename(self.canonic_filename(self.curframe))) + + def msg(self, msg, out=None): + """Common routine for reporting messages. +Index: pydb/subcmd.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/subcmd.py,v +retrieving revision 1.1 +diff -u -r1.1 subcmd.py +--- pydb/subcmd.py 22 Jul 2006 22:39:18 -0000 1.1 ++++ pydb/subcmd.py 24 Jul 2006 14:36:15 -0000 +@@ -24,7 +24,11 @@ + + entry=self.lookup(subcmd_name) + if entry: +- obj.msg(entry['doc']) ++ d = entry['doc'] ++ # Only print one line of the docstring, stopping at the full-stop. ++ if '.' in d: ++ d = d[:d.find('.')] ++ obj.msg(d) + return + obj.undefined_cmd("help", subcmd_name) + +@@ -75,6 +79,10 @@ + + def list(self): + l=self.subcmds.keys() ++ for i in l: ++ # Remove subcmd if we don't want it displayed in the list ++ if not self.subcmds[i]['in_list']: ++ l.pop(l.index(i)) + l.sort() + return l + +Index: test/cmdparse.right +=================================================================== +RCS file: /cvsroot/bashdb/pydb/test/cmdparse.right,v +retrieving revision 1.19 +diff -u -r1.19 cmdparse.right +--- test/cmdparse.right 22 Jul 2006 22:39:18 -0000 1.19 ++++ test/cmdparse.right 24 Jul 2006 14:36:15 -0000 +@@ -295,10 +295,9 @@ + show args -- Show argument list to give debugged program on start + show basename -- Show if we are to show short of long filenames + show cmdtrace -- Show if we are to show debugger commands before running +-show commands -- Show the history of commands you typed + show history -- Generic command for showing command history parameters + show interactive -- Show whether we are interactive +-show linetrace -- Show the line tracing status. Can also add 'delay' ++show linetrace -- Show the line tracing status + show listsize -- Show number of source lines the debugger will list by default + show logging -- Show logging options + show prompt -- Show debugger's prompt Added: sandbox/trunk/pdb/patches/24-07-06-pydb2.diff ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/24-07-06-pydb2.diff Mon Aug 21 17:49:31 2006 @@ -0,0 +1,269 @@ +Index: pydb/gdb.py.in +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/gdb.py.in,v +retrieving revision 1.41 +diff -u -r1.41 gdb.py.in +--- pydb/gdb.py.in 22 Jul 2006 22:39:18 -0000 1.41 ++++ pydb/gdb.py.in 24 Jul 2006 16:53:11 -0000 +@@ -258,7 +258,7 @@ + self.showcmds.add('args', self.show_args) + self.showcmds.add('basename', self.show_basename) + self.showcmds.add('cmdtrace', self.show_cmdtrace, 2) +- self.showcmds.add('commands', self.show_commands, 2) ++ self.showcmds.add('commands', self.show_commands, 2, False) + self.showcmds.add('history', self.show_history) + self.showcmds.add('interactive', self.show_interactive) + self.showcmds.add('linetrace', self.show_linetrace, 3) +@@ -1096,87 +1096,14 @@ + get info about just that subcommand.""" + + if not arg: +- self.help_info([]) ++ for subcommand in self.infocmds.list(): ++ self.msg_nocr("%s: " % subcommand) ++ self.do_info(subcommand) + return + +- arglist = arg.split() +- arg = arglist[0] +- frame=self.curframe +- if "args".startswith(arg): +- if not self.curframe: +- self.msg("No stack.") +- return +- self.info_args(None) +- elif "break".startswith(arg): +- # FIXME: Should split out the "info" part in args +- self.do_L(None) +- elif 'display'.startswith(arg): +- if not self.display.displayAll(): +- self.msg('There are no auto-display expressions now.') +- elif "globals".startswith(arg): +- if not frame: +- self.msg("No frame selected.") +- return +- self.msg("\n".join(["%s = %s" +- % (l, pprint.pformat(self.getval(l))) +- for l in frame.f_globals])) +- elif "line".startswith(arg) and len(arg) > 1: +- #info line identifier +- if not frame: +- self.msg("No line number information available.") +- return +- if len(arglist) == 2: +- # lineinfo returns (item, file, lineno) or (None,) +- answer = self.lineinfo(arglist[1]) +- if answer[0]: +- item, file, lineno = answer +- if not os.path.isfile(file): +- file = search_file(file, self.search_path, +- self.main_dirname) +- self.msg('Line %s of "%s" <%s>' % +- (lineno, file, item)) +- return +- #info line +- file=self.canonic_filename(frame) +- if not os.path.isfile(file): +- file = search_file(file, self.search_path, self.main_dirname) +- +- self.msg('Line %d of \"%s\" at instruction %d' % +- (inspect.getlineno(frame), +- self.filename(self.canonic_filename(frame)), +- self.curframe.f_lasti)) +- elif "locals".startswith(arg) and len(arg) > 1: +- if not frame: +- self.msg("No frame selected.") +- return +- self.msg("\n".join(["%s = %s" +- % (l, pprint.pformat(self.getval(l))) +- for l in frame.f_locals])) +- elif 'program'.startswith(arg): +- if not frame: +- self.msg("The program being debugged is not being run.") +- return +- if self.is_running(): +- self.msg('Program stopped.') +- if self.currentbp: +- self.msg('It stopped at breakpoint %d.' % self.currentbp) +- elif self.stop_reason == 'call': +- self.msg('It stopped at a call.') +- elif self.stop_reason == 'exception': +- self.msg('It stopped as a result of an exception.') +- elif self.stop_reason == 'return': +- self.msg('It stopped at a return.') +- else: +- self.msg("It stopped after stepping, next'ing or initial start.") +- return +- elif "source".startswith(arg): +- if not frame: +- self.msg("No current source file.") +- return +- self.msg('Current Python file is %s' % +- self.filename(self.canonic_filename(frame))) + else: +- self.undefined_cmd("info", arg) ++ args = arg.split() ++ self.infocmds.do(self, args[0], args) + + def info_break(self, arg): + """info break +@@ -1468,8 +1395,10 @@ + + if not arg: + for subcommand in self.showcmds.list(): +- self.msg_nocr("%s: " % subcommand) +- self.do_show(subcommand) ++ # Only display commands that are 'in_list' ++ if self.showcmds.subcmds[subcommand]['in_list']: ++ self.msg_nocr("%s: " % subcommand) ++ self.do_show(subcommand) + return + + if self._re_linetrace_delay.match(arg): +Index: pydb/pydbcmd.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/pydbcmd.py,v +retrieving revision 1.23 +diff -u -r1.23 pydbcmd.py +--- pydb/pydbcmd.py 22 Jul 2006 22:39:18 -0000 1.23 ++++ pydb/pydbcmd.py 24 Jul 2006 16:53:11 -0000 +@@ -6,7 +6,7 @@ + of more oriented towards any gdb-like debugger. Also routines that need to + be changed from cmd are here. + """ +-import cmd, linecache, os, sys, types ++import cmd, linecache, os, pprint, sys, types + from fns import * + + # Interaction prompt line will separate file and call info from code +@@ -104,6 +104,10 @@ + try: + doc=getattr(self, 'do_' + first_arg).__doc__ + if doc: ++ # We only print the first line, removing any periods ++ # if they are the last character on the line ++ doc = doc[:doc.find('\n')] ++ if doc[-1] == '.': doc = doc[:-1] + self.msg("%s\n" % str(doc)) + return + except AttributeError: +@@ -274,7 +278,7 @@ + self.commands_doprompt[self.commands_bnum] = False + self.cmdqueue = [] + return 1 +- return ++ return + + def info_args(self, arg): + """Argument variables of current stack frame""" +@@ -318,9 +322,9 @@ + if not self.curframe: + self.msg("No line number information available.") + return +- if len(arglist) == 2: ++ if len(arg) == 2: + # lineinfo returns (item, file, lineno) or (None,) +- answer = self.lineinfo(arglist[1]) ++ answer = self.lineinfo(arg[1]) + if answer[0]: + item, file, lineno = answer + if not os.path.isfile(file): +@@ -329,6 +333,14 @@ + self.msg('Line %s of "%s" <%s>' % + (lineno, file, item)) + return ++ file=self.canonic_filename(self.curframe) ++ if not os.path.isfile(file): ++ file = search_file(file, self.search_path, self.main_dirname) ++ ++ self.msg('Line %d of \"%s\" at instruction %d' % ++ (inspect.getlineno(self.curframe), ++ self.filename(self.canonic_filename(self.curframe)), ++ self.curframe.f_lasti)) + + def info_locals(self, arg): + """Local variables of current stack frame""" +@@ -362,7 +374,7 @@ + self.msg("No current source file.") + return + self.msg('Current Python file is %s' % +- self.filename(self.canonic_filename(frame))) ++ self.filename(self.canonic_filename(self.curframe))) + + def msg(self, msg, out=None): + """Common routine for reporting messages. +Index: pydb/subcmd.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/subcmd.py,v +retrieving revision 1.1 +diff -u -r1.1 subcmd.py +--- pydb/subcmd.py 22 Jul 2006 22:39:18 -0000 1.1 ++++ pydb/subcmd.py 24 Jul 2006 16:53:12 -0000 +@@ -17,14 +17,21 @@ + return self.subcmds[subcmd_name] + return None + +- def _subcmd_helper(self, subcmd_name, obj, label=False): ++ def _subcmd_helper(self, subcmd_name, obj, label=False, strip=False): + """Show help for a single subcommand""" + if label: + obj.msg_nocr("%s %s --" % (self.name, subcmd_name)) + + entry=self.lookup(subcmd_name) + if entry: +- obj.msg(entry['doc']) ++ d = entry['doc'] ++ if strip: ++ # Limit the help message to one line (delimited by '\n') ++ if '\n' in d: ++ d = d[:d.find('\n')] ++ # If the last character is a period, remove it. ++ if d[-1] == '.': d = d[:d.find('.')] ++ obj.msg(d) + return + obj.undefined_cmd("help", subcmd_name) + +@@ -54,7 +61,7 @@ + + # Note: format of help is compatible with ddd. + def help(self, obj, *args): +- """help for subcommands""" ++ """help for subcommands.""" + + subcmd_prefix=args[0] + if not subcmd_prefix or len(subcmd_prefix) == 0: +@@ -63,7 +70,7 @@ + List of %s subcommands: + """ % (self.name)) + for subcmd_name in self.list(): +- self._subcmd_helper(subcmd_name, obj, True) ++ self._subcmd_helper(subcmd_name, obj, True, True) + return + + entry=self.lookup(subcmd_prefix) +@@ -75,6 +82,10 @@ + + def list(self): + l=self.subcmds.keys() ++ for i in l: ++ # Remove subcmd if we don't want it displayed in the list ++ if not self.subcmds[i]['in_list']: ++ l.pop(l.index(i)) + l.sort() + return l + +Index: test/cmdparse.right +=================================================================== +RCS file: /cvsroot/bashdb/pydb/test/cmdparse.right,v +retrieving revision 1.19 +diff -u -r1.19 cmdparse.right +--- test/cmdparse.right 22 Jul 2006 22:39:18 -0000 1.19 ++++ test/cmdparse.right 24 Jul 2006 16:53:12 -0000 +@@ -295,7 +295,6 @@ + show args -- Show argument list to give debugged program on start + show basename -- Show if we are to show short of long filenames + show cmdtrace -- Show if we are to show debugger commands before running +-show commands -- Show the history of commands you typed + show history -- Generic command for showing command history parameters + show interactive -- Show whether we are interactive + show linetrace -- Show the line tracing status. Can also add 'delay' Added: sandbox/trunk/pdb/patches/27-07-06-pydb.diff ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/27-07-06-pydb.diff Mon Aug 21 17:49:31 2006 @@ -0,0 +1,27 @@ +Index: pydb/fns.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/fns.py,v +retrieving revision 1.17 +diff -u -r1.17 fns.py +--- pydb/fns.py 13 Jul 2006 07:45:09 -0000 1.17 ++++ pydb/fns.py 27 Jul 2006 17:48:29 -0000 +@@ -256,6 +256,9 @@ + action="store", type='string', + help="Write debugger's error output " + + "(stderr) to FILE") ++ optparser.add_option("-e", "--exec", dest="execute", type="string", ++ help="A comma-separate list of commands to " + ++ "execute.") + + # Set up to stop on the first non-option because that's the name + # of the script to be debugged on arguments following that are +@@ -297,6 +300,9 @@ + if opts.command: + pydb.setup_source(os.path.expanduser(opts.command), True); + ++ if opts.execute: ++ pydb.cmdqueue = list(opts.execute.split(',')) ++ + if opts.output: + try: + pydb.stdout = open(opts.output, 'w') Added: sandbox/trunk/pdb/patches/27-07-06-sighandler.py ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/27-07-06-sighandler.py Mon Aug 21 17:49:31 2006 @@ -0,0 +1,112 @@ +"""$Id $ +Handles signal handlers within Pydb. +""" +import signal + +def lookup_signum(name): + """Find the corresponding signal number for 'name'.""" + try: + exec 'from signal import %s' % name + except ImportError: + return + return eval(name) + +# XXX Rocky, do you think the do_* methods are confusing? I.e. that someone +# will think they work the same way as the do_* method from cmd.Cmd? +# I used it because print and pass are keywords and trying to strip out the +# 'i' and 'a' from print and pass respectively, when this code is used in +# another file is just.. mad.. 'do' made sense to me. + +class SigHandler: + + """Store information about what we do when we handle a signal, + + - Do we print/not print when signal is caught + - Do we pass/not pass the signal to the program + - Do we stop/not stop when signal is caught + + All the methods to change these attributes return None on error, or + True or False if we have set the action (pass/print/stop) for a signal + handler. + """ + def __init__(self, signum): + + # This list contains tuples made up of four items, one tuple for + # every available signal number on this system. The tuples contain + # (signal_num, stop, print, pass) + self._sig_attr = [] + + for i in range(1, NSIG): + try: + d_handler = signal.getsignal(i) + self._sig_nums.append((i, True, True, True)) + except RuntimeError: + # A runtime exception can be raised if we ask for the signal + # handler for a signal that doesn't exist. + continue + + def _get_sig(self, num): + for i in self._sig_attr: + if i[0] == num: + return i[1:] + + def _set_sig(self, num, (st, pr, pa)): + for i in self._sig_attr: + if i[0] == num: + self._sig_attr.pop(self._sig_attr.index(i)) + self._sig_attr.append((num, st, pr, pa)) + + def do_stop(self, signum, change): + """Change whether we stop or not when this signal is caught. + If 'change' is True your program will stop when this signal + happens.""" + if not isinstance(change, bool): + return + old_attr = self._get_sig(signum) + st, pr, pa = change, old_attr[1], old_attr[2] + if st: + pr = True + self._set_sig(signum, (st, pr, pa)) + return change + + def do_pass(self, signum, change): + """Change whether we pass this signal to the program (or not) + when this signal is caught. If change is True, Pydb should allow + your program to see this signal. + """ + if not isinstance(change, bool): + return + old_attr = self._get_sig(signum) + st, pr, pa = old_attr[0], old_attr[1], change + self._set_sig(signum, (st, pr, pa)) + return change + + # ignore is a synonym for nopass and noignore is a synonym for pass + def do_ignore(self, signum, change): + if not isinstance(change, bool): + return + self.do_pass(not change) + return change + + def do_print(self, signum, change): + """Change whether we print or not when this signal is caught.""" + if not isinstance(change, bool): + return + old_attr = self._get_sig(signum) + st, pr, pa = old_attr[0], change, old_attr[2] + if not change: + # noprint implies nostop + st = False + self._set_sig(signum, (st, pr, pa)) + return change + + def handle(self, signum, frame): + """This method is called when a signal is received.""" + st, pa, pr = self._get_sig(signum) + if pr: + print 'Signal %d received' % self._signum + if pa: + # pass signal to program and stop + pass + + Added: sandbox/trunk/pdb/patches/30-05-06-pdb.py ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/30-05-06-pdb.py Mon Aug 21 17:49:31 2006 @@ -0,0 +1,116 @@ +# Use the version of Pdb that's in svn trunk because the constructor +# from Pdb needs to take a stdin and stdout argument. +class MPdb(pdb.Pdb): + def __init__(self, sys.stdin, sys.stdout): + """ Use sys.stdin and sys.stdout for our input + and output streams respectively. + """ + + def do_list(self, args): + """ Override pdb's implementation of the list command """" + + def do_info(self, args): + """ Provide information about [args] like the gdb info + command. + """ + + def do_thread(self, thread_no): + """ Use this command to switch between threads or to apply + a command to all threads. + """ + + def do_attach(self, location): + """ fork a new MXXXConsole object and close this one. """ + +class MSocketConsole(MPdb): + """ A debugging console that connects to a debugging + server on a socket. We leave stdin and stdout in tact + """ + def __init__(self, stdin, stdout) + + def do_attach(self, args): + """ Attach to a debugging server. """ + + def write(self, cmd): + """ Send a command to the debugging server. """ + + def read(self): + """ Receive output from a debugging server. """ + + def cmdloop(self): + """ Loop until we exit sending and receiving commands + and output from the debugging server. + """ + +# SERVER CLASSES + +# What I'm think would be cool here is allowing a design where a +# programmer can combine MPdb and a server class to produce a working +# debugging server. Below are some samples + +# It is possible for someone to write a wrapper for this class to allow +# XMLRPC communication over SSL. See, +# http://www.shipyard.com.au/articles/webdevelopment/sslxmlrpc.py +class MXMLRPCServer(MPdb, SimpleXMLRPCServer): + def __init__(self, stdin, stdout, host, port): + """ A XMLRPC server. """ + + def _register_functions(Self): + """ Register all MPdb functions with the XMLRPC + server. + """ + + def do_list(self, args): + """ This is an example of a method that one may wish to override + in order to provide the debugging console (which may end up being + a GUI front-end) with more structured information than that which + is available in the inherited methods. + + For example, one may wish to return the contents of an entire file + for the GUIs parsing plus a tag indicating where we currently + are in the file. + """ + +# It is possible to provide a wrapper class for this to enable SSL +# See above for more info (url link above MXMLRPCServer class) +class MTCPSocketServer(MPdb, SocketServer.TCPServer): + def __init__(self, stdin, stdout, host, port): + """ A socket server implementation of a debugging + server. + """ + + def handle_request(self): + """ Override the method from TCPServer. + Handle requests coming in on the socket. + + Most of the work of this entire class will be done in + this method. For instance, + + - redirecting self.stdin and self.stdout to the connected + sockets + - providing any authentication methods + """ + +class MSerialServer(MPdb): + """ A class that sets up a debugging server for use with serial + communication, such as that through a serial port. + """ + def __init__(self, stdin, stdout, device): + """ Specify the serial device on the computer as a file from + /dev to read and write serial information from and to. + """ + + def listen(self): + """ Listen on the serial device for connecting debugging + consoles. + """ + + def accept(self): + """ Accept a debugging console connection through the serial + device. + """ + + + + + Added: sandbox/trunk/pdb/patches/31-07-06-fns.diff ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/31-07-06-fns.diff Mon Aug 21 17:49:31 2006 @@ -0,0 +1,26 @@ +Index: pydb/fns.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/fns.py,v +retrieving revision 1.15 +diff -u -r1.15 fns.py +--- pydb/fns.py 10 Jul 2006 07:21:32 -0000 1.15 ++++ pydb/fns.py 11 Jul 2006 20:41:11 -0000 +@@ -55,12 +55,12 @@ + except EOFError: + reply = 'no' + reply = reply.strip().lower() +- if reply in ('y', 'yes'): +- return True +- elif reply in ('n', 'no'): +- return False +- else: +- self.msg("Please answer y or n.") ++ if reply in ('y', 'yes'): ++ return True ++ elif reply in ('n', 'no'): ++ return False ++ else: ++ self.msg("Please answer y or n.") + return False + + Added: sandbox/trunk/pdb/patches/31-07-06-pydb.diff ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/31-07-06-pydb.diff Mon Aug 21 17:49:31 2006 @@ -0,0 +1,33 @@ +Index: pydb/sighandler.py +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/sighandler.py,v +retrieving revision 1.3 +diff -u -r1.3 sighandler.py +--- pydb/sighandler.py 31 Jul 2006 00:14:54 -0000 1.3 ++++ pydb/sighandler.py 31 Jul 2006 10:02:20 -0000 +@@ -32,9 +32,6 @@ + """ + def __init__(self, pydb): + self.pydb = pydb +- # This list contains tuples made up of four items, one tuple for +- # every signal handler we've created. The tuples contain +- # (signal_num, stop, print, pass) + self._sig_attr = [] + self._sig_stop = [] + self._sig_print = [] +Index: test/Makefile.am +=================================================================== +RCS file: /cvsroot/bashdb/pydb/test/Makefile.am,v +retrieving revision 1.17 +diff -u -r1.17 Makefile.am +--- test/Makefile.am 28 Jul 2006 00:47:47 -0000 1.17 ++++ test/Makefile.am 31 Jul 2006 10:02:20 -0000 +@@ -28,6 +28,8 @@ + run.right \ + run2.cmd \ + run2.right \ ++ sighandler.cmd \ ++ sighandle.right \ + test.py \ + trace-2.5.right \ + trace.py \ Added: sandbox/trunk/pdb/patches/31-07-06-sig.diff ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/31-07-06-sig.diff Mon Aug 21 17:49:31 2006 @@ -0,0 +1,66 @@ +? sig.diff +? t.py +? thread_script2.py +? tpdb.py +? tpdb2.py +? pydb/.gdb.py.in.swp +? pydb/sighandler.py +Index: pydb/gdb.py.in +=================================================================== +RCS file: /cvsroot/bashdb/pydb/pydb/gdb.py.in,v +retrieving revision 1.49 +diff -u -r1.49 gdb.py.in +--- pydb/gdb.py.in 29 Jul 2006 08:09:32 -0000 1.49 ++++ pydb/gdb.py.in 30 Jul 2006 23:17:40 -0000 +@@ -21,6 +21,8 @@ + from pydbcmd import Cmd + from pydbbdb import Bdb + ++from sighandler import SigHandler ++ + class Restart(Exception): + """Causes a debugger to be restarted for the debugged Python program.""" + pass +@@ -37,6 +39,9 @@ + self._re_linetrace_delay = re.compile(r'\s*linetrace\s+delay') + self._wait_for_mainpyfile = False + ++ # set up signal handling ++ self._sig_handler = SigHandler(self) ++ + self.__init_info() + self.__init_set() + self.__init_show() +@@ -236,10 +241,12 @@ + self.infocmds.add('args', self.info_args) + self.infocmds.add('breakpoints', self.info_breakpoints) + self.infocmds.add('display', self.info_display) ++ self.infocmds.add('handle', self._sig_handler.info_signal) + self.infocmds.add('globals', self.info_globals, 1, False) + self.infocmds.add('line', self.info_line) + self.infocmds.add('locals', self.info_locals, 1, False) + self.infocmds.add('program', self.info_program) ++ self.infocmds.add('signal', self._sig_handler.info_signal) + self.infocmds.add('source', self.info_source) + + def __init_set(self): +@@ -1043,6 +1050,19 @@ + else: + self.__adjust_frame(pos=arg, absolute_pos=True) + ++ def do_handle(self, arg): ++ """Specify how to handle a signal. ++ Args are signals and actions to apply to those signals. ++ Recognized actions include "stop", "nostop", "print", "noprint", ++ "pass", "nopass", "ignore", or "noignore". ++ Stop means reenter debugger if this signal happens (implies print). ++ Print means print a message if this signal happens. ++ Pass means let program see this signal; otherwise program doesn't know. ++ Ignore is a synonym for nopass and noignore is a synonym for pass. ++ Pass and Stop may be combined. ++ """ ++ self._sig_handler.action(arg) ++ + def do_ignore(self,arg): + """ignore bpnumber count + Added: sandbox/trunk/pdb/patches/31-07-06-sighandler.cmd ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/31-07-06-sighandler.cmd Mon Aug 21 17:49:31 2006 @@ -0,0 +1,11 @@ +info signal +info handle +handle SIGINT +handle SIGINT stop pass noprint +handle SIGINT +handle SIGINT print +handle SIGINT +handle SIGINT nopass noprint nostop +handle SIGINT +info signal SIGINT +quit Added: sandbox/trunk/pdb/patches/31-07-06-sighandler.py ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/31-07-06-sighandler.py Mon Aug 21 17:49:31 2006 @@ -0,0 +1,190 @@ +"""$Id $ +Handles signal handlers within Pydb. +""" +import signal + +def lookup_signame(num): + """Find the corresponding signal name for 'num'. Return None + if 'num' is invalid.""" + for signame in signal.__dict__.keys(): + if signal.__dict__[signame] == num: + return signame + +def lookup_signum(name): + """Find the corresponding signal number for 'name'. Return None + if 'name' is invalid.""" + if hasattr(signal, name): + return getattr(signal, name) + else: + return None + +class SigHandler: + + """Store information about what we do when we handle a signal, + + - Do we print/not print when signal is caught + - Do we pass/not pass the signal to the program + - Do we stop/not stop when signal is caught + + All the methods to change these attributes return None on error, or + True or False if we have set the action (pass/print/stop) for a signal + handler. + """ + def __init__(self, pydb): + self.pydb = pydb + # This list contains tuples made up of four items, one tuple for + # every signal handler we've created. The tuples contain + # (signal_num, stop, print, pass) + self._sig_attr = [] + self._sig_stop = [] + self._sig_print = [] + self._sig_pass = [] + + for sig in signal.__dict__.keys(): + if sig.startswith('SIG') and '_' not in sig: + self._sig_attr.append(sig) + + # set up signal handling for some known signals + fatal = ['SIGINT', 'SIGTRAP', 'SIGTERM', 'SIGQUIT', 'SIGILL', \ + 'SIGKILL', 'SIGSTOP'] + for sig in self._sig_attr: + if str(sig) not in fatal: + num = lookup_signum(sig) + if num: + self._set_sig(sig, (True, True, True)) + signal.signal(num, self.handle) + else: + self._set_sig(sig, (False, False, True)) + + def _get_sig(self, name): + st = name in self._sig_stop + pr = name in self._sig_print + pa = name in self._sig_pass + return (st, pr, pa) + + def _set_sig(self, name, (st, pr, pa)): + """Set the actions to be taken when a signal, specified by + 'name', is received. + """ + if st: + if name not in self._sig_stop: + self._sig_stop.append(name) + else: + if name in self._sig_stop: + self._sig_stop.pop(self._sig_stop.index(name)) + if pr: + if name not in self._sig_print: + self._sig_print.append(name) + else: + if name in self._sig_print: + self._sig_print.pop(self._sig_print.index(name)) + if pa: + if name not in self._sig_pass: + self._sig_pass.append(name) + else: + if name in self._sig_pass: + self._sig_pass.pop(self._sig_pass.index(name)) + + def info_signal(self, signame): + """Print information about a signal""" + if 'handle' in signame or 'signal' in signame: + # This has come from pydb's info command + if len(signame) == 1: + self.pydb.msg('NAME\t\tSTOP\tPRINT\tPASS') + for sig in self._sig_attr: + s = sig in self._sig_stop + pr = sig in self._sig_print + pa = sig in self._sig_pass + self.pydb.msg('%s\t\t%s\t%s\t%s' % (sig,s,pr,pa)) + else: + self.info_signal(signame[1]) + return + + s = signame in self._sig_stop + pr = signame in self._sig_print + pa = signame in self._sig_pass + self.pydb.msg('NAME\t\tSTOP\tPRINT\tPASS') + self.pydb.msg('%s\t\t%s\t%s\t%s' % (signame, s, pr, pa)) + + def action(self, arg): + """Delegate the actions specified in 'arg' to another + method. + """ + if not arg: + self.info_signal(['handle']) + return + args = arg.split() + if args[0] in self._sig_attr: + if len(args) == 1: + self.info_signal(args[0]) + return + # multiple commands might be specified, i.e. 'nopass nostop' + for attr in args[1:]: + if attr.startswith('no'): + on = False + attr = attr[2:] + else: + on = True + if attr.startswith('stop'): + self.handle_stop(args[0], on) + elif attr.startswith('print'): + self.handle_print(args[0], on) + elif attr.startswith('pass'): + self.handle_pass(args[0], on) + else: + self.pydb.errmsg('Invalid arguments') + + def handle_stop(self, signum, change): + """Change whether we stop or not when this signal is caught. + If 'change' is True your program will stop when this signal + happens.""" + if not isinstance(change, bool): + return + old_attr = self._get_sig(signum) + st, pr, pa = change, old_attr[1], old_attr[2] + if st: + pr = True + self._set_sig(signum, (st, pr, pa)) + return change + + def handle_pass(self, signum, change): + """Change whether we pass this signal to the program (or not) + when this signal is caught. If change is True, Pydb should allow + your program to see this signal. + """ + if not isinstance(change, bool): + return + old_attr = self._get_sig(signum) + st, pr, pa = old_attr[0], old_attr[1], change + self._set_sig(signum, (st, pr, pa)) + return change + + # ignore is a synonym for nopass and noignore is a synonym for pass + def handle_ignore(self, signum, change): + if not isinstance(change, bool): + return + self.handle_pass(not change) + return change + + def handle_print(self, signum, change): + """Change whether we print or not when this signal is caught.""" + if not isinstance(change, bool): + return + old_attr = self._get_sig(signum) + st, pr, pa = old_attr[0], change, old_attr[2] + if not change: + # noprint implies nostop + st = False + self._set_sig(signum, (st, pr, pa)) + return change + + def handle(self, signum, frame): + """This method is called when a signal is received.""" + sig = lookup_signame(signum) + st, pa, pr = self._get_sig(sig) + if pr: + self.pydb.msg('Program received signal %s' % sig) + if st: + # XXX Rocky what's the best way to handle this? + self.pydb.use_rawinput = False + self.pydb.interaction(self.pydb.curframe, None) Added: sandbox/trunk/pdb/patches/31-07-06-sighandler.right ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/31-07-06-sighandler.right Mon Aug 21 17:49:31 2006 @@ -0,0 +1,85 @@ +Signal Stop Print Pass to program + +SIGHUP True True True +SIGSYS True True True +SIGQUIT False False True +SIGUSR1 True True True +SIGFPE True True True +SIGTSTP True True True +SIGCHLD True True True +SIGIOT True True True +SIGBUS True True True +SIGXCPU True True True +SIGPROF True True True +SIGCONT True True True +SIGUSR2 True True True +SIGKILL False False True +SIGSEGV True True True +SIGINT False False True +SIGIO True True True +SIGTRAP False False True +SIGILL False False True +SIGEMT True True True +SIGABRT True True True +SIGALRM True True True +SIGPIPE True True True +SIGWINCH True True True +SIGTERM False False True +SIGVTALRM True True True +SIGINFO True True True +SIGURG True True True +SIGPWR True True True +SIGXFSZ True True True +SIGTTIN True True True +SIGSTOP False False True +SIGTTOU True True True +Signal Stop Print Pass to program + +SIGHUP True True True +SIGSYS True True True +SIGQUIT False False True +SIGUSR1 True True True +SIGFPE True True True +SIGTSTP True True True +SIGCHLD True True True +SIGIOT True True True +SIGBUS True True True +SIGXCPU True True True +SIGPROF True True True +SIGCONT True True True +SIGUSR2 True True True +SIGKILL False False True +SIGSEGV True True True +SIGINT False False True +SIGIO True True True +SIGTRAP False False True +SIGILL False False True +SIGEMT True True True +SIGABRT True True True +SIGALRM True True True +SIGPIPE True True True +SIGWINCH True True True +SIGTERM False False True +SIGVTALRM True True True +SIGINFO True True True +SIGURG True True True +SIGPWR True True True +SIGXFSZ True True True +SIGTTIN True True True +SIGSTOP False False True +SIGTTOU True True True +Signal Stop Print Pass to program + +SIGINT False False True +Signal Stop Print Pass to program + +SIGINT False False True +Signal Stop Print Pass to program + +SIGINT False True True +Signal Stop Print Pass to program + +SIGINT False False False +Signal Stop Print Pass to program + +SIGINT False False False Added: sandbox/trunk/pdb/patches/31-07-06-test.py ============================================================================== --- (empty file) +++ sandbox/trunk/pdb/patches/31-07-06-test.py Mon Aug 21 17:49:31 2006 @@ -0,0 +1,51 @@ +#!/usr/bin/env python +"""Run a bunch of threading programs with line tracing +to make sure we don't hang tracing them.""" + +import os, time + +def run_test(test, wait_period): + """Run the test 'test' in a separate process and sleep for 'wait_period' + seconds. 'wait_period' should specify an optimal amount of time for + 'test' to finish. If the process hasn't finished by the time + 'wait_period' seconds have passed, we assume that the test is hung. + If the test has hung False is returned, otherwise True is returned. + """ + pid = os.spawnlp(os.P_NOWAIT, 'python', 'python', 'tpdb.py', '--trace', + test) + time.sleep(wait_period) + ret = os.waitpid(pid, os.WNOHANG) + if ret == (0,0): + import signal + os.kill(pid, signal.SIGKILL) + return False + else: + return True + +def main(): + # The way that I got the times below was by timing each file on + # my AMD64 machine and adding 5 seconds on to it. We may find that + # these times are way too short. + tests = [('t2.py', 5.0), ('q.py', 15.0), ('thread1.py',10.0)] + failed_tests = [] + + # Construct a test command suitable for passing to run_test + for test in tests: + filename = os.path.realpath(test[0]) + result = run_test(filename, test[1]) + if not result: + failed_tests.append(test) + + if failed_tests: + print '=' * 60 + print 'Failed Tests:\n' + for failed in failed_tests: + print failed[0] + print '=' * 60 + else: + print '=' * 60 + print 'All tests passed\n' + print '=' * 60 + +if __name__ == '__main__': + main() From python-checkins at python.org Mon Aug 21 18:19:38 2006 From: python-checkins at python.org (jeremy.hylton) Date: Mon, 21 Aug 2006 18:19:38 +0200 (CEST) Subject: [Python-checkins] r51428 - in python/trunk: Makefile.pre.in Python/compile.c Python/peephole.c Message-ID: <20060821161938.05B081E4009@bag.python.org> Author: jeremy.hylton Date: Mon Aug 21 18:19:37 2006 New Revision: 51428 Added: python/trunk/Python/peephole.c Modified: python/trunk/Makefile.pre.in python/trunk/Python/compile.c Log: Move peephole optimizer to separate file. Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Mon Aug 21 18:19:37 2006 @@ -260,6 +260,7 @@ Python/modsupport.o \ Python/mystrtoul.o \ Python/mysnprintf.o \ + Python/peephole.o \ Python/pyarena.o \ Python/pyfpe.o \ Python/pystate.o \ Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Mon Aug 21 18:19:37 2006 @@ -394,613 +394,6 @@ return dest; } -/* Begin: Peephole optimizations ----------------------------------------- */ - -#define GETARG(arr, i) ((int)((arr[i+2]<<8) + arr[i+1])) -#define UNCONDITIONAL_JUMP(op) (op==JUMP_ABSOLUTE || op==JUMP_FORWARD) -#define ABSOLUTE_JUMP(op) (op==JUMP_ABSOLUTE || op==CONTINUE_LOOP) -#define GETJUMPTGT(arr, i) (GETARG(arr,i) + (ABSOLUTE_JUMP(arr[i]) ? 0 : i+3)) -#define SETARG(arr, i, val) arr[i+2] = val>>8; arr[i+1] = val & 255 -#define CODESIZE(op) (HAS_ARG(op) ? 3 : 1) -#define ISBASICBLOCK(blocks, start, bytes) \ - (blocks[start]==blocks[start+bytes-1]) - -/* Replace LOAD_CONST c1. LOAD_CONST c2 ... LOAD_CONST cn BUILD_TUPLE n - with LOAD_CONST (c1, c2, ... cn). - The consts table must still be in list form so that the - new constant (c1, c2, ... cn) can be appended. - Called with codestr pointing to the first LOAD_CONST. - Bails out with no change if one or more of the LOAD_CONSTs is missing. - Also works for BUILD_LIST when followed by an "in" or "not in" test. -*/ -static int -tuple_of_constants(unsigned char *codestr, int n, PyObject *consts) -{ - PyObject *newconst, *constant; - Py_ssize_t i, arg, len_consts; - - /* Pre-conditions */ - assert(PyList_CheckExact(consts)); - assert(codestr[n*3] == BUILD_TUPLE || codestr[n*3] == BUILD_LIST); - assert(GETARG(codestr, (n*3)) == n); - for (i=0 ; i 20) { - Py_DECREF(newconst); - return 0; - } - - /* Append folded constant into consts table */ - len_consts = PyList_GET_SIZE(consts); - if (PyList_Append(consts, newconst)) { - Py_DECREF(newconst); - return 0; - } - Py_DECREF(newconst); - - /* Write NOP NOP NOP NOP LOAD_CONST newconst */ - memset(codestr, NOP, 4); - codestr[4] = LOAD_CONST; - SETARG(codestr, 4, len_consts); - return 1; -} - -static int -fold_unaryops_on_constants(unsigned char *codestr, PyObject *consts) -{ - PyObject *newconst=NULL, *v; - Py_ssize_t len_consts; - int opcode; - - /* Pre-conditions */ - assert(PyList_CheckExact(consts)); - assert(codestr[0] == LOAD_CONST); - - /* Create new constant */ - v = PyList_GET_ITEM(consts, GETARG(codestr, 0)); - opcode = codestr[3]; - switch (opcode) { - case UNARY_NEGATIVE: - /* Preserve the sign of -0.0 */ - if (PyObject_IsTrue(v) == 1) - newconst = PyNumber_Negative(v); - break; - case UNARY_CONVERT: - newconst = PyObject_Repr(v); - break; - case UNARY_INVERT: - newconst = PyNumber_Invert(v); - break; - default: - /* Called with an unknown opcode */ - PyErr_Format(PyExc_SystemError, - "unexpected unary operation %d on a constant", - opcode); - return 0; - } - if (newconst == NULL) { - PyErr_Clear(); - return 0; - } - - /* Append folded constant into consts table */ - len_consts = PyList_GET_SIZE(consts); - if (PyList_Append(consts, newconst)) { - Py_DECREF(newconst); - return 0; - } - Py_DECREF(newconst); - - /* Write NOP LOAD_CONST newconst */ - codestr[0] = NOP; - codestr[1] = LOAD_CONST; - SETARG(codestr, 1, len_consts); - return 1; -} - -static unsigned int * -markblocks(unsigned char *code, int len) -{ - unsigned int *blocks = (unsigned int *)PyMem_Malloc(len*sizeof(int)); - int i,j, opcode, blockcnt = 0; - - if (blocks == NULL) { - PyErr_NoMemory(); - return NULL; - } - memset(blocks, 0, len*sizeof(int)); - - /* Mark labels in the first pass */ - for (i=0 ; i= 255. - - Optimizations are restricted to simple transformations occuring within a - single basic block. All transformations keep the code size the same or - smaller. For those that reduce size, the gaps are initially filled with - NOPs. Later those NOPs are removed and the jump addresses retargeted in - a single pass. Line numbering is adjusted accordingly. */ - -static PyObject * -optimize_code(PyObject *code, PyObject* consts, PyObject *names, - PyObject *lineno_obj) -{ - Py_ssize_t i, j, codelen; - int nops, h, adj; - int tgt, tgttgt, opcode; - unsigned char *codestr = NULL; - unsigned char *lineno; - int *addrmap = NULL; - int new_line, cum_orig_line, last_line, tabsiz; - int cumlc=0, lastlc=0; /* Count runs of consecutive LOAD_CONSTs */ - unsigned int *blocks = NULL; - char *name; - - /* Bail out if an exception is set */ - if (PyErr_Occurred()) - goto exitUnchanged; - - /* Bypass optimization when the lineno table is too complex */ - assert(PyString_Check(lineno_obj)); - lineno = (unsigned char*)PyString_AS_STRING(lineno_obj); - tabsiz = PyString_GET_SIZE(lineno_obj); - if (memchr(lineno, 255, tabsiz) != NULL) - goto exitUnchanged; - - /* Avoid situations where jump retargeting could overflow */ - assert(PyString_Check(code)); - codelen = PyString_Size(code); - if (codelen > 32700) - goto exitUnchanged; - - /* Make a modifiable copy of the code string */ - codestr = (unsigned char *)PyMem_Malloc(codelen); - if (codestr == NULL) - goto exitUnchanged; - codestr = (unsigned char *)memcpy(codestr, - PyString_AS_STRING(code), codelen); - - /* Verify that RETURN_VALUE terminates the codestring. This allows - the various transformation patterns to look ahead several - instructions without additional checks to make sure they are not - looking beyond the end of the code string. - */ - if (codestr[codelen-1] != RETURN_VALUE) - goto exitUnchanged; - - /* Mapping to new jump targets after NOPs are removed */ - addrmap = (int *)PyMem_Malloc(codelen * sizeof(int)); - if (addrmap == NULL) - goto exitUnchanged; - - blocks = markblocks(codestr, codelen); - if (blocks == NULL) - goto exitUnchanged; - assert(PyList_Check(consts)); - - for (i=0 ; i a is not b - not a in b --> a not in b - not a is not b --> a is b - not a not in b --> a in b - */ - case COMPARE_OP: - j = GETARG(codestr, i); - if (j < 6 || j > 9 || - codestr[i+3] != UNARY_NOT || - !ISBASICBLOCK(blocks,i,4)) - continue; - SETARG(codestr, i, (j^1)); - codestr[i+3] = NOP; - break; - - /* Replace LOAD_GLOBAL/LOAD_NAME None - with LOAD_CONST None */ - case LOAD_NAME: - case LOAD_GLOBAL: - j = GETARG(codestr, i); - name = PyString_AsString(PyTuple_GET_ITEM(names, j)); - if (name == NULL || strcmp(name, "None") != 0) - continue; - for (j=0 ; j < PyList_GET_SIZE(consts) ; j++) { - if (PyList_GET_ITEM(consts, j) == Py_None) { - codestr[i] = LOAD_CONST; - SETARG(codestr, i, j); - cumlc = lastlc + 1; - break; - } - } - break; - - /* Skip over LOAD_CONST trueconst - JUMP_IF_FALSE xx POP_TOP */ - case LOAD_CONST: - cumlc = lastlc + 1; - j = GETARG(codestr, i); - if (codestr[i+3] != JUMP_IF_FALSE || - codestr[i+6] != POP_TOP || - !ISBASICBLOCK(blocks,i,7) || - !PyObject_IsTrue(PyList_GET_ITEM(consts, j))) - continue; - memset(codestr+i, NOP, 7); - cumlc = 0; - break; - - /* Try to fold tuples of constants (includes a case for lists - which are only used for "in" and "not in" tests). - Skip over BUILD_SEQN 1 UNPACK_SEQN 1. - Replace BUILD_SEQN 2 UNPACK_SEQN 2 with ROT2. - Replace BUILD_SEQN 3 UNPACK_SEQN 3 with ROT3 ROT2. */ - case BUILD_TUPLE: - case BUILD_LIST: - j = GETARG(codestr, i); - h = i - 3 * j; - if (h >= 0 && - j <= lastlc && - ((opcode == BUILD_TUPLE && - ISBASICBLOCK(blocks, h, 3*(j+1))) || - (opcode == BUILD_LIST && - codestr[i+3]==COMPARE_OP && - ISBASICBLOCK(blocks, h, 3*(j+2)) && - (GETARG(codestr,i+3)==6 || - GETARG(codestr,i+3)==7))) && - tuple_of_constants(&codestr[h], j, consts)) { - assert(codestr[i] == LOAD_CONST); - cumlc = 1; - break; - } - if (codestr[i+3] != UNPACK_SEQUENCE || - !ISBASICBLOCK(blocks,i,6) || - j != GETARG(codestr, i+3)) - continue; - if (j == 1) { - memset(codestr+i, NOP, 6); - } else if (j == 2) { - codestr[i] = ROT_TWO; - memset(codestr+i+1, NOP, 5); - } else if (j == 3) { - codestr[i] = ROT_THREE; - codestr[i+1] = ROT_TWO; - memset(codestr+i+2, NOP, 4); - } - break; - - /* Fold binary ops on constants. - LOAD_CONST c1 LOAD_CONST c2 BINOP --> LOAD_CONST binop(c1,c2) */ - case BINARY_POWER: - case BINARY_MULTIPLY: - case BINARY_TRUE_DIVIDE: - case BINARY_FLOOR_DIVIDE: - case BINARY_MODULO: - case BINARY_ADD: - case BINARY_SUBTRACT: - case BINARY_SUBSCR: - case BINARY_LSHIFT: - case BINARY_RSHIFT: - case BINARY_AND: - case BINARY_XOR: - case BINARY_OR: - if (lastlc >= 2 && - ISBASICBLOCK(blocks, i-6, 7) && - fold_binops_on_constants(&codestr[i-6], consts)) { - i -= 2; - assert(codestr[i] == LOAD_CONST); - cumlc = 1; - } - break; - - /* Fold unary ops on constants. - LOAD_CONST c1 UNARY_OP --> LOAD_CONST unary_op(c) */ - case UNARY_NEGATIVE: - case UNARY_CONVERT: - case UNARY_INVERT: - if (lastlc >= 1 && - ISBASICBLOCK(blocks, i-3, 4) && - fold_unaryops_on_constants(&codestr[i-3], consts)) { - i -= 2; - assert(codestr[i] == LOAD_CONST); - cumlc = 1; - } - break; - - /* Simplify conditional jump to conditional jump where the - result of the first test implies the success of a similar - test or the failure of the opposite test. - Arises in code like: - "if a and b:" - "if a or b:" - "a and b or c" - "(a and b) and c" - x:JUMP_IF_FALSE y y:JUMP_IF_FALSE z --> x:JUMP_IF_FALSE z - x:JUMP_IF_FALSE y y:JUMP_IF_TRUE z --> x:JUMP_IF_FALSE y+3 - where y+3 is the instruction following the second test. - */ - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: - tgt = GETJUMPTGT(codestr, i); - j = codestr[tgt]; - if (j == JUMP_IF_FALSE || j == JUMP_IF_TRUE) { - if (j == opcode) { - tgttgt = GETJUMPTGT(codestr, tgt) - i - 3; - SETARG(codestr, i, tgttgt); - } else { - tgt -= i; - SETARG(codestr, i, tgt); - } - break; - } - /* Intentional fallthrough */ - - /* Replace jumps to unconditional jumps */ - case FOR_ITER: - case JUMP_FORWARD: - case JUMP_ABSOLUTE: - case CONTINUE_LOOP: - case SETUP_LOOP: - case SETUP_EXCEPT: - case SETUP_FINALLY: - tgt = GETJUMPTGT(codestr, i); - if (!UNCONDITIONAL_JUMP(codestr[tgt])) - continue; - tgttgt = GETJUMPTGT(codestr, tgt); - if (opcode == JUMP_FORWARD) /* JMP_ABS can go backwards */ - opcode = JUMP_ABSOLUTE; - if (!ABSOLUTE_JUMP(opcode)) - tgttgt -= i + 3; /* Calc relative jump addr */ - if (tgttgt < 0) /* No backward relative jumps */ - continue; - codestr[i] = opcode; - SETARG(codestr, i, tgttgt); - break; - - case EXTENDED_ARG: - goto exitUnchanged; - - /* Replace RETURN LOAD_CONST None RETURN with just RETURN */ - case RETURN_VALUE: - if (i+4 >= codelen || - codestr[i+4] != RETURN_VALUE || - !ISBASICBLOCK(blocks,i,5)) - continue; - memset(codestr+i+1, NOP, 4); - break; - } - } - - /* Fixup linenotab */ - for (i=0, nops=0 ; ia_bytecode, consts, names, a->a_lnotab); + bytecode = PyCode_Optimize(a->a_bytecode, consts, names, a->a_lnotab); if (!bytecode) goto error; Added: python/trunk/Python/peephole.c ============================================================================== --- (empty file) +++ python/trunk/Python/peephole.c Mon Aug 21 18:19:37 2006 @@ -0,0 +1,615 @@ +/* Peehole optimizations for bytecode compiler. */ + +#include "Python.h" + +#include "Python-ast.h" +#include "node.h" +#include "pyarena.h" +#include "ast.h" +#include "code.h" +#include "compile.h" +#include "symtable.h" +#include "opcode.h" + +#define GETARG(arr, i) ((int)((arr[i+2]<<8) + arr[i+1])) +#define UNCONDITIONAL_JUMP(op) (op==JUMP_ABSOLUTE || op==JUMP_FORWARD) +#define ABSOLUTE_JUMP(op) (op==JUMP_ABSOLUTE || op==CONTINUE_LOOP) +#define GETJUMPTGT(arr, i) (GETARG(arr,i) + (ABSOLUTE_JUMP(arr[i]) ? 0 : i+3)) +#define SETARG(arr, i, val) arr[i+2] = val>>8; arr[i+1] = val & 255 +#define CODESIZE(op) (HAS_ARG(op) ? 3 : 1) +#define ISBASICBLOCK(blocks, start, bytes) \ + (blocks[start]==blocks[start+bytes-1]) + +/* Replace LOAD_CONST c1. LOAD_CONST c2 ... LOAD_CONST cn BUILD_TUPLE n + with LOAD_CONST (c1, c2, ... cn). + The consts table must still be in list form so that the + new constant (c1, c2, ... cn) can be appended. + Called with codestr pointing to the first LOAD_CONST. + Bails out with no change if one or more of the LOAD_CONSTs is missing. + Also works for BUILD_LIST when followed by an "in" or "not in" test. +*/ +static int +tuple_of_constants(unsigned char *codestr, int n, PyObject *consts) +{ + PyObject *newconst, *constant; + Py_ssize_t i, arg, len_consts; + + /* Pre-conditions */ + assert(PyList_CheckExact(consts)); + assert(codestr[n*3] == BUILD_TUPLE || codestr[n*3] == BUILD_LIST); + assert(GETARG(codestr, (n*3)) == n); + for (i=0 ; i 20) { + Py_DECREF(newconst); + return 0; + } + + /* Append folded constant into consts table */ + len_consts = PyList_GET_SIZE(consts); + if (PyList_Append(consts, newconst)) { + Py_DECREF(newconst); + return 0; + } + Py_DECREF(newconst); + + /* Write NOP NOP NOP NOP LOAD_CONST newconst */ + memset(codestr, NOP, 4); + codestr[4] = LOAD_CONST; + SETARG(codestr, 4, len_consts); + return 1; +} + +static int +fold_unaryops_on_constants(unsigned char *codestr, PyObject *consts) +{ + PyObject *newconst=NULL, *v; + Py_ssize_t len_consts; + int opcode; + + /* Pre-conditions */ + assert(PyList_CheckExact(consts)); + assert(codestr[0] == LOAD_CONST); + + /* Create new constant */ + v = PyList_GET_ITEM(consts, GETARG(codestr, 0)); + opcode = codestr[3]; + switch (opcode) { + case UNARY_NEGATIVE: + /* Preserve the sign of -0.0 */ + if (PyObject_IsTrue(v) == 1) + newconst = PyNumber_Negative(v); + break; + case UNARY_CONVERT: + newconst = PyObject_Repr(v); + break; + case UNARY_INVERT: + newconst = PyNumber_Invert(v); + break; + default: + /* Called with an unknown opcode */ + PyErr_Format(PyExc_SystemError, + "unexpected unary operation %d on a constant", + opcode); + return 0; + } + if (newconst == NULL) { + PyErr_Clear(); + return 0; + } + + /* Append folded constant into consts table */ + len_consts = PyList_GET_SIZE(consts); + if (PyList_Append(consts, newconst)) { + Py_DECREF(newconst); + return 0; + } + Py_DECREF(newconst); + + /* Write NOP LOAD_CONST newconst */ + codestr[0] = NOP; + codestr[1] = LOAD_CONST; + SETARG(codestr, 1, len_consts); + return 1; +} + +static unsigned int * +markblocks(unsigned char *code, int len) +{ + unsigned int *blocks = (unsigned int *)PyMem_Malloc(len*sizeof(int)); + int i,j, opcode, blockcnt = 0; + + if (blocks == NULL) { + PyErr_NoMemory(); + return NULL; + } + memset(blocks, 0, len*sizeof(int)); + + /* Mark labels in the first pass */ + for (i=0 ; i= 255. + + Optimizations are restricted to simple transformations occuring within a + single basic block. All transformations keep the code size the same or + smaller. For those that reduce size, the gaps are initially filled with + NOPs. Later those NOPs are removed and the jump addresses retargeted in + a single pass. Line numbering is adjusted accordingly. */ + +PyObject * +PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, + PyObject *lineno_obj) +{ + Py_ssize_t i, j, codelen; + int nops, h, adj; + int tgt, tgttgt, opcode; + unsigned char *codestr = NULL; + unsigned char *lineno; + int *addrmap = NULL; + int new_line, cum_orig_line, last_line, tabsiz; + int cumlc=0, lastlc=0; /* Count runs of consecutive LOAD_CONSTs */ + unsigned int *blocks = NULL; + char *name; + + /* Bail out if an exception is set */ + if (PyErr_Occurred()) + goto exitUnchanged; + + /* Bypass optimization when the lineno table is too complex */ + assert(PyString_Check(lineno_obj)); + lineno = (unsigned char*)PyString_AS_STRING(lineno_obj); + tabsiz = PyString_GET_SIZE(lineno_obj); + if (memchr(lineno, 255, tabsiz) != NULL) + goto exitUnchanged; + + /* Avoid situations where jump retargeting could overflow */ + assert(PyString_Check(code)); + codelen = PyString_Size(code); + if (codelen > 32700) + goto exitUnchanged; + + /* Make a modifiable copy of the code string */ + codestr = (unsigned char *)PyMem_Malloc(codelen); + if (codestr == NULL) + goto exitUnchanged; + codestr = (unsigned char *)memcpy(codestr, + PyString_AS_STRING(code), codelen); + + /* Verify that RETURN_VALUE terminates the codestring. This allows + the various transformation patterns to look ahead several + instructions without additional checks to make sure they are not + looking beyond the end of the code string. + */ + if (codestr[codelen-1] != RETURN_VALUE) + goto exitUnchanged; + + /* Mapping to new jump targets after NOPs are removed */ + addrmap = (int *)PyMem_Malloc(codelen * sizeof(int)); + if (addrmap == NULL) + goto exitUnchanged; + + blocks = markblocks(codestr, codelen); + if (blocks == NULL) + goto exitUnchanged; + assert(PyList_Check(consts)); + + for (i=0 ; i a is not b + not a in b --> a not in b + not a is not b --> a is b + not a not in b --> a in b + */ + case COMPARE_OP: + j = GETARG(codestr, i); + if (j < 6 || j > 9 || + codestr[i+3] != UNARY_NOT || + !ISBASICBLOCK(blocks,i,4)) + continue; + SETARG(codestr, i, (j^1)); + codestr[i+3] = NOP; + break; + + /* Replace LOAD_GLOBAL/LOAD_NAME None + with LOAD_CONST None */ + case LOAD_NAME: + case LOAD_GLOBAL: + j = GETARG(codestr, i); + name = PyString_AsString(PyTuple_GET_ITEM(names, j)); + if (name == NULL || strcmp(name, "None") != 0) + continue; + for (j=0 ; j < PyList_GET_SIZE(consts) ; j++) { + if (PyList_GET_ITEM(consts, j) == Py_None) { + codestr[i] = LOAD_CONST; + SETARG(codestr, i, j); + cumlc = lastlc + 1; + break; + } + } + break; + + /* Skip over LOAD_CONST trueconst + JUMP_IF_FALSE xx POP_TOP */ + case LOAD_CONST: + cumlc = lastlc + 1; + j = GETARG(codestr, i); + if (codestr[i+3] != JUMP_IF_FALSE || + codestr[i+6] != POP_TOP || + !ISBASICBLOCK(blocks,i,7) || + !PyObject_IsTrue(PyList_GET_ITEM(consts, j))) + continue; + memset(codestr+i, NOP, 7); + cumlc = 0; + break; + + /* Try to fold tuples of constants (includes a case for lists + which are only used for "in" and "not in" tests). + Skip over BUILD_SEQN 1 UNPACK_SEQN 1. + Replace BUILD_SEQN 2 UNPACK_SEQN 2 with ROT2. + Replace BUILD_SEQN 3 UNPACK_SEQN 3 with ROT3 ROT2. */ + case BUILD_TUPLE: + case BUILD_LIST: + j = GETARG(codestr, i); + h = i - 3 * j; + if (h >= 0 && + j <= lastlc && + ((opcode == BUILD_TUPLE && + ISBASICBLOCK(blocks, h, 3*(j+1))) || + (opcode == BUILD_LIST && + codestr[i+3]==COMPARE_OP && + ISBASICBLOCK(blocks, h, 3*(j+2)) && + (GETARG(codestr,i+3)==6 || + GETARG(codestr,i+3)==7))) && + tuple_of_constants(&codestr[h], j, consts)) { + assert(codestr[i] == LOAD_CONST); + cumlc = 1; + break; + } + if (codestr[i+3] != UNPACK_SEQUENCE || + !ISBASICBLOCK(blocks,i,6) || + j != GETARG(codestr, i+3)) + continue; + if (j == 1) { + memset(codestr+i, NOP, 6); + } else if (j == 2) { + codestr[i] = ROT_TWO; + memset(codestr+i+1, NOP, 5); + } else if (j == 3) { + codestr[i] = ROT_THREE; + codestr[i+1] = ROT_TWO; + memset(codestr+i+2, NOP, 4); + } + break; + + /* Fold binary ops on constants. + LOAD_CONST c1 LOAD_CONST c2 BINOP --> LOAD_CONST binop(c1,c2) */ + case BINARY_POWER: + case BINARY_MULTIPLY: + case BINARY_TRUE_DIVIDE: + case BINARY_FLOOR_DIVIDE: + case BINARY_MODULO: + case BINARY_ADD: + case BINARY_SUBTRACT: + case BINARY_SUBSCR: + case BINARY_LSHIFT: + case BINARY_RSHIFT: + case BINARY_AND: + case BINARY_XOR: + case BINARY_OR: + if (lastlc >= 2 && + ISBASICBLOCK(blocks, i-6, 7) && + fold_binops_on_constants(&codestr[i-6], consts)) { + i -= 2; + assert(codestr[i] == LOAD_CONST); + cumlc = 1; + } + break; + + /* Fold unary ops on constants. + LOAD_CONST c1 UNARY_OP --> LOAD_CONST unary_op(c) */ + case UNARY_NEGATIVE: + case UNARY_CONVERT: + case UNARY_INVERT: + if (lastlc >= 1 && + ISBASICBLOCK(blocks, i-3, 4) && + fold_unaryops_on_constants(&codestr[i-3], consts)) { + i -= 2; + assert(codestr[i] == LOAD_CONST); + cumlc = 1; + } + break; + + /* Simplify conditional jump to conditional jump where the + result of the first test implies the success of a similar + test or the failure of the opposite test. + Arises in code like: + "if a and b:" + "if a or b:" + "a and b or c" + "(a and b) and c" + x:JUMP_IF_FALSE y y:JUMP_IF_FALSE z --> x:JUMP_IF_FALSE z + x:JUMP_IF_FALSE y y:JUMP_IF_TRUE z --> x:JUMP_IF_FALSE y+3 + where y+3 is the instruction following the second test. + */ + case JUMP_IF_FALSE: + case JUMP_IF_TRUE: + tgt = GETJUMPTGT(codestr, i); + j = codestr[tgt]; + if (j == JUMP_IF_FALSE || j == JUMP_IF_TRUE) { + if (j == opcode) { + tgttgt = GETJUMPTGT(codestr, tgt) - i - 3; + SETARG(codestr, i, tgttgt); + } else { + tgt -= i; + SETARG(codestr, i, tgt); + } + break; + } + /* Intentional fallthrough */ + + /* Replace jumps to unconditional jumps */ + case FOR_ITER: + case JUMP_FORWARD: + case JUMP_ABSOLUTE: + case CONTINUE_LOOP: + case SETUP_LOOP: + case SETUP_EXCEPT: + case SETUP_FINALLY: + tgt = GETJUMPTGT(codestr, i); + if (!UNCONDITIONAL_JUMP(codestr[tgt])) + continue; + tgttgt = GETJUMPTGT(codestr, tgt); + if (opcode == JUMP_FORWARD) /* JMP_ABS can go backwards */ + opcode = JUMP_ABSOLUTE; + if (!ABSOLUTE_JUMP(opcode)) + tgttgt -= i + 3; /* Calc relative jump addr */ + if (tgttgt < 0) /* No backward relative jumps */ + continue; + codestr[i] = opcode; + SETARG(codestr, i, tgttgt); + break; + + case EXTENDED_ARG: + goto exitUnchanged; + + /* Replace RETURN LOAD_CONST None RETURN with just RETURN */ + case RETURN_VALUE: + if (i+4 >= codelen || + codestr[i+4] != RETURN_VALUE || + !ISBASICBLOCK(blocks,i,5)) + continue; + memset(codestr+i+1, NOP, 4); + break; + } + } + + /* Fixup linenotab */ + for (i=0, nops=0 ; i Author: jeremy.hylton Date: Mon Aug 21 18:20:29 2006 New Revision: 51429 Modified: python/trunk/Include/code.h Log: Move peephole optimizer to separate file. (Forgot .h in previous checkin.) Modified: python/trunk/Include/code.h ============================================================================== --- python/trunk/Include/code.h (original) +++ python/trunk/Include/code.h Mon Aug 21 18:20:29 2006 @@ -88,6 +88,9 @@ PyAPI_FUNC(int) PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds); +PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts, + PyObject *names, PyObject *lineno_obj); + #ifdef __cplusplus } #endif From buildbot at python.org Mon Aug 21 18:47:51 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 21 Aug 2006 16:47:51 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060821164751.A8A5E1E4009@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/50 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeremy.hylton Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Mon Aug 21 19:14:42 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 21 Aug 2006 17:14:42 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060821171442.1FC211E4009@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1111 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeremy.hylton Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Mon Aug 21 19:55:27 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 21 Aug 2006 17:55:27 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-2 trunk Message-ID: <20060821175527.E76381E400D@bag.python.org> The Buildbot has detected a new failure of x86 XP-2 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP-2%2520trunk/builds/892 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeremy.hylton BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Mon Aug 21 19:59:47 2006 From: python-checkins at python.org (neal.norwitz) Date: Mon, 21 Aug 2006 19:59:47 +0200 (CEST) Subject: [Python-checkins] r51432 - in python/trunk/Lib: tarfile.py test/test_tarfile.py Message-ID: <20060821175947.A6E211E4009@bag.python.org> Author: neal.norwitz Date: Mon Aug 21 19:59:46 2006 New Revision: 51432 Modified: python/trunk/Lib/tarfile.py python/trunk/Lib/test/test_tarfile.py Log: Fix bug #1543303, tarfile adds padding that breaks gunzip. Patch # 1543897. Will backport to 2.5 Modified: python/trunk/Lib/tarfile.py ============================================================================== --- python/trunk/Lib/tarfile.py (original) +++ python/trunk/Lib/tarfile.py Mon Aug 21 19:59:46 2006 @@ -411,9 +411,6 @@ self.buf += self.cmp.flush() if self.mode == "w" and self.buf: - blocks, remainder = divmod(len(self.buf), self.bufsize) - if remainder > 0: - self.buf += NUL * (self.bufsize - remainder) self.fileobj.write(self.buf) self.buf = "" if self.comptype == "gz": Modified: python/trunk/Lib/test/test_tarfile.py ============================================================================== --- python/trunk/Lib/test/test_tarfile.py (original) +++ python/trunk/Lib/test/test_tarfile.py Mon Aug 21 19:59:46 2006 @@ -324,6 +324,27 @@ class WriteStreamTest(WriteTest): sep = '|' + def test_padding(self): + self.dst.close() + + if self.comp == "gz": + f = gzip.GzipFile(self.dstname) + s = f.read() + f.close() + elif self.comp == "bz2": + f = bz2.BZ2Decompressor() + s = file(self.dstname).read() + s = f.decompress(s) + self.assertEqual(len(f.unused_data), 0, "trailing data") + else: + f = file(self.dstname) + s = f.read() + f.close() + + self.assertEqual(s.count("\0"), tarfile.RECORDSIZE, + "incorrect zero padding") + + class WriteGNULongTest(unittest.TestCase): """This testcase checks for correct creation of GNU Longname and Longlink extensions. From python-checkins at python.org Mon Aug 21 20:01:31 2006 From: python-checkins at python.org (neal.norwitz) Date: Mon, 21 Aug 2006 20:01:31 +0200 (CEST) Subject: [Python-checkins] r51433 - python/trunk/Python/compile.c Message-ID: <20060821180131.54B3A1E4009@bag.python.org> Author: neal.norwitz Date: Mon Aug 21 20:01:30 2006 New Revision: 51433 Modified: python/trunk/Python/compile.c Log: Add assert to make Klocwork happy (#276) Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Mon Aug 21 20:01:30 2006 @@ -568,6 +568,7 @@ if (n >= 0) { wrapper = PyList_GET_ITEM(c->c_stack, n); c->u = (struct compiler_unit *)PyCObject_AsVoidPtr(wrapper); + assert(c->u); /* we are deleting from a list so this really shouldn't fail */ if (PySequence_DelItem(c->c_stack, n) < 0) Py_FatalError("compiler_exit_scope()"); From python-checkins at python.org Mon Aug 21 20:20:13 2006 From: python-checkins at python.org (neal.norwitz) Date: Mon, 21 Aug 2006 20:20:13 +0200 (CEST) Subject: [Python-checkins] r51434 - in python/trunk: Modules/mmapmodule.c Objects/fileobject.c Message-ID: <20060821182013.53AF41E4009@bag.python.org> Author: neal.norwitz Date: Mon Aug 21 20:20:10 2006 New Revision: 51434 Modified: python/trunk/Modules/mmapmodule.c python/trunk/Objects/fileobject.c Log: Fix a couple of ssize-t issues reported by Alexander Belopolsky on python-dev Modified: python/trunk/Modules/mmapmodule.c ============================================================================== --- python/trunk/Modules/mmapmodule.c (original) +++ python/trunk/Modules/mmapmodule.c Mon Aug 21 20:20:10 2006 @@ -470,7 +470,7 @@ mmap_tell_method(mmap_object *self, PyObject *unused) { CHECK_VALID(NULL); - return PyInt_FromLong((long) self->pos); + return PyInt_FromSsize_t(self->pos); } static PyObject * Modified: python/trunk/Objects/fileobject.c ============================================================================== --- python/trunk/Objects/fileobject.c (original) +++ python/trunk/Objects/fileobject.c Mon Aug 21 20:20:10 2006 @@ -922,7 +922,7 @@ ndone += nnow; ntodo -= nnow; } - return PyInt_FromLong((long)ndone); + return PyInt_FromSsize_t(ndone); } /************************************************************************** From python-checkins at python.org Mon Aug 21 20:43:52 2006 From: python-checkins at python.org (neal.norwitz) Date: Mon, 21 Aug 2006 20:43:52 +0200 (CEST) Subject: [Python-checkins] r51436 - in python/branches/release25-maint: Lib/tarfile.py Lib/test/test_tarfile.py Misc/NEWS Message-ID: <20060821184352.DDDC31E4009@bag.python.org> Author: neal.norwitz Date: Mon Aug 21 20:43:51 2006 New Revision: 51436 Modified: python/branches/release25-maint/Lib/tarfile.py python/branches/release25-maint/Lib/test/test_tarfile.py python/branches/release25-maint/Misc/NEWS Log: Backport 51432: Fix bug #1543303, tarfile adds padding that breaks gunzip. Patch # 1543897. (remove the padding) Modified: python/branches/release25-maint/Lib/tarfile.py ============================================================================== --- python/branches/release25-maint/Lib/tarfile.py (original) +++ python/branches/release25-maint/Lib/tarfile.py Mon Aug 21 20:43:51 2006 @@ -411,9 +411,6 @@ self.buf += self.cmp.flush() if self.mode == "w" and self.buf: - blocks, remainder = divmod(len(self.buf), self.bufsize) - if remainder > 0: - self.buf += NUL * (self.bufsize - remainder) self.fileobj.write(self.buf) self.buf = "" if self.comptype == "gz": Modified: python/branches/release25-maint/Lib/test/test_tarfile.py ============================================================================== --- python/branches/release25-maint/Lib/test/test_tarfile.py (original) +++ python/branches/release25-maint/Lib/test/test_tarfile.py Mon Aug 21 20:43:51 2006 @@ -324,6 +324,27 @@ class WriteStreamTest(WriteTest): sep = '|' + def test_padding(self): + self.dst.close() + + if self.comp == "gz": + f = gzip.GzipFile(self.dstname) + s = f.read() + f.close() + elif self.comp == "bz2": + f = bz2.BZ2Decompressor() + s = file(self.dstname).read() + s = f.decompress(s) + self.assertEqual(len(f.unused_data), 0, "trailing data") + else: + f = file(self.dstname) + s = f.read() + f.close() + + self.assertEqual(s.count("\0"), tarfile.RECORDSIZE, + "incorrect zero padding") + + class WriteGNULongTest(unittest.TestCase): """This testcase checks for correct creation of GNU Longname and Longlink extensions. Modified: python/branches/release25-maint/Misc/NEWS ============================================================================== --- python/branches/release25-maint/Misc/NEWS (original) +++ python/branches/release25-maint/Misc/NEWS Mon Aug 21 20:43:51 2006 @@ -15,6 +15,8 @@ - Bug #1541863: uuid.uuid1 failed to generate unique identifiers on systems with low clock resolution. +- Bug #1543303, patch #1543897: remove NUL padding from tarfiles. + Documentation ------------- From python-checkins at python.org Mon Aug 21 20:44:10 2006 From: python-checkins at python.org (neal.norwitz) Date: Mon, 21 Aug 2006 20:44:10 +0200 (CEST) Subject: [Python-checkins] r51437 - in python/branches/release25-maint: Modules/mmapmodule.c Objects/fileobject.c Message-ID: <20060821184410.413961E4009@bag.python.org> Author: neal.norwitz Date: Mon Aug 21 20:44:09 2006 New Revision: 51437 Modified: python/branches/release25-maint/Modules/mmapmodule.c python/branches/release25-maint/Objects/fileobject.c Log: Fix a couple of ssize-t issues reported by Alexander Belopolsky on python-dev Modified: python/branches/release25-maint/Modules/mmapmodule.c ============================================================================== --- python/branches/release25-maint/Modules/mmapmodule.c (original) +++ python/branches/release25-maint/Modules/mmapmodule.c Mon Aug 21 20:44:09 2006 @@ -470,7 +470,7 @@ mmap_tell_method(mmap_object *self, PyObject *unused) { CHECK_VALID(NULL); - return PyInt_FromLong((long) self->pos); + return PyInt_FromSsize_t(self->pos); } static PyObject * Modified: python/branches/release25-maint/Objects/fileobject.c ============================================================================== --- python/branches/release25-maint/Objects/fileobject.c (original) +++ python/branches/release25-maint/Objects/fileobject.c Mon Aug 21 20:44:09 2006 @@ -922,7 +922,7 @@ ndone += nnow; ntodo -= nnow; } - return PyInt_FromLong((long)ndone); + return PyInt_FromSsize_t(ndone); } /************************************************************************** From python-checkins at python.org Mon Aug 21 21:47:09 2006 From: python-checkins at python.org (neal.norwitz) Date: Mon, 21 Aug 2006 21:47:09 +0200 (CEST) Subject: [Python-checkins] r51439 - in python/trunk: Lib/test/test_syntax.py Misc/NEWS Python/compile.c Message-ID: <20060821194709.A03A81E4009@bag.python.org> Author: neal.norwitz Date: Mon Aug 21 21:47:08 2006 New Revision: 51439 Modified: python/trunk/Lib/test/test_syntax.py python/trunk/Misc/NEWS python/trunk/Python/compile.c Log: Patch #1542451: disallow continue anywhere under a finally I'm undecided if this should be backported to 2.5 or 2.5.1. Armin suggested to wait (I'm of the same opinion). Thomas W thinks it's fine to go in 2.5. Modified: python/trunk/Lib/test/test_syntax.py ============================================================================== --- python/trunk/Lib/test/test_syntax.py (original) +++ python/trunk/Lib/test/test_syntax.py Mon Aug 21 21:47:08 2006 @@ -235,6 +235,93 @@ >>> f() += 1 Traceback (most recent call last): SyntaxError: illegal expression for augmented assignment (, line 1) + + +Test continue in finally in weird combinations. + +continue in for loop under finally shouuld be ok. + + >>> def test(): + ... try: + ... pass + ... finally: + ... for abc in range(10): + ... continue + ... print abc + >>> test() + 9 + +Start simple, a continue in a finally should not be allowed. + + >>> def test(): + ... for abc in range(10): + ... try: + ... pass + ... finally: + ... continue + Traceback (most recent call last): + ... + SyntaxError: 'continue' not supported inside 'finally' clause (, line 6) + +This is essentially a continue in a finally which should not be allowed. + + >>> def test(): + ... for abc in range(10): + ... try: + ... pass + ... finally: + ... try: + ... continue + ... except: + ... pass + Traceback (most recent call last): + ... + SyntaxError: 'continue' not supported inside 'finally' clause (, line 7) + + >>> def foo(): + ... try: + ... pass + ... finally: + ... continue + Traceback (most recent call last): + ... + SyntaxError: 'continue' not supported inside 'finally' clause (, line 5) + + >>> def foo(): + ... for a in (): + ... try: + ... pass + ... finally: + ... continue + Traceback (most recent call last): + ... + SyntaxError: 'continue' not supported inside 'finally' clause (, line 6) + + >>> def foo(): + ... for a in (): + ... try: + ... pass + ... finally: + ... try: + ... continue + ... finally: + ... pass + Traceback (most recent call last): + ... + SyntaxError: 'continue' not supported inside 'finally' clause (, line 7) + + >>> def foo(): + ... for a in (): + ... try: pass + ... finally: + ... try: + ... pass + ... except: + ... continue + Traceback (most recent call last): + ... + SyntaxError: 'continue' not supported inside 'finally' clause (, line 8) + """ import re Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon Aug 21 21:47:08 2006 @@ -12,6 +12,8 @@ Core and builtins ----------------- +- Patch #1542451: disallow continue anywhere under a finally. + Library ------- Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Mon Aug 21 21:47:08 2006 @@ -1682,6 +1682,8 @@ compiler_continue(struct compiler *c) { static const char LOOP_ERROR_MSG[] = "'continue' not properly in loop"; + static const char IN_FINALLY_ERROR_MSG[] = + "'continue' not supported inside 'finally' clause"; int i; if (!c->u->u_nfblocks) @@ -1693,15 +1695,18 @@ break; case EXCEPT: case FINALLY_TRY: - while (--i >= 0 && c->u->u_fblock[i].fb_type != LOOP) - ; + while (--i >= 0 && c->u->u_fblock[i].fb_type != LOOP) { + /* Prevent continue anywhere under a finally + even if hidden in a sub-try or except. */ + if (c->u->u_fblock[i].fb_type == FINALLY_END) + return compiler_error(c, IN_FINALLY_ERROR_MSG); + } if (i == -1) return compiler_error(c, LOOP_ERROR_MSG); ADDOP_JABS(c, CONTINUE_LOOP, c->u->u_fblock[i].fb_block); break; case FINALLY_END: - return compiler_error(c, - "'continue' not supported inside 'finally' clause"); + return compiler_error(c, IN_FINALLY_ERROR_MSG); } return 1; From python-checkins at python.org Mon Aug 21 21:59:37 2006 From: python-checkins at python.org (jeremy.hylton) Date: Mon, 21 Aug 2006 21:59:37 +0200 (CEST) Subject: [Python-checkins] r51442 - sandbox/trunk/refactor Message-ID: <20060821195937.C86A21E4009@bag.python.org> Author: jeremy.hylton Date: Mon Aug 21 21:59:37 2006 New Revision: 51442 Added: sandbox/trunk/refactor/ Log: Directory for tool to translate Python 2.x source to Python 3.x From python-checkins at python.org Mon Aug 21 22:16:26 2006 From: python-checkins at python.org (neal.norwitz) Date: Mon, 21 Aug 2006 22:16:26 +0200 (CEST) Subject: [Python-checkins] r51443 - python/trunk/Python/pythonrun.c Message-ID: <20060821201626.1C7751E4009@bag.python.org> Author: neal.norwitz Date: Mon Aug 21 22:16:24 2006 New Revision: 51443 Modified: python/trunk/Python/pythonrun.c Log: Handle a few more error conditions. Klocwork 301 and 302. Will backport. Modified: python/trunk/Python/pythonrun.c ============================================================================== --- python/trunk/Python/pythonrun.c (original) +++ python/trunk/Python/pythonrun.c Mon Aug 21 22:16:24 2006 @@ -531,11 +531,15 @@ bimod = _PyImport_FindExtension("__builtin__", "__builtin__"); if (bimod != NULL) { interp->builtins = PyModule_GetDict(bimod); + if (interp->builtins == NULL) + goto handle_error; Py_INCREF(interp->builtins); } sysmod = _PyImport_FindExtension("sys", "sys"); if (bimod != NULL && sysmod != NULL) { interp->sysdict = PyModule_GetDict(sysmod); + if (interp->sysdict == NULL) + goto handle_error; Py_INCREF(interp->sysdict); PySys_SetPath(Py_GetPath()); PyDict_SetItemString(interp->sysdict, "modules", @@ -549,6 +553,7 @@ if (!PyErr_Occurred()) return tstate; +handle_error: /* Oops, it didn't work. Undo it all. */ PyErr_Print(); From python-checkins at python.org Mon Aug 21 22:21:03 2006 From: python-checkins at python.org (neal.norwitz) Date: Mon, 21 Aug 2006 22:21:03 +0200 (CEST) Subject: [Python-checkins] r51444 - python/branches/release25-maint/Python/pythonrun.c Message-ID: <20060821202103.CBD641E4009@bag.python.org> Author: neal.norwitz Date: Mon Aug 21 22:20:59 2006 New Revision: 51444 Modified: python/branches/release25-maint/Python/pythonrun.c Log: Backport 51443: Handle a few more error conditions. Klocwork 301 and 302. Will backport. Modified: python/branches/release25-maint/Python/pythonrun.c ============================================================================== --- python/branches/release25-maint/Python/pythonrun.c (original) +++ python/branches/release25-maint/Python/pythonrun.c Mon Aug 21 22:20:59 2006 @@ -531,11 +531,15 @@ bimod = _PyImport_FindExtension("__builtin__", "__builtin__"); if (bimod != NULL) { interp->builtins = PyModule_GetDict(bimod); + if (interp->builtins == NULL) + goto handle_error; Py_INCREF(interp->builtins); } sysmod = _PyImport_FindExtension("sys", "sys"); if (bimod != NULL && sysmod != NULL) { interp->sysdict = PyModule_GetDict(sysmod); + if (interp->sysdict == NULL) + goto handle_error; Py_INCREF(interp->sysdict); PySys_SetPath(Py_GetPath()); PyDict_SetItemString(interp->sysdict, "modules", @@ -549,6 +553,7 @@ if (!PyErr_Occurred()) return tstate; +handle_error: /* Oops, it didn't work. Undo it all. */ PyErr_Print(); From buildbot at python.org Mon Aug 21 22:32:34 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 21 Aug 2006 20:32:34 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060821203234.AB6061E400A@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1113 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Tue Aug 22 00:03:05 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 21 Aug 2006 22:03:05 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) 2.5 Message-ID: <20060821220305.EF41F1E4009@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%25202.5/builds/8 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Tue Aug 22 00:13:13 2006 From: python-checkins at python.org (neal.norwitz) Date: Tue, 22 Aug 2006 00:13:13 +0200 (CEST) Subject: [Python-checkins] r51448 - in python/branches/release25-maint: Lib/test/test_unicode.py Misc/ACKS Misc/NEWS Objects/unicodeobject.c Message-ID: <20060821221313.768C61E4009@bag.python.org> Author: neal.norwitz Date: Tue Aug 22 00:13:11 2006 New Revision: 51448 Modified: python/branches/release25-maint/Lib/test/test_unicode.py python/branches/release25-maint/Misc/ACKS python/branches/release25-maint/Misc/NEWS python/branches/release25-maint/Objects/unicodeobject.c Log: - Patch #1541585: fix buffer overrun when performing repr() on a unicode string in a build with wide unicode (UCS-4) support. I will forward port to 2.6. Can someone backport to 2.4? Modified: python/branches/release25-maint/Lib/test/test_unicode.py ============================================================================== --- python/branches/release25-maint/Lib/test/test_unicode.py (original) +++ python/branches/release25-maint/Lib/test/test_unicode.py Tue Aug 22 00:13:11 2006 @@ -92,6 +92,10 @@ "\\xfe\\xff'") testrepr = repr(u''.join(map(unichr, xrange(256)))) self.assertEqual(testrepr, latin1repr) + # Test repr works on wide unicode escapes without overflow. + self.assertEqual(repr(u"\U00010000" * 39 + u"\uffff" * 4096), + repr(u"\U00010000" * 39 + u"\uffff" * 4096)) + def test_count(self): string_tests.CommonTest.test_count(self) Modified: python/branches/release25-maint/Misc/ACKS ============================================================================== --- python/branches/release25-maint/Misc/ACKS (original) +++ python/branches/release25-maint/Misc/ACKS Tue Aug 22 00:13:11 2006 @@ -365,6 +365,7 @@ Soren Larsen Piers Lauder Ben Laurie +Simon Law Chris Lawrence Christopher Lee Inyeol Lee Modified: python/branches/release25-maint/Misc/NEWS ============================================================================== --- python/branches/release25-maint/Misc/NEWS (original) +++ python/branches/release25-maint/Misc/NEWS Tue Aug 22 00:13:11 2006 @@ -9,6 +9,13 @@ *Release date: XX-SEP-2006* +Core and builtins +----------------- + +- Patch #1541585: fix buffer overrun when performing repr() on + a unicode string in a build with wide unicode (UCS-4) support. + + Library ------- Modified: python/branches/release25-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release25-maint/Objects/unicodeobject.c (original) +++ python/branches/release25-maint/Objects/unicodeobject.c Tue Aug 22 00:13:11 2006 @@ -2040,7 +2040,28 @@ static const char *hexdigit = "0123456789abcdef"; - repr = PyString_FromStringAndSize(NULL, 2 + 6*size + 1); + /* Initial allocation is based on the longest-possible unichr + escape. + + In wide (UTF-32) builds '\U00xxxxxx' is 10 chars per source + unichr, so in this case it's the longest unichr escape. In + narrow (UTF-16) builds this is five chars per source unichr + since there are two unichrs in the surrogate pair, so in narrow + (UTF-16) builds it's not the longest unichr escape. + + In wide or narrow builds '\uxxxx' is 6 chars per source unichr, + so in the narrow (UTF-16) build case it's the longest unichr + escape. + */ + + repr = PyString_FromStringAndSize(NULL, + 2 +#ifdef Py_UNICODE_WIDE + + 10*size +#else + + 6*size +#endif + + 1); if (repr == NULL) return NULL; @@ -2065,15 +2086,6 @@ #ifdef Py_UNICODE_WIDE /* Map 21-bit characters to '\U00xxxxxx' */ else if (ch >= 0x10000) { - Py_ssize_t offset = p - PyString_AS_STRING(repr); - - /* Resize the string if necessary */ - if (offset + 12 > PyString_GET_SIZE(repr)) { - if (_PyString_Resize(&repr, PyString_GET_SIZE(repr) + 100)) - return NULL; - p = PyString_AS_STRING(repr) + offset; - } - *p++ = '\\'; *p++ = 'U'; *p++ = hexdigit[(ch >> 28) & 0x0000000F]; @@ -2086,8 +2098,8 @@ *p++ = hexdigit[ch & 0x0000000F]; continue; } -#endif - /* Map UTF-16 surrogate pairs to Unicode \UXXXXXXXX escapes */ +#else + /* Map UTF-16 surrogate pairs to '\U00xxxxxx' */ else if (ch >= 0xD800 && ch < 0xDC00) { Py_UNICODE ch2; Py_UCS4 ucs; @@ -2112,6 +2124,7 @@ s--; size++; } +#endif /* Map 16-bit characters to '\uxxxx' */ if (ch >= 256) { From python-checkins at python.org Tue Aug 22 00:21:20 2006 From: python-checkins at python.org (neal.norwitz) Date: Tue, 22 Aug 2006 00:21:20 +0200 (CEST) Subject: [Python-checkins] r51450 - in python/trunk: Lib/test/test_unicode.py Misc/ACKS Objects/unicodeobject.c Message-ID: <20060821222120.63F851E4009@bag.python.org> Author: neal.norwitz Date: Tue Aug 22 00:21:19 2006 New Revision: 51450 Modified: python/trunk/Lib/test/test_unicode.py python/trunk/Misc/ACKS python/trunk/Objects/unicodeobject.c Log: Patch #1541585: fix buffer overrun when performing repr() on a unicode string in a build with wide unicode (UCS-4) support. This code could be improved, so add an XXX comment. Modified: python/trunk/Lib/test/test_unicode.py ============================================================================== --- python/trunk/Lib/test/test_unicode.py (original) +++ python/trunk/Lib/test/test_unicode.py Tue Aug 22 00:21:19 2006 @@ -92,6 +92,10 @@ "\\xfe\\xff'") testrepr = repr(u''.join(map(unichr, xrange(256)))) self.assertEqual(testrepr, latin1repr) + # Test repr works on wide unicode escapes without overflow. + self.assertEqual(repr(u"\U00010000" * 39 + u"\uffff" * 4096), + repr(u"\U00010000" * 39 + u"\uffff" * 4096)) + def test_count(self): string_tests.CommonTest.test_count(self) Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Tue Aug 22 00:21:19 2006 @@ -365,6 +365,7 @@ Soren Larsen Piers Lauder Ben Laurie +Simon Law Chris Lawrence Christopher Lee Inyeol Lee Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Tue Aug 22 00:21:19 2006 @@ -2040,7 +2040,32 @@ static const char *hexdigit = "0123456789abcdef"; - repr = PyString_FromStringAndSize(NULL, 2 + 6*size + 1); + /* XXX(nnorwitz): rather than over-allocating, it would be + better to choose a different scheme. Perhaps scan the + first N-chars of the string and allocate based on that size. + */ + /* Initial allocation is based on the longest-possible unichr + escape. + + In wide (UTF-32) builds '\U00xxxxxx' is 10 chars per source + unichr, so in this case it's the longest unichr escape. In + narrow (UTF-16) builds this is five chars per source unichr + since there are two unichrs in the surrogate pair, so in narrow + (UTF-16) builds it's not the longest unichr escape. + + In wide or narrow builds '\uxxxx' is 6 chars per source unichr, + so in the narrow (UTF-16) build case it's the longest unichr + escape. + */ + + repr = PyString_FromStringAndSize(NULL, + 2 +#ifdef Py_UNICODE_WIDE + + 10*size +#else + + 6*size +#endif + + 1); if (repr == NULL) return NULL; @@ -2065,15 +2090,6 @@ #ifdef Py_UNICODE_WIDE /* Map 21-bit characters to '\U00xxxxxx' */ else if (ch >= 0x10000) { - Py_ssize_t offset = p - PyString_AS_STRING(repr); - - /* Resize the string if necessary */ - if (offset + 12 > PyString_GET_SIZE(repr)) { - if (_PyString_Resize(&repr, PyString_GET_SIZE(repr) + 100)) - return NULL; - p = PyString_AS_STRING(repr) + offset; - } - *p++ = '\\'; *p++ = 'U'; *p++ = hexdigit[(ch >> 28) & 0x0000000F]; @@ -2086,8 +2102,8 @@ *p++ = hexdigit[ch & 0x0000000F]; continue; } -#endif - /* Map UTF-16 surrogate pairs to Unicode \UXXXXXXXX escapes */ +#else + /* Map UTF-16 surrogate pairs to '\U00xxxxxx' */ else if (ch >= 0xD800 && ch < 0xDC00) { Py_UNICODE ch2; Py_UCS4 ucs; @@ -2112,6 +2128,7 @@ s--; size++; } +#endif /* Map 16-bit characters to '\uxxxx' */ if (ch >= 256) { From buildbot at python.org Tue Aug 22 00:28:50 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 21 Aug 2006 22:28:50 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian 2.5 Message-ID: <20060821222850.A6B181E400D@bag.python.org> The Buildbot has detected a new failure of alpha Debian 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%25202.5/builds/6 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Tue Aug 22 01:16:14 2006 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 22 Aug 2006 01:16:14 +0200 (CEST) Subject: [Python-checkins] r51452 - python/branches/int_unification Message-ID: <20060821231614.BBD571E4009@bag.python.org> Author: martin.v.loewis Date: Tue Aug 22 01:16:13 2006 New Revision: 51452 Added: python/branches/int_unification/ - copied from r51451, python/branches/p3yk/ Log: Branch from p3yk for long/int-unification. From python-checkins at python.org Tue Aug 22 01:31:06 2006 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 22 Aug 2006 01:31:06 +0200 (CEST) Subject: [Python-checkins] r51453 - in python/branches: unlabeled-1.1.1 unlabeled-1.1.2 unlabeled-1.2.2 unlabeled-1.23.4 unlabeled-1.3.2 unlabeled-1.5.2 unlabeled-1.5.4 unlabeled-1.8.2 unlabeled-1.9.2 unlabeled-1.98.2 unlabeled-2.1.2 unlabeled-2.10.2 unlabeled-2.108.2 unlabeled-2.16.2 unlabeled-2.25.2 unlabeled-2.3.2 unlabeled-2.36.2 unlabeled-2.54.2 unlabeled-2.9.2 unlabeled-2.9.4 Message-ID: <20060821233106.D38451E4009@bag.python.org> Author: martin.v.loewis Date: Tue Aug 22 01:31:05 2006 New Revision: 51453 Removed: python/branches/unlabeled-1.1.1/ python/branches/unlabeled-1.1.2/ python/branches/unlabeled-1.2.2/ python/branches/unlabeled-1.23.4/ python/branches/unlabeled-1.3.2/ python/branches/unlabeled-1.5.2/ python/branches/unlabeled-1.5.4/ python/branches/unlabeled-1.8.2/ python/branches/unlabeled-1.9.2/ python/branches/unlabeled-1.98.2/ python/branches/unlabeled-2.1.2/ python/branches/unlabeled-2.10.2/ python/branches/unlabeled-2.108.2/ python/branches/unlabeled-2.16.2/ python/branches/unlabeled-2.25.2/ python/branches/unlabeled-2.3.2/ python/branches/unlabeled-2.36.2/ python/branches/unlabeled-2.54.2/ python/branches/unlabeled-2.9.2/ python/branches/unlabeled-2.9.4/ Log: Remove unlabeled branches; these are vestiges from the CVS conversion. From buildbot at python.org Tue Aug 22 01:38:08 2006 From: buildbot at python.org (buildbot at python.org) Date: Mon, 21 Aug 2006 23:38:08 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060821233808.C65181E4009@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/53 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Tue Aug 22 01:44:48 2006 From: python-checkins at python.org (neal.norwitz) Date: Tue, 22 Aug 2006 01:44:48 +0200 (CEST) Subject: [Python-checkins] r51456 - python/trunk/PCbuild/pythoncore.vcproj Message-ID: <20060821234448.7D74D1E4009@bag.python.org> Author: neal.norwitz Date: Tue Aug 22 01:44:48 2006 New Revision: 51456 Modified: python/trunk/PCbuild/pythoncore.vcproj Log: Try to get the windows bots working again with the new peephole.c Modified: python/trunk/PCbuild/pythoncore.vcproj ============================================================================== --- python/trunk/PCbuild/pythoncore.vcproj (original) +++ python/trunk/PCbuild/pythoncore.vcproj Tue Aug 22 01:44:48 2006 @@ -464,6 +464,9 @@ RelativePath="..\Python\compile.c"> + + Author: brett.cannon Date: Tue Aug 22 01:54:07 2006 New Revision: 51458 Added: peps/trunk/pep-0362.txt (contents, props changed) Modified: peps/trunk/pep-0000.txt Log: PEP 362: Function Signature Object. Modified: peps/trunk/pep-0000.txt ============================================================================== --- peps/trunk/pep-0000.txt (original) +++ peps/trunk/pep-0000.txt Tue Aug 22 01:54:07 2006 @@ -97,6 +97,7 @@ S 354 Enumerations in Python Finney S 355 Path - Object oriented filesystem paths Lindqvist S 358 The "bytes" Object Schemenauer + S 362 Function Signature Object Cannon, Seo S 754 IEEE 754 Floating Point Special Values Warnes S 3101 Advanced String Formatting Talin S 3102 Keyword-Only Arguments Talin @@ -425,6 +426,7 @@ SW 359 The "make" Statement Bethard I 360 Externally Maintained Packages Cannon I 361 Python 2.6 Release Schedule Norwitz, et al + S 362 Function Signature Object Cannon, Seo SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes P 3000 Python 3000 GvR @@ -529,6 +531,7 @@ Sajip, Vinay vinay_sajip at red-dove.com Schemenauer, Neil nas at arctrix.com Schneider-Kamp, Peter nowonder at nowonder.de + Seo, Jiwon seojiwon at gmail.com Smith, Kevin D. Kevin.Smith at theMorgue.org Stein, Greg gstein at lyra.org Suzi, Roman rnd at onego.ru Added: peps/trunk/pep-0362.txt ============================================================================== --- (empty file) +++ peps/trunk/pep-0362.txt Tue Aug 22 01:54:07 2006 @@ -0,0 +1,175 @@ +PEP: 362 +Title: Function Signature Object +Version: $Revision$ +Last-Modified: $Date$ +Author: Brett Cannon + Jiwon Seo +Status: Draft +Type: Standards Track +Python-Version: 2.6 +Content-Type: text/x-rst +Created: 21-Aug-2006 + + +Abstract +======== + +Python has always supported powerful introspection capabilities, +including that for functions. Taking a function object, you can fully +reconstruct the function signature using ``func_defaults``, +``func_code.co_argcount``, ``func_code.co_flags``, and +``func_code.co_varnames``. Unfortunately this is a little unruly +having to look at four different attributes to pull together complete +information for a function's signature. + +This PEP proposes an object representation for function signatures. +This should help facilitate introspection on functions. It also helps +for introspection for decorators that wrap the function they are +applied to by allowing the wrapped function's signature object be set +for the wrapping function. + + +Signature Object +================ + +The overall signature of an object is represented by the Signature +object. This object is to store Parameter objects (discussed later) +along with any information about the function itself and any +parameters that are highly unique (.e.g, ``*args``). + +A Signature object has the following structure attributes: + +* name:str + Name of the function. +* var_args:str + Name of the ``*args`` parameter, if present, else the empty + string. +* var_kw_args:str + Name of the ``**kwargs`` parameter, if present, else the empty + string. +* parameters:list(Parameter) + List of the parameters of the function are represented by + Parameter objects (see `Parameter Object`_ for their + description). + +The Signature object is stored in the ``__signature__`` attribute of +the function. When it is to be created is an `Open Issues`_. + + +Parameter Object +================ + +A function's signature is partially made up of several parameters. +Python's different kinds of parameters is quite large and rich and +continues to grow. This means that Parameter objects require they +represent any possible parameter. + +Originally the plan was to represent parameters using a list of +parameter names on the Signature object along with various dicts keyed +on parameter names to disseminate the various possible pieces of +information one can know about a parameter. But the decision was made +to incorporate all information about a parameter in a single argument +so as to make extending the information easier. This was originally +put forth by Talin and the preferred form of Guido (as discussed at +the 2006 Google Sprint). + +The structure of the Parameter object is: + +* name:(str | tuple(str)) + The name of the parameter as a string if it is not a tuple. If + the argument is a tuple, use a tuple of strings where each item is + the name of the parameter contained within the tuple. +* position:int + The position of the parameter within the signature of the + function (zero-indexed). +* has_default:bool + True if the parameter has a default value, else False. +* default_value:object + The default value for the parameter, if present, else the + attribute does not exist. This is done so that the attribute is + not accidentally used if no default value is set as any default + value could be a legitimate default value itself. + + +Implementation +============== + +An implementation is forthcoming for experimentation purposes based on +the 'inspect' module [#inspect-module]_. The classes will be exposed +in the 'inspect' module as well. This PEP has been posted without +implementation so as to not be a hinderance to another PEP that is +under development by another author. + + +Relation With Other PEPs +======================== + +"Keyword-Only Arguments [#pep-3102]_ +------------------------------------ + +If keyword-only parameters come into existence, the Parameter object +will require modification. A ``keyword_only`` attribute will be added +that holds a boolean representing whether the parameter is +keyword-only or not. + +As to whether the keyword-only parameters should be stored in the +``parameters`` attribute of a Signature object or in a set is +discussed in `Open Issues`_. + + +Open Issues +=========== + +When to construct the Parameter object? +--------------------------------------- + +The Parameter object can either be created in an eager or lazy +fashion. In the eager situation, the object can be created during +creation of the function object. In the lazy situation, one would +pass a function object to ``inspect.signature()`` and that would +generate the Signature object and store it to ``__signature__`` if +needed, and then return the value of ``__signature__``. + + +Where should keyword-only parameters be stored in the Signature object? +----------------------------------------------------------------------- + +If PEP 3102 [#pep-3102]_ ends up being accepted, there is the +possibility that storing keyword-only parameters in a set instead of +in the ``parameters`` attribute of the Signature object makes more +sense. Since keyword-only parameters do not have any semantic meaning +in terms of their position within the signature, there is no direct +semantic gain in storing it in the parameter list. + +Storing keyword-only paramaters in a set makes it much more explicit +that keyword-only parameters have no inherent order. It does have the +drawback, though, that if one wants to process all parameters at once +they would need to perform extra work to make sure to go through both +the parameter list and set. + + +References +========== + +.. [#inspect-module] ``inspect`` -- Inspect live objects + (http://docs.python.org/lib/module-inspect.html) + +.. [#pep-3102] Keyword-Only Arguments + (http://www.python.org/dev/peps/pep-3102/) + + +Copyright +========= + +This document has been placed in the public domain. + + + +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + coding: utf-8 + End: From buildbot at python.org Tue Aug 22 02:10:28 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 22 Aug 2006 00:10:28 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper 2.5 Message-ID: <20060822001028.94A861E4009@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%25202.5/builds/9 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Tue Aug 22 02:18:31 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 22 Aug 2006 00:18:31 +0000 Subject: [Python-checkins] buildbot warnings in x86 gentoo trunk Message-ID: <20060822001831.F28B11E4009@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520gentoo%2520trunk/builds/1547 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings failed slave lost sincerely, -The Buildbot From buildbot at python.org Tue Aug 22 02:52:15 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 22 Aug 2006 00:52:15 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060822005215.704BC1E4009@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/524 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Tue Aug 22 02:56:57 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 22 Aug 2006 00:56:57 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) trunk Message-ID: <20060822005657.B49BC1E4009@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%2520trunk/builds/913 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings failed slave lost sincerely, -The Buildbot From buildbot at python.org Tue Aug 22 04:27:22 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 22 Aug 2006 02:27:22 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060822022723.125791E4009@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/55 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Tue Aug 22 09:36:06 2006 From: python-checkins at python.org (anthony.baxter) Date: Tue, 22 Aug 2006 09:36:06 +0200 (CEST) Subject: [Python-checkins] r51460 - python/branches/release25-maint/Doc/lib/libuuid.tex Message-ID: <20060822073606.97DCB1E4009@bag.python.org> Author: anthony.baxter Date: Tue Aug 22 09:36:06 2006 New Revision: 51460 Modified: python/branches/release25-maint/Doc/lib/libuuid.tex Log: patch for documentation for recent uuid changes (from ping) Modified: python/branches/release25-maint/Doc/lib/libuuid.tex ============================================================================== --- python/branches/release25-maint/Doc/lib/libuuid.tex (original) +++ python/branches/release25-maint/Doc/lib/libuuid.tex Tue Aug 22 09:36:06 2006 @@ -18,20 +18,11 @@ network address. \function{uuid4()} creates a random UUID. \begin{classdesc}{UUID}{\optional{hex\optional{, bytes\optional{, -fields\optional{, int\optional{, version}}}}}} - -%Instances of the UUID class represent UUIDs as specified in RFC 4122. -%UUID objects are immutable, hashable, and usable as dictionary keys. -%Converting a UUID to a string with str() yields something in the form -%'12345678-1234-1234-1234-123456789abc'. The UUID constructor accepts -%four possible forms: a similar string of hexadecimal digits, or a -%string of 16 raw bytes as an argument named 'bytes', or a tuple of -%six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and -%48-bit values respectively) as an argument named 'fields', or a single -%128-bit integer as an argument named 'int'. +bytes_le\optional{, fields\optional{, int\optional{, version}}}}}}} Create a UUID from either a string of 32 hexadecimal digits, -a string of 16 bytes as the \var{bytes} argument, a tuple of six +a string of 16 bytes as the \var{bytes} argument, a string of 16 bytes +in little-endian order as the \var{bytes_le} argument, a tuple of six integers (32-bit \var{time_low}, 16-bit \var{time_mid}, 16-bit \var{time_hi_version}, 8-bit \var{clock_seq_hi_variant}, 8-bit \var{clock_seq_low}, 48-bit \var{node}) @@ -45,22 +36,31 @@ UUID('12345678123456781234567812345678') UUID('urn:uuid:12345678-1234-5678-1234-567812345678') UUID(bytes='\x12\x34\x56\x78'*4) +UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' + + '\x12\x34\x56\x78\x12\x34\x56\x78') UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678)) UUID(int=0x12345678123456781234567812345678) \end{verbatim} -Exactly one of \var{hex}, \var{bytes}, \var{fields}, or \var{int} must +Exactly one of \var{hex}, \var{bytes}, \var{bytes_le}, \var{fields}, +or \var{int} must be given. The \var{version} argument is optional; if given, the resulting UUID will have its variant and version number set according to RFC 4122, overriding bits in the given \var{hex}, \var{bytes}, -\var{fields}, or \var{int}. +\var{bytes_le}, \var{fields}, or \var{int}. \end{classdesc} \class{UUID} instances have these read-only attributes: \begin{memberdesc}{bytes} -The UUID as a 16-byte string. +The UUID as a 16-byte string (containing the six +integer fields in big-endian byte order). +\end{memberdesc} + +\begin{memberdesc}{bytes_le} +The UUID as a 16-byte string (with \var{time_low}, \var{time_mid}, +and \var{time_hi_version} in little-endian byte order). \end{memberdesc} \begin{memberdesc}{fields} From python-checkins at python.org Tue Aug 22 09:36:59 2006 From: python-checkins at python.org (anthony.baxter) Date: Tue, 22 Aug 2006 09:36:59 +0200 (CEST) Subject: [Python-checkins] r51461 - python/trunk/Doc/lib/libuuid.tex Message-ID: <20060822073659.F31991E4009@bag.python.org> Author: anthony.baxter Date: Tue Aug 22 09:36:59 2006 New Revision: 51461 Modified: python/trunk/Doc/lib/libuuid.tex Log: patch for documentation for recent uuid changes (from ping) Modified: python/trunk/Doc/lib/libuuid.tex ============================================================================== --- python/trunk/Doc/lib/libuuid.tex (original) +++ python/trunk/Doc/lib/libuuid.tex Tue Aug 22 09:36:59 2006 @@ -18,20 +18,11 @@ network address. \function{uuid4()} creates a random UUID. \begin{classdesc}{UUID}{\optional{hex\optional{, bytes\optional{, -fields\optional{, int\optional{, version}}}}}} - -%Instances of the UUID class represent UUIDs as specified in RFC 4122. -%UUID objects are immutable, hashable, and usable as dictionary keys. -%Converting a UUID to a string with str() yields something in the form -%'12345678-1234-1234-1234-123456789abc'. The UUID constructor accepts -%four possible forms: a similar string of hexadecimal digits, or a -%string of 16 raw bytes as an argument named 'bytes', or a tuple of -%six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and -%48-bit values respectively) as an argument named 'fields', or a single -%128-bit integer as an argument named 'int'. +bytes_le\optional{, fields\optional{, int\optional{, version}}}}}}} Create a UUID from either a string of 32 hexadecimal digits, -a string of 16 bytes as the \var{bytes} argument, a tuple of six +a string of 16 bytes as the \var{bytes} argument, a string of 16 bytes +in little-endian order as the \var{bytes_le} argument, a tuple of six integers (32-bit \var{time_low}, 16-bit \var{time_mid}, 16-bit \var{time_hi_version}, 8-bit \var{clock_seq_hi_variant}, 8-bit \var{clock_seq_low}, 48-bit \var{node}) @@ -45,22 +36,31 @@ UUID('12345678123456781234567812345678') UUID('urn:uuid:12345678-1234-5678-1234-567812345678') UUID(bytes='\x12\x34\x56\x78'*4) +UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' + + '\x12\x34\x56\x78\x12\x34\x56\x78') UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678)) UUID(int=0x12345678123456781234567812345678) \end{verbatim} -Exactly one of \var{hex}, \var{bytes}, \var{fields}, or \var{int} must +Exactly one of \var{hex}, \var{bytes}, \var{bytes_le}, \var{fields}, +or \var{int} must be given. The \var{version} argument is optional; if given, the resulting UUID will have its variant and version number set according to RFC 4122, overriding bits in the given \var{hex}, \var{bytes}, -\var{fields}, or \var{int}. +\var{bytes_le}, \var{fields}, or \var{int}. \end{classdesc} \class{UUID} instances have these read-only attributes: \begin{memberdesc}{bytes} -The UUID as a 16-byte string. +The UUID as a 16-byte string (containing the six +integer fields in big-endian byte order). +\end{memberdesc} + +\begin{memberdesc}{bytes_le} +The UUID as a 16-byte string (with \var{time_low}, \var{time_mid}, +and \var{time_hi_version} in little-endian byte order). \end{memberdesc} \begin{memberdesc}{fields} From python-checkins at python.org Tue Aug 22 10:25:35 2006 From: python-checkins at python.org (georg.brandl) Date: Tue, 22 Aug 2006 10:25:35 +0200 (CEST) Subject: [Python-checkins] r51466 - in python/branches/release24-maint: Lib/test/test_unicode.py Misc/ACKS Misc/NEWS Objects/unicodeobject.c Message-ID: <20060822082535.8DA661E400C@bag.python.org> Author: georg.brandl Date: Tue Aug 22 10:25:33 2006 New Revision: 51466 Modified: python/branches/release24-maint/Lib/test/test_unicode.py python/branches/release24-maint/Misc/ACKS python/branches/release24-maint/Misc/NEWS python/branches/release24-maint/Objects/unicodeobject.c Log: Backport rev 51448: - Patch #1541585: fix buffer overrun when performing repr() on a unicode string in a build with wide unicode (UCS-4) support. Modified: python/branches/release24-maint/Lib/test/test_unicode.py ============================================================================== --- python/branches/release24-maint/Lib/test/test_unicode.py (original) +++ python/branches/release24-maint/Lib/test/test_unicode.py Tue Aug 22 10:25:33 2006 @@ -92,6 +92,10 @@ "\\xfe\\xff'") testrepr = repr(u''.join(map(unichr, xrange(256)))) self.assertEqual(testrepr, latin1repr) + # Test repr works on wide unicode escapes without overflow. + self.assertEqual(repr(u"\U00010000" * 39 + u"\uffff" * 4096), + repr(u"\U00010000" * 39 + u"\uffff" * 4096)) + def test_count(self): string_tests.CommonTest.test_count(self) Modified: python/branches/release24-maint/Misc/ACKS ============================================================================== --- python/branches/release24-maint/Misc/ACKS (original) +++ python/branches/release24-maint/Misc/ACKS Tue Aug 22 10:25:33 2006 @@ -348,6 +348,7 @@ Soren Larsen Piers Lauder Ben Laurie +Simon Law Chris Lawrence Christopher Lee Inyeol Lee Modified: python/branches/release24-maint/Misc/NEWS ============================================================================== --- python/branches/release24-maint/Misc/NEWS (original) +++ python/branches/release24-maint/Misc/NEWS Tue Aug 22 10:25:33 2006 @@ -12,6 +12,9 @@ Core and builtins ----------------- +- Patch #1541585: fix buffer overrun when performing repr() on + a unicode string in a build with wide unicode (UCS-4) support. + - Bug #1536786: buffer comparison could emit a RuntimeWarning. - Bug #1535165: fixed a segfault in input() and raw_input() when @@ -33,6 +36,7 @@ - Patch #1488312, Fix memory alignment problem on SPARC in unicode + Extension Modules ----------------- @@ -72,6 +76,7 @@ methods now allow their database parameter to be None as the sleepycat API allows. + Library ------- Modified: python/branches/release24-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release24-maint/Objects/unicodeobject.c (original) +++ python/branches/release24-maint/Objects/unicodeobject.c Tue Aug 22 10:25:33 2006 @@ -1970,7 +1970,28 @@ static const char *hexdigit = "0123456789abcdef"; - repr = PyString_FromStringAndSize(NULL, 2 + 6*size + 1); + /* Initial allocation is based on the longest-possible unichr + escape. + + In wide (UTF-32) builds '\U00xxxxxx' is 10 chars per source + unichr, so in this case it's the longest unichr escape. In + narrow (UTF-16) builds this is five chars per source unichr + since there are two unichrs in the surrogate pair, so in narrow + (UTF-16) builds it's not the longest unichr escape. + + In wide or narrow builds '\uxxxx' is 6 chars per source unichr, + so in the narrow (UTF-16) build case it's the longest unichr + escape. + */ + + repr = PyString_FromStringAndSize(NULL, + 2 +#ifdef Py_UNICODE_WIDE + + 10*size +#else + + 6*size +#endif + + 1); if (repr == NULL) return NULL; @@ -1995,15 +2016,6 @@ #ifdef Py_UNICODE_WIDE /* Map 21-bit characters to '\U00xxxxxx' */ else if (ch >= 0x10000) { - int offset = p - PyString_AS_STRING(repr); - - /* Resize the string if necessary */ - if (offset + 12 > PyString_GET_SIZE(repr)) { - if (_PyString_Resize(&repr, PyString_GET_SIZE(repr) + 100)) - return NULL; - p = PyString_AS_STRING(repr) + offset; - } - *p++ = '\\'; *p++ = 'U'; *p++ = hexdigit[(ch >> 28) & 0x0000000F]; @@ -2016,8 +2028,8 @@ *p++ = hexdigit[ch & 0x0000000F]; continue; } -#endif - /* Map UTF-16 surrogate pairs to Unicode \UXXXXXXXX escapes */ +#else + /* Map UTF-16 surrogate pairs to '\U00xxxxxx' */ else if (ch >= 0xD800 && ch < 0xDC00) { Py_UNICODE ch2; Py_UCS4 ucs; @@ -2042,6 +2054,7 @@ s--; size++; } +#endif /* Map 16-bit characters to '\uxxxx' */ if (ch >= 256) { From buildbot at python.org Tue Aug 22 10:30:46 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 22 Aug 2006 08:30:46 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian trunk Message-ID: <20060822083046.6933A1E4009@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%2520trunk/builds/431 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl Build Had Warnings: warnings failed slave lost sincerely, -The Buildbot From buildbot at python.org Tue Aug 22 11:59:26 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 22 Aug 2006 09:59:26 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian 2.4 Message-ID: <20060822095926.89CB31E4009@bag.python.org> The Buildbot has detected a new failure of alpha Debian 2.4. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%25202.4/builds/11 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release24-maint] HEAD Blamelist: georg.brandl Build Had Warnings: warnings test sincerely, -The Buildbot From ncoghlan at gmail.com Tue Aug 22 12:19:32 2006 From: ncoghlan at gmail.com (Nick Coghlan) Date: Tue, 22 Aug 2006 20:19:32 +1000 Subject: [Python-checkins] r51438 - in python/branches/p3yk: Doc/api/abstract.tex Doc/api/concrete.tex Doc/api/exceptions.tex Doc/api/init.tex Doc/api/intro.tex Doc/api/newtypes.tex Doc/commontex/boilerplate.tex Doc/dist/dist.tex Doc/lib/libctypes.tex Doc/lib/libexcs.tex Doc/lib/libwarnings.tex Doc/whatsnew/whatsnew25.tex Include/abstract.h Include/code.h Include/import.h Include/object.h Include/pyerrors.h Include/unicodeobject.h Lib/Cookie.py Lib/cgi.py Lib/compiler/ast.py Lib/compiler/pycodegen.py Lib/compiler/symbols.py Lib/ctypes/__init__.py Lib/ctypes/test/test_as_parameter.py Lib/ctypes/test/test_functions.py Lib/ctypes/test/test_numbers.py Lib/ctypes/test/test_prototypes.py Lib/ctypes/test/test_python_api.py Lib/distutils/__init__.py Lib/idlelib/Bindings.py Lib/idlelib/CREDITS.txt Lib/idlelib/CodeContext.py Lib/idlelib/NEWS.txt Lib/idlelib/PyShell.py Lib/idlelib/idlever.py Lib/logging/__init__.py Lib/logging/config.py Lib/site.py Lib/string.py Lib/tabnanny.py Lib/tarfile.py Lib/test/exception_hierarchy.txt Lib/test/inspect_fodder2.py Lib/test/output/test_cgi Lib/test/test_bytes.py Lib/test/test_bz2.py Lib/test/test_cgi.py Lib/test/test_compiler.py Lib/test/test_format.py Lib/test/test_index.py Lib/test/test_inspect.py Lib/test/test_logging.py Lib/test/test_mailbox.py Lib/test/test_signal.py Lib/test/test_socketserver.py Lib/test/test_tarfile.py Lib/test/test_threading.py Lib/test/test_threadsignals.py Lib/test/test_urllib2.py Lib/test/test_uuid.py Lib/test/test_xml_etree_c.py Lib/tokenize.py Lib/trace.py Lib/urllib2.py Lib/uuid.py Makefile.pre.in Misc/ACKS Misc/PURIFY.README Misc/README.klocwork Misc/RPM/python-2.5.spec Misc/RPM/python-2.6.spec Misc/build.sh Modules/_bsddb.c Modules/_codecsmodule.c Modules/_ctypes/_ctypes.c Modules/_ctypes/_ctypes_test.c Modules/_ctypes/callbacks.c Modules/_ctypes/callproc.c Modules/_ctypes/cfield.c Modules/_ctypes/ctypes.h Modules/_ctypes/libffi/configure Modules/_ctypes/libffi/configure.ac Modules/_ctypes/libffi/fficonfig.py.in Modules/_ctypes/stgdict.c Modules/_cursesmodule.c Modules/_elementtree.c Modules/_hotshot.c Modules/_sre.c Modules/_tkinter.c Modules/arraymodule.c Modules/bz2module.c Modules/collectionsmodule.c Modules/expat/xmlparse.c Modules/mmapmodule.c Modules/operator.c Modules/posixmodule.c Modules/rgbimgmodule.c Modules/socketmodule.c Modules/unicodedata.c Modules/zipimport.c Objects/abstract.c Objects/bytesobject.c Objects/exceptions.c Objects/intobject.c Objects/listobject.c Objects/longobject.c Objects/object.c Objects/sliceobject.c Objects/stringobject.c Objects/structseq.c Objects/tupleobject.c Objects/typeobject.c Objects/unicodeobject.c PC/pyconfig.h PCbuild/_ssl.mak PCbuild/_ssl.vcproj PCbuild/build_ssl.py PCbuild/pythoncore.vcproj PCbuild/readme.txt Parser Parser/grammar.c Parser/parsetok.c Python/ast.c Python/bltinmodule.c Python/ceval.c Python/compile.c Python/import.c Python/marshal.c Python/peephole.c Python/pystate.c Python/pythonrun.c Python/symtable.c Tools/buildbot Tools/buildbot/external.bat Tools/msi/msi.py In-Reply-To: <20060821190754.922A61E4009@bag.python.org> References: <20060821190754.922A61E4009@bag.python.org> Message-ID: <44EADA34.5030604@gmail.com> thomas.wouters wrote: > Log: > > Merge current trunk into p3yk. This includes the PyNumber_Index API change, > which unfortunately means the errors from the bytes type change somewhat: > > bytes([300]) still raises a ValueError, but bytes([10**100]) now raises a > TypeError (either that, or bytes(1.0) also raises a ValueError -- > PyNumber_AsSsize_t() can only raise one type of exception.) That's not right. The error argument for PyNumber_AsSsize_t is only used for overflow handling (that's why it's always either IndexError or OverflowError in the core). The TypeError for non-integers (like 1.0) is raised separately (even if you set the error argument to NULL to request clipping). Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org From python-checkins at python.org Tue Aug 22 14:37:30 2006 From: python-checkins at python.org (andrew.kuchling) Date: Tue, 22 Aug 2006 14:37:30 +0200 (CEST) Subject: [Python-checkins] r51470 - sandbox/trunk/trackers Message-ID: <20060822123730.4A7F81E400A@bag.python.org> Author: andrew.kuchling Date: Tue Aug 22 14:37:29 2006 New Revision: 51470 Added: sandbox/trunk/trackers/ Log: Add tracker info From python-checkins at python.org Tue Aug 22 14:37:46 2006 From: python-checkins at python.org (andrew.kuchling) Date: Tue, 22 Aug 2006 14:37:46 +0200 (CEST) Subject: [Python-checkins] r51471 - sandbox/trunk/trackers/trackers.txt Message-ID: <20060822123746.762531E400A@bag.python.org> Author: andrew.kuchling Date: Tue Aug 22 14:37:46 2006 New Revision: 51471 Added: sandbox/trunk/trackers/trackers.txt Log: Record default login info for future reference Added: sandbox/trunk/trackers/trackers.txt ============================================================================== --- (empty file) +++ sandbox/trunk/trackers/trackers.txt Tue Aug 22 14:37:46 2006 @@ -0,0 +1,45 @@ + +Jira +========================= + +You can find the JIRA test instance at: + + http://jira.python.atlassian.com/secure/Dashboard.jspa + +All the infrastructure committee members have admin-level accounts in +the form "first initial + lastname". + + akuchling + bcannon + bwarsaw + mloewis + rjones + twouters + +You can have your password emailed to you by visiting the forgot +password page and entering your username: + + http://jira.python.atlassian.com/secure/ForgotPassword!default.jspa + + +Launchpad +========================= + +Launchpad uses email addresses to identify the user when logging in (a +user can use any of their validated addresses to log in with). For +the import, we used the $USER at users.sourceforge.net email addresses. +I outlined the use of the password recovery on the following wiki +page: http://wiki.python.org/moin/LaunchpadTracker + +Note that we've got an outgoing email filter in place for the demo +instance, so people not listed on that page (currently just the +infrastructure committee) won't receive any email. + +To make things a little easier for you though, I went through the list +of Python developers and did a quick search to see if they had +Launchpad accounts already. For those I noticed, I linked the SF +email address to the existing account. So you should be able to log +into the demo instance using your existing "amk" account with your +existing password. + + From thomas at python.org Tue Aug 22 15:41:46 2006 From: thomas at python.org (Thomas Wouters) Date: Tue, 22 Aug 2006 15:41:46 +0200 Subject: [Python-checkins] r51438 - in python/branches/p3yk: Doc/api/abstract.tex Doc/api/concrete.tex Doc/api/exceptions.tex Doc/api/init.tex Doc/api/intro.tex Doc/api/newtypes.tex Doc/commontex/boilerplate.tex Doc/dist/dist.tex Doc/lib/libctypes.tex Doc Message-ID: <9e804ac0608220641s196cfd06s5fe68c2c5cc235b9@mail.gmail.com> On 8/22/06, Nick Coghlan wrote: > > The error argument for PyNumber_AsSsize_t is only used for > overflow handling (that's why it's always either IndexError or > OverflowError > in the core). The TypeError for non-integers (like 1.0) is raised > separately > (even if you set the error argument to NULL to request clipping). Thanks, fixed. -- Thomas Wouters Hi! I'm a .signature virus! copy me into your .signature file to help me spread! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20060822/b0539b05/attachment.htm From python-checkins at python.org Tue Aug 22 15:56:57 2006 From: python-checkins at python.org (neal.norwitz) Date: Tue, 22 Aug 2006 15:56:57 +0200 (CEST) Subject: [Python-checkins] r51473 - python/trunk/Modules/mmapmodule.c Message-ID: <20060822135657.9314C1E401D@bag.python.org> Author: neal.norwitz Date: Tue Aug 22 15:56:56 2006 New Revision: 51473 Modified: python/trunk/Modules/mmapmodule.c Log: Alexander Belopolsky pointed out that pos is a size_t Modified: python/trunk/Modules/mmapmodule.c ============================================================================== --- python/trunk/Modules/mmapmodule.c (original) +++ python/trunk/Modules/mmapmodule.c Tue Aug 22 15:56:56 2006 @@ -470,7 +470,7 @@ mmap_tell_method(mmap_object *self, PyObject *unused) { CHECK_VALID(NULL); - return PyInt_FromSsize_t(self->pos); + return PyInt_FromSize_t(self->pos); } static PyObject * From python-checkins at python.org Tue Aug 22 15:57:07 2006 From: python-checkins at python.org (neal.norwitz) Date: Tue, 22 Aug 2006 15:57:07 +0200 (CEST) Subject: [Python-checkins] r51474 - python/branches/release25-maint/Modules/mmapmodule.c Message-ID: <20060822135707.F2D861E402D@bag.python.org> Author: neal.norwitz Date: Tue Aug 22 15:57:07 2006 New Revision: 51474 Modified: python/branches/release25-maint/Modules/mmapmodule.c Log: Alexander Belopolsky pointed out that pos is a size_t Modified: python/branches/release25-maint/Modules/mmapmodule.c ============================================================================== --- python/branches/release25-maint/Modules/mmapmodule.c (original) +++ python/branches/release25-maint/Modules/mmapmodule.c Tue Aug 22 15:57:07 2006 @@ -470,7 +470,7 @@ mmap_tell_method(mmap_object *self, PyObject *unused) { CHECK_VALID(NULL); - return PyInt_FromSsize_t(self->pos); + return PyInt_FromSize_t(self->pos); } static PyObject * From python-checkins at python.org Tue Aug 22 17:12:27 2006 From: python-checkins at python.org (jim.fulton) Date: Tue, 22 Aug 2006 17:12:27 +0200 (CEST) Subject: [Python-checkins] r51475 - sandbox/branches/jim-fix-setuptools-cli Message-ID: <20060822151227.D39011E4009@bag.python.org> Author: jim.fulton Date: Tue Aug 22 17:12:27 2006 New Revision: 51475 Added: sandbox/branches/jim-fix-setuptools-cli/ - copied from r51474, sandbox/trunk/ Log: Created branch to work on setuptools windows script wrapper From python-checkins at python.org Tue Aug 22 17:19:55 2006 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 22 Aug 2006 17:19:55 +0200 (CEST) Subject: [Python-checkins] r51476 - python/branches/int_unification/Modules/_testcapimodule.c Message-ID: <20060822151955.6CF501E4009@bag.python.org> Author: martin.v.loewis Date: Tue Aug 22 17:19:55 2006 New Revision: 51476 Modified: python/branches/int_unification/Modules/_testcapimodule.c Log: Add int benchmarks. Modified: python/branches/int_unification/Modules/_testcapimodule.c ============================================================================== --- python/branches/int_unification/Modules/_testcapimodule.c (original) +++ python/branches/int_unification/Modules/_testcapimodule.c Tue Aug 22 17:19:55 2006 @@ -713,6 +713,83 @@ Py_RETURN_NONE; } +#ifdef HAVE_GETTIMEOFDAY +/* Profiling of integer performance */ +void print_delta(int test, struct timeval *s, struct timeval *e) +{ + e->tv_sec -= s->tv_sec; + e->tv_usec -= s->tv_usec; + if (e->tv_usec < 0) { + e->tv_sec -=1; + e->tv_usec += 1000000; + } + printf("Test %d: %d.%06ds\n", test, (int)e->tv_sec, e->tv_usec); +} + +static PyObject * +profile_int(PyObject *self, PyObject* args) +{ + int i, k; + struct timeval start, stop; + PyObject *single, **multiple; + + /* Test 1: Allocate and immediately deallocate + many small integers */ + gettimeofday(&start, NULL); + for(k=0; k < 20000; k++) + for(i=0; i < 1000; i++) { + single = PyInt_FromLong(i); + Py_DECREF(single); + } + gettimeofday(&stop, NULL); + print_delta(1, &start, &stop); + + /* Test 2: Allocate and immediately deallocate + many large integers */ + gettimeofday(&start, NULL); + for(k=0; k < 20000; k++) + for(i=0; i < 1000; i++) { + single = PyInt_FromLong(i+1000000); + Py_DECREF(single); + } + gettimeofday(&stop, NULL); + print_delta(2, &start, &stop); + + /* Test 3: Allocate a few integers, then release + them all simultaneously. */ + multiple = malloc(sizeof(PyObject*) * 1000); + gettimeofday(&start, NULL); + for(k=0; k < 20000; k++) { + for(i=0; i < 1000; i++) { + multiple[i] = PyInt_FromLong(i+1000000); + } + for(i=0; i < 1000; i++) { + Py_DECREF(multiple[i]); + } + } + gettimeofday(&stop, NULL); + print_delta(3, &start, &stop); + + /* Test 4: Allocate many integers, then release + them all simultaneously. */ + multiple = malloc(sizeof(PyObject*) * 1000000); + gettimeofday(&start, NULL); + for(k=0; k < 20; k++) { + for(i=0; i < 1000000; i++) { + multiple[i] = PyInt_FromLong(i+1000000); + } + for(i=0; i < 1000000; i++) { + Py_DECREF(multiple[i]); + } + } + gettimeofday(&stop, NULL); + print_delta(4, &start, &stop); + + Py_INCREF(Py_None); + return Py_None; +} +#endif + static PyMethodDef TestMethods[] = { {"raise_exception", raise_exception, METH_VARARGS}, {"test_config", (PyCFunction)test_config, METH_NOARGS}, @@ -751,6 +828,9 @@ #ifdef WITH_THREAD {"_test_thread_state", test_thread_state, METH_VARARGS}, #endif +#ifdef HAVE_GETTIMEOFDAY + {"profile_int", profile_int, METH_NOARGS}, +#endif {NULL, NULL} /* sentinel */ }; From python-checkins at python.org Tue Aug 22 17:23:55 2006 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 22 Aug 2006 17:23:55 +0200 (CEST) Subject: [Python-checkins] r51477 - python/branches/int_unification/INTBENCH Message-ID: <20060822152355.306E71E4009@bag.python.org> Author: martin.v.loewis Date: Tue Aug 22 17:23:54 2006 New Revision: 51477 Added: python/branches/int_unification/INTBENCH Log: Add measurement results. Added: python/branches/int_unification/INTBENCH ============================================================================== --- (empty file) +++ python/branches/int_unification/INTBENCH Tue Aug 22 17:23:54 2006 @@ -0,0 +1,9 @@ +Measurements of _testcapi.profile_int, on an 800MHz G3, OSX 10.4.7 +best of three runs + +r51476 (original p3yk) +Test 1: 1.601978s +Test 2: 1.696623s +Test 3: 1.900683s +Test 4: 5.307155s + From python-checkins at python.org Tue Aug 22 19:30:17 2006 From: python-checkins at python.org (brett.cannon) Date: Tue, 22 Aug 2006 19:30:17 +0200 (CEST) Subject: [Python-checkins] r51479 - peps/trunk/pep-0362.txt Message-ID: <20060822173017.40E431E4013@bag.python.org> Author: brett.cannon Date: Tue Aug 22 19:30:16 2006 New Revision: 51479 Modified: peps/trunk/pep-0362.txt Log: Remove Open Issue of whether keyword-only parameters should be kept in a separate set instead of the 'parameters' attribute on Signature objects. Also strengthen the argument for keeping keyword_only as an attribute instead of setting position to None to flag this state. Modified: peps/trunk/pep-0362.txt ============================================================================== --- peps/trunk/pep-0362.txt (original) +++ peps/trunk/pep-0362.txt Tue Aug 22 19:30:16 2006 @@ -112,9 +112,13 @@ that holds a boolean representing whether the parameter is keyword-only or not. -As to whether the keyword-only parameters should be stored in the -``parameters`` attribute of a Signature object or in a set is -discussed in `Open Issues`_. +Nick Coghlan suggested to set 'position' to None to signal that the +argument is keyword-only and thus remove the need for the new +attribute. But that would cause different types to be used in the +attribute that are in no way compatible. It also removes the ability +to know the position number within the signature from the Paramter +object itself. Plus Guido preferred the original approach over this +alternative. Open Issues @@ -131,23 +135,6 @@ needed, and then return the value of ``__signature__``. -Where should keyword-only parameters be stored in the Signature object? ------------------------------------------------------------------------ - -If PEP 3102 [#pep-3102]_ ends up being accepted, there is the -possibility that storing keyword-only parameters in a set instead of -in the ``parameters`` attribute of the Signature object makes more -sense. Since keyword-only parameters do not have any semantic meaning -in terms of their position within the signature, there is no direct -semantic gain in storing it in the parameter list. - -Storing keyword-only paramaters in a set makes it much more explicit -that keyword-only parameters have no inherent order. It does have the -drawback, though, that if one wants to process all parameters at once -they would need to perform extra work to make sure to go through both -the parameter list and set. - - References ========== From buildbot at python.org Tue Aug 22 19:43:03 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 22 Aug 2006 17:43:03 +0000 Subject: [Python-checkins] buildbot warnings in ppc Debian unstable 2.5 Message-ID: <20060822174303.8ACE91E4006@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%2520Debian%2520unstable%25202.5/builds/7 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: anthony.baxter,neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Tue Aug 22 20:44:33 2006 From: python-checkins at python.org (jim.fulton) Date: Tue, 22 Aug 2006 20:44:33 +0200 (CEST) Subject: [Python-checkins] r51481 - in sandbox/branches/jim-fix-setuptools-cli/setuptools: launcher.c setuptools/cli.exe setuptools/gui.exe setuptools/tests/__init__.py setuptools/tests/win_script_wrapper.txt Message-ID: <20060822184433.AF4561E4009@bag.python.org> Author: jim.fulton Date: Tue Aug 22 20:44:33 2006 New Revision: 51481 Added: sandbox/branches/jim-fix-setuptools-cli/setuptools/setuptools/tests/win_script_wrapper.txt Modified: sandbox/branches/jim-fix-setuptools-cli/setuptools/launcher.c sandbox/branches/jim-fix-setuptools-cli/setuptools/setuptools/cli.exe sandbox/branches/jim-fix-setuptools-cli/setuptools/setuptools/gui.exe sandbox/branches/jim-fix-setuptools-cli/setuptools/setuptools/tests/__init__.py Log: Added quoting of script arguments and extended the quoting logic to handle embedded quotes. Added support for passing a single argument on the shebang line to pass things like -O and -i. Fixed bug in handling trailing whitespace in Python command. Modified: sandbox/branches/jim-fix-setuptools-cli/setuptools/launcher.c ============================================================================== --- sandbox/branches/jim-fix-setuptools-cli/setuptools/launcher.c (original) +++ sandbox/branches/jim-fix-setuptools-cli/setuptools/launcher.c Tue Aug 22 20:44:33 2006 @@ -33,22 +33,80 @@ fprintf(stderr, format, data); return 2; } + char *quoted(char *data) { - char *result = calloc(strlen(data)+3,sizeof(char)); - strcat(result,"\""); strcat(result,data); strcat(result,"\""); + int i, l = strlen(data), nb; + /* We allocate twice as much space as needed to deal with worse-case + of having to escape everything. */ + char *result = calloc(l*2+3, sizeof(char)); + char *presult = result; + + *presult++ = '"'; + for (nb=0, i=0; i < l; i++) + { + if (data[i] == '\\') + nb += 1; + else if (data[i] == '"') + { + for (; nb > 0; nb--) + *presult++ = '\\'; + *presult++ = '\\'; + } + else + nb = 0; + *presult++ = data[i]; + } + for (; nb > 0; nb--) /* Deal w trailing slashes */ + *presult++ = '\\'; + + *presult++ = '"'; + *presult++ = 0; return result; } +char *getpyopt(char *python) +{ + /* Search a Python command string, read from a #! line for an + option. An option must be separated from an executable name by + one or more spaces. An option consistes of a hyphen followed by + one or more letters. + */ + static char *letters = + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + ; + char *p = python + strlen(python) - 1; + if (strchr(letters, *p) == NULL) + return NULL; /* Path doen't end with a letter. Odd. */ + while (p > python && strchr(letters, *p) != NULL) + p--; + if (p == python || *p != '-') + return NULL; /* Can't be an option */ + p--; + if (p > python && isspace(*p)) + { /* BINGO, we have an option */ + char *pyopt = p+1; + /* strip trailing spaces from remainder of python command */ + while (p > python && isspace(*p)) + *p-- = '\0'; + return pyopt; + } + else + return NULL; +} + int run(int argc, char **argv, int is_gui) { char python[256]; /* python executable's filename*/ + char *pyopt; /* Python option */ char script[256]; /* the script's filename */ HINSTANCE hPython; /* DLL handle for python executable */ int scriptf; /* file descriptor for script file */ - char **newargs; /* argument array for exec */ + char **newargs, **newargsp; /* argument array for exec */ char *ptr, *end; /* working pointers for string manipulation */ + int i; /* loop counter */ /* compute script name from our .exe name*/ GetModuleFileName(NULL, script, sizeof(script)); @@ -73,13 +131,16 @@ *ptr='\\'; /* convert slashes to avoid LoadLibrary crashes... */ } - *ptr = '\0'; + *ptr-- = '\0'; while (ptr>python && isspace(*ptr)) *ptr-- = '\0'; /* strip trailing sp */ if (strncmp(python, "#!", 2)) { /* default to python.exe if no #! header */ strcpy(python, "#!python.exe"); } + /* Check for Python options */ + pyopt = getpyopt(python); + /* At this point, the python buffer contains "#!pythonfilename" */ /* Using spawnv() can fail strangely if you e.g. find the Cygwin @@ -94,12 +155,19 @@ /* printf("Python executable: %s\n", python); */ - /* Argument array needs to be argc+1 for args, plus 1 for null sentinel */ - newargs = (char **)calloc(argc+2, sizeof(char *)); - newargs[0] = quoted(python); - newargs[1] = quoted(script); - memcpy(newargs+2, argv+1, (argc-1)*sizeof(char *)); - newargs[argc+1] = NULL; + /* Argument array needs to be + argc+1 for python executable, + plus 1 for possible python opts, + plus 1 for null sentinel */ + newargs = (char **)calloc(argc+3, sizeof(char *)); + newargsp = newargs; + *newargsp++ = quoted(python); + if (pyopt) + *newargsp++ = pyopt; + *newargsp++ = quoted(script); + for (i = 1; i < argc; i++) + *newargsp++ = quoted(argv[i]); + *newargsp++ = NULL; /* printf("args 0: %s\nargs 1: %s\n", newargs[0], newargs[1]); */ if (is_gui) { Modified: sandbox/branches/jim-fix-setuptools-cli/setuptools/setuptools/cli.exe ============================================================================== Binary files. No diff available. Modified: sandbox/branches/jim-fix-setuptools-cli/setuptools/setuptools/gui.exe ============================================================================== Binary files. No diff available. Modified: sandbox/branches/jim-fix-setuptools-cli/setuptools/setuptools/tests/__init__.py ============================================================================== --- sandbox/branches/jim-fix-setuptools-cli/setuptools/setuptools/tests/__init__.py (original) +++ sandbox/branches/jim-fix-setuptools-cli/setuptools/setuptools/tests/__init__.py Tue Aug 22 20:44:33 2006 @@ -14,11 +14,15 @@ import sys, os.path def additional_tests(): - import doctest - return doctest.DocFileSuite( - 'api_tests.txt', optionflags=doctest.ELLIPSIS, package=__name__, - ) - + import doctest, unittest + suite = unittest.TestSuite(( + doctest.DocFileSuite('api_tests.txt', + optionflags=doctest.ELLIPSIS, package=__name__, + ), + )) + if sys.platform == 'win32': + suite.addTest(doctest.DocFileSuite('win_script_wrapper.txt')) + return suite def makeSetup(**args): """Return distribution from 'setup(**args)', without executing commands""" Added: sandbox/branches/jim-fix-setuptools-cli/setuptools/setuptools/tests/win_script_wrapper.txt ============================================================================== --- (empty file) +++ sandbox/branches/jim-fix-setuptools-cli/setuptools/setuptools/tests/win_script_wrapper.txt Tue Aug 22 20:44:33 2006 @@ -0,0 +1,103 @@ +Python Script Wrapper for Windows +================================= + +setuptools includes wrappers for Python scripts that allows them to be +executed like regular windows programs. There are 2 wrappers, once +for command-line programs, cli.exe, and one for graphica programs, +gui.exe. These programs are almost identical, function pretty much +the same way, and are generated from the same source file. In this +document, we'll demonstrate use of the command-line program only. The +wrapper programs are used by copying them to the directory containing +the script they are to wrap and with the same name as the script they +are to wrap. In the rest of this document, we'll give an example that +will illustrate this. + +Let's create a simple script, foo-script.py: + + >>> import os, sys, tempfile + >>> sample_directory = tempfile.mkdtemp() + >>> open(os.path.join(sample_directory, 'foo-script.py'), 'w').write( + ... """#!%(python_exe)s + ... import sys + ... input = repr(sys.stdin.read()) + ... print sys.argv[0][-14:] + ... print sys.argv[1:] + ... print input + ... if __debug__: + ... print 'non-optimized' + ... """ % dict(python_exe=sys.executable)) + +Note that the script starts with a Unix-style '#!' line saying which +Python executable to run. The wrapper will use this to find the +correct Python executable. + +We'll also copy cli.exe to the sample-directory with the name foo.exe: + + >>> import pkg_resources + >>> open(os.path.join(sample_directory, 'foo.exe'), 'wb').write( + ... pkg_resources.resource_string('setuptools', 'cli.exe') + ... ) + +When the copy of cli.exe, foo.exe in this example, runs, it examines +the path name it was run with and computes a Python script path name +by removing the '.exe' suffic and adding the '-script.py' suffix. (For +GUI programs, the suffix '-script-pyw' is added.) This is why we +named out script the way we did. Now we can run out script by running +the wrapper: + + >>> import os + >>> input, output = os.popen4(os.path.join(sample_directory, 'foo.exe') + ... + r' arg1 "arg 2" "arg \"2\\\"" "arg 4\\" "arg5 a\\b') + >>> input.write('hello\nworld\n') + >>> input.close() + >>> print output.read(), + \foo-script.py + ['arg1', 'arg 2', 'arg "2\\"', 'arg 4\\', 'arg5 a\\\\b'] + 'hello\nworld\n' + non-optimized + +This example was a little pathological in that it exercised windows +(MS C runtime) quoting rules: + +- Strings containing spaces are surrounded by double quotes. + +- Double quotes in strings need to be escaped by preceding them with + back slashes. + +- One or more backslashes preceding double quotes quotes need to be + escaped by preceding each of them them with back slashes. + +Specifying Python Command-line Options +-------------------------------------- + +You can specify a single argument on the '#!' line. This can be used +to specify Python options like -O, to run in optimized mode or -i +to start the interactive interpreter. You can combine multiple +options as usual. For example, to run in optimized mode and +enter the interpreter after running the script, you could use -Oi: + + >>> open(os.path.join(sample_directory, 'foo-script.py'), 'w').write( + ... """#!%(python_exe)s -Oi + ... import sys + ... input = repr(sys.stdin.read()) + ... print sys.argv[0][-14:] + ... print sys.argv[1:] + ... print input + ... if __debug__: + ... print 'non-optimized' + ... sys.ps1 = '---' + ... """ % dict(python_exe=sys.executable)) + + >>> input, output = os.popen4(os.path.join(sample_directory, 'foo.exe')) + >>> input.close() + >>> print output.read(), + \foo-script.py + [] + '' + --- + + +We're done with the sample_directory: + + >>> import shutil + >>> shutil.rmtree(sample_directory) From python-checkins at python.org Tue Aug 22 21:36:15 2006 From: python-checkins at python.org (thomas.wouters) Date: Tue, 22 Aug 2006 21:36:15 +0200 (CEST) Subject: [Python-checkins] r51482 - python/branches/p3yk-noslice Message-ID: <20060822193615.C399E1E4018@bag.python.org> Author: thomas.wouters Date: Tue Aug 22 21:36:15 2006 New Revision: 51482 Added: python/branches/p3yk-noslice/ - copied from r51481, python/branches/p3yk/ Log: Create branch for p3yk without __*slice__ hooks and *SLICE opcodes. From python-checkins at python.org Tue Aug 22 21:42:49 2006 From: python-checkins at python.org (jim.fulton) Date: Tue, 22 Aug 2006 21:42:49 +0200 (CEST) Subject: [Python-checkins] r51485 - in sandbox/trunk/setuptools: launcher.c setuptools/cli.exe setuptools/gui.exe setuptools/tests/__init__.py setuptools/tests/win_script_wrapper.txt Message-ID: <20060822194249.5F1431E4009@bag.python.org> Author: jim.fulton Date: Tue Aug 22 21:42:48 2006 New Revision: 51485 Added: sandbox/trunk/setuptools/setuptools/tests/win_script_wrapper.txt - copied unchanged from r51481, sandbox/branches/jim-fix-setuptools-cli/setuptools/setuptools/tests/win_script_wrapper.txt Modified: sandbox/trunk/setuptools/launcher.c sandbox/trunk/setuptools/setuptools/cli.exe sandbox/trunk/setuptools/setuptools/gui.exe sandbox/trunk/setuptools/setuptools/tests/__init__.py Log: Added quoting of script arguments and extended the quoting logic to handle embedded quotes. Added support for passing a single argument on the shebang line to pass things like -O and -i. Fixed bug in handling trailing whitespace in Python command. Modified: sandbox/trunk/setuptools/launcher.c ============================================================================== --- sandbox/trunk/setuptools/launcher.c (original) +++ sandbox/trunk/setuptools/launcher.c Tue Aug 22 21:42:48 2006 @@ -33,22 +33,80 @@ fprintf(stderr, format, data); return 2; } + char *quoted(char *data) { - char *result = calloc(strlen(data)+3,sizeof(char)); - strcat(result,"\""); strcat(result,data); strcat(result,"\""); + int i, l = strlen(data), nb; + /* We allocate twice as much space as needed to deal with worse-case + of having to escape everything. */ + char *result = calloc(l*2+3, sizeof(char)); + char *presult = result; + + *presult++ = '"'; + for (nb=0, i=0; i < l; i++) + { + if (data[i] == '\\') + nb += 1; + else if (data[i] == '"') + { + for (; nb > 0; nb--) + *presult++ = '\\'; + *presult++ = '\\'; + } + else + nb = 0; + *presult++ = data[i]; + } + for (; nb > 0; nb--) /* Deal w trailing slashes */ + *presult++ = '\\'; + + *presult++ = '"'; + *presult++ = 0; return result; } +char *getpyopt(char *python) +{ + /* Search a Python command string, read from a #! line for an + option. An option must be separated from an executable name by + one or more spaces. An option consistes of a hyphen followed by + one or more letters. + */ + static char *letters = + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + ; + char *p = python + strlen(python) - 1; + if (strchr(letters, *p) == NULL) + return NULL; /* Path doen't end with a letter. Odd. */ + while (p > python && strchr(letters, *p) != NULL) + p--; + if (p == python || *p != '-') + return NULL; /* Can't be an option */ + p--; + if (p > python && isspace(*p)) + { /* BINGO, we have an option */ + char *pyopt = p+1; + /* strip trailing spaces from remainder of python command */ + while (p > python && isspace(*p)) + *p-- = '\0'; + return pyopt; + } + else + return NULL; +} + int run(int argc, char **argv, int is_gui) { char python[256]; /* python executable's filename*/ + char *pyopt; /* Python option */ char script[256]; /* the script's filename */ HINSTANCE hPython; /* DLL handle for python executable */ int scriptf; /* file descriptor for script file */ - char **newargs; /* argument array for exec */ + char **newargs, **newargsp; /* argument array for exec */ char *ptr, *end; /* working pointers for string manipulation */ + int i; /* loop counter */ /* compute script name from our .exe name*/ GetModuleFileName(NULL, script, sizeof(script)); @@ -73,13 +131,16 @@ *ptr='\\'; /* convert slashes to avoid LoadLibrary crashes... */ } - *ptr = '\0'; + *ptr-- = '\0'; while (ptr>python && isspace(*ptr)) *ptr-- = '\0'; /* strip trailing sp */ if (strncmp(python, "#!", 2)) { /* default to python.exe if no #! header */ strcpy(python, "#!python.exe"); } + /* Check for Python options */ + pyopt = getpyopt(python); + /* At this point, the python buffer contains "#!pythonfilename" */ /* Using spawnv() can fail strangely if you e.g. find the Cygwin @@ -94,12 +155,19 @@ /* printf("Python executable: %s\n", python); */ - /* Argument array needs to be argc+1 for args, plus 1 for null sentinel */ - newargs = (char **)calloc(argc+2, sizeof(char *)); - newargs[0] = quoted(python); - newargs[1] = quoted(script); - memcpy(newargs+2, argv+1, (argc-1)*sizeof(char *)); - newargs[argc+1] = NULL; + /* Argument array needs to be + argc+1 for python executable, + plus 1 for possible python opts, + plus 1 for null sentinel */ + newargs = (char **)calloc(argc+3, sizeof(char *)); + newargsp = newargs; + *newargsp++ = quoted(python); + if (pyopt) + *newargsp++ = pyopt; + *newargsp++ = quoted(script); + for (i = 1; i < argc; i++) + *newargsp++ = quoted(argv[i]); + *newargsp++ = NULL; /* printf("args 0: %s\nargs 1: %s\n", newargs[0], newargs[1]); */ if (is_gui) { Modified: sandbox/trunk/setuptools/setuptools/cli.exe ============================================================================== Binary files. No diff available. Modified: sandbox/trunk/setuptools/setuptools/gui.exe ============================================================================== Binary files. No diff available. Modified: sandbox/trunk/setuptools/setuptools/tests/__init__.py ============================================================================== --- sandbox/trunk/setuptools/setuptools/tests/__init__.py (original) +++ sandbox/trunk/setuptools/setuptools/tests/__init__.py Tue Aug 22 21:42:48 2006 @@ -14,11 +14,15 @@ import sys, os.path def additional_tests(): - import doctest - return doctest.DocFileSuite( - 'api_tests.txt', optionflags=doctest.ELLIPSIS, package=__name__, - ) - + import doctest, unittest + suite = unittest.TestSuite(( + doctest.DocFileSuite('api_tests.txt', + optionflags=doctest.ELLIPSIS, package=__name__, + ), + )) + if sys.platform == 'win32': + suite.addTest(doctest.DocFileSuite('win_script_wrapper.txt')) + return suite def makeSetup(**args): """Return distribution from 'setup(**args)', without executing commands""" From python-checkins at python.org Tue Aug 22 21:54:36 2006 From: python-checkins at python.org (thomas.wouters) Date: Tue, 22 Aug 2006 21:54:36 +0200 (CEST) Subject: [Python-checkins] r51486 - in python/branches/p3yk-noslice: Include/opcode.h Lib/UserList.py Lib/UserString.py Lib/sre_parse.py Lib/test/list_tests.py Lib/test/output/test_class Lib/test/seq_tests.py Lib/test/string_tests.py Lib/test/test_descr.py Lib/test/test_index.py Lib/test/test_support.py Lib/test/test_userlist.py Objects/bufferobject.c Objects/bytesobject.c Objects/structseq.c Python/ceval.c Python/compile.c Message-ID: <20060822195436.3CB4E1E4009@bag.python.org> Author: thomas.wouters Date: Tue Aug 22 21:54:34 2006 New Revision: 51486 Modified: python/branches/p3yk-noslice/Include/opcode.h python/branches/p3yk-noslice/Lib/UserList.py python/branches/p3yk-noslice/Lib/UserString.py python/branches/p3yk-noslice/Lib/sre_parse.py python/branches/p3yk-noslice/Lib/test/list_tests.py python/branches/p3yk-noslice/Lib/test/output/test_class python/branches/p3yk-noslice/Lib/test/seq_tests.py python/branches/p3yk-noslice/Lib/test/string_tests.py python/branches/p3yk-noslice/Lib/test/test_descr.py python/branches/p3yk-noslice/Lib/test/test_index.py python/branches/p3yk-noslice/Lib/test/test_support.py python/branches/p3yk-noslice/Lib/test/test_userlist.py python/branches/p3yk-noslice/Objects/bufferobject.c python/branches/p3yk-noslice/Objects/bytesobject.c python/branches/p3yk-noslice/Objects/structseq.c python/branches/p3yk-noslice/Python/ceval.c python/branches/p3yk-noslice/Python/compile.c Log: Checkpoint current status of removing-slice work: - Add 'extended' (now really just 'normal') slicing support to buffer, bytes and structseq, including non-default step sizes. - Fix proxying in UserList, UserString - Adjust sre_parse to cope with slice objects (Those three items could be forward-ported to 2.6) - Remove all 12 SLICE opcodes, freeing up an otherwise unused register vrbl in ceval.c's PyEval_EvalFrameEx - Fix tests to not look at __getslice__ (possibly by removing tests too rigorously) TODO: - Fix mmap to support slice objects (test currently fails) - Fix ctypes to support slice objects (test currently fails) - Remove PySequenceMethod hooks and rework various API's to index using slice objects instead - Remove PySequence_Check and PyMapping_Check (or think of a new way of spelling them) - Check removed tests to see if they should be readded Modified: python/branches/p3yk-noslice/Include/opcode.h ============================================================================== --- python/branches/p3yk-noslice/Include/opcode.h (original) +++ python/branches/p3yk-noslice/Include/opcode.h Tue Aug 22 21:54:34 2006 @@ -36,15 +36,6 @@ #define INPLACE_FLOOR_DIVIDE 28 #define INPLACE_TRUE_DIVIDE 29 -#define SLICE 30 -/* Also uses 31-33 */ - -#define STORE_SLICE 40 -/* Also uses 41-43 */ - -#define DELETE_SLICE 50 -/* Also uses 51-53 */ - #define INPLACE_ADD 55 #define INPLACE_SUBTRACT 56 #define INPLACE_MULTIPLY 57 Modified: python/branches/p3yk-noslice/Lib/UserList.py ============================================================================== --- python/branches/p3yk-noslice/Lib/UserList.py (original) +++ python/branches/p3yk-noslice/Lib/UserList.py Tue Aug 22 21:54:34 2006 @@ -28,20 +28,6 @@ def __getitem__(self, i): return self.data[i] def __setitem__(self, i, item): self.data[i] = item def __delitem__(self, i): del self.data[i] - def __getslice__(self, i, j): - i = max(i, 0); j = max(j, 0) - return self.__class__(self.data[i:j]) - def __setslice__(self, i, j, other): - i = max(i, 0); j = max(j, 0) - if isinstance(other, UserList): - self.data[i:j] = other.data - elif isinstance(other, type(self.data)): - self.data[i:j] = other - else: - self.data[i:j] = list(other) - def __delslice__(self, i, j): - i = max(i, 0); j = max(j, 0) - del self.data[i:j] def __add__(self, other): if isinstance(other, UserList): return self.__class__(self.data + other.data) Modified: python/branches/p3yk-noslice/Lib/UserString.py ============================================================================== --- python/branches/p3yk-noslice/Lib/UserString.py (original) +++ python/branches/p3yk-noslice/Lib/UserString.py Tue Aug 22 21:54:34 2006 @@ -35,9 +35,6 @@ def __len__(self): return len(self.data) def __getitem__(self, index): return self.__class__(self.data[index]) - def __getslice__(self, start, end): - start = max(start, 0); end = max(end, 0) - return self.__class__(self.data[start:end]) def __add__(self, other): if isinstance(other, UserString): @@ -149,26 +146,31 @@ def __hash__(self): raise TypeError, "unhashable type (it is mutable)" def __setitem__(self, index, sub): - if index < 0: - index += len(self.data) - if index < 0 or index >= len(self.data): raise IndexError - self.data = self.data[:index] + sub + self.data[index+1:] + if isinstance(index, slice): + if isinstance(sub, UserString): + sub = sub.data + elif not isinstance(sub, basestring): + sub = str(sub) + start, stop, step = index.indices(len(self.data)) + if step != 1: + raise TypeError, "invalid step in slicing assignment" + self.data = self.data[:start] + sub + self.data[stop:] + else: + if index < 0: + index += len(self.data) + if index < 0 or index >= len(self.data): raise IndexError + self.data = self.data[:index] + sub + self.data[index+1:] def __delitem__(self, index): - if index < 0: - index += len(self.data) - if index < 0 or index >= len(self.data): raise IndexError - self.data = self.data[:index] + self.data[index+1:] - def __setslice__(self, start, end, sub): - start = max(start, 0); end = max(end, 0) - if isinstance(sub, UserString): - self.data = self.data[:start]+sub.data+self.data[end:] - elif isinstance(sub, basestring): - self.data = self.data[:start]+sub+self.data[end:] - else: - self.data = self.data[:start]+str(sub)+self.data[end:] - def __delslice__(self, start, end): - start = max(start, 0); end = max(end, 0) - self.data = self.data[:start] + self.data[end:] + if isinstance(index, slice): + start, stop, step = index.indices(len(self.data)) + if step != 1: + raise TypeError, "invalid step in slicing assignment" + self.data = self.data[:start] + self.data[stop:] + else: + if index < 0: + index += len(self.data) + if index < 0 or index >= len(self.data): raise IndexError + self.data = self.data[:index] + self.data[index+1:] def immutable(self): return UserString(self.data) def __iadd__(self, other): Modified: python/branches/p3yk-noslice/Lib/sre_parse.py ============================================================================== --- python/branches/p3yk-noslice/Lib/sre_parse.py (original) +++ python/branches/p3yk-noslice/Lib/sre_parse.py Tue Aug 22 21:54:34 2006 @@ -134,11 +134,11 @@ def __delitem__(self, index): del self.data[index] def __getitem__(self, index): + if isinstance(index, slice): + return SubPattern(self.pattern, self.data[index]) return self.data[index] def __setitem__(self, index, code): self.data[index] = code - def __getslice__(self, start, stop): - return SubPattern(self.pattern, self.data[start:stop]) def insert(self, index, code): self.data.insert(index, code) def append(self, code): Modified: python/branches/p3yk-noslice/Lib/test/list_tests.py ============================================================================== --- python/branches/p3yk-noslice/Lib/test/list_tests.py (original) +++ python/branches/p3yk-noslice/Lib/test/list_tests.py Tue Aug 22 21:54:34 2006 @@ -178,9 +178,9 @@ a[:] = tuple(range(10)) self.assertEqual(a, self.type2test(range(10))) - self.assertRaises(TypeError, a.__setslice__, 0, 1, 5) + self.assertRaises(TypeError, a.__setitem__, slice(0, 1, 5)) - self.assertRaises(TypeError, a.__setslice__) + self.assertRaises(TypeError, a.__setitem__) def test_delslice(self): a = self.type2test([0, 1]) Modified: python/branches/p3yk-noslice/Lib/test/output/test_class ============================================================================== --- python/branches/p3yk-noslice/Lib/test/output/test_class (original) +++ python/branches/p3yk-noslice/Lib/test/output/test_class Tue Aug 22 21:54:34 2006 @@ -28,9 +28,9 @@ __getitem__: (1,) __setitem__: (1, 1) __delitem__: (1,) -__getslice__: (0, 42) -__setslice__: (0, 42, 'The Answer') -__delslice__: (0, 42) +__getitem__: (slice(None, 42, None),) +__setitem__: (slice(None, 42, None), 'The Answer') +__delitem__: (slice(None, 42, None),) __getitem__: (slice(2, 1024, 10),) __setitem__: (slice(2, 1024, 10), 'A lot') __delitem__: (slice(2, 1024, 10),) Modified: python/branches/p3yk-noslice/Lib/test/seq_tests.py ============================================================================== --- python/branches/p3yk-noslice/Lib/test/seq_tests.py (original) +++ python/branches/p3yk-noslice/Lib/test/seq_tests.py Tue Aug 22 21:54:34 2006 @@ -196,8 +196,6 @@ self.assertEqual(a[ -pow(2,128L): 3 ], self.type2test([0,1,2])) self.assertEqual(a[ 3: pow(2,145L) ], self.type2test([3,4])) - self.assertRaises(TypeError, u.__getslice__) - def test_contains(self): u = self.type2test([0, 1, 2]) for i in u: Modified: python/branches/p3yk-noslice/Lib/test/string_tests.py ============================================================================== --- python/branches/p3yk-noslice/Lib/test/string_tests.py (original) +++ python/branches/p3yk-noslice/Lib/test/string_tests.py Tue Aug 22 21:54:34 2006 @@ -911,20 +911,6 @@ self.checkraises(TypeError, 'abc', '__getitem__', 'def') - def test_slice(self): - self.checkequal('abc', 'abc', '__getslice__', 0, 1000) - self.checkequal('abc', 'abc', '__getslice__', 0, 3) - self.checkequal('ab', 'abc', '__getslice__', 0, 2) - self.checkequal('bc', 'abc', '__getslice__', 1, 3) - self.checkequal('b', 'abc', '__getslice__', 1, 2) - self.checkequal('', 'abc', '__getslice__', 2, 2) - self.checkequal('', 'abc', '__getslice__', 1000, 1000) - self.checkequal('', 'abc', '__getslice__', 2000, 1000) - self.checkequal('', 'abc', '__getslice__', 2, 1) - # FIXME What about negative indizes? This is handled differently by [] and __getslice__ - - self.checkraises(TypeError, 'abc', '__getslice__', 'def') - def test_mul(self): self.checkequal('', 'abc', '__mul__', -1) self.checkequal('', 'abc', '__mul__', 0) Modified: python/branches/p3yk-noslice/Lib/test/test_descr.py ============================================================================== --- python/branches/p3yk-noslice/Lib/test/test_descr.py (original) +++ python/branches/p3yk-noslice/Lib/test/test_descr.py Tue Aug 22 21:54:34 2006 @@ -39,7 +39,7 @@ bm = getattr(a, meth) vereq(bm(b), res) -def testternop(a, b, c, res, expr="a[b:c]", meth="__getslice__"): +def testternop(a, b, c, res, expr="a[b:c]", meth="__getitem__"): if verbose: print "checking", expr dict = {'a': a, 'b': b, 'c': c} vereq(eval(expr, dict), res) @@ -48,9 +48,9 @@ while meth not in t.__dict__: t = t.__bases__[0] vereq(m, t.__dict__[meth]) - vereq(m(a, b, c), res) + vereq(m(a, slice(b, c, None)), res) bm = getattr(a, meth) - vereq(bm(b, c), res) + vereq(bm(slice(b, c, None)), res) def testsetop(a, b, res, stmt="a+=b", meth="__iadd__"): if verbose: print "checking", stmt @@ -88,7 +88,7 @@ bm(b, c) vereq(dict['a'], res) -def testset3op(a, b, c, d, res, stmt="a[b:c]=d", meth="__setslice__"): +def testset3op(a, b, c, d, res, stmt="a[b:c]=d", meth="__setitem__"): if verbose: print "checking", stmt dict = {'a': deepcopy(a), 'b': b, 'c': c, 'd': d} exec stmt in dict @@ -99,11 +99,11 @@ m = getattr(t, meth) vereq(m, t.__dict__[meth]) dict['a'] = deepcopy(a) - m(dict['a'], b, c, d) + m(dict['a'], slice(b, c, None), d) vereq(dict['a'], res) dict['a'] = deepcopy(a) bm = getattr(dict['a'], meth) - bm(b, c, d) + bm(slice(b, c, None), d) vereq(dict['a'], res) def class_docstrings(): @@ -140,14 +140,14 @@ testbinop([1,2,3], 2, 1, "b in a", "__contains__") testbinop([1,2,3], 4, 0, "b in a", "__contains__") testbinop([1,2,3], 1, 2, "a[b]", "__getitem__") - testternop([1,2,3], 0, 2, [1,2], "a[b:c]", "__getslice__") + testternop([1,2,3], 0, 2, [1,2], "a[b:c]", "__getitem__") testsetop([1], [2], [1,2], "a+=b", "__iadd__") testsetop([1,2], 3, [1,2,1,2,1,2], "a*=b", "__imul__") testunop([1,2,3], 3, "len(a)", "__len__") testbinop([1,2], 3, [1,2,1,2,1,2], "a*b", "__mul__") testbinop([1,2], 3, [1,2,1,2,1,2], "b*a", "__rmul__") testset2op([1,2], 1, 3, [1,3], "a[b]=c", "__setitem__") - testset3op([1,2,3,4], 1, 3, [5,6], [1,5,6,4], "a[b:c]=d", "__setslice__") + testset3op([1,2,3,4], 1, 3, [5,6], [1,5,6,4], "a[b:c]=d", "__setitem__") def dicts(): if verbose: print "Testing dict operations..." @@ -490,7 +490,7 @@ testbinop(spamlist([1,2,3]), 4, 0, "b in a", "__contains__") testbinop(spamlist([1,2,3]), 1, 2, "a[b]", "__getitem__") testternop(spamlist([1,2,3]), 0, 2, spamlist([1,2]), - "a[b:c]", "__getslice__") + "a[b:c]", "__getitem__") testsetop(spamlist([1]), spamlist([2]), spamlist([1,2]), "a+=b", "__iadd__") testsetop(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "a*=b", "__imul__") @@ -499,7 +499,7 @@ testbinop(spamlist([1,2]), 3, spamlist([1,2,1,2,1,2]), "b*a", "__rmul__") testset2op(spamlist([1,2]), 1, 3, spamlist([1,3]), "a[b]=c", "__setitem__") testset3op(spamlist([1,2,3,4]), 1, 3, spamlist([5,6]), - spamlist([1,5,6,4]), "a[b:c]=d", "__setslice__") + spamlist([1,5,6,4]), "a[b:c]=d", "__setitem__") # Test subclassing class C(spam.spamlist): def foo(self): return 1 @@ -613,9 +613,9 @@ if verbose: print "Testing Python subclass of list..." class C(list): def __getitem__(self, i): + if isinstance(i, slice): + return i.start, i.stop return list.__getitem__(self, i) + 100 - def __getslice__(self, i, j): - return (i, j) a = C() a.extend([0,1,2]) vereq(a[0], 100) @@ -1580,13 +1580,6 @@ def __delitem__(self, key): self.delitem = key - def __getslice__(self, i, j): - return ("getslice", i, j) - def __setslice__(self, i, j, value): - self.setslice = (i, j, value) - def __delslice__(self, i, j): - self.delslice = (i, j) - a = C() vereq(a.foo, ("getattr", "foo")) a.foo = 12 @@ -1600,11 +1593,11 @@ del a[12] vereq(a.delitem, 12) - vereq(a[0:10], ("getslice", 0, 10)) + vereq(a[0:10], ("getitem", slice(0, 10, None))) a[0:10] = "foo" - vereq(a.setslice, (0, 10, "foo")) + vereq(a.setitem, (slice(0, 10, None), "foo")) del a[0:10] - vereq(a.delslice, (0, 10)) + vereq(a.delitem, slice(0, 10, None)) def methods(): if verbose: print "Testing methods..." Modified: python/branches/p3yk-noslice/Lib/test/test_index.py ============================================================================== --- python/branches/p3yk-noslice/Lib/test/test_index.py (original) +++ python/branches/p3yk-noslice/Lib/test/test_index.py Tue Aug 22 21:54:34 2006 @@ -188,12 +188,10 @@ return maxint def __getitem__(self, key): return key - def __getslice__(self, i, j): - return i, j x = GetItem() self.assertEqual(x[self.pos], self.pos) self.assertEqual(x[self.neg], self.neg) - self.assertEqual(x[self.neg:self.pos], (-1, maxint)) + self.assertEqual(x[self.neg:self.pos], slice(self.neg, self.pos, None)) self.assertEqual(x[self.neg:self.pos:1].indices(maxint), (0, maxint, 1)) def test_getitem(self): Modified: python/branches/p3yk-noslice/Lib/test/test_support.py ============================================================================== --- python/branches/p3yk-noslice/Lib/test/test_support.py (original) +++ python/branches/p3yk-noslice/Lib/test/test_support.py Tue Aug 22 21:54:34 2006 @@ -314,10 +314,7 @@ _2G = 2 * _1G # Hack to get at the maximum value an internal index can take. -class _Dummy: - def __getslice__(self, i, j): - return j -MAX_Py_ssize_t = _Dummy()[:] +MAX_Py_ssize_t = 1<<63 def set_memlimit(limit): import re Modified: python/branches/p3yk-noslice/Lib/test/test_userlist.py ============================================================================== --- python/branches/p3yk-noslice/Lib/test/test_userlist.py (original) +++ python/branches/p3yk-noslice/Lib/test/test_userlist.py Tue Aug 22 21:54:34 2006 @@ -7,16 +7,6 @@ class UserListTest(list_tests.CommonTest): type2test = UserList - def test_getslice(self): - super(UserListTest, self).test_getslice() - l = [0, 1, 2, 3, 4] - u = self.type2test(l) - for i in range(-3, 6): - self.assertEqual(u[:i], l[:i]) - self.assertEqual(u[i:], l[i:]) - for j in xrange(-3, 6): - self.assertEqual(u[i:j], l[i:j]) - def test_add_specials(self): u = UserList("spam") u2 = u + "eggs" Modified: python/branches/p3yk-noslice/Objects/bufferobject.c ============================================================================== --- python/branches/p3yk-noslice/Objects/bufferobject.c (original) +++ python/branches/p3yk-noslice/Objects/bufferobject.c Tue Aug 22 21:54:34 2006 @@ -466,6 +466,62 @@ right - left); } +static PyObject * +buffer_subscript(PyBufferObject *self, PyObject *item) +{ + void *p; + Py_ssize_t size; + + if (!get_buf(self, &p, &size, ANY_BUFFER)) + return NULL; + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return NULL; + if (i < 0) + i += size; + return buffer_item(self, i); + } + else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelength, cur, i; + + if (PySlice_GetIndicesEx((PySliceObject*)item, size, + &start, &stop, &step, &slicelength) < 0) { + return NULL; + } + + if (slicelength <= 0) + return PyString_FromStringAndSize("", 0); + else if (step == 1) + return PyString_FromStringAndSize((char *)p + start, + stop - start); + else { + PyObject *result; + char *source_buf = (char *)p; + char *result_buf = (char *)PyMem_Malloc(slicelength); + + if (result_buf == NULL) + return PyErr_NoMemory(); + + for (cur = start, i = 0; i < slicelength; + cur += step, i++) { + result_buf[i] = source_buf[cur]; + } + + result = PyString_FromStringAndSize(result_buf, + slicelength); + PyMem_Free(result_buf); + return result; + } + } + else { + PyErr_SetString(PyExc_TypeError, + "string indices must be integers"); + return NULL; + } +} + + static int buffer_ass_item(PyBufferObject *self, Py_ssize_t idx, PyObject *other) { @@ -575,6 +631,101 @@ return 0; } +static int +buffer_ass_subscript(PyBufferObject *self, PyObject *item, PyObject *value) +{ + PyBufferProcs *pb; + void *ptr1, *ptr2; + Py_ssize_t selfsize; + Py_ssize_t othersize; + Py_ssize_t start, stop, step, slicelength; + + if ( self->b_readonly ) { + PyErr_SetString(PyExc_TypeError, + "buffer is read-only"); + return -1; + } + + pb = value ? value->ob_type->tp_as_buffer : NULL; + if ( pb == NULL || + pb->bf_getreadbuffer == NULL || + pb->bf_getsegcount == NULL ) + { + PyErr_BadArgument(); + return -1; + } + if ( (*pb->bf_getsegcount)(value, NULL) != 1 ) + { + /* ### use a different exception type/message? */ + PyErr_SetString(PyExc_TypeError, + "single-segment buffer object expected"); + return -1; + } + if (!get_buf(self, &ptr1, &selfsize, ANY_BUFFER)) + return -1; + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return -1; + if (i < 0) + i += selfsize; + return buffer_ass_item(self, i, value); + } + else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelength; + + if (PySlice_GetIndicesEx((PySliceObject *)item, selfsize, + &start, &stop, &step, &slicelength) < 0) + return -1; + + pb = value ? value->ob_type->tp_as_buffer : NULL; + if (pb == NULL || + pb->bf_getreadbuffer == NULL || + pb->bf_getsegcount == NULL) { + PyErr_BadArgument(); + return -1; + } + if ((*pb->bf_getsegcount)(value, NULL) != 1) { + /* ### use a different exception type/message? */ + PyErr_SetString(PyExc_TypeError, + "single-segment buffer object expected"); + return -1; + } + if ((othersize = (*pb->bf_getreadbuffer)(value, 0, &ptr2)) < 0) + return -1; + + if (othersize != slicelength) { + PyErr_SetString( + PyExc_TypeError, + "right operand length must match slice length"); + return -1; + } + + if (slicelength == 0) + return 0; + else if (step == 1) { + memcpy((char *)ptr1 + start, ptr2, slicelength); + return 0; + } + else { + Py_ssize_t cur, i; + char *resultbuf = (char *)ptr1; + char *sourcebuf = (char *)ptr2; + + for (cur = start, i = 0; i < slicelength; + cur += step, i++) { + ((char *)ptr1)[cur] = ((char *)ptr2)[i]; + } + + return 0; + } + } else { + PyErr_SetString(PyExc_TypeError, + "buffer indices must be integers"); + return -1; + } +} + /* Buffer methods */ static Py_ssize_t @@ -650,6 +801,12 @@ (ssizessizeobjargproc)buffer_ass_slice, /*sq_ass_slice*/ }; +static PyMappingMethods buffer_as_mapping = { + (lenfunc)buffer_length, + (binaryfunc)buffer_subscript, + (objobjargproc)buffer_ass_subscript, +}; + static PyBufferProcs buffer_as_buffer = { (readbufferproc)buffer_getreadbuf, (writebufferproc)buffer_getwritebuf, @@ -671,7 +828,7 @@ (reprfunc)buffer_repr, /* tp_repr */ 0, /* tp_as_number */ &buffer_as_sequence, /* tp_as_sequence */ - 0, /* tp_as_mapping */ + &buffer_as_mapping, /* tp_as_mapping */ (hashfunc)buffer_hash, /* tp_hash */ 0, /* tp_call */ (reprfunc)buffer_str, /* tp_str */ Modified: python/branches/p3yk-noslice/Objects/bytesobject.c ============================================================================== --- python/branches/p3yk-noslice/Objects/bytesobject.c (original) +++ python/branches/p3yk-noslice/Objects/bytesobject.c Tue Aug 22 21:54:34 2006 @@ -280,6 +280,61 @@ return PyBytes_FromStringAndSize(self->ob_bytes + lo, hi - lo); } +static PyObject * +bytes_subscript(PyBytesObject *self, PyObject *item) +{ + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + + if (i == -1 && PyErr_Occurred()) + return NULL; + + if (i < 0) + i += PyBytes_GET_SIZE(self); + + if (i < 0 || i >= self->ob_size) { + PyErr_SetString(PyExc_IndexError, "bytes index out of range"); + return NULL; + } + return PyInt_FromLong((unsigned char)(self->ob_bytes[i])); + } + else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelength, cur, i; + if (PySlice_GetIndicesEx((PySliceObject *)item, + PyBytes_GET_SIZE(self), + &start, &stop, &step, &slicelength) < 0) { + return NULL; + } + + if (slicelength <= 0) + return PyBytes_FromStringAndSize("", 0); + else if (step == 1) { + return PyBytes_FromStringAndSize(self->ob_bytes + start, + slicelength); + } + else { + char *source_buf = PyBytes_AS_STRING(self); + char *result_buf = (char *)PyMem_Malloc(slicelength); + PyObject *result; + + if (result_buf == NULL) + return PyErr_NoMemory(); + + for (cur = start, i = 0; i < slicelength; + cur += step, i++) { + result_buf[i] = source_buf[cur]; + } + result = PyBytes_FromStringAndSize(result_buf, slicelength); + PyMem_Free(result_buf); + return result; + } + } + else { + PyErr_SetString(PyExc_TypeError, "bytes indices must be integers"); + return NULL; + } +} + static int bytes_setslice(PyBytesObject *self, Py_ssize_t lo, Py_ssize_t hi, PyObject *values) @@ -379,6 +434,158 @@ } static int +bytes_ass_subscript(PyBytesObject *self, PyObject *item, PyObject *values) +{ + Py_ssize_t start, stop, step, slicelen, needed; + char *bytes; + + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + + if (i == -1 && PyErr_Occurred()) + return -1; + + if (i < 0) + i += PyBytes_GET_SIZE(self); + + if (i < 0 || i >= self->ob_size) { + PyErr_SetString(PyExc_IndexError, "bytes index out of range"); + return -1; + } + + if (values == NULL) { + /* Fall through to slice assignment */ + start = i; + stop = i + 1; + step = 1; + slicelen = 1; + } else { + Py_ssize_t ival = PyNumber_AsSsize_t(values, PyExc_ValueError); + if (ival == -1 && PyErr_Occurred()) + return -1; + if (ival < 0 || ival >= 256) { + PyErr_SetString(PyExc_ValueError, + "byte must be in range(0, 256)"); + return -1; + } + self->ob_bytes[i] = (char)ival; + return 0; + } + } + else if (PySlice_Check(item)) { + if (PySlice_GetIndicesEx((PySliceObject *)item, + PyBytes_GET_SIZE(self), + &start, &stop, &step, &slicelen) < 0) { + return -1; + } + } + else { + PyErr_SetString(PyExc_TypeError, "bytes indices must be integer"); + return -1; + } + + if (values == NULL) { + bytes = NULL; + needed = 0; + } + else if (values == (PyObject *)self || !PyBytes_Check(values)) { + /* Make a copy an call this function recursively */ + int err; + values = PyBytes_FromObject(values); + if (values == NULL) + return -1; + err = bytes_ass_subscript(self, item, values); + Py_DECREF(values); + return err; + } + else { + assert(PyBytes_Check(values)); + bytes = ((PyBytesObject *)values)->ob_bytes; + needed = ((PyBytesObject *)values)->ob_size; + } + + if (step == 1) { + if (slicelen != needed) { + if (slicelen > needed) { + /* + 0 start stop old_size + | |<---slicelen--->|<-----tomove------>| + | |<-needed->|<-----tomove------>| + 0 lo new_hi new_size + */ + memmove(self->ob_bytes + start + needed, self->ob_bytes + stop, + self->ob_size - stop); + } + if (PyBytes_Resize((PyObject *)self, + self->ob_size + needed - slicelen) < 0) + return -1; + if (slicelen < needed) { + /* + 0 lo hi old_size + | |<-avail->|<-----tomove------>| + | |<----needed---->|<-----tomove------>| + 0 lo new_hi new_size + */ + memmove(self->ob_bytes + start + needed, self->ob_bytes + stop, + self->ob_size - start - needed); + } + } + + if (needed > 0) + memcpy(self->ob_bytes + start, bytes, needed); + + return 0; + } + else { + if (needed == 0) { + /* Delete slice */ + Py_ssize_t cur, i; + + if (step < 0) { + stop = start + 1; + start = stop + step * (slicelen - 1) - 1; + step = -step; + } + for (cur = start, i = 0; + i < slicelen; cur += step, i++) { + Py_ssize_t lim = step; + + if (cur + step >= PyBytes_GET_SIZE(self)) + lim = PyBytes_GET_SIZE(self) - cur - 1; + + memmove(self->ob_bytes + cur - i, + self->ob_bytes + cur + 1, lim); + } + /* Move the tail of the bytes, in one chunk */ + cur = start + slicelen*step + 1; + memmove(self->ob_bytes + cur - slicelen, + self->ob_bytes + cur, + PyBytes_GET_SIZE(self) - cur); + if (PyBytes_Resize((PyObject *)self, + PyBytes_GET_SIZE(self) - slicelen) < 0) + return -1; + + return 0; + } + else { + /* Assign slice */ + Py_ssize_t cur, i; + + if (needed != slicelen) { + PyErr_Format(PyExc_ValueError, + "attempt to assign bytes of size %zd " + "to extended slice of size %zd", + needed, slicelen); + return -1; + } + for (cur = start, i = 0; i < slicelen; cur += step, i++) + self->ob_bytes[cur] = bytes[i]; + return 0; + } + } +} + +static int bytes_init(PyBytesObject *self, PyObject *args, PyObject *kwds) { static char *kwlist[] = {"source", "encoding", "errors", 0}; @@ -784,8 +991,8 @@ static PyMappingMethods bytes_as_mapping = { (lenfunc)bytes_length, - (binaryfunc)0, - 0, + (binaryfunc)bytes_subscript, + (objobjargproc)bytes_ass_subscript, }; static PyBufferProcs bytes_as_buffer = { Modified: python/branches/p3yk-noslice/Objects/structseq.c ============================================================================== --- python/branches/p3yk-noslice/Objects/structseq.c (original) +++ python/branches/p3yk-noslice/Objects/structseq.c Tue Aug 22 21:54:34 2006 @@ -90,6 +90,54 @@ } static PyObject * +structseq_subscript(PyStructSequence *self, PyObject *item) +{ + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return NULL; + + if (i < 0) + i += VISIBLE_SIZE(self); + + if (i < 0 || i >= VISIBLE_SIZE(self)) { + PyErr_SetString(PyExc_IndexError, + "tuple index out of range"); + return NULL; + } + Py_INCREF(self->ob_item[i]); + return self->ob_item[i]; + } + else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelen, cur, i; + PyObject *result; + + if (PySlice_GetIndicesEx((PySliceObject *)item, + VISIBLE_SIZE(self), &start, &stop, + &step, &slicelen) < 0) { + return NULL; + } + if (slicelen <= 0) + return PyTuple_New(0); + result = PyTuple_New(slicelen); + if (result == NULL) + return NULL; + for (cur = start, i = 0; i < slicelen; + cur += step, i++) { + PyObject *v = self->ob_item[cur]; + Py_INCREF(v); + PyTuple_SET_ITEM(result, i, v); + } + return result; + } + else { + PyErr_SetString(PyExc_TypeError, + "structseq indices must be integers"); + return NULL; + } +} + +static PyObject * structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *arg = NULL; @@ -298,6 +346,11 @@ (objobjproc)structseq_contains, /* sq_contains */ }; +static PyMappingMethods structseq_as_mapping = { + (lenfunc)structseq_length, + (binaryfunc)structseq_subscript, +}; + static PyMethodDef structseq_methods[] = { {"__reduce__", (PyCFunction)structseq_reduce, METH_NOARGS, NULL}, @@ -318,7 +371,7 @@ (reprfunc)structseq_repr, /* tp_repr */ 0, /* tp_as_number */ &structseq_as_sequence, /* tp_as_sequence */ - 0, /* tp_as_mapping */ + &structseq_as_mapping, /* tp_as_mapping */ structseq_hash, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ Modified: python/branches/p3yk-noslice/Python/ceval.c ============================================================================== --- python/branches/p3yk-noslice/Python/ceval.c (original) +++ python/branches/p3yk-noslice/Python/ceval.c Tue Aug 22 21:54:34 2006 @@ -111,9 +111,6 @@ static int maybe_call_line_trace(Py_tracefunc, PyObject *, PyFrameObject *, int *, int *, int *); -static PyObject * apply_slice(PyObject *, PyObject *, PyObject *); -static int assign_slice(PyObject *, PyObject *, - PyObject *, PyObject *); static PyObject * cmp_outcome(int, PyObject *, PyObject *); static PyObject * import_from(PyObject *, PyObject *); static int import_all_from(PyObject *, PyObject *); @@ -525,7 +522,6 @@ register PyObject *v; /* Temporary objects popped off stack */ register PyObject *w; register PyObject *u; - register PyObject *t; register PyObject *stream = NULL; /* for PRINT opcodes */ register PyObject **fastlocals, **freevars; PyObject *retval = NULL; /* Return value */ @@ -1398,70 +1394,6 @@ if (x != NULL) continue; break; - case SLICE+0: - case SLICE+1: - case SLICE+2: - case SLICE+3: - if ((opcode-SLICE) & 2) - w = POP(); - else - w = NULL; - if ((opcode-SLICE) & 1) - v = POP(); - else - v = NULL; - u = TOP(); - x = apply_slice(u, v, w); - Py_DECREF(u); - Py_XDECREF(v); - Py_XDECREF(w); - SET_TOP(x); - if (x != NULL) continue; - break; - - case STORE_SLICE+0: - case STORE_SLICE+1: - case STORE_SLICE+2: - case STORE_SLICE+3: - if ((opcode-STORE_SLICE) & 2) - w = POP(); - else - w = NULL; - if ((opcode-STORE_SLICE) & 1) - v = POP(); - else - v = NULL; - u = POP(); - t = POP(); - err = assign_slice(u, v, w, t); /* u[v:w] = t */ - Py_DECREF(t); - Py_DECREF(u); - Py_XDECREF(v); - Py_XDECREF(w); - if (err == 0) continue; - break; - - case DELETE_SLICE+0: - case DELETE_SLICE+1: - case DELETE_SLICE+2: - case DELETE_SLICE+3: - if ((opcode-DELETE_SLICE) & 2) - w = POP(); - else - w = NULL; - if ((opcode-DELETE_SLICE) & 1) - v = POP(); - else - v = NULL; - u = POP(); - err = assign_slice(u, v, w, (PyObject *)NULL); - /* del u[v:w] */ - Py_DECREF(u); - Py_XDECREF(v); - Py_XDECREF(w); - if (err == 0) continue; - break; - case STORE_SUBSCR: w = TOP(); v = SECOND(); @@ -3842,70 +3774,6 @@ return 1; } -#undef ISINDEX -#define ISINDEX(x) ((x) == NULL || \ - PyInt_Check(x) || PyLong_Check(x) || PyIndex_Check(x)) - -static PyObject * -apply_slice(PyObject *u, PyObject *v, PyObject *w) /* return u[v:w] */ -{ - PyTypeObject *tp = u->ob_type; - PySequenceMethods *sq = tp->tp_as_sequence; - - if (sq && sq->sq_slice && ISINDEX(v) && ISINDEX(w)) { - Py_ssize_t ilow = 0, ihigh = PY_SSIZE_T_MAX; - if (!_PyEval_SliceIndex(v, &ilow)) - return NULL; - if (!_PyEval_SliceIndex(w, &ihigh)) - return NULL; - return PySequence_GetSlice(u, ilow, ihigh); - } - else { - PyObject *slice = PySlice_New(v, w, NULL); - if (slice != NULL) { - PyObject *res = PyObject_GetItem(u, slice); - Py_DECREF(slice); - return res; - } - else - return NULL; - } -} - -static int -assign_slice(PyObject *u, PyObject *v, PyObject *w, PyObject *x) - /* u[v:w] = x */ -{ - PyTypeObject *tp = u->ob_type; - PySequenceMethods *sq = tp->tp_as_sequence; - - if (sq && sq->sq_slice && ISINDEX(v) && ISINDEX(w)) { - Py_ssize_t ilow = 0, ihigh = PY_SSIZE_T_MAX; - if (!_PyEval_SliceIndex(v, &ilow)) - return -1; - if (!_PyEval_SliceIndex(w, &ihigh)) - return -1; - if (x == NULL) - return PySequence_DelSlice(u, ilow, ihigh); - else - return PySequence_SetSlice(u, ilow, ihigh, x); - } - else { - PyObject *slice = PySlice_New(v, w, NULL); - if (slice != NULL) { - int res; - if (x != NULL) - res = PyObject_SetItem(u, slice, x); - else - res = PyObject_DelItem(u, slice); - Py_DECREF(slice); - return res; - } - else - return -1; - } -} - static PyObject * cmp_outcome(int op, register PyObject *v, register PyObject *w) { Modified: python/branches/p3yk-noslice/Python/compile.c ============================================================================== --- python/branches/p3yk-noslice/Python/compile.c (original) +++ python/branches/p3yk-noslice/Python/compile.c Tue Aug 22 21:54:34 2006 @@ -741,33 +741,6 @@ case INPLACE_TRUE_DIVIDE: return -1; - case SLICE+0: - return 1; - case SLICE+1: - return 0; - case SLICE+2: - return 0; - case SLICE+3: - return -1; - - case STORE_SLICE+0: - return -2; - case STORE_SLICE+1: - return -3; - case STORE_SLICE+2: - return -3; - case STORE_SLICE+3: - return -4; - - case DELETE_SLICE+0: - return -1; - case DELETE_SLICE+1: - return -2; - case DELETE_SLICE+2: - return -2; - case DELETE_SLICE+3: - return -3; - case INPLACE_ADD: case INPLACE_SUBTRACT: case INPLACE_MULTIPLY: @@ -3214,57 +3187,6 @@ } static int -compiler_simple_slice(struct compiler *c, slice_ty s, expr_context_ty ctx) -{ - int op = 0, slice_offset = 0, stack_count = 0; - - assert(s->v.Slice.step == NULL); - if (s->v.Slice.lower) { - slice_offset++; - stack_count++; - if (ctx != AugStore) - VISIT(c, expr, s->v.Slice.lower); - } - if (s->v.Slice.upper) { - slice_offset += 2; - stack_count++; - if (ctx != AugStore) - VISIT(c, expr, s->v.Slice.upper); - } - - if (ctx == AugLoad) { - switch (stack_count) { - case 0: ADDOP(c, DUP_TOP); break; - case 1: ADDOP_I(c, DUP_TOPX, 2); break; - case 2: ADDOP_I(c, DUP_TOPX, 3); break; - } - } - else if (ctx == AugStore) { - switch (stack_count) { - case 0: ADDOP(c, ROT_TWO); break; - case 1: ADDOP(c, ROT_THREE); break; - case 2: ADDOP(c, ROT_FOUR); break; - } - } - - switch (ctx) { - case AugLoad: /* fall through to Load */ - case Load: op = SLICE; break; - case AugStore:/* fall through to Store */ - case Store: op = STORE_SLICE; break; - case Del: op = DELETE_SLICE; break; - case Param: - default: - PyErr_SetString(PyExc_SystemError, - "param invalid in simple slice"); - return 0; - } - - ADDOP(c, op + slice_offset); - return 1; -} - -static int compiler_visit_nested_slice(struct compiler *c, slice_ty s, expr_context_ty ctx) { @@ -3306,8 +3228,6 @@ break; case Slice_kind: kindname = "slice"; - if (!s->v.Slice.step) - return compiler_simple_slice(c, s, ctx); if (ctx != AugStore) { if (!compiler_slice(c, s, ctx)) return 0; From python-checkins at python.org Tue Aug 22 21:58:05 2006 From: python-checkins at python.org (jim.fulton) Date: Tue, 22 Aug 2006 21:58:05 +0200 (CEST) Subject: [Python-checkins] r51487 - in sandbox/branches/setuptools-0.6: launcher.c setuptools/cli.exe setuptools/gui.exe setuptools/tests/__init__.py setuptools/tests/win_script_wrapper.txt Message-ID: <20060822195805.00F3C1E4009@bag.python.org> Author: jim.fulton Date: Tue Aug 22 21:58:05 2006 New Revision: 51487 Added: sandbox/branches/setuptools-0.6/setuptools/tests/win_script_wrapper.txt - copied unchanged from r51481, sandbox/branches/jim-fix-setuptools-cli/setuptools/setuptools/tests/win_script_wrapper.txt Modified: sandbox/branches/setuptools-0.6/launcher.c sandbox/branches/setuptools-0.6/setuptools/cli.exe sandbox/branches/setuptools-0.6/setuptools/gui.exe sandbox/branches/setuptools-0.6/setuptools/tests/__init__.py Log: Added quoting of script arguments and extended the quoting logic to handle embedded quotes. Added support for passing a single argument on the shebang line to pass things like -O and -i. Fixed bug in handling trailing whitespace in Python command. Modified: sandbox/branches/setuptools-0.6/launcher.c ============================================================================== --- sandbox/branches/setuptools-0.6/launcher.c (original) +++ sandbox/branches/setuptools-0.6/launcher.c Tue Aug 22 21:58:05 2006 @@ -33,22 +33,80 @@ fprintf(stderr, format, data); return 2; } + char *quoted(char *data) { - char *result = calloc(strlen(data)+3,sizeof(char)); - strcat(result,"\""); strcat(result,data); strcat(result,"\""); + int i, l = strlen(data), nb; + /* We allocate twice as much space as needed to deal with worse-case + of having to escape everything. */ + char *result = calloc(l*2+3, sizeof(char)); + char *presult = result; + + *presult++ = '"'; + for (nb=0, i=0; i < l; i++) + { + if (data[i] == '\\') + nb += 1; + else if (data[i] == '"') + { + for (; nb > 0; nb--) + *presult++ = '\\'; + *presult++ = '\\'; + } + else + nb = 0; + *presult++ = data[i]; + } + for (; nb > 0; nb--) /* Deal w trailing slashes */ + *presult++ = '\\'; + + *presult++ = '"'; + *presult++ = 0; return result; } +char *getpyopt(char *python) +{ + /* Search a Python command string, read from a #! line for an + option. An option must be separated from an executable name by + one or more spaces. An option consistes of a hyphen followed by + one or more letters. + */ + static char *letters = + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + ; + char *p = python + strlen(python) - 1; + if (strchr(letters, *p) == NULL) + return NULL; /* Path doen't end with a letter. Odd. */ + while (p > python && strchr(letters, *p) != NULL) + p--; + if (p == python || *p != '-') + return NULL; /* Can't be an option */ + p--; + if (p > python && isspace(*p)) + { /* BINGO, we have an option */ + char *pyopt = p+1; + /* strip trailing spaces from remainder of python command */ + while (p > python && isspace(*p)) + *p-- = '\0'; + return pyopt; + } + else + return NULL; +} + int run(int argc, char **argv, int is_gui) { char python[256]; /* python executable's filename*/ + char *pyopt; /* Python option */ char script[256]; /* the script's filename */ HINSTANCE hPython; /* DLL handle for python executable */ int scriptf; /* file descriptor for script file */ - char **newargs; /* argument array for exec */ + char **newargs, **newargsp; /* argument array for exec */ char *ptr, *end; /* working pointers for string manipulation */ + int i; /* loop counter */ /* compute script name from our .exe name*/ GetModuleFileName(NULL, script, sizeof(script)); @@ -73,13 +131,16 @@ *ptr='\\'; /* convert slashes to avoid LoadLibrary crashes... */ } - *ptr = '\0'; + *ptr-- = '\0'; while (ptr>python && isspace(*ptr)) *ptr-- = '\0'; /* strip trailing sp */ if (strncmp(python, "#!", 2)) { /* default to python.exe if no #! header */ strcpy(python, "#!python.exe"); } + /* Check for Python options */ + pyopt = getpyopt(python); + /* At this point, the python buffer contains "#!pythonfilename" */ /* Using spawnv() can fail strangely if you e.g. find the Cygwin @@ -94,12 +155,19 @@ /* printf("Python executable: %s\n", python); */ - /* Argument array needs to be argc+1 for args, plus 1 for null sentinel */ - newargs = (char **)calloc(argc+2, sizeof(char *)); - newargs[0] = quoted(python); - newargs[1] = quoted(script); - memcpy(newargs+2, argv+1, (argc-1)*sizeof(char *)); - newargs[argc+1] = NULL; + /* Argument array needs to be + argc+1 for python executable, + plus 1 for possible python opts, + plus 1 for null sentinel */ + newargs = (char **)calloc(argc+3, sizeof(char *)); + newargsp = newargs; + *newargsp++ = quoted(python); + if (pyopt) + *newargsp++ = pyopt; + *newargsp++ = quoted(script); + for (i = 1; i < argc; i++) + *newargsp++ = quoted(argv[i]); + *newargsp++ = NULL; /* printf("args 0: %s\nargs 1: %s\n", newargs[0], newargs[1]); */ if (is_gui) { Modified: sandbox/branches/setuptools-0.6/setuptools/cli.exe ============================================================================== Binary files. No diff available. Modified: sandbox/branches/setuptools-0.6/setuptools/gui.exe ============================================================================== Binary files. No diff available. Modified: sandbox/branches/setuptools-0.6/setuptools/tests/__init__.py ============================================================================== --- sandbox/branches/setuptools-0.6/setuptools/tests/__init__.py (original) +++ sandbox/branches/setuptools-0.6/setuptools/tests/__init__.py Tue Aug 22 21:58:05 2006 @@ -14,11 +14,16 @@ import sys, os.path def additional_tests(): - import doctest - return doctest.DocFileSuite( - 'api_tests.txt', optionflags=doctest.ELLIPSIS, package='pkg_resources', - ) - + import doctest, unittest + suite = unittest.TestSuite(( + doctest.DocFileSuite( + 'api_tests.txt', + optionflags=doctest.ELLIPSIS, package='pkg_resources', + ), + )) + if sys.platform == 'win32': + suite.addTest(doctest.DocFileSuite('win_script_wrapper.txt')) + return suite def makeSetup(**args): """Return distribution from 'setup(**args)', without executing commands""" From python-checkins at python.org Tue Aug 22 22:11:27 2006 From: python-checkins at python.org (phillip.eby) Date: Tue, 22 Aug 2006 22:11:27 +0200 (CEST) Subject: [Python-checkins] r51488 - sandbox/branches/setuptools-0.6/EasyInstall.txt Message-ID: <20060822201127.8E0061E4009@bag.python.org> Author: phillip.eby Date: Tue Aug 22 22:11:27 2006 New Revision: 51488 Modified: sandbox/branches/setuptools-0.6/EasyInstall.txt Log: Update release notes for Jim's #! fixes. Modified: sandbox/branches/setuptools-0.6/EasyInstall.txt ============================================================================== --- sandbox/branches/setuptools-0.6/EasyInstall.txt (original) +++ sandbox/branches/setuptools-0.6/EasyInstall.txt Tue Aug 22 22:11:27 2006 @@ -1190,6 +1190,10 @@ Release Notes/Change History ============================ +0.6c2 + * Windows script wrappers now support quoted arguments and arguments + containing spaces. (Patch contributed by Jim Fulton.) + 0.6c1 * EasyInstall now includes setuptools version information in the ``User-Agent`` string sent to websites it visits. From python-checkins at python.org Tue Aug 22 22:46:01 2006 From: python-checkins at python.org (jeremy.hylton) Date: Tue, 22 Aug 2006 22:46:01 +0200 (CEST) Subject: [Python-checkins] r51489 - in python/trunk: Lib/test/test_parser.py Modules/parsermodule.c Message-ID: <20060822204601.D14061E4009@bag.python.org> Author: jeremy.hylton Date: Tue Aug 22 22:46:00 2006 New Revision: 51489 Modified: python/trunk/Lib/test/test_parser.py python/trunk/Modules/parsermodule.c Log: Expose column offset information in parse trees. Modified: python/trunk/Lib/test/test_parser.py ============================================================================== --- python/trunk/Lib/test/test_parser.py (original) +++ python/trunk/Lib/test/test_parser.py Tue Aug 22 22:46:00 2006 @@ -183,6 +183,44 @@ def test_assert(self): self.check_suite("assert alo < ahi and blo < bhi\n") + def test_position(self): + # An absolutely minimal test of position information. Better + # tests would be a big project. + code = "def f(x):\n return x + 1\n" + st1 = parser.suite(code) + st2 = st1.totuple(line_info=1, col_info=1) + + def walk(tree): + node_type = tree[0] + next = tree[1] + if isinstance(next, tuple): + for elt in tree[1:]: + for x in walk(elt): + yield x + else: + yield tree + + terminals = list(walk(st2)) + self.assertEqual([ + (1, 'def', 1, 0), + (1, 'f', 1, 4), + (7, '(', 1, 5), + (1, 'x', 1, 6), + (8, ')', 1, 7), + (11, ':', 1, 8), + (4, '', 1, 9), + (5, '', 2, -1), + (1, 'return', 2, 4), + (1, 'x', 2, 11), + (14, '+', 2, 13), + (2, '1', 2, 15), + (4, '', 2, 16), + (6, '', 2, -1), + (4, '', 2, -1), + (0, '', 2, -1)], + terminals) + + # # Second, we take *invalid* trees and make sure we get ParserError # rejections for them. Modified: python/trunk/Modules/parsermodule.c ============================================================================== --- python/trunk/Modules/parsermodule.c (original) +++ python/trunk/Modules/parsermodule.c Tue Aug 22 22:46:00 2006 @@ -74,7 +74,8 @@ node2tuple(node *n, /* node to convert */ SeqMaker mkseq, /* create sequence */ SeqInserter addelem, /* func. to add elem. in seq. */ - int lineno) /* include line numbers? */ + int lineno, /* include line numbers? */ + int col_offset) /* include column offsets? */ { if (n == NULL) { Py_INCREF(Py_None); @@ -95,7 +96,7 @@ } (void) addelem(v, 0, w); for (i = 0; i < NCH(n); i++) { - w = node2tuple(CHILD(n, i), mkseq, addelem, lineno); + w = node2tuple(CHILD(n, i), mkseq, addelem, lineno, col_offset); if (w == NULL) { Py_DECREF(v); return ((PyObject*) NULL); @@ -108,12 +109,14 @@ return (v); } else if (ISTERMINAL(TYPE(n))) { - PyObject *result = mkseq(2 + lineno); + PyObject *result = mkseq(2 + lineno + col_offset); if (result != NULL) { (void) addelem(result, 0, PyInt_FromLong(TYPE(n))); (void) addelem(result, 1, PyString_FromString(STR(n))); if (lineno == 1) (void) addelem(result, 2, PyInt_FromLong(n->n_lineno)); + if (col_offset == 1) + (void) addelem(result, 3, PyInt_FromLong(n->n_col_offset)); } return (result); } @@ -289,29 +292,35 @@ parser_st2tuple(PyST_Object *self, PyObject *args, PyObject *kw) { PyObject *line_option = 0; + PyObject *col_option = 0; PyObject *res = 0; int ok; - static char *keywords[] = {"ast", "line_info", NULL}; + static char *keywords[] = {"ast", "line_info", "col_info", NULL}; if (self == NULL) { - ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|O:st2tuple", keywords, - &PyST_Type, &self, &line_option); + ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|OO:st2tuple", keywords, + &PyST_Type, &self, &line_option, + &col_option); } else - ok = PyArg_ParseTupleAndKeywords(args, kw, "|O:totuple", &keywords[1], - &line_option); + ok = PyArg_ParseTupleAndKeywords(args, kw, "|OO:totuple", &keywords[1], + &line_option, &col_option); if (ok != 0) { int lineno = 0; + int col_offset = 0; if (line_option != NULL) { lineno = (PyObject_IsTrue(line_option) != 0) ? 1 : 0; } + if (col_option != NULL) { + col_offset = (PyObject_IsTrue(col_option) != 0) ? 1 : 0; + } /* * Convert ST into a tuple representation. Use Guido's function, * since it's known to work already. */ res = node2tuple(((PyST_Object*)self)->st_node, - PyTuple_New, PyTuple_SetItem, lineno); + PyTuple_New, PyTuple_SetItem, lineno, col_offset); } return (res); } @@ -327,28 +336,34 @@ parser_st2list(PyST_Object *self, PyObject *args, PyObject *kw) { PyObject *line_option = 0; + PyObject *col_option = 0; PyObject *res = 0; int ok; - static char *keywords[] = {"ast", "line_info", NULL}; + static char *keywords[] = {"ast", "line_info", "col_info", NULL}; if (self == NULL) - ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|O:st2list", keywords, - &PyST_Type, &self, &line_option); + ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|OO:st2list", keywords, + &PyST_Type, &self, &line_option, + &col_option); else - ok = PyArg_ParseTupleAndKeywords(args, kw, "|O:tolist", &keywords[1], - &line_option); + ok = PyArg_ParseTupleAndKeywords(args, kw, "|OO:tolist", &keywords[1], + &line_option, &col_option); if (ok) { int lineno = 0; + int col_offset = 0; if (line_option != 0) { lineno = PyObject_IsTrue(line_option) ? 1 : 0; } + if (col_option != NULL) { + col_offset = (PyObject_IsTrue(col_option) != 0) ? 1 : 0; + } /* * Convert ST into a tuple representation. Use Guido's function, * since it's known to work already. */ res = node2tuple(self->st_node, - PyList_New, PyList_SetItem, lineno); + PyList_New, PyList_SetItem, lineno, col_offset); } return (res); } From python-checkins at python.org Tue Aug 22 22:50:14 2006 From: python-checkins at python.org (thomas.wouters) Date: Tue, 22 Aug 2006 22:50:14 +0200 (CEST) Subject: [Python-checkins] r51490 - in python/branches/p3yk-noslice: Modules/mmapmodule.c TODO Message-ID: <20060822205014.3E6021E4011@bag.python.org> Author: thomas.wouters Date: Tue Aug 22 22:50:13 2006 New Revision: 51490 Added: python/branches/p3yk-noslice/TODO Modified: python/branches/p3yk-noslice/Modules/mmapmodule.c Log: - Add extended slicing to mmap (test passes, new code not tested.) - Add TODO file for the noslice branch. Modified: python/branches/p3yk-noslice/Modules/mmapmodule.c ============================================================================== --- python/branches/p3yk-noslice/Modules/mmapmodule.c (original) +++ python/branches/p3yk-noslice/Modules/mmapmodule.c Tue Aug 22 22:50:13 2006 @@ -681,6 +681,60 @@ } static PyObject * +mmap_subscript(mmap_object *self, PyObject *item) +{ + CHECK_VALID(NULL); + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return NULL; + if (i < 0) + i += self->size; + if (i < 0 || i > self->size) { + PyErr_SetString(PyExc_IndexError, + "mmap index out of range"); + return NULL; + } + return PyString_FromStringAndSize(self->data + i, 1); + } + else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelen; + + if (PySlice_GetIndicesEx((PySliceObject *)item, self->size, + &start, &stop, &step, &slicelen) < 0) { + return NULL; + } + + if (slicelen <= 0) + return PyString_FromStringAndSize("", 0); + else if (step == 1) + return PyString_FromStringAndSize(self->data + start, + slicelen); + else { + char *result_buf = (char *)PyMem_Malloc(slicelen); + Py_ssize_t cur, i; + PyObject *result; + + if (result_buf == NULL) + return PyErr_NoMemory(); + for (cur = start, i = 0; i < slicelen; + cur += step, i++) { + result_buf[i] = self->data[cur]; + } + result = PyString_FromStringAndSize(result_buf, + slicelen); + PyMem_Free(result_buf); + return result; + } + } + else { + PyErr_SetString(PyExc_TypeError, + "mmap indices must be integers"); + return NULL; + } +} + +static PyObject * mmap_concat(mmap_object *self, PyObject *bb) { CHECK_VALID(NULL); @@ -764,6 +818,96 @@ return 0; } +static int +mmap_ass_subscript(mmap_object *self, PyObject *item, PyObject *value) +{ + CHECK_VALID(-1); + + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + const char *buf; + + if (i == -1 && PyErr_Occurred()) + return -1; + if (i < 0) + i += self->size; + if (i < 0 || i > self->size) { + PyErr_SetString(PyExc_IndexError, + "mmap index out of range"); + return -1; + } + if (value == NULL) { + PyErr_SetString(PyExc_TypeError, + "mmap object doesn't support item deletion"); + return -1; + } + if (!PyString_Check(value) || PyString_Size(value) != 1) { + PyErr_SetString(PyExc_IndexError, + "mmap assignment must be single-character string"); + return -1; + } + if (!is_writeable(self)) + return -1; + buf = PyString_AsString(value); + self->data[i] = buf[0]; + return 0; + } + else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelen; + + if (PySlice_GetIndicesEx((PySliceObject *)item, + self->size, &start, &stop, + &step, &slicelen) < 0) { + return -1; + } + if (value == NULL) { + PyErr_SetString(PyExc_TypeError, + "mmap object doesn't support slice deletion"); + return -1; + } + if (!PyString_Check(value)) { + PyErr_SetString(PyExc_IndexError, + "mmap slice assignment must be a string"); + return -1; + } + if (PyString_Size(value) != slicelen) { + PyErr_SetString(PyExc_IndexError, + "mmap slice assignment is wrong size"); + return -1; + } + if (!is_writeable(self)) + return -1; + + if (slicelen == 0) + return 0; + else if (step == 1) { + const char *buf = PyString_AsString(value); + + if (buf == NULL) + return -1; + memcpy(self->data + start, buf, slicelen); + return 0; + } + else { + Py_ssize_t cur, i; + const char *buf = PyString_AsString(value); + + if (buf == NULL) + return -1; + for (cur = start, i = 0; i < slicelen; + cur += step, i++) { + self->data[cur] = buf[i]; + } + return 0; + } + } + else { + PyErr_SetString(PyExc_TypeError, + "mmap indices must be integer"); + return -1; + } +} + static PySequenceMethods mmap_as_sequence = { (lenfunc)mmap_length, /*sq_length*/ (binaryfunc)mmap_concat, /*sq_concat*/ @@ -774,6 +918,12 @@ (ssizessizeobjargproc)mmap_ass_slice, /*sq_ass_slice*/ }; +static PyMappingMethods mmap_as_mapping = { + (lenfunc)mmap_length, + (binaryfunc)mmap_subscript, + (objobjargproc)mmap_ass_subscript, +}; + static PyBufferProcs mmap_as_buffer = { (readbufferproc)mmap_buffer_getreadbuf, (writebufferproc)mmap_buffer_getwritebuf, @@ -796,7 +946,7 @@ 0, /* tp_repr */ 0, /* tp_as_number */ &mmap_as_sequence, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ + &mmap_as_mapping, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ Added: python/branches/p3yk-noslice/TODO ============================================================================== --- (empty file) +++ python/branches/p3yk-noslice/TODO Tue Aug 22 22:50:13 2006 @@ -0,0 +1,16 @@ + +TODO in slice removal: + + - Fix compiler-package to avoid SLICE opcodes + - Add tests for the extended slicing abilities of: + buffer + bytes + mmap.mmap + structseq + - Add extended slicing (or at least slice-object support) to ctypes objects + - Remove slice API (or emulate it ontop of sliceobject API) + - Remove slice/ass_slice PySequenceMethod hooks + - Figure out what to do with PyMapping_Check (it uses the presence of the + classic slicing hook to tell sequences-with-extended-slicing from + mappings.) + From buildbot at python.org Tue Aug 22 22:58:45 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 22 Aug 2006 20:58:45 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060822205845.488791E4009@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/57 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeremy.hylton Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Tue Aug 22 23:19:53 2006 From: python-checkins at python.org (brett.cannon) Date: Tue, 22 Aug 2006 23:19:53 +0200 (CEST) Subject: [Python-checkins] r51491 - peps/trunk/pep-0362.txt Message-ID: <20060822211953.EBF811E4009@bag.python.org> Author: brett.cannon Date: Tue Aug 22 23:19:53 2006 New Revision: 51491 Modified: peps/trunk/pep-0362.txt Log: Change name of function for 'inspect' module to have to return Signature objects. Modified: peps/trunk/pep-0362.txt ============================================================================== --- peps/trunk/pep-0362.txt (original) +++ peps/trunk/pep-0362.txt Tue Aug 22 23:19:53 2006 @@ -130,7 +130,7 @@ The Parameter object can either be created in an eager or lazy fashion. In the eager situation, the object can be created during creation of the function object. In the lazy situation, one would -pass a function object to ``inspect.signature()`` and that would +pass a function object to ``inspect.getsignature()`` and that would generate the Signature object and store it to ``__signature__`` if needed, and then return the value of ``__signature__``. From python-checkins at python.org Tue Aug 22 23:41:30 2006 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 22 Aug 2006 23:41:30 +0200 (CEST) Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.h Modules/_sre.c Objects/abstract.c Objects/boolobject.c Objects/exceptions.c Objects/intobject.c Objects/listobject.c Objects/longobject.c Python/bltinmodule.c Python/marshal.c Python/pythonrun.c Message-ID: <20060822214130.9EE7E1E4013@bag.python.org> Author: martin.v.loewis Date: Tue Aug 22 23:41:27 2006 New Revision: 51492 Modified: python/branches/int_unification/Include/boolobject.h python/branches/int_unification/Include/intobject.h python/branches/int_unification/Include/longobject.h python/branches/int_unification/Modules/_sre.c python/branches/int_unification/Objects/abstract.c python/branches/int_unification/Objects/boolobject.c python/branches/int_unification/Objects/exceptions.c python/branches/int_unification/Objects/intobject.c python/branches/int_unification/Objects/listobject.c python/branches/int_unification/Objects/longobject.c python/branches/int_unification/Python/bltinmodule.c python/branches/int_unification/Python/marshal.c python/branches/int_unification/Python/pythonrun.c Log: Drop the int type. Modified: python/branches/int_unification/Include/boolobject.h ============================================================================== --- python/branches/int_unification/Include/boolobject.h (original) +++ python/branches/int_unification/Include/boolobject.h Tue Aug 22 23:41:27 2006 @@ -7,7 +7,10 @@ #endif -typedef PyIntObject PyBoolObject; +typedef struct { + PyObject_HEAD + long ob_ival; +} PyBoolObject; PyAPI_DATA(PyTypeObject) PyBool_Type; @@ -17,10 +20,10 @@ Don't forget to apply Py_INCREF() when returning either!!! */ /* Don't use these directly */ -PyAPI_DATA(PyIntObject) _Py_ZeroStruct, _Py_TrueStruct; +PyAPI_DATA(PyBoolObject) _Py_FalseStruct, _Py_TrueStruct; /* Use these macros */ -#define Py_False ((PyObject *) &_Py_ZeroStruct) +#define Py_False ((PyObject *) &_Py_FalseStruct) #define Py_True ((PyObject *) &_Py_TrueStruct) /* Macros for returning Py_True or Py_False, respectively */ Modified: python/branches/int_unification/Include/intobject.h ============================================================================== --- python/branches/int_unification/Include/intobject.h (original) +++ python/branches/int_unification/Include/intobject.h Tue Aug 22 23:41:27 2006 @@ -20,34 +20,31 @@ extern "C" { #endif +/* typedef struct { PyObject_HEAD long ob_ival; } PyIntObject; PyAPI_DATA(PyTypeObject) PyInt_Type; +*/ -#define PyInt_Check(op) PyObject_TypeCheck(op, &PyInt_Type) -#define PyInt_CheckExact(op) ((op)->ob_type == &PyInt_Type) +#define PyInt_Check(op) PyLong_Check(op) +#define PyInt_CheckExact(op) (PyLong_CheckExact(op) && _PyLong_FitsInLong(op)) -PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int); -#ifdef Py_USING_UNICODE -PyAPI_FUNC(PyObject *) PyInt_FromUnicode(Py_UNICODE*, Py_ssize_t, int); -#endif -PyAPI_FUNC(PyObject *) PyInt_FromLong(long); -PyAPI_FUNC(PyObject *) PyInt_FromSize_t(size_t); -PyAPI_FUNC(PyObject *) PyInt_FromSsize_t(Py_ssize_t); -PyAPI_FUNC(long) PyInt_AsLong(PyObject *); -PyAPI_FUNC(Py_ssize_t) PyInt_AsSsize_t(PyObject *); -PyAPI_FUNC(unsigned long) PyInt_AsUnsignedLongMask(PyObject *); -#ifdef HAVE_LONG_LONG -PyAPI_FUNC(unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *); -#endif +#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_AsSsize_t PyLong_AsSsize_t +#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask +#define PyInt_AsUnsignedLongLongMask PyInt_AsUnsignedLongM PyAPI_FUNC(long) PyInt_GetMax(void); -/* Macro, trading safety for speed */ -#define PyInt_AS_LONG(op) (((PyIntObject *)(op))->ob_ival) +#define PyInt_AS_LONG(op) PyLong_AsLong(op) /* These aren't really part of the Int object, but they're handy; the protos * are necessary for systems that need the magic of PyAPI_FUNC and that want Modified: python/branches/int_unification/Include/longobject.h ============================================================================== --- python/branches/int_unification/Include/longobject.h (original) +++ python/branches/int_unification/Include/longobject.h Tue Aug 22 23:41:27 2006 @@ -16,15 +16,16 @@ PyAPI_FUNC(PyObject *) PyLong_FromLong(long); PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLong(unsigned long); +PyAPI_FUNC(PyObject *) PyLong_FromSize_t(size_t); +PyAPI_FUNC(PyObject *) PyLong_FromSsize_t(Py_ssize_t); PyAPI_FUNC(PyObject *) PyLong_FromDouble(double); PyAPI_FUNC(long) PyLong_AsLong(PyObject *); +PyAPI_FUNC(ssize_t) PyLong_AsSsize_t(PyObject *); +PyAPI_FUNC(size_t) PyLong_AsSize_t(PyObject *); PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *); PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *); /* For use by intobject.c only */ -PyAPI_FUNC(Py_ssize_t) _PyLong_AsSsize_t(PyObject *); -PyAPI_FUNC(PyObject *) _PyLong_FromSize_t(size_t); -PyAPI_FUNC(PyObject *) _PyLong_FromSsize_t(Py_ssize_t); PyAPI_DATA(int) _PyLong_DigitValue[256]; /* _PyLong_AsScaledDouble returns a double x and an exponent e such that @@ -34,6 +35,7 @@ be multiplied by SHIFT! There may not be enough room in an int to store e*SHIFT directly. */ PyAPI_FUNC(double) _PyLong_AsScaledDouble(PyObject *vv, int *e); + PyAPI_FUNC(int) _PyLong_FitsInLong(PyObject* vv); PyAPI_FUNC(double) PyLong_AsDouble(PyObject *); PyAPI_FUNC(PyObject *) PyLong_FromVoidPtr(void *); Modified: python/branches/int_unification/Modules/_sre.c ============================================================================== --- python/branches/int_unification/Modules/_sre.c (original) +++ python/branches/int_unification/Modules/_sre.c Tue Aug 22 23:41:27 2006 @@ -2748,6 +2748,10 @@ { Py_ssize_t i; + if (index == NULL) + /* Default value */ + return 0; + if (PyInt_Check(index)) return PyInt_AsSsize_t(index); @@ -2898,7 +2902,7 @@ { Py_ssize_t index; - PyObject* index_ = Py_False; /* zero */ + PyObject* index_ = NULL; if (!PyArg_UnpackTuple(args, "start", 0, 1, &index_)) return NULL; @@ -2921,7 +2925,7 @@ { Py_ssize_t index; - PyObject* index_ = Py_False; /* zero */ + PyObject* index_ = NULL; if (!PyArg_UnpackTuple(args, "end", 0, 1, &index_)) return NULL; @@ -2971,7 +2975,7 @@ { Py_ssize_t index; - PyObject* index_ = Py_False; /* zero */ + PyObject* index_ = NULL; if (!PyArg_UnpackTuple(args, "span", 0, 1, &index_)) return NULL; Modified: python/branches/int_unification/Objects/abstract.c ============================================================================== --- python/branches/int_unification/Objects/abstract.c (original) +++ python/branches/int_unification/Objects/abstract.c Tue Aug 22 23:41:27 2006 @@ -915,10 +915,6 @@ } return res; } - if (PyInt_Check(o)) { /* A int subclass without nb_int */ - PyIntObject *io = (PyIntObject*)o; - return PyInt_FromLong(io->ob_ival); - } if (PyString_Check(o)) return int_from_string(PyString_AS_STRING(o), PyString_GET_SIZE(o)); Modified: python/branches/int_unification/Objects/boolobject.c ============================================================================== --- python/branches/int_unification/Objects/boolobject.c (original) +++ python/branches/int_unification/Objects/boolobject.c Tue Aug 22 23:41:27 2006 @@ -67,8 +67,10 @@ static PyObject * bool_and(PyObject *a, PyObject *b) { - if (!PyBool_Check(a) || !PyBool_Check(b)) - return PyInt_Type.tp_as_number->nb_and(a, b); + if (!PyBool_Check(a) || !PyBool_Check(b)) { + PyErr_BadInternalCall(); + return NULL; + } return PyBool_FromLong( ((PyBoolObject *)a)->ob_ival & ((PyBoolObject *)b)->ob_ival); } @@ -76,8 +78,10 @@ static PyObject * bool_or(PyObject *a, PyObject *b) { - if (!PyBool_Check(a) || !PyBool_Check(b)) - return PyInt_Type.tp_as_number->nb_or(a, b); + if (!PyBool_Check(a) || !PyBool_Check(b)) { + PyErr_BadInternalCall(); + return NULL; + } return PyBool_FromLong( ((PyBoolObject *)a)->ob_ival | ((PyBoolObject *)b)->ob_ival); } @@ -85,12 +89,20 @@ static PyObject * bool_xor(PyObject *a, PyObject *b) { - if (!PyBool_Check(a) || !PyBool_Check(b)) - return PyInt_Type.tp_as_number->nb_xor(a, b); + if (!PyBool_Check(a) || !PyBool_Check(b)) { + PyErr_BadInternalCall(); + return NULL; + } return PyBool_FromLong( ((PyBoolObject *)a)->ob_ival ^ ((PyBoolObject *)b)->ob_ival); } +static PyObject * +bool_index(PyObject *a) +{ + return PyInt_FromLong(((PyBoolObject *)a)->ob_ival); +} + /* Doc string */ PyDoc_STRVAR(bool_doc, @@ -139,6 +151,7 @@ 0, /* nb_true_divide */ 0, /* nb_inplace_floor_divide */ 0, /* nb_inplace_true_divide */ + bool_index, /* nb_index */ }; /* The type object for bool. Note that this cannot be subclassed! */ @@ -147,7 +160,7 @@ PyObject_HEAD_INIT(&PyType_Type) 0, "bool", - sizeof(PyIntObject), + sizeof(PyBoolObject), 0, 0, /* tp_dealloc */ (printfunc)bool_print, /* tp_print */ @@ -175,7 +188,7 @@ 0, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ - &PyInt_Type, /* tp_base */ + 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ @@ -188,12 +201,12 @@ /* The objects representing bool values False and True */ /* Named Zero for link-level compatibility */ -PyIntObject _Py_ZeroStruct = { +PyBoolObject _Py_FalseStruct = { PyObject_HEAD_INIT(&PyBool_Type) 0 }; -PyIntObject _Py_TrueStruct = { +PyBoolObject _Py_TrueStruct = { PyObject_HEAD_INIT(&PyBool_Type) 1 }; Modified: python/branches/int_unification/Objects/exceptions.c ============================================================================== --- python/branches/int_unification/Objects/exceptions.c (original) +++ python/branches/int_unification/Objects/exceptions.c Tue Aug 22 23:41:27 2006 @@ -1233,7 +1233,7 @@ if (PyInt_Check(attr)) { *value = PyInt_AS_LONG(attr); } else if (PyLong_Check(attr)) { - *value = _PyLong_AsSsize_t(attr); + *value = PyLong_AsSsize_t(attr); if (*value == -1 && PyErr_Occurred()) return -1; } else { @@ -1520,8 +1520,8 @@ if (!PyArg_ParseTuple(args, "O!O!O!O!O!", &PyString_Type, &self->encoding, objecttype, &self->object, - &PyInt_Type, &self->start, - &PyInt_Type, &self->end, + &PyLong_Type, &self->start, + &PyLong_Type, &self->end, &PyString_Type, &self->reason)) { self->encoding = self->object = self->start = self->end = self->reason = NULL; @@ -1752,8 +1752,8 @@ if (!PyArg_ParseTuple(args, "O!O!O!O!", &PyUnicode_Type, &self->object, - &PyInt_Type, &self->start, - &PyInt_Type, &self->end, + &PyLong_Type, &self->start, + &PyLong_Type, &self->end, &PyString_Type, &self->reason)) { self->object = self->start = self->end = self->reason = NULL; return -1; Modified: python/branches/int_unification/Objects/intobject.c ============================================================================== --- python/branches/int_unification/Objects/intobject.c (original) +++ python/branches/int_unification/Objects/intobject.c Tue Aug 22 23:41:27 2006 @@ -10,6 +10,7 @@ return LONG_MAX; /* To initialize sys.maxint */ } +#if 0 /* Integers are quite normal objects, to make object handling uniform. (Using odd pointers to represent integers would save much space but require extra checks for this special case throughout the code.) @@ -1215,3 +1216,4 @@ } } } +#endif /* if 0 */ Modified: python/branches/int_unification/Objects/listobject.c ============================================================================== --- python/branches/int_unification/Objects/listobject.c (original) +++ python/branches/int_unification/Objects/listobject.c Tue Aug 22 23:41:27 2006 @@ -869,8 +869,8 @@ if (!PyArg_UnpackTuple(args, "pop", 0, 1, &arg)) return NULL; if (arg != NULL) { - if (PyInt_Check(arg)) - i = PyInt_AS_LONG((PyIntObject*) arg); + if (PyLong_Check(arg)) + i = PyLong_AsLong(arg); else if (!PyArg_ParseTuple(args, "|n:pop", &i)) return NULL; } Modified: python/branches/int_unification/Objects/longobject.c ============================================================================== --- python/branches/int_unification/Objects/longobject.c (original) +++ python/branches/int_unification/Objects/longobject.c Tue Aug 22 23:41:27 2006 @@ -206,8 +206,6 @@ int sign; if (vv == NULL || !PyLong_Check(vv)) { - if (vv != NULL && PyInt_Check(vv)) - return PyInt_AsLong(vv); PyErr_BadInternalCall(); return -1; } @@ -236,15 +234,26 @@ overflow: PyErr_SetString(PyExc_OverflowError, - "long int too large to convert to int"); + "long int too large to convert to long"); return -1; } +int +_PyLong_FitsInLong(PyObject *vv) +{ + if (!PyLong_CheckExact(vv)) { + PyErr_BadInternalCall(); + return 0; + } + /* conservative estimate */ + return ((PyLongObject*)vv)->ob_size <= 2; +} + /* Get a Py_ssize_t from a long int object. Returns -1 and sets an error condition if overflow occurs. */ Py_ssize_t -_PyLong_AsSsize_t(PyObject *vv) { +PyLong_AsSsize_t(PyObject *vv) { register PyLongObject *v; size_t x, prev; Py_ssize_t i; @@ -279,7 +288,7 @@ overflow: PyErr_SetString(PyExc_OverflowError, - "long int too large to convert to int"); + "long int too large to convert to "); return -1; } @@ -294,15 +303,6 @@ Py_ssize_t i; if (vv == NULL || !PyLong_Check(vv)) { - if (vv != NULL && PyInt_Check(vv)) { - long val = PyInt_AsLong(vv); - if (val < 0) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long) -1; - } - return val; - } PyErr_BadInternalCall(); return (unsigned long) -1; } @@ -326,6 +326,40 @@ return x; } +/* Get a C unsigned long int from a long int object. + Returns -1 and sets an error condition if overflow occurs. */ + +size_t +PyLong_AsSize_t(PyObject *vv) +{ + register PyLongObject *v; + size_t x, prev; + Py_ssize_t i; + + if (vv == NULL || !PyLong_Check(vv)) { + PyErr_BadInternalCall(); + return (unsigned long) -1; + } + v = (PyLongObject *)vv; + i = v->ob_size; + x = 0; + if (i < 0) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; + } + while (--i >= 0) { + prev = x; + x = (x << SHIFT) + v->ob_digit[i]; + if ((x >> SHIFT) != prev) { + PyErr_SetString(PyExc_OverflowError, + "long int too large to convert"); + return (unsigned long) -1; + } + } + return x; +} + /* Get a C unsigned long int from a long int object, ignoring the high bits. Returns -1 and sets an error condition if an error occurs. */ @@ -338,8 +372,6 @@ int sign; if (vv == NULL || !PyLong_Check(vv)) { - if (vv != NULL && PyInt_Check(vv)) - return PyInt_AsUnsignedLongMask(vv); PyErr_BadInternalCall(); return (unsigned long) -1; } @@ -734,24 +766,14 @@ PyObject * PyLong_FromVoidPtr(void *p) { -#if SIZEOF_VOID_P <= SIZEOF_LONG - if ((long)p < 0) - return PyLong_FromUnsignedLong((unsigned long)p); - return PyInt_FromLong((long)p); -#else - #ifndef HAVE_LONG_LONG # error "PyLong_FromVoidPtr: sizeof(void*) > sizeof(long), but no long long" #endif #if SIZEOF_LONG_LONG < SIZEOF_VOID_P # error "PyLong_FromVoidPtr: sizeof(PY_LONG_LONG) < sizeof(void*)" #endif - /* optimize null pointers */ - if (p == NULL) - return PyInt_FromLong(0); return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)p); -#endif /* SIZEOF_VOID_P <= SIZEOF_LONG */ } /* Get a C pointer from a long object (or an int object in some cases) */ @@ -766,9 +788,7 @@ #if SIZEOF_VOID_P <= SIZEOF_LONG long x; - if (PyInt_Check(vv)) - x = PyInt_AS_LONG(vv); - else if (PyLong_Check(vv) && _PyLong_Sign(vv) < 0) + if (PyLong_Check(vv) && _PyLong_Sign(vv) < 0) x = PyLong_AsLong(vv); else x = PyLong_AsUnsignedLong(vv); @@ -782,9 +802,7 @@ #endif PY_LONG_LONG x; - if (PyInt_Check(vv)) - x = PyInt_AS_LONG(vv); - else if (PyLong_Check(vv) && _PyLong_Sign(vv) < 0) + if (PyLong_Check(vv) && _PyLong_Sign(vv) < 0) x = PyLong_AsLongLong(vv); else x = PyLong_AsUnsignedLongLong(vv); @@ -871,19 +889,19 @@ /* Create a new long int object from a C Py_ssize_t. */ PyObject * -_PyLong_FromSsize_t(Py_ssize_t ival) +PyLong_FromSsize_t(Py_ssize_t ival) { Py_ssize_t bytes = ival; int one = 1; return _PyLong_FromByteArray( (unsigned char *)&bytes, - SIZEOF_SIZE_T, IS_LITTLE_ENDIAN, 0); + SIZEOF_SIZE_T, IS_LITTLE_ENDIAN, 1); } /* Create a new long int object from a C size_t. */ PyObject * -_PyLong_FromSize_t(size_t ival) +PyLong_FromSize_t(size_t ival) { size_t bytes = ival; int one = 1; @@ -909,8 +927,6 @@ if (!PyLong_Check(vv)) { PyNumberMethods *nb; PyObject *io; - if (PyInt_Check(vv)) - return (PY_LONG_LONG)PyInt_AsLong(vv); if ((nb = vv->ob_type->tp_as_number) == NULL || nb->nb_int == NULL) { PyErr_SetString(PyExc_TypeError, "an integer is required"); @@ -919,11 +935,6 @@ io = (*nb->nb_int) (vv); if (io == NULL) return -1; - if (PyInt_Check(io)) { - bytes = PyInt_AsLong(io); - Py_DECREF(io); - return bytes; - } if (PyLong_Check(io)) { bytes = PyLong_AsLongLong(io); Py_DECREF(io); @@ -1010,9 +1021,6 @@ *a = (PyLongObject *) v; Py_INCREF(v); } - else if (PyInt_Check(v)) { - *a = (PyLongObject *) PyLong_FromLong(PyInt_AS_LONG(v)); - } else { return 0; } @@ -1020,9 +1028,6 @@ *b = (PyLongObject *) w; Py_INCREF(w); } - else if (PyInt_Check(w)) { - *b = (PyLongObject *) PyLong_FromLong(PyInt_AS_LONG(w)); - } else { Py_DECREF(*a); return 0; @@ -2662,11 +2667,6 @@ c = (PyLongObject *)x; Py_INCREF(x); } - else if (PyInt_Check(x)) { - c = (PyLongObject *)PyLong_FromLong(PyInt_AS_LONG(x)); - if (c == NULL) - goto Error; - } else if (x == Py_None) c = NULL; else { @@ -3155,12 +3155,7 @@ static int long_coerce(PyObject **pv, PyObject **pw) { - if (PyInt_Check(*pw)) { - *pw = PyLong_FromLong(PyInt_AS_LONG(*pw)); - Py_INCREF(*pv); - return 0; - } - else if (PyLong_Check(*pw)) { + if (PyLong_Check(*pw)) { Py_INCREF(*pv); Py_INCREF(*pw); return 0; @@ -3181,22 +3176,8 @@ static PyObject * long_int(PyObject *v) { - long x; - x = PyLong_AsLong(v); - if (PyErr_Occurred()) { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) { - PyErr_Clear(); - if (PyLong_CheckExact(v)) { - Py_INCREF(v); - return v; - } - else - return _PyLong_Copy((PyLongObject *)v); - } - else - return NULL; - } - return PyInt_FromLong(x); + Py_INCREF(v); + return v; } static PyObject * @@ -3364,7 +3345,7 @@ 0, /* tp_as_mapping */ (hashfunc)long_hash, /* tp_hash */ 0, /* tp_call */ - 0, /* tp_str */ + long_repr, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -3389,3 +3370,42 @@ long_new, /* tp_new */ PyObject_Del, /* tp_free */ }; + +int +_PyLong_Init(void) +{ + int ival; +#if 0 +#if NSMALLNEGINTS + NSMALLPOSINTS > 0 + for (ival = -NSMALLNEGINTS; ival < NSMALLPOSINTS; ival++) { + if (!free_list && (free_list = fill_free_list()) == NULL) + return 0; + /* PyObject_New is inlined */ + v = free_list; + free_list = (PyIntObject *)v->ob_type; + PyObject_INIT(v, &PyInt_Type); + v->ob_ival = ival; + small_ints[ival + NSMALLNEGINTS] = v; + } +#endif +#endif + return 1; +} + +void +PyLong_Fini(void) +{ + int i; +#if 0 +#if NSMALLNEGINTS + NSMALLPOSINTS > 0 + PyIntObject **q; + + i = NSMALLNEGINTS + NSMALLPOSINTS; + q = small_ints; + while (--i >= 0) { + Py_XDECREF(*q); + *q++ = NULL; + } +#endif +#endif +} Modified: python/branches/int_unification/Python/bltinmodule.c ============================================================================== --- python/branches/int_unification/Python/bltinmodule.c (original) +++ python/branches/int_unification/Python/bltinmodule.c Tue Aug 22 23:41:27 2006 @@ -2138,7 +2138,7 @@ SETBUILTIN("float", &PyFloat_Type); SETBUILTIN("frozenset", &PyFrozenSet_Type); SETBUILTIN("property", &PyProperty_Type); - SETBUILTIN("int", &PyInt_Type); + SETBUILTIN("int", &PyLong_Type); SETBUILTIN("list", &PyList_Type); SETBUILTIN("long", &PyLong_Type); SETBUILTIN("object", &PyBaseObject_Type); Modified: python/branches/int_unification/Python/marshal.c ============================================================================== --- python/branches/int_unification/Python/marshal.c (original) +++ python/branches/int_unification/Python/marshal.c Tue Aug 22 23:41:27 2006 @@ -144,31 +144,34 @@ else if (v == Py_True) { w_byte(TYPE_TRUE, p); } - else if (PyInt_Check(v)) { - long x = PyInt_AS_LONG((PyIntObject *)v); + else if (PyLong_Check(v)) { + long x = PyLong_AsLong(v); + if ((x == -1) && PyErr_Occurred()) { + PyLongObject *ob = (PyLongObject *)v; + PyErr_Clear(); + w_byte(TYPE_LONG, p); + n = ob->ob_size; + w_long((long)n, p); + if (n < 0) + n = -n; + for (i = 0; i < n; i++) + w_short(ob->ob_digit[i], p); + } + else { #if SIZEOF_LONG > 4 - long y = Py_ARITHMETIC_RIGHT_SHIFT(long, x, 31); - if (y && y != -1) { - w_byte(TYPE_INT64, p); - w_long64(x, p); - } - else + long y = Py_ARITHMETIC_RIGHT_SHIFT(long, x, 31); + if (y && y != -1) { + w_byte(TYPE_INT64, p); + w_long64(x, p); + } + else #endif { - w_byte(TYPE_INT, p); - w_long(x, p); + w_byte(TYPE_INT, p); + w_long(x, p); + } } } - else if (PyLong_Check(v)) { - PyLongObject *ob = (PyLongObject *)v; - w_byte(TYPE_LONG, p); - n = ob->ob_size; - w_long((long)n, p); - if (n < 0) - n = -n; - for (i = 0; i < n; i++) - w_short(ob->ob_digit[i], p); - } else if (PyFloat_Check(v)) { if (p->version > 1) { unsigned char buf[8]; Modified: python/branches/int_unification/Python/pythonrun.c ============================================================================== --- python/branches/int_unification/Python/pythonrun.c (original) +++ python/branches/int_unification/Python/pythonrun.c Tue Aug 22 23:41:27 2006 @@ -181,7 +181,7 @@ if (!_PyFrame_Init()) Py_FatalError("Py_Initialize: can't init frames"); - if (!_PyInt_Init()) + if (!_PyLong_Init()) Py_FatalError("Py_Initialize: can't init ints"); _PyFloat_Init(); @@ -453,7 +453,7 @@ PyList_Fini(); PySet_Fini(); PyString_Fini(); - PyInt_Fini(); + PyLong_Fini(); PyFloat_Fini(); #ifdef Py_USING_UNICODE From python-checkins at python.org Wed Aug 23 00:03:11 2006 From: python-checkins at python.org (brett.cannon) Date: Wed, 23 Aug 2006 00:03:11 +0200 (CEST) Subject: [Python-checkins] r51493 - peps/trunk/pep-0362.txt Message-ID: <20060822220311.C686A1E4009@bag.python.org> Author: brett.cannon Date: Wed Aug 23 00:03:11 2006 New Revision: 51493 Modified: peps/trunk/pep-0362.txt Log: Point to prototype implementation. Also clarify 'name' attribute on Signature is not fully qualified. Modified: peps/trunk/pep-0362.txt ============================================================================== --- peps/trunk/pep-0362.txt (original) +++ peps/trunk/pep-0362.txt Wed Aug 23 00:03:11 2006 @@ -15,12 +15,13 @@ ======== Python has always supported powerful introspection capabilities, -including that for functions. Taking a function object, you can fully -reconstruct the function signature using ``func_defaults``, -``func_code.co_argcount``, ``func_code.co_flags``, and -``func_code.co_varnames``. Unfortunately this is a little unruly -having to look at four different attributes to pull together complete -information for a function's signature. +including that for functions and methods (for the rest of this PEP the +word "function" refers to both functions and methods). Taking a +function object, you can fully reconstruct the function signature +using ``func_defaults``, ``func_code.co_argcount``, +``func_code.co_flags``, and ``func_code.co_varnames``. Unfortunately +this is a little unruly having to look at four different attributes +to pull together complete information for a function's signature. This PEP proposes an object representation for function signatures. This should help facilitate introspection on functions. It also helps @@ -40,7 +41,12 @@ A Signature object has the following structure attributes: * name:str - Name of the function. + Name of the function. This is not fully qualified because + function objects for methods do not know the class they are + contained within. This makes functions and methods + indistinguishable from one another when passed to decorators, + prevventing proper creation of a fully qualified name. + indistinguishable from * var_args:str Name of the ``*args`` parameter, if present, else the empty string. @@ -94,11 +100,12 @@ Implementation ============== -An implementation is forthcoming for experimentation purposes based on -the 'inspect' module [#inspect-module]_. The classes will be exposed -in the 'inspect' module as well. This PEP has been posted without -implementation so as to not be a hinderance to another PEP that is -under development by another author. +An implementation can be found in patch #1544909 [#impl]_. It +modifies the 'inspect' module [#inspect-module]_to include the +implementation. There is a function named ``getsignature()`` which +returns the value stored on the ``__signature__`` attribute (for +methods this is stored directly on the im_func function object since +that is what decorators will work with). Relation With Other PEPs @@ -144,6 +151,9 @@ .. [#pep-3102] Keyword-Only Arguments (http://www.python.org/dev/peps/pep-3102/) +.. [#impl] Implementation of PEP 362 + (http://www.python.org/sf/1544909) + Copyright ========= From python-checkins at python.org Wed Aug 23 00:37:36 2006 From: python-checkins at python.org (thomas.wouters) Date: Wed, 23 Aug 2006 00:37:36 +0200 (CEST) Subject: [Python-checkins] r51494 - python/branches/p3yk-noslice/Objects/stringobject.c python/branches/p3yk-noslice/Objects/tupleobject.c python/branches/p3yk-noslice/Objects/unicodeobject.c Message-ID: <20060822223736.B50491E4009@bag.python.org> Author: thomas.wouters Date: Wed Aug 23 00:37:35 2006 New Revision: 51494 Modified: python/branches/p3yk-noslice/Objects/stringobject.c python/branches/p3yk-noslice/Objects/tupleobject.c python/branches/p3yk-noslice/Objects/unicodeobject.c Log: Copy some of the special cases from normal slicing to extended slicing, for general speedup. Modified: python/branches/p3yk-noslice/Objects/stringobject.c ============================================================================== --- python/branches/p3yk-noslice/Objects/stringobject.c (original) +++ python/branches/p3yk-noslice/Objects/stringobject.c Wed Aug 23 00:37:35 2006 @@ -1210,6 +1210,17 @@ if (slicelength <= 0) { return PyString_FromStringAndSize("", 0); } + else if (start == 0 && step == 1 && + slicelength == PyString_GET_SIZE(self) && + PyString_CheckExact(self)) { + Py_INCREF(self); + return (PyObject *)self; + } + else if (step == 1) { + return PyString_FromStringAndSize( + PyString_AS_STRING(self) + start, + slicelength); + } else { source_buf = PyString_AsString((PyObject*)self); result_buf = (char *)PyMem_Malloc(slicelength); Modified: python/branches/p3yk-noslice/Objects/tupleobject.c ============================================================================== --- python/branches/p3yk-noslice/Objects/tupleobject.c (original) +++ python/branches/p3yk-noslice/Objects/tupleobject.c Wed Aug 23 00:37:35 2006 @@ -603,6 +603,12 @@ if (slicelength <= 0) { return PyTuple_New(0); } + else if (start == 0 && step == 1 && + slicelength == PyTuple_GET_SIZE(self) && + PyTuple_CheckExact(self)) { + Py_INCREF(self); + return (PyObject *)self; + } else { result = PyTuple_New(slicelength); if (!result) return NULL; Modified: python/branches/p3yk-noslice/Objects/unicodeobject.c ============================================================================== --- python/branches/p3yk-noslice/Objects/unicodeobject.c (original) +++ python/branches/p3yk-noslice/Objects/unicodeobject.c Wed Aug 23 00:37:35 2006 @@ -7083,6 +7083,12 @@ if (slicelength <= 0) { return PyUnicode_FromUnicode(NULL, 0); + } else if (start == 0 && step == 1 && slicelength == self->length && + PyUnicode_CheckExact(self)) { + Py_INCREF(self); + return (PyObject *)self; + } else if (step == 1) { + return PyUnicode_FromUnicode(self->str + start, slicelength); } else { source_buf = PyUnicode_AS_UNICODE((PyObject*)self); result_buf = (Py_UNICODE *)PyMem_MALLOC(slicelength* From python-checkins at python.org Wed Aug 23 00:49:54 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 23 Aug 2006 00:49:54 +0200 (CEST) Subject: [Python-checkins] r51495 - in python/branches/int_unification: Include/boolobject.h Objects/boolobject.c Message-ID: <20060822224954.35CA31E4009@bag.python.org> Author: martin.v.loewis Date: Wed Aug 23 00:49:53 2006 New Revision: 51495 Modified: python/branches/int_unification/Include/boolobject.h python/branches/int_unification/Objects/boolobject.c Log: Make bool a subtype of long. Modified: python/branches/int_unification/Include/boolobject.h ============================================================================== --- python/branches/int_unification/Include/boolobject.h (original) +++ python/branches/int_unification/Include/boolobject.h Wed Aug 23 00:49:53 2006 @@ -7,11 +7,6 @@ #endif -typedef struct { - PyObject_HEAD - long ob_ival; -} PyBoolObject; - PyAPI_DATA(PyTypeObject) PyBool_Type; #define PyBool_Check(x) ((x)->ob_type == &PyBool_Type) @@ -20,7 +15,7 @@ Don't forget to apply Py_INCREF() when returning either!!! */ /* Don't use these directly */ -PyAPI_DATA(PyBoolObject) _Py_FalseStruct, _Py_TrueStruct; +PyAPI_DATA(struct _longobject) _Py_FalseStruct, _Py_TrueStruct; /* Use these macros */ #define Py_False ((PyObject *) &_Py_FalseStruct) Modified: python/branches/int_unification/Objects/boolobject.c ============================================================================== --- python/branches/int_unification/Objects/boolobject.c (original) +++ python/branches/int_unification/Objects/boolobject.c Wed Aug 23 00:49:53 2006 @@ -1,13 +1,14 @@ /* Boolean type, a subtype of int */ #include "Python.h" +#include "longintrepr.h" /* We need to define bool_print to override int_print */ static int -bool_print(PyBoolObject *self, FILE *fp, int flags) +bool_print(PyObject *self, FILE *fp, int flags) { - fputs(self->ob_ival == 0 ? "False" : "True", fp); + fputs(self == Py_False ? "False" : "True", fp); return 0; } @@ -17,11 +18,11 @@ static PyObject *true_str = NULL; static PyObject * -bool_repr(PyBoolObject *self) +bool_repr(PyObject *self) { PyObject *s; - if (self->ob_ival) + if (self == Py_True) s = true_str ? true_str : (true_str = PyString_InternFromString("True")); else @@ -67,40 +68,25 @@ static PyObject * bool_and(PyObject *a, PyObject *b) { - if (!PyBool_Check(a) || !PyBool_Check(b)) { - PyErr_BadInternalCall(); - return NULL; - } - return PyBool_FromLong( - ((PyBoolObject *)a)->ob_ival & ((PyBoolObject *)b)->ob_ival); + if (!PyBool_Check(a) || !PyBool_Check(b)) + return PyLong_Type.tp_as_number->nb_and(a, b); + return PyBool_FromLong((a == Py_True) & (b == Py_True)); } static PyObject * bool_or(PyObject *a, PyObject *b) { - if (!PyBool_Check(a) || !PyBool_Check(b)) { - PyErr_BadInternalCall(); - return NULL; - } - return PyBool_FromLong( - ((PyBoolObject *)a)->ob_ival | ((PyBoolObject *)b)->ob_ival); + if (!PyBool_Check(a) || !PyBool_Check(b)) + return PyLong_Type.tp_as_number->nb_or(a, b); + return PyBool_FromLong((a == Py_True) | (b == Py_True)); } static PyObject * bool_xor(PyObject *a, PyObject *b) { - if (!PyBool_Check(a) || !PyBool_Check(b)) { - PyErr_BadInternalCall(); - return NULL; - } - return PyBool_FromLong( - ((PyBoolObject *)a)->ob_ival ^ ((PyBoolObject *)b)->ob_ival); -} - -static PyObject * -bool_index(PyObject *a) -{ - return PyInt_FromLong(((PyBoolObject *)a)->ob_ival); + if (!PyBool_Check(a) || !PyBool_Check(b)) + return PyLong_Type.tp_as_number->nb_xor(a, b); + return PyBool_FromLong((a == Py_True) ^ (b == Py_True)); } /* Doc string */ @@ -151,7 +137,7 @@ 0, /* nb_true_divide */ 0, /* nb_inplace_floor_divide */ 0, /* nb_inplace_true_divide */ - bool_index, /* nb_index */ + 0, /* nb_index */ }; /* The type object for bool. Note that this cannot be subclassed! */ @@ -160,20 +146,20 @@ PyObject_HEAD_INIT(&PyType_Type) 0, "bool", - sizeof(PyBoolObject), + sizeof(struct _longobject), 0, 0, /* tp_dealloc */ - (printfunc)bool_print, /* tp_print */ + bool_print, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ - (reprfunc)bool_repr, /* tp_repr */ + bool_repr, /* tp_repr */ &bool_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ - (reprfunc)bool_repr, /* tp_str */ + bool_repr, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -188,7 +174,7 @@ 0, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ - 0, /* tp_base */ + &PyLong_Type, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ @@ -201,12 +187,12 @@ /* The objects representing bool values False and True */ /* Named Zero for link-level compatibility */ -PyBoolObject _Py_FalseStruct = { +struct _longobject _Py_FalseStruct = { PyObject_HEAD_INIT(&PyBool_Type) - 0 + 0, { 0 } }; -PyBoolObject _Py_TrueStruct = { +struct _longobject _Py_TrueStruct = { PyObject_HEAD_INIT(&PyBool_Type) - 1 + 1, { 1 } }; From buildbot at python.org Wed Aug 23 01:03:41 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 22 Aug 2006 23:03:41 +0000 Subject: [Python-checkins] buildbot warnings in alpha Debian trunk Message-ID: <20060822230341.DB5D51E4009@bag.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Debian%2520trunk/builds/527 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeremy.hylton Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 23 01:12:42 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 23 Aug 2006 01:12:42 +0200 (CEST) Subject: [Python-checkins] r51496 - sandbox/trunk/Doc/functional.rst Message-ID: <20060822231242.1B5CF1E400A@bag.python.org> Author: andrew.kuchling Date: Wed Aug 23 01:12:41 2006 New Revision: 51496 Modified: sandbox/trunk/Doc/functional.rst Log: Typo fix Modified: sandbox/trunk/Doc/functional.rst ============================================================================== --- sandbox/trunk/Doc/functional.rst (original) +++ sandbox/trunk/Doc/functional.rst Wed Aug 23 01:12:41 2006 @@ -579,7 +579,7 @@ + 12``.) Values are sent into a generator by calling its -``send(value})`` method. This method resumes the +``send(value)`` method. This method resumes the generator's code and the ``yield`` expression returns the specified value. If the regular ``next()`` method is called, the ``yield`` returns ``None``. From python-checkins at python.org Wed Aug 23 01:13:44 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 23 Aug 2006 01:13:44 +0200 (CEST) Subject: [Python-checkins] r51497 - python/trunk/Doc/howto/functional.rst sandbox/trunk/Doc/functional.rst Message-ID: <20060822231344.5355A1E4009@bag.python.org> Author: andrew.kuchling Date: Wed Aug 23 01:13:43 2006 New Revision: 51497 Added: python/trunk/Doc/howto/functional.rst - copied unchanged from r51496, sandbox/trunk/Doc/functional.rst Removed: sandbox/trunk/Doc/functional.rst Log: Move functional howto into trunk Deleted: /sandbox/trunk/Doc/functional.rst ============================================================================== --- /sandbox/trunk/Doc/functional.rst Wed Aug 23 01:13:43 2006 +++ (empty file) @@ -1,1279 +0,0 @@ -Functional Programming HOWTO -================================ - -**Version 0.21** - -(This is a first draft. Please send comments/error -reports/suggestions to amk at amk.ca. This URL is probably not going to -be the final location of the document, so be careful about linking to -it -- you may want to add a disclaimer.) - -In this document, we'll take a tour of Python's features suitable for -implementing programs in a functional style. After an introduction to -the concepts of functional programming, we'll look at language -features such as iterators and generators and relevant library modules -such as ``itertools`` and ``functools``. - - -Introduction ----------------------- - -This section explains the basic concept of functional programming; if -you're just interested in learning about Python language features, -skip to the next section. - -Programming languages support decomposing problems in several different -ways: - -* Most programming languages are **procedural**: - programs are lists of instructions that tell the computer what to - do with the program's input. - C, Pascal, and even Unix shells are procedural languages. - -* In **declarative** languages, you write a specification that describes - the problem to be solved, and the language implementation figures out - how to perform the computation efficiently. SQL is the declarative - language you're most likely to be familiar with; a SQL query describes - the data set you want to retrieve, and the SQL engine decides whether to - scan tables or use indexes, which subclauses should be performed first, - etc. - -* **Object-oriented** programs manipulate collections of objects. - Objects have internal state and support methods that query or modify - this internal state in some way. Smalltalk and Java are - object-oriented languages. C++ and Python are languages that - support object-oriented programming, but don't force the use - of object-oriented features. - -* **Functional** programming decomposes a problem into a set of functions. - Ideally, functions only take inputs and produce outputs, and don't have any - internal state that affects the output produced for a given input. - Well-known functional languages include the ML family (Standard ML, - OCaml, and other variants) and Haskell. - -The designers of some computer languages have chosen one approach to -programming that's emphasized. This often makes it difficult to -write programs that use a different approach. Other languages are -multi-paradigm languages that support several different approaches. Lisp, -C++, and Python are multi-paradigm; you can write programs or -libraries that are largely procedural, object-oriented, or functional -in all of these languages. In a large program, different sections -might be written using different approaches; the GUI might be object-oriented -while the processing logic is procedural or functional, for example. - -In a functional program, input flows through a set of functions. Each -function operates on its input and produces some output. Functional -style frowns upon functions with side effects that modify internal -state or make other changes that aren't visible in the function's -return value. Functions that have no side effects at all are -called **purely functional**. -Avoiding side effects means not using data structures -that get updated as a program runs; every function's output -must only depend on its input. - -Some languages are very strict about purity and don't even have -assignment statements such as ``a=3`` or ``c = a + b``, but it's -difficult to avoid all side effects. Printing to the screen or -writing to a disk file are side effects, for example. For example, in -Python a ``print`` statement or a ``time.sleep(1)`` both return no -useful value; they're only called for their side effects of sending -some text to the screen or pausing execution for a second. - -Python programs written in functional style usually won't go to the -extreme of avoiding all I/O or all assignments; instead, they'll -provide a functional-appearing interface but will use non-functional -features internally. For example, the implementation of a function -will still use assignments to local variables, but won't modify global -variables or have other side effects. - -Functional programming can be considered the opposite of -object-oriented programming. Objects are little capsules containing -some internal state along with a collection of method calls that let -you modify this state, and programs consist of making the right set of -state changes. Functional programming wants to avoid state changes as -much as possible and works with data flowing between functions. In -Python you might combine the two approaches by writing functions that -take and return instances representing objects in your application -(e-mail messages, transactions, etc.). - -Functional design may seem like an odd constraint to work under. Why -should you avoid objects and side effects? There are theoretical and -practical advantages to the functional style: - -* Formal provability. -* Modularity. -* Composability. -* Ease of debugging and testing. - -Formal provability -'''''''''''''''''''''' - -A theoretical benefit is that it's easier to construct a mathematical proof -that a functional program is correct. - -For a long time researchers have been interested in finding ways to -mathematically prove programs correct. This is different from testing -a program on numerous inputs and concluding that its output is usually -correct, or reading a program's source code and concluding that the -code looks right; the goal is instead a rigorous proof that a program -produces the right result for all possible inputs. - -The technique used to prove programs correct is to write down -**invariants**, properties of the input data and of the program's -variables that are always true. For each line of code, you then show -that if invariants X and Y are true **before** the line is executed, -the slightly different invariants X' and Y' are true **after** -the line is executed. This continues until you reach the end of the -program, at which point the invariants should match the desired -conditions on the program's output. - -Functional programming's avoidance of assignments arose because -assignments are difficult to handle with this technique; -assignments can break invariants that were true before the assignment -without producing any new invariants that can be propagated onward. - -Unfortunately, proving programs correct is largely impractical and not -relevant to Python software. Even trivial programs require proofs that -are several pages long; the proof of correctness for a moderately -complicated program would be enormous, and few or none of the programs -you use daily (the Python interpreter, your XML parser, your web -browser) could be proven correct. Even if you wrote down or generated -a proof, there would then be the question of verifying the proof; -maybe there's an error in it, and you wrongly believe you've proved -the program correct. - -Modularity -'''''''''''''''''''''' - -A more practical benefit of functional programming is that it forces -you to break apart your problem into small pieces. Programs are more -modular as a result. It's easier to specify and write a small -function that does one thing than a large function that performs a -complicated transformation. Small functions are also easier to read -and to check for errors. - - -Ease of debugging and testing -'''''''''''''''''''''''''''''''''' - -Testing and debugging a functional-style program is easier. - -Debugging is simplified because functions are generally small and -clearly specified. When a program doesn't work, each function is an -interface point where you can check that the data are correct. You -can look at the intermediate inputs and outputs to quickly isolate the -function that's responsible for a bug. - -Testing is easier because each function is a potential subject for a -unit test. Functions don't depend on system state that needs to be -replicated before running a test; instead you only have to synthesize -the right input and then check that the output matches expectations. - - - -Composability -'''''''''''''''''''''' - -As you work on a functional-style program, you'll write a number of -functions with varying inputs and outputs. Some of these functions -will be unavoidably specialized to a particular application, but -others will be useful in a wide variety of programs. For example, a -function that takes a directory path and returns all the XML files in -the directory, or a function that takes a filename and returns its -contents, can be applied to many different situations. - -Over time you'll form a personal library of utilities. Often you'll -assemble new programs by arranging existing functions in a new -configuration and writing a few functions specialized for the current -task. - - - -Iterators ------------------------ - -I'll start by looking at a Python language feature that's an important -foundation for writing functional-style programs: iterators. - -An iterator is an object representing a stream of data; this object -returns the data one element at a time. A Python iterator must -support a method called ``next()`` that takes no arguments and always -returns the next element of the stream. If there are no more elements -in the stream, ``next()`` must raise the ``StopIteration`` exception. -Iterators don't have to be finite, though; it's perfectly reasonable -to write an iterator that produces an infinite stream of data. - -The built-in ``iter()`` function takes an arbitrary object and tries -to return an iterator that will return the object's contents or -elements, raising ``TypeError`` if the object doesn't support -iteration. Several of Python's built-in data types support iteration, -the most common being lists and dictionaries. An object is called -an **iterable** object if you can get an iterator for it. - -You can experiment with the iteration interface manually:: - - >>> L = [1,2,3] - >>> it = iter(L) - >>> print it - - >>> it.next() - 1 - >>> it.next() - 2 - >>> it.next() - 3 - >>> it.next() - Traceback (most recent call last): - File "", line 1, in ? - StopIteration - >>> - -Python expects iterable objects in several different contexts, the -most important being the ``for`` statement. In the statement ``for X in Y``, -Y must be an iterator or some object for which ``iter()`` can create -an iterator. These two statements are equivalent:: - - for i in iter(obj): - print i - - for i in obj: - print i - -Iterators can be materialized as lists or tuples by using the -``list()`` or ``tuple()`` constructor functions:: - - >>> L = [1,2,3] - >>> iterator = iter(L) - >>> t = tuple(iterator) - >>> t - (1, 2, 3) - -Sequence unpacking also supports iterators: if you know an iterator -will return N elements, you can unpack them into an N-tuple:: - - >>> L = [1,2,3] - >>> iterator = iter(L) - >>> a,b,c = iterator - >>> a,b,c - (1, 2, 3) - -Built-in functions such as ``max()`` and ``min()`` can take a single -iterator argument and will return the largest or smallest element. -The ``"in"`` and ``"not in"`` operators also support iterators: ``X in -iterator`` is true if X is found in the stream returned by the -iterator. You'll run into obvious problems if the iterator is -infinite; ``max()``, ``min()``, and ``"not in"`` will never return, and -if the element X never appears in the stream, the ``"in"`` operator -won't return either. - -Note that you can only go forward in an iterator; there's no way to -get the previous element, reset the iterator, or make a copy of it. -Iterator objects can optionally provide these additional capabilities, -but the iterator protocol only specifies the ``next()`` method. -Functions may therefore consume all of the iterator's output, and if -you need to do something different with the same stream, you'll have -to create a new iterator. - - - -Data Types That Support Iterators -''''''''''''''''''''''''''''''''''' - -We've already seen how lists and tuples support iterators. In fact, -any Python sequence type, such as strings, will automatically support -creation of an iterator. - -Calling ``iter()`` on a dictionary returns an iterator that will loop -over the dictionary's keys:: - - >>> m = {'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6, - ... 'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12} - >>> for key in m: - ... print key, m[key] - Mar 3 - Feb 2 - Aug 8 - Sep 9 - May 5 - Jun 6 - Jul 7 - Jan 1 - Apr 4 - Nov 11 - Dec 12 - Oct 10 - -Note that the order is essentially random, because it's based on the -hash ordering of the objects in the dictionary. - -Applying ``iter()`` to a dictionary always loops over the keys, but -dictionaries have methods that return other iterators. If you want to -iterate over keys, values, or key/value pairs, you can explicitly call -the ``iterkeys()``, ``itervalues()``, or ``iteritems()`` methods to -get an appropriate iterator. - -The ``dict()`` constructor can accept an iterator that returns a -finite stream of ``(key, value)`` tuples:: - - >>> L = [('Italy', 'Rome'), ('France', 'Paris'), ('US', 'Washington DC')] - >>> dict(iter(L)) - {'Italy': 'Rome', 'US': 'Washington DC', 'France': 'Paris'} - -Files also support iteration by calling the ``readline()`` -method until there are no more lines in the file. This means you can -read each line of a file like this:: - - for line in file: - # do something for each line - ... - -Sets can take their contents from an iterable and let you iterate over -the set's elements:: - - S = set((2, 3, 5, 7, 11, 13)) - for i in S: - print i - - - -Generator expressions and list comprehensions ----------------------------------------------------- - -Two common operations on a stream are 1) performing some operation for -every element, 2) selecting a subset of elements that meet some -condition. For example, given a list of strings, you might want to -strip off trailing whitespace from each line or extract all the -strings containing a given substring. - -List comprehensions and generator expressions (short form: "listcomps" -and "genexps") are a concise notation for such operations, borrowed -from the functional programming language Haskell -(http://www.haskell.org). You can strip all the whitespace from a -stream of strings with the following code:: - - line_list = [' line 1\n', 'line 2 \n', ...] - - # Generator expression -- returns iterator - stripped_iter = (line.strip() for line in line_list) - - # List comprehension -- returns list - stripped_list = [line.strip() for line in line_list] - -You can select only certain elements by adding an ``"if"`` condition:: - - stripped_list = [line.strip() for line in line_list - if line != ""] - -With a list comprehension, you get back a Python list; -``stripped_list`` is a list containing the resulting lines, not an -iterator. Generator expressions return an iterator that computes the -values as necessary, not needing to materialize all the values at -once. This means that list comprehensions aren't useful if you're -working with iterators that return an infinite stream or a very large -amount of data. Generator expressions are preferable in these -situations. - -Generator expressions are surrounded by parentheses ("()") and list -comprehensions are surrounded by square brackets ("[]"). Generator -expressions have the form:: - - ( expression for expr in sequence1 - if condition1 - for expr2 in sequence2 - if condition2 - for expr3 in sequence3 ... - if condition3 - for exprN in sequenceN - if conditionN ) - -Again, for a list comprehension only the outside brackets are -different (square brackets instead of parentheses). - -The elements of the generated output will be the successive values of -``expression``. The ``if`` clauses are all optional; if present, -``expression`` is only evaluated and added to the result when -``condition`` is true. - -Generator expressions always have to be written inside parentheses, -but the parentheses signalling a function call also count. If you -want to create an iterator that will be immediately passed to a -function you can write:: - - obj_total = sum(obj.count for obj in list_all_objects()) - -The ``for...in`` clauses contain the sequences to be iterated over. -The sequences do not have to be the same length, because they are -iterated over from left to right, **not** in parallel. For each -element in ``sequence1``, ``sequence2`` is looped over from the -beginning. ``sequence3`` is then looped over for each -resulting pair of elements from ``sequence1`` and ``sequence2``. - -To put it another way, a list comprehension or generator expression is -equivalent to the following Python code:: - - for expr1 in sequence1: - if not (condition1): - continue # Skip this element - for expr2 in sequence2: - if not (condition2): - continue # Skip this element - ... - for exprN in sequenceN: - if not (conditionN): - continue # Skip this element - - # Output the value of - # the expression. - -This means that when there are multiple ``for...in`` clauses but no -``if`` clauses, the length of the resulting output will be equal to -the product of the lengths of all the sequences. If you have two -lists of length 3, the output list is 9 elements long:: - - seq1 = 'abc' - seq2 = (1,2,3) - >>> [ (x,y) for x in seq1 for y in seq2] - [('a', 1), ('a', 2), ('a', 3), - ('b', 1), ('b', 2), ('b', 3), - ('c', 1), ('c', 2), ('c', 3)] - -To avoid introducing an ambiguity into Python's grammar, if -``expression`` is creating a tuple, it must be surrounded with -parentheses. The first list comprehension below is a syntax error, -while the second one is correct:: - - # Syntax error - [ x,y for x in seq1 for y in seq2] - # Correct - [ (x,y) for x in seq1 for y in seq2] - - -Generators ------------------------ - -Generators are a special class of functions that simplify the task of -writing iterators. Regular functions compute a value and return it, -but generators return an iterator that returns a stream of values. - -You're doubtless familiar with how regular function calls work in -Python or C. When you call a function, it gets a private namespace -where its local variables are created. When the function reaches a -``return`` statement, the local variables are destroyed and the -value is returned to the caller. A later call to the same function -creates a new private namespace and a fresh set of local -variables. But, what if the local variables weren't thrown away on -exiting a function? What if you could later resume the function where -it left off? This is what generators provide; they can be thought of -as resumable functions. - -Here's the simplest example of a generator function:: - - def generate_ints(N): - for i in range(N): - yield i - -Any function containing a ``yield`` keyword is a generator function; -this is detected by Python's bytecode compiler which compiles the -function specially as a result. - -When you call a generator function, it doesn't return a single value; -instead it returns a generator object that supports the iterator -protocol. On executing the ``yield`` expression, the generator -outputs the value of ``i``, similar to a ``return`` -statement. The big difference between ``yield`` and a -``return`` statement is that on reaching a ``yield`` the -generator's state of execution is suspended and local variables are -preserved. On the next call to the generator's ``.next()`` method, -the function will resume executing. - -Here's a sample usage of the ``generate_ints()`` generator:: - - >>> gen = generate_ints(3) - >>> gen - - >>> gen.next() - 0 - >>> gen.next() - 1 - >>> gen.next() - 2 - >>> gen.next() - Traceback (most recent call last): - File "stdin", line 1, in ? - File "stdin", line 2, in generate_ints - StopIteration - -You could equally write ``for i in generate_ints(5)``, or -``a,b,c = generate_ints(3)``. - -Inside a generator function, the ``return`` statement can only be used -without a value, and signals the end of the procession of values; -after executing a ``return`` the generator cannot return any further -values. ``return`` with a value, such as ``return 5``, is a syntax -error inside a generator function. The end of the generator's results -can also be indicated by raising ``StopIteration`` manually, or by -just letting the flow of execution fall off the bottom of the -function. - -You could achieve the effect of generators manually by writing your -own class and storing all the local variables of the generator as -instance variables. For example, returning a list of integers could -be done by setting ``self.count`` to 0, and having the -``next()`` method increment ``self.count`` and return it. -However, for a moderately complicated generator, writing a -corresponding class can be much messier. - -The test suite included with Python's library, ``test_generators.py``, -contains a number of more interesting examples. Here's one generator -that implements an in-order traversal of a tree using generators -recursively. - -:: - - # A recursive generator that generates Tree leaves in in-order. - def inorder(t): - if t: - for x in inorder(t.left): - yield x - - yield t.label - - for x in inorder(t.right): - yield x - -Two other examples in ``test_generators.py`` produce -solutions for the N-Queens problem (placing N queens on an NxN -chess board so that no queen threatens another) and the Knight's Tour -(finding a route that takes a knight to every square of an NxN chessboard -without visiting any square twice). - - - -Passing values into a generator -'''''''''''''''''''''''''''''''''''''''''''''' - -In Python 2.4 and earlier, generators only produced output. Once a -generator's code was invoked to create an iterator, there was no way to -pass any new information into the function when its execution is -resumed. You could hack together this ability by making the -generator look at a global variable or by passing in some mutable object -that callers then modify, but these approaches are messy. - -In Python 2.5 there's a simple way to pass values into a generator. -``yield`` became an expression, returning a value that can be assigned -to a variable or otherwise operated on:: - - val = (yield i) - -I recommend that you **always** put parentheses around a ``yield`` -expression when you're doing something with the returned value, as in -the above example. The parentheses aren't always necessary, but it's -easier to always add them instead of having to remember when they're -needed. - -(PEP 342 explains the exact rules, which are that a -``yield``-expression must always be parenthesized except when it -occurs at the top-level expression on the right-hand side of an -assignment. This means you can write ``val = yield i`` but have to -use parentheses when there's an operation, as in ``val = (yield i) -+ 12``.) - -Values are sent into a generator by calling its -``send(value)`` method. This method resumes the -generator's code and the ``yield`` expression returns the specified -value. If the regular ``next()`` method is called, the -``yield`` returns ``None``. - -Here's a simple counter that increments by 1 and allows changing the -value of the internal counter. - -:: - - def counter (maximum): - i = 0 - while i < maximum: - val = (yield i) - # If value provided, change counter - if val is not None: - i = val - else: - i += 1 - -And here's an example of changing the counter: - - >>> it = counter(10) - >>> print it.next() - 0 - >>> print it.next() - 1 - >>> print it.send(8) - 8 - >>> print it.next() - 9 - >>> print it.next() - Traceback (most recent call last): - File ``t.py'', line 15, in ? - print it.next() - StopIteration - -Because ``yield`` will often be returning ``None``, you -should always check for this case. Don't just use its value in -expressions unless you're sure that the ``send()`` method -will be the only method used resume your generator function. - -In addition to ``send()``, there are two other new methods on -generators: - -* ``throw(type, value=None, traceback=None)`` is used to raise an exception inside the - generator; the exception is raised by the ``yield`` expression - where the generator's execution is paused. - -* ``close()`` raises a ``GeneratorExit`` - exception inside the generator to terminate the iteration. - On receiving this - exception, the generator's code must either raise - ``GeneratorExit`` or ``StopIteration``; catching the - exception and doing anything else is illegal and will trigger - a ``RuntimeError``. ``close()`` will also be called by - Python's garbage collector when the generator is garbage-collected. - - If you need to run cleanup code when a ``GeneratorExit`` occurs, - I suggest using a ``try: ... finally:`` suite instead of - catching ``GeneratorExit``. - -The cumulative effect of these changes is to turn generators from -one-way producers of information into both producers and consumers. - -Generators also become **coroutines**, a more generalized form of -subroutines. Subroutines are entered at one point and exited at -another point (the top of the function, and a ``return`` -statement), but coroutines can be entered, exited, and resumed at -many different points (the ``yield`` statements). - - -Built-in functions ----------------------------------------------- - -Let's look in more detail at built-in functions often used with iterators. - -Two Python's built-in functions, ``map()`` and ``filter()``, are -somewhat obsolete; they duplicate the features of list comprehensions -and return actual lists instead of iterators. - -``map(f, iterA, iterB, ...)`` returns a list containing ``f(iterA[0], -iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``. - -:: - - def upper(s): - return s.upper() - map(upper, ['sentence', 'fragment']) => - ['SENTENCE', 'FRAGMENT'] - - [upper(s) for s in ['sentence', 'fragment']] => - ['SENTENCE', 'FRAGMENT'] - -As shown above, you can achieve the same effect with a list -comprehension. The ``itertools.imap()`` function does the same thing -but can handle infinite iterators; it'll be discussed in the section on -the ``itertools`` module. - -``filter(predicate, iter)`` returns a list -that contains all the sequence elements that meet a certain condition, -and is similarly duplicated by list comprehensions. -A **predicate** is a function that returns the truth value of -some condition; for use with ``filter()``, the predicate must take a -single value. - -:: - - def is_even(x): - return (x % 2) == 0 - - filter(is_even, range(10)) => - [0, 2, 4, 6, 8] - -This can also be written as a list comprehension:: - - >>> [x for x in range(10) if is_even(x)] - [0, 2, 4, 6, 8] - -``filter()`` also has a counterpart in the ``itertools`` module, -``itertools.ifilter()``, that returns an iterator and -can therefore handle infinite sequences just as ``itertools.imap()`` can. - -``reduce(func, iter, [initial_value])`` doesn't have a counterpart in -the ``itertools`` module because it cumulatively performs an operation -on all the iterable's elements and therefore can't be applied to -infinite ones. ``func`` must be a function that takes two elements -and returns a single value. ``reduce()`` takes the first two elements -A and B returned by the iterator and calculates ``func(A, B)``. It -then requests the third element, C, calculates ``func(func(A, B), -C)``, combines this result with the fourth element returned, and -continues until the iterable is exhausted. If the iterable returns no -values at all, a ``TypeError`` exception is raised. If the initial -value is supplied, it's used as a starting point and -``func(initial_value, A)`` is the first calculation. - -:: - - import operator - reduce(operator.concat, ['A', 'BB', 'C']) => - 'ABBC' - reduce(operator.concat, []) => - TypeError: reduce() of empty sequence with no initial value - reduce(operator.mul, [1,2,3], 1) => - 6 - reduce(operator.mul, [], 1) => - 1 - -If you use ``operator.add`` with ``reduce()``, you'll add up all the -elements of the iterable. This case is so common that there's a special -built-in called ``sum()`` to compute it:: - - reduce(operator.add, [1,2,3,4], 0) => - 10 - sum([1,2,3,4]) => - 10 - sum([]) => - 0 - -For many uses of ``reduce()``, though, it can be clearer to just write -the obvious ``for`` loop:: - - # Instead of: - product = reduce(operator.mul, [1,2,3], 1) - - # You can write: - product = 1 - for i in [1,2,3]: - product *= i - - -``enumerate(iter)`` counts off the elements in the iterable, returning -2-tuples containing the count and each element. - -:: - - enumerate(['subject', 'verb', 'object']) => - (0, 'subject'), (1, 'verb'), (2, 'object') - -``enumerate()`` is often used when looping through a list -and recording the indexes at which certain conditions are met:: - - f = open('data.txt', 'r') - for i, line in enumerate(f): - if line.strip() == '': - print 'Blank line at line #%i' % i - -``sorted(iterable, [cmp=None], [key=None], [reverse=False)`` -collects all the elements of the iterable into a list, sorts -the list, and returns the sorted result. The ``cmp``, ``key``, -and ``reverse`` arguments are passed through to the -constructed list's ``.sort()`` method. - -:: - - import random - # Generate 8 random numbers between [0, 10000) - rand_list = random.sample(range(10000), 8) - rand_list => - [769, 7953, 9828, 6431, 8442, 9878, 6213, 2207] - sorted(rand_list) => - [769, 2207, 6213, 6431, 7953, 8442, 9828, 9878] - sorted(rand_list, reverse=True) => - [9878, 9828, 8442, 7953, 6431, 6213, 2207, 769] - -(For a more detailed discussion of sorting, see the Sorting mini-HOWTO -in the Python wiki at http://wiki.python.org/moin/HowTo/Sorting.) - -The ``any(iter)`` and ``all(iter)`` built-ins look at -the truth values of an iterable's contents. ``any()`` returns -True if any element in the iterable is a true value, and ``all()`` -returns True if all of the elements are true values:: - - any([0,1,0]) => - True - any([0,0,0]) => - False - any([1,1,1]) => - True - all([0,1,0]) => - False - all([0,0,0]) => - False - all([1,1,1]) => - True - - -Small functions and the lambda statement ----------------------------------------------- - -When writing functional-style programs, you'll often need little -functions that act as predicates or that combine elements in some way. - -If there's a Python built-in or a module function that's suitable, you -don't need to define a new function at all:: - - stripped_lines = [line.strip() for line in lines] - existing_files = filter(os.path.exists, file_list) - -If the function you need doesn't exist, you need to write it. One way -to write small functions is to use the ``lambda`` statement. ``lambda`` -takes a number of parameters and an expression combining these parameters, -and creates a small function that returns the value of the expression: - - lowercase = lambda x: x.lower() - - print_assign = lambda name, value: name + '=' + str(value) - - adder = lambda x, y: x+y - -An alternative is to just use the ``def`` statement and define a -function in the usual way:: - - def lowercase(x): - return x.lower() - - def print_assign(name, value): - return name + '=' + str(value) - - def adder(x,y): - return x + y - -Which alternative is preferable? That's a style question; my usual -view is to avoid using ``lambda``. - -``lambda`` is quite limited in the functions it can define. The -result has to be computable as a single expression, which means you -can't have multiway ``if... elif... else`` comparisons or -``try... except`` statements. If you try to do too much in a -``lambda`` statement, you'll end up with an overly complicated -expression that's hard to read. Quick, what's the following code doing? - -:: - - total = reduce(lambda a, b: (0, a[1] + b[1]), items)[1] - -You can figure it out, but it takes time to disentangle the expression -to figure out what's going on. Using a short nested -``def`` statements makes things a little bit better:: - - def combine (a, b): - return 0, a[1] + b[1] - - total = reduce(combine, items)[1] - -But it would be best of all if I had simply used a ``for`` loop:: - - total = 0 - for a, b in items: - total += b - -Or the ``sum()`` built-in and a generator expression:: - - total = sum(b for a,b in items) - -Many uses of ``reduce()`` are clearer when written as ``for`` loops. - -Fredrik Lundh once suggested the following set of rules for refactoring -uses of ``lambda``: - -1) Write a lambda function. -2) Write a comment explaining what the heck that lambda does. -3) Study the comment for a while, and think of a name that captures - the essence of the comment. -4) Convert the lambda to a def statement, using that name. -5) Remove the comment. - -I really like these rules, but you're free to disagree that this style -is better. - - -The itertools module ------------------------ - -The ``itertools`` module contains a number of commonly-used iterators -as well as functions for combining several iterators. This section -will introduce the module's contents by showing small examples. - -``itertools.count(n)`` returns an infinite stream of -integers, increasing by 1 each time. You can optionally supply the -starting number, which defaults to 0:: - - itertools.count() => - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... - itertools.count(10) => - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ... - -``itertools.cycle(iter)`` saves a copy of the contents of a provided -iterable and returns a new iterator that returns its elements from -first to last. The new iterator will repeat these elements infinitely. - -:: - - itertools.cycle([1,2,3,4,5]) => - 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, ... - -``itertools.repeat(elem, [n])`` returns the provided element ``n`` -times, or returns the element endlessly if ``n`` is not provided. - -:: - - itertools.repeat('abc') => - abc, abc, abc, abc, abc, abc, abc, abc, abc, abc, ... - itertools.repeat('abc', 5) => - abc, abc, abc, abc, abc - -``itertools.chain(iterA, iterB, ...)`` takes an arbitrary number of -iterables as input, and returns all the elements of the first -iterator, then all the elements of the second, and so on, until all of -the iterables have been exhausted. - -:: - - itertools.chain(['a', 'b', 'c'], (1, 2, 3)) => - a, b, c, 1, 2, 3 - -``itertools.izip(iterA, iterB, ...)`` takes one element from each iterable -and returns them in a tuple:: - - itertools.izip(['a', 'b', 'c'], (1, 2, 3)) => - ('a', 1), ('b', 2), ('c', 3) - -This iterator is intended to be used with iterables that are all of -the same length. If the iterables are of different lengths, the -resulting stream will be the same length as the shortest iterable. - -:: - - itertools.izip(['a', 'b'], (1, 2, 3)) => - ('a', 1), ('b', 2) - -You should avoid doing this, though, because an element may be taken -from the longer iterators and discarded. This means you can't go on -to use the iterators further because you risk skipping a discarded -element. - -``itertools.islice(iter, [start], stop, [step])`` returns a stream -that's a slice of the iterator. It can return the first ``stop`` -elements. If you supply a starting index, you'll get ``stop-start`` -elements, and if you supply a value for ``step` elements will be -skipped accordingly. Unlike Python's string and list slicing, you -can't use negative values for ``start``, ``stop``, or ``step``. - -:: - - itertools.islice(range(10), 8) => - 0, 1, 2, 3, 4, 5, 6, 7 - itertools.islice(range(10), 2, 8) => - 2, 3, 4, 5, 6, 7 - itertools.islice(range(10), 2, 8, 2) => - 2, 4, 6 - -``itertools.tee(iter, [n])`` replicates an iterator; it returns ``n`` -independent iterators that will all return the contents of the source -iterator. If you don't supply a value for ``n``, the default is 2. -Replicating iterators requires saving some of the contents of the source -iterator, so this can consume significant memory if the iterator is large -and one of the new iterators is consumed more than the others. - -:: - - itertools.tee( itertools.count() ) => - iterA, iterB - - where iterA -> - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... - - and iterB -> - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ... - - -Two functions are used for calling other functions on the contents of an -iterable. - -``itertools.imap(f, iterA, iterB, ...)`` returns -a stream containing ``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), -f(iterA[2], iterB[2]), ...``:: - - itertools.imap(operator.add, [5, 6, 5], [1, 2, 3]) => - 6, 8, 8 - -The ``operator`` module contains a set of functions -corresponding to Python's operators. Some examples are -``operator.add(a, b)`` (adds two values), -``operator.ne(a, b)`` (same as ``a!=b``), -and -``operator.attrgetter('id')`` (returns a callable that -fetches the ``"id"`` attribute). - -``itertools.starmap(func, iter)`` assumes that the iterable will -return a stream of tuples, and calls ``f()`` using these tuples as the -arguments:: - - itertools.starmap(os.path.join, - [('/usr', 'bin', 'java'), ('/bin', 'python'), - ('/usr', 'bin', 'perl'),('/usr', 'bin', 'ruby')]) - => - /usr/bin/java, /bin/python, /usr/bin/perl, /usr/bin/ruby - -Another group of functions chooses a subset of an iterator's elements -based on a predicate. - -``itertools.ifilter(predicate, iter)`` returns all the elements for -which the predicate returns true:: - - def is_even(x): - return (x % 2) == 0 - - itertools.ifilter(is_even, itertools.count()) => - 0, 2, 4, 6, 8, 10, 12, 14, ... - -``itertools.ifilterfalse(predicate, iter)`` is the opposite, -returning all elements for which the predicate returns false:: - - itertools.ifilterfalse(is_even, itertools.count()) => - 1, 3, 5, 7, 9, 11, 13, 15, ... - -``itertools.takewhile(predicate, iter)`` returns elements for as long -as the predicate returns true. Once the predicate returns false, -the iterator will signal the end of its results. - -:: - - def less_than_10(x): - return (x < 10) - - itertools.takewhile(less_than_10, itertools.count()) => - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 - - itertools.takewhile(is_even, itertools.count()) => - 0 - -``itertools.dropwhile(predicate, iter)`` discards elements while the -predicate returns true, and then returns the rest of the iterable's -results. - -:: - - itertools.dropwhile(less_than_10, itertools.count()) => - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ... - - itertools.dropwhile(is_even, itertools.count()) => - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ... - - -The last function I'll discuss, ``itertools.groupby(iter, -key_func=None)``, is the most complicated. ``key_func(elem)`` is a -function that can compute a key value for each element returned by the -iterable. If you don't supply a key function, the key is simply each -element itself. - -``groupby()`` collects all the consecutive elements from the -underlying iterable that have the same key value, and returns a stream -of 2-tuples containing a key value and an iterator for the elements -with that key. - -:: - - city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'), - ('Anchorage', 'AK'), ('Nome', 'AK'), - ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'), - ... - ] - - def get_state ((city, state)): - return state - - itertools.groupby(city_list, get_state) => - ('AL', iterator-1), - ('AK', iterator-2), - ('AZ', iterator-3), ... - - where - iterator-1 => - ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL') - iterator-2 => - ('Anchorage', 'AK'), ('Nome', 'AK') - iterator-3 => - ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ') - -``groupby()`` assumes that the underlying iterable's contents will -already be sorted based on the key. Note that the returned iterators -also use the underlying iterable, so you have to consume the results -of iterator-1 before requesting iterator-2 and its corresponding key. - - -The functools module ----------------------------------------------- - -The ``functools`` module in Python 2.5 contains some higher-order -functions. A **higher-order function** takes functions as input and -returns new functions. The most useful tool in this module is the -``partial()`` function. - -For programs written in a functional style, you'll sometimes want to -construct variants of existing functions that have some of the -parameters filled in. Consider a Python function ``f(a, b, c)``; you -may wish to create a new function ``g(b, c)`` that was equivalent to -``f(1, b, c)``. This is called "partial function application". - -The constructor for ``partial`` takes the arguments ``(function, arg1, -arg2, ... kwarg1=value1, kwarg2=value2)``. The resulting object is -callable, so you can just call it to invoke ``function`` with the -filled-in arguments. - -Here's a small but realistic example:: - - import functools - - def log (message, subsystem): - "Write the contents of 'message' to the specified subsystem." - print '%s: %s' % (subsystem, message) - ... - - server_log = functools.partial(log, subsystem='server') - server_log('Unable to open socket') - -There are also third-party modules, such as Collin Winter's -`functional package `__, -that are intended for use in functional-style programs. - - -Revision History and Acknowledgements ------------------------------------------------- - -The author would like to thank the following people for offering -suggestions, corrections and assistance with various drafts of this -article: Ian Bicking, Nick Coghlan, Nick Efford, Raymond Hettinger, -Jim Jewett, Mike Krell, Leandro Lameiro, Jussi Salmela, -Collin Winter, Blake Winton. - -Version 0.1: posted June 30 2006. - -Version 0.11: posted July 1 2006. Typo fixes. - -Version 0.2: posted July 10 2006. Merged genexp and listcomp -sections into one. Typo fixes. - -Version 0.21: Added more references suggested on the tutor mailing list. - - -References --------------------- - -General -''''''''''''''' - -**Structure and Interpretation of Computer Programs**, by -Harold Abelson and Gerald Jay Sussman with Julie Sussman. -Full text at http://mitpress.mit.edu/sicp/. -In this classic textbook of computer science, chapters 2 and 3 discuss the -use of sequences and streams to organize the data flow inside a -program. The book uses Scheme for its examples, but many of the -design approaches described in these chapters are applicable to -functional-style Python code. - -http://www.defmacro.org/ramblings/fp.html: A general -introduction to functional programming that uses Java examples -and has a lengthy historical introduction. - -http://en.wikipedia.org/wiki/Functional_programming: -General Wikipedia entry describing functional programming. - -http://en.wikipedia.org/wiki/Coroutine: -Entry for coroutines. - - -Python-specific -''''''''''''''''''''''''''' - -http://gnosis.cx/TPiP/: -The first chapter of David Mertz's book :title-reference:`Text Processing in Python` -discusses functional programming for text processing, in the section titled -"Utilizing Higher-Order Functions in Text Processing". - -Mertz also wrote a 3-part series of articles on functional programming -for IBM's DeveloperWorks site; see -`part 1 `__, -`part 2 `__, and -`part 3 `__, - - -Python documentation -''''''''''''''''''''''''''' - -http://docs.python.org/lib/module-itertools.html: -Documentation ``for the itertools`` module. - -http://docs.python.org/lib/module-operator.html: -Documentation ``for the operator`` module. - -http://www.python.org/dev/peps/pep-0289/: -PEP 289: "Generator Expressions" - -http://www.python.org/dev/peps/pep-0342/ -PEP 342: "Coroutines via Enhanced Generators" describes the new generator -features in Python 2.5. - -.. comment - - Topics to place - ----------------------------- - - XXX os.walk() - - XXX Need a large example. - - But will an example add much? I'll post a first draft and see - what the comments say. - -.. comment - - Original outline: - Introduction - Idea of FP - Programs built out of functions - Functions are strictly input-output, no internal state - Opposed to OO programming, where objects have state - - Why FP? - Formal provability - Assignment is difficult to reason about - Not very relevant to Python - Modularity - Small functions that do one thing - Debuggability: - Easy to test due to lack of state - Easy to verify output from intermediate steps - Composability - You assemble a toolbox of functions that can be mixed - - Tackling a problem - Need a significant example - - Iterators - Generators - The itertools module - List comprehensions - Small functions and the lambda statement - Built-in functions - map - filter - reduce - -.. comment - - Handy little function for printing part of an iterator -- used - while writing this document. - - import itertools - def print_iter(it): - slice = itertools.islice(it, 10) - for elem in slice[:-1]: - sys.stdout.write(str(elem)) - sys.stdout.write(', ') - print elem[-1] - - From python-checkins at python.org Wed Aug 23 01:14:31 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 23 Aug 2006 01:14:31 +0200 (CEST) Subject: [Python-checkins] r51498 - sandbox/trunk/Doc/Makefile Message-ID: <20060822231431.509B01E4009@bag.python.org> Author: andrew.kuchling Date: Wed Aug 23 01:14:31 2006 New Revision: 51498 Modified: sandbox/trunk/Doc/Makefile Log: Change Makefile to build threading Modified: sandbox/trunk/Doc/Makefile ============================================================================== --- sandbox/trunk/Doc/Makefile (original) +++ sandbox/trunk/Doc/Makefile Wed Aug 23 01:14:31 2006 @@ -2,7 +2,7 @@ SOURCES = $(shell echo *.rst) RSTARGS = --input-encoding=utf-8 -all: functional.html +all: threading.html %.html: %.rst rst2html.py $(RSTARGS) $< >$@ From python-checkins at python.org Wed Aug 23 01:52:51 2006 From: python-checkins at python.org (jackilyn.hoxworth) Date: Wed, 23 Aug 2006 01:52:51 +0200 (CEST) Subject: [Python-checkins] r51499 - python/branches/hoxworth-stdlib_logging-soc/asyncore.py python/branches/hoxworth-stdlib_logging-soc/new_soc_logging_test.py python/branches/hoxworth-stdlib_logging-soc/pep_update.txt python/branches/hoxworth-stdlib_logging-soc/test_stdliblogging.py Message-ID: <20060822235251.8AC1B1E4009@bag.python.org> Author: jackilyn.hoxworth Date: Wed Aug 23 01:52:50 2006 New Revision: 51499 Added: python/branches/hoxworth-stdlib_logging-soc/pep_update.txt Modified: python/branches/hoxworth-stdlib_logging-soc/asyncore.py python/branches/hoxworth-stdlib_logging-soc/new_soc_logging_test.py python/branches/hoxworth-stdlib_logging-soc/test_stdliblogging.py Log: Modified: python/branches/hoxworth-stdlib_logging-soc/asyncore.py ============================================================================== --- python/branches/hoxworth-stdlib_logging-soc/asyncore.py (original) +++ python/branches/hoxworth-stdlib_logging-soc/asyncore.py Wed Aug 23 01:52:50 2006 @@ -1,568 +1,568 @@ -# -*- Mode: Python -*- -# Id: asyncore.py,v 2.51 2000/09/07 22:29:26 rushing Exp -# Author: Sam Rushing - -# ====================================================================== -# Copyright 1996 by Sam Rushing -# -# All Rights Reserved -# -# Permission to use, copy, modify, and distribute this software and -# its documentation for any purpose and without fee is hereby -# granted, provided that the above copyright notice appear in all -# copies and that both that copyright notice and this permission -# notice appear in supporting documentation, and that the name of Sam -# Rushing not be used in advertising or publicity pertaining to -# distribution of the software without specific, written prior -# permission. -# -# SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN -# NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR -# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# ====================================================================== - -"""Basic infrastructure for asynchronous socket service clients and servers. - -There are only two ways to have a program on a single processor do "more -than one thing at a time". Multi-threaded programming is the simplest and -most popular way to do it, but there is another very different technique, -that lets you have nearly all the advantages of multi-threading, without -actually using multiple threads. it's really only practical if your program -is largely I/O bound. If your program is CPU bound, then pre-emptive -scheduled threads are probably what you really need. Network servers are -rarely CPU-bound, however. - -If your operating system supports the select() system call in its I/O -library (and nearly all do), then you can use it to juggle multiple -communication channels at once; doing other work while your I/O is taking -place in the "background." Although this strategy can seem strange and -complex, especially at first, it is in many ways easier to understand and -control than multi-threaded programming. The module documented here solves -many of the difficult problems for you, making the task of building -sophisticated high-performance network servers and clients a snap. -""" - -import select -import socket -import sys -import time - -import os -from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \ - ENOTCONN, ESHUTDOWN, EINTR, EISCONN, errorcode - -try: - socket_map -except NameError: - socket_map = {} - -class ExitNow(Exception): - pass - -def read(obj): - try: - obj.handle_read_event() - except ExitNow: - raise - except: - obj.handle_error() - -def write(obj): - try: - obj.handle_write_event() - except ExitNow: - raise - except: - obj.handle_error() - -def _exception (obj): - try: - obj.handle_expt_event() - except ExitNow: - raise - except: - obj.handle_error() - -def readwrite(obj, flags): - try: - if flags & (select.POLLIN | select.POLLPRI): - obj.handle_read_event() - if flags & select.POLLOUT: - obj.handle_write_event() - if flags & (select.POLLERR | select.POLLHUP | select.POLLNVAL): - obj.handle_expt_event() - except ExitNow: - raise - except: - obj.handle_error() - -def poll(timeout=0.0, map=None): - if map is None: - map = socket_map - if map: - r = []; w = []; e = [] - for fd, obj in map.items(): - is_r = obj.readable() - is_w = obj.writable() - if is_r: - r.append(fd) - if is_w: - w.append(fd) - if is_r or is_w: - e.append(fd) - if [] == r == w == e: - time.sleep(timeout) - else: - try: - r, w, e = select.select(r, w, e, timeout) - except select.error, err: - if err[0] != EINTR: - raise - else: - return - - for fd in r: - obj = map.get(fd) - if obj is None: - continue - read(obj) - - for fd in w: - obj = map.get(fd) - if obj is None: - continue - write(obj) - - for fd in e: - obj = map.get(fd) - if obj is None: - continue - _exception(obj) - -def poll2(timeout=0.0, map=None): - # Use the poll() support added to the select module in Python 2.0 - if map is None: - map = socket_map - if timeout is not None: - # timeout is in milliseconds - timeout = int(timeout*1000) - pollster = select.poll() - if map: - for fd, obj in map.items(): - flags = 0 - if obj.readable(): - flags |= select.POLLIN | select.POLLPRI - if obj.writable(): - flags |= select.POLLOUT - if flags: - # Only check for exceptions if object was either readable - # or writable. - flags |= select.POLLERR | select.POLLHUP | select.POLLNVAL - pollster.register(fd, flags) - try: - r = pollster.poll(timeout) - except select.error, err: - if err[0] != EINTR: - raise - r = [] - for fd, flags in r: - obj = map.get(fd) - if obj is None: - continue - readwrite(obj, flags) - -poll3 = poll2 # Alias for backward compatibility - -def loop(timeout=30.0, use_poll=False, map=None, count=None): - if map is None: - map = socket_map - - if use_poll and hasattr(select, 'poll'): - poll_fun = poll2 - else: - poll_fun = poll - - if count is None: - while map: - poll_fun(timeout, map) - - else: - while map and count > 0: - poll_fun(timeout, map) - count = count - 1 - -class dispatcher: - - debug = False - connected = False - accepting = False - closing = False - addr = None - - def __init__(self, sock=None, map=None): - if map is None: - self._map = socket_map - else: - self._map = map - - if sock: - self.set_socket(sock, map) - # I think it should inherit this anyway - self.socket.setblocking(0) - self.connected = True - # XXX Does the constructor require that the socket passed - # be connected? - try: - self.addr = sock.getpeername() - except socket.error: - # The addr isn't crucial - pass - else: - self.socket = None - - def __repr__(self): - status = [self.__class__.__module__+"."+self.__class__.__name__] - if self.accepting and self.addr: - status.append('listening') - elif self.connected: - status.append('connected') - if self.addr is not None: - try: - status.append('%s:%d' % self.addr) - except TypeError: - status.append(repr(self.addr)) - return '<%s at %#x>' % (' '.join(status), id(self)) - - def add_channel(self, map=None): - #self.log_info('adding channel %s' % self) - if map is None: - map = self._map - map[self._fileno] = self - - def del_channel(self, map=None): - fd = self._fileno - if map is None: - map = self._map - if map.has_key(fd): - #self.log_info('closing channel %d:%s' % (fd, self)) - del map[fd] - self._fileno = None - - def create_socket(self, family, type): - self.family_and_type = family, type - self.socket = socket.socket(family, type) - self.socket.setblocking(0) - self._fileno = self.socket.fileno() - self.add_channel() - - def set_socket(self, sock, map=None): - self.socket = sock -## self.__dict__['socket'] = sock - self._fileno = sock.fileno() - self.add_channel(map) - - def set_reuse_addr(self): - # try to re-use a server port if possible - try: - self.socket.setsockopt( - socket.SOL_SOCKET, socket.SO_REUSEADDR, - self.socket.getsockopt(socket.SOL_SOCKET, - socket.SO_REUSEADDR) | 1 - ) - except socket.error: - pass - - # ================================================== - # predicates for select() - # these are used as filters for the lists of sockets - # to pass to select(). - # ================================================== - - def readable(self): - return True - - def writable(self): - return True - - # ================================================== - # socket object methods. - # ================================================== - - def listen(self, num): - self.accepting = True - if os.name == 'nt' and num > 5: - num = 1 - return self.socket.listen(num) - - def bind(self, addr): - self.addr = addr - return self.socket.bind(addr) - - def connect(self, address): - self.connected = False - err = self.socket.connect_ex(address) - # XXX Should interpret Winsock return values - if err in (EINPROGRESS, EALREADY, EWOULDBLOCK): - return - if err in (0, EISCONN): - self.addr = address - self.connected = True - self.handle_connect() - else: - raise socket.error, (err, errorcode[err]) - - def accept(self): - # XXX can return either an address pair or None - try: - conn, addr = self.socket.accept() - return conn, addr - except socket.error, why: - if why[0] == EWOULDBLOCK: - pass - else: - raise - - def send(self, data): - try: - result = self.socket.send(data) - return result - except socket.error, why: - if why[0] == EWOULDBLOCK: - return 0 - else: - raise - return 0 - - def recv(self, buffer_size): - try: - data = self.socket.recv(buffer_size) - if not data: - # a closed connection is indicated by signaling - # a read condition, and having recv() return 0. - self.handle_close() - return '' - else: - return data - except socket.error, why: - # winsock sometimes throws ENOTCONN - if why[0] in [ECONNRESET, ENOTCONN, ESHUTDOWN]: - self.handle_close() - return '' - else: - raise - - def close(self): - self.del_channel() - self.socket.close() - -# ================================================================================================= -# SoC start edit -# ================================================================================================= - - logger = None - - def _logger(self, level, msg, *args, **kwargs): - if self.logger is None: - import logging - self.logger = logging.getLogger("py.asyncore") - self.logger.log(level, msg, *args, **kwargs) - - hit_logger = None - - def log(self, message): - if self.hit_logger is None: - import logging - self.hit_logger = logging.getLogger("py.asyncore.dispatcher.hits").info - self.hit_logger(message) - - message_logger = None - - def log_info(self, message, type='info'): - if self.message_logger is None: - import logging - self.message_logger = logging.getLogger("py.asyncore.dispatcher.messages").info - self.message_logger(level, message) - -# ================================================================================================= -# SoC end edit -# ================================================================================================= - - - def handle_read_event(self): - if self.accepting: - # for an accepting socket, getting a read implies - # that we are connected - if not self.connected: - self.connected = True - self.handle_accept() - elif not self.connected: - self.handle_connect() - self.connected = True - self.handle_read() - else: - self.handle_read() - - def handle_write_event(self): - # getting a write implies that we are connected - if not self.connected: - self.handle_connect() - self.connected = True - self.handle_write() - - def handle_expt_event(self): - self.handle_expt() - - def handle_error(self): - nil, t, v, tbinfo = compact_traceback() - - # sometimes a user repr method will crash. - try: - self_repr = repr(self) - except: - self_repr = '<__repr__(self) failed for object at %0x>' % id(self) - - self.log_info( - 'uncaptured python exception, closing channel %s (%s:%s %s)' % ( - self_repr, - t, - v, - tbinfo - ), - 'error' - ) - self.close() - - def handle_expt(self): - self.log_info('unhandled exception', 'warning') - - def handle_read(self): - self.log_info('unhandled read event', 'warning') - - def handle_write(self): - self.log_info('unhandled write event', 'warning') - - def handle_connect(self): - self.log_info('unhandled connect event', 'warning') - - def handle_accept(self): - self.log_info('unhandled accept event', 'warning') - - def handle_close(self): - self.log_info('unhandled close event', 'warning') - self.close() - -# --------------------------------------------------------------------------- -# adds simple buffered output capability, useful for simple clients. -# [for more sophisticated usage use asynchat.async_chat] -# --------------------------------------------------------------------------- - -class dispatcher_with_send(dispatcher): - - def __init__(self, sock=None, map=None): - dispatcher.__init__(self, sock, map) - self.out_buffer = '' - - def initiate_send(self): - num_sent = 0 - num_sent = dispatcher.send(self, self.out_buffer[:512]) - self.out_buffer = self.out_buffer[num_sent:] - - def handle_write(self): - self.initiate_send() - - def writable(self): - return (not self.connected) or len(self.out_buffer) - - def send(self, data): - if self.debug: - self.log_info('sending %s' % repr(data)) - self.out_buffer = self.out_buffer + data - self.initiate_send() - -# --------------------------------------------------------------------------- -# used for debugging. -# --------------------------------------------------------------------------- - -def compact_traceback(): - t, v, tb = sys.exc_info() - tbinfo = [] - assert tb # Must have a traceback - while tb: - tbinfo.append(( - tb.tb_frame.f_code.co_filename, - tb.tb_frame.f_code.co_name, - str(tb.tb_lineno) - )) - tb = tb.tb_next - - # just to be safe - del tb - - file, function, line = tbinfo[-1] - info = ' '.join(['[%s|%s|%s]' % x for x in tbinfo]) - return (file, function, line), t, v, info - -def close_all(map=None): - if map is None: - map = socket_map - for x in map.values(): - x.socket.close() - map.clear() - -# Asynchronous File I/O: -# -# After a little research (reading man pages on various unixen, and -# digging through the linux kernel), I've determined that select() -# isn't meant for doing asynchronous file i/o. -# Heartening, though - reading linux/mm/filemap.c shows that linux -# supports asynchronous read-ahead. So _MOST_ of the time, the data -# will be sitting in memory for us already when we go to read it. -# -# What other OS's (besides NT) support async file i/o? [VMS?] -# -# Regardless, this is useful for pipes, and stdin/stdout... - -if os.name == 'posix': - import fcntl - - class file_wrapper: - # here we override just enough to make a file - # look like a socket for the purposes of asyncore. - - def __init__(self, fd): - self.fd = fd - - def recv(self, *args): - return os.read(self.fd, *args) - - def send(self, *args): - return os.write(self.fd, *args) - - read = recv - write = send - - def close(self): - os.close(self.fd) - - def fileno(self): - return self.fd - - class file_dispatcher(dispatcher): - - def __init__(self, fd, map=None): - dispatcher.__init__(self, None, map) - self.connected = True - self.set_file(fd) - # set it to non-blocking mode - flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0) - flags = flags | os.O_NONBLOCK - fcntl.fcntl(fd, fcntl.F_SETFL, flags) - - def set_file(self, fd): - self._fileno = fd - self.socket = file_wrapper(fd) - self.add_channel() +# -*- Mode: Python -*- +# Id: asyncore.py,v 2.51 2000/09/07 22:29:26 rushing Exp +# Author: Sam Rushing + +# ====================================================================== +# Copyright 1996 by Sam Rushing +# +# All Rights Reserved +# +# Permission to use, copy, modify, and distribute this software and +# its documentation for any purpose and without fee is hereby +# granted, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name of Sam +# Rushing not be used in advertising or publicity pertaining to +# distribution of the software without specific, written prior +# permission. +# +# SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN +# NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# ====================================================================== + +"""Basic infrastructure for asynchronous socket service clients and servers. + +There are only two ways to have a program on a single processor do "more +than one thing at a time". Multi-threaded programming is the simplest and +most popular way to do it, but there is another very different technique, +that lets you have nearly all the advantages of multi-threading, without +actually using multiple threads. it's really only practical if your program +is largely I/O bound. If your program is CPU bound, then pre-emptive +scheduled threads are probably what you really need. Network servers are +rarely CPU-bound, however. + +If your operating system supports the select() system call in its I/O +library (and nearly all do), then you can use it to juggle multiple +communication channels at once; doing other work while your I/O is taking +place in the "background." Although this strategy can seem strange and +complex, especially at first, it is in many ways easier to understand and +control than multi-threaded programming. The module documented here solves +many of the difficult problems for you, making the task of building +sophisticated high-performance network servers and clients a snap. +""" + +import select +import socket +import sys +import time + +import os +from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \ + ENOTCONN, ESHUTDOWN, EINTR, EISCONN, errorcode + +try: + socket_map +except NameError: + socket_map = {} + +class ExitNow(Exception): + pass + +def read(obj): + try: + obj.handle_read_event() + except ExitNow: + raise + except: + obj.handle_error() + +def write(obj): + try: + obj.handle_write_event() + except ExitNow: + raise + except: + obj.handle_error() + +def _exception (obj): + try: + obj.handle_expt_event() + except ExitNow: + raise + except: + obj.handle_error() + +def readwrite(obj, flags): + try: + if flags & (select.POLLIN | select.POLLPRI): + obj.handle_read_event() + if flags & select.POLLOUT: + obj.handle_write_event() + if flags & (select.POLLERR | select.POLLHUP | select.POLLNVAL): + obj.handle_expt_event() + except ExitNow: + raise + except: + obj.handle_error() + +def poll(timeout=0.0, map=None): + if map is None: + map = socket_map + if map: + r = []; w = []; e = [] + for fd, obj in map.items(): + is_r = obj.readable() + is_w = obj.writable() + if is_r: + r.append(fd) + if is_w: + w.append(fd) + if is_r or is_w: + e.append(fd) + if [] == r == w == e: + time.sleep(timeout) + else: + try: + r, w, e = select.select(r, w, e, timeout) + except select.error, err: + if err[0] != EINTR: + raise + else: + return + + for fd in r: + obj = map.get(fd) + if obj is None: + continue + read(obj) + + for fd in w: + obj = map.get(fd) + if obj is None: + continue + write(obj) + + for fd in e: + obj = map.get(fd) + if obj is None: + continue + _exception(obj) + +def poll2(timeout=0.0, map=None): + # Use the poll() support added to the select module in Python 2.0 + if map is None: + map = socket_map + if timeout is not None: + # timeout is in milliseconds + timeout = int(timeout*1000) + pollster = select.poll() + if map: + for fd, obj in map.items(): + flags = 0 + if obj.readable(): + flags |= select.POLLIN | select.POLLPRI + if obj.writable(): + flags |= select.POLLOUT + if flags: + # Only check for exceptions if object was either readable + # or writable. + flags |= select.POLLERR | select.POLLHUP | select.POLLNVAL + pollster.register(fd, flags) + try: + r = pollster.poll(timeout) + except select.error, err: + if err[0] != EINTR: + raise + r = [] + for fd, flags in r: + obj = map.get(fd) + if obj is None: + continue + readwrite(obj, flags) + +poll3 = poll2 # Alias for backward compatibility + +def loop(timeout=30.0, use_poll=False, map=None, count=None): + if map is None: + map = socket_map + + if use_poll and hasattr(select, 'poll'): + poll_fun = poll2 + else: + poll_fun = poll + + if count is None: + while map: + poll_fun(timeout, map) + + else: + while map and count > 0: + poll_fun(timeout, map) + count = count - 1 + +class dispatcher: + + debug = False + connected = False + accepting = False + closing = False + addr = None + + def __init__(self, sock=None, map=None): + if map is None: + self._map = socket_map + else: + self._map = map + + if sock: + self.set_socket(sock, map) + # I think it should inherit this anyway + self.socket.setblocking(0) + self.connected = True + # XXX Does the constructor require that the socket passed + # be connected? + try: + self.addr = sock.getpeername() + except socket.error: + # The addr isn't crucial + pass + else: + self.socket = None + + def __repr__(self): + status = [self.__class__.__module__+"."+self.__class__.__name__] + if self.accepting and self.addr: + status.append('listening') + elif self.connected: + status.append('connected') + if self.addr is not None: + try: + status.append('%s:%d' % self.addr) + except TypeError: + status.append(repr(self.addr)) + return '<%s at %#x>' % (' '.join(status), id(self)) + + def add_channel(self, map=None): + #self.log_info('adding channel %s' % self) + if map is None: + map = self._map + map[self._fileno] = self + + def del_channel(self, map=None): + fd = self._fileno + if map is None: + map = self._map + if map.has_key(fd): + #self.log_info('closing channel %d:%s' % (fd, self)) + del map[fd] + self._fileno = None + + def create_socket(self, family, type): + self.family_and_type = family, type + self.socket = socket.socket(family, type) + self.socket.setblocking(0) + self._fileno = self.socket.fileno() + self.add_channel() + + def set_socket(self, sock, map=None): + self.socket = sock +## self.__dict__['socket'] = sock + self._fileno = sock.fileno() + self.add_channel(map) + + def set_reuse_addr(self): + # try to re-use a server port if possible + try: + self.socket.setsockopt( + socket.SOL_SOCKET, socket.SO_REUSEADDR, + self.socket.getsockopt(socket.SOL_SOCKET, + socket.SO_REUSEADDR) | 1 + ) + except socket.error: + pass + + # ================================================== + # predicates for select() + # these are used as filters for the lists of sockets + # to pass to select(). + # ================================================== + + def readable(self): + return True + + def writable(self): + return True + + # ================================================== + # socket object methods. + # ================================================== + + def listen(self, num): + self.accepting = True + if os.name == 'nt' and num > 5: + num = 1 + return self.socket.listen(num) + + def bind(self, addr): + self.addr = addr + return self.socket.bind(addr) + + def connect(self, address): + self.connected = False + err = self.socket.connect_ex(address) + # XXX Should interpret Winsock return values + if err in (EINPROGRESS, EALREADY, EWOULDBLOCK): + return + if err in (0, EISCONN): + self.addr = address + self.connected = True + self.handle_connect() + else: + raise socket.error, (err, errorcode[err]) + + def accept(self): + # XXX can return either an address pair or None + try: + conn, addr = self.socket.accept() + return conn, addr + except socket.error, why: + if why[0] == EWOULDBLOCK: + pass + else: + raise + + def send(self, data): + try: + result = self.socket.send(data) + return result + except socket.error, why: + if why[0] == EWOULDBLOCK: + return 0 + else: + raise + return 0 + + def recv(self, buffer_size): + try: + data = self.socket.recv(buffer_size) + if not data: + # a closed connection is indicated by signaling + # a read condition, and having recv() return 0. + self.handle_close() + return '' + else: + return data + except socket.error, why: + # winsock sometimes throws ENOTCONN + if why[0] in [ECONNRESET, ENOTCONN, ESHUTDOWN]: + self.handle_close() + return '' + else: + raise + + def close(self): + self.del_channel() + self.socket.close() + +# ========================================================================== +# SoC start edit +# ========================================================================== + + logger = None + + def _logger(self, level, msg, *args, **kwargs): + if self.logger is None: + import logging + self.logger = logging.getLogger("py.asyncore") + self.logger.log(level, msg, *args, **kwargs) + + hit_logger = None + + def log(self, message): + if self.hit_logger is None: + import logging + self.hit_logger = logging.getLogger("py.asyncore.dispatcher.hits").info + self.hit_logger(message) + + message_logger = None + + def log_info(self, message, type='info'): + if self.message_logger is None: + import logging + self.message_logger = logging.getLogger("py.asyncore.dispatcher.messages").info + self.message_logger(level, message) + +# ========================================================================== +# SoC end edit +# ========================================================================== + + + def handle_read_event(self): + if self.accepting: + # for an accepting socket, getting a read implies + # that we are connected + if not self.connected: + self.connected = True + self.handle_accept() + elif not self.connected: + self.handle_connect() + self.connected = True + self.handle_read() + else: + self.handle_read() + + def handle_write_event(self): + # getting a write implies that we are connected + if not self.connected: + self.handle_connect() + self.connected = True + self.handle_write() + + def handle_expt_event(self): + self.handle_expt() + + def handle_error(self): + nil, t, v, tbinfo = compact_traceback() + + # sometimes a user repr method will crash. + try: + self_repr = repr(self) + except: + self_repr = '<__repr__(self) failed for object at %0x>' % id(self) + + self.log_info( + 'uncaptured python exception, closing channel %s (%s:%s %s)' % ( + self_repr, + t, + v, + tbinfo + ), + 'error' + ) + self.close() + + def handle_expt(self): + self.log_info('unhandled exception', 'warning') + + def handle_read(self): + self.log_info('unhandled read event', 'warning') + + def handle_write(self): + self.log_info('unhandled write event', 'warning') + + def handle_connect(self): + self.log_info('unhandled connect event', 'warning') + + def handle_accept(self): + self.log_info('unhandled accept event', 'warning') + + def handle_close(self): + self.log_info('unhandled close event', 'warning') + self.close() + +# -------------------------------------------------------------------------- +# adds simple buffered output capability, useful for simple clients. +# [for more sophisticated usage use asynchat.async_chat] +# -------------------------------------------------------------------------- + +class dispatcher_with_send(dispatcher): + + def __init__(self, sock=None, map=None): + dispatcher.__init__(self, sock, map) + self.out_buffer = '' + + def initiate_send(self): + num_sent = 0 + num_sent = dispatcher.send(self, self.out_buffer[:512]) + self.out_buffer = self.out_buffer[num_sent:] + + def handle_write(self): + self.initiate_send() + + def writable(self): + return (not self.connected) or len(self.out_buffer) + + def send(self, data): + if self.debug: + self.log_info('sending %s' % repr(data)) + self.out_buffer = self.out_buffer + data + self.initiate_send() + +# --------------------------------------------------------------------------- +# used for debugging. +# --------------------------------------------------------------------------- + +def compact_traceback(): + t, v, tb = sys.exc_info() + tbinfo = [] + assert tb # Must have a traceback + while tb: + tbinfo.append(( + tb.tb_frame.f_code.co_filename, + tb.tb_frame.f_code.co_name, + str(tb.tb_lineno) + )) + tb = tb.tb_next + + # just to be safe + del tb + + file, function, line = tbinfo[-1] + info = ' '.join(['[%s|%s|%s]' % x for x in tbinfo]) + return (file, function, line), t, v, info + +def close_all(map=None): + if map is None: + map = socket_map + for x in map.values(): + x.socket.close() + map.clear() + +# Asynchronous File I/O: +# +# After a little research (reading man pages on various unixen, and +# digging through the linux kernel), I've determined that select() +# isn't meant for doing asynchronous file i/o. +# Heartening, though - reading linux/mm/filemap.c shows that linux +# supports asynchronous read-ahead. So _MOST_ of the time, the data +# will be sitting in memory for us already when we go to read it. +# +# What other OS's (besides NT) support async file i/o? [VMS?] +# +# Regardless, this is useful for pipes, and stdin/stdout... + +if os.name == 'posix': + import fcntl + + class file_wrapper: + # here we override just enough to make a file + # look like a socket for the purposes of asyncore. + + def __init__(self, fd): + self.fd = fd + + def recv(self, *args): + return os.read(self.fd, *args) + + def send(self, *args): + return os.write(self.fd, *args) + + read = recv + write = send + + def close(self): + os.close(self.fd) + + def fileno(self): + return self.fd + + class file_dispatcher(dispatcher): + + def __init__(self, fd, map=None): + dispatcher.__init__(self, None, map) + self.connected = True + self.set_file(fd) + # set it to non-blocking mode + flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0) + flags = flags | os.O_NONBLOCK + fcntl.fcntl(fd, fcntl.F_SETFL, flags) + + def set_file(self, fd): + self._fileno = fd + self.socket = file_wrapper(fd) + self.add_channel() Modified: python/branches/hoxworth-stdlib_logging-soc/new_soc_logging_test.py ============================================================================== --- python/branches/hoxworth-stdlib_logging-soc/new_soc_logging_test.py (original) +++ python/branches/hoxworth-stdlib_logging-soc/new_soc_logging_test.py Wed Aug 23 01:52:50 2006 @@ -26,9 +26,10 @@ if myconn.debuglevel > 0: print "Debug level is > 0" -myconn.connect() +#myconn.connect() +httplib.HTTPConnection('MOCK') myconn.putrequest("GET", "/search?q=python") -myconn.getresponse() +#myconn.getresponse() print stringLog.getvalue() # For testing purposes Added: python/branches/hoxworth-stdlib_logging-soc/pep_update.txt ============================================================================== --- (empty file) +++ python/branches/hoxworth-stdlib_logging-soc/pep_update.txt Wed Aug 23 01:52:50 2006 @@ -0,0 +1,21 @@ +Modifications to the Original Proposal +- the import is delayed until it's need + +Module Checklist +BaseHTTPServer.py - done but no test case created +SocketServer.py - done but no test case created +asyncore.py - done +gopherlib.py - done but no test case created +httplib - done with a test case almost completed +ihooks.py - done but no test case created +imaplib.py - done but no test case created +mhlib.py - done but no test case created +nntplib.py - done but no test case created +pipes.py - done but no test case created +pkgutil.py - done but no test case created +robotparser.py - done but no test case created +shlex.py - done but no test case created +smtpd.py - done but no test case created +threading.py - done but no test case created +timeit.py - done but no test case created +trace.py - done but no test case created \ No newline at end of file Modified: python/branches/hoxworth-stdlib_logging-soc/test_stdliblogging.py ============================================================================== --- python/branches/hoxworth-stdlib_logging-soc/test_stdliblogging.py (original) +++ python/branches/hoxworth-stdlib_logging-soc/test_stdliblogging.py Wed Aug 23 01:52:50 2006 @@ -1,33 +1,33 @@ -# !/usr/bin/env python - -""" - -Test harness for the standard library logging module. - -""" - -import logging -import asyncore -from cStringIO import StringIO - -log=logging.getLogger("py.asyncore") -stringLog = StringIO() - -# define the handler and level -handler = logging.StreamHandler(stringLog) -log.setLevel(logging.INFO) - -# set a format for the output -formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') -handler.setFormatter(formatter) - -# add the handler to the logger -log.addHandler(handler) - -asyncore.dispatcher().log("message") -print stringLog.getvalue() # For testing purposes - -if stringLog.getvalue() != "Error: It worked": - print "it worked" -else: - print "it didn't work" +# !/usr/bin/env python + +""" + +Test harness for the standard library logging module. + +""" + +import logging +import asyncore +from cStringIO import StringIO + +log=logging.getLogger("py.asyncore") +stringLog = StringIO() + +# define the handler and level +handler = logging.StreamHandler(stringLog) +log.setLevel(logging.INFO) + +# set a format for the output +formatter = logging.Formatter('%(name)s: %(levelname)s %(message)s') +handler.setFormatter(formatter) + +# add the handler to the logger +log.addHandler(handler) + +asyncore.dispatcher().log("message") +print stringLog.getvalue() # For testing purposes + +if stringLog.getvalue() != "Error: It worked": + print "it worked" +else: + print "it didn't work" From python-checkins at python.org Wed Aug 23 02:08:34 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 23 Aug 2006 02:08:34 +0200 (CEST) Subject: [Python-checkins] r51500 - in python/branches/int_unification: Include/abstract.h Include/intobject.h Objects/abstract.c Objects/longobject.c Message-ID: <20060823000834.A05D91E4009@bag.python.org> Author: martin.v.loewis Date: Wed Aug 23 02:08:32 2006 New Revision: 51500 Modified: python/branches/int_unification/Include/abstract.h python/branches/int_unification/Include/intobject.h python/branches/int_unification/Objects/abstract.c python/branches/int_unification/Objects/longobject.c Log: Make PyNumber_Long invoke nb_int, drop PyNumber_Int. Also fix PyLong_FitsInLong. Modified: python/branches/int_unification/Include/abstract.h ============================================================================== --- python/branches/int_unification/Include/abstract.h (original) +++ python/branches/int_unification/Include/abstract.h Wed Aug 23 02:08:32 2006 @@ -715,7 +715,7 @@ is cleared and the value is clipped. */ - PyAPI_FUNC(PyObject *) PyNumber_Int(PyObject *o); + #define PyNumber_Int PyNumber_Long /* Returns the o converted to an integer object on success, or Modified: python/branches/int_unification/Include/intobject.h ============================================================================== --- python/branches/int_unification/Include/intobject.h (original) +++ python/branches/int_unification/Include/intobject.h Wed Aug 23 02:08:32 2006 @@ -40,7 +40,7 @@ #define PyInt_AsLong PyLong_AsLong #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask -#define PyInt_AsUnsignedLongLongMask PyInt_AsUnsignedLongM +#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask PyAPI_FUNC(long) PyInt_GetMax(void); Modified: python/branches/int_unification/Objects/abstract.c ============================================================================== --- python/branches/int_unification/Objects/abstract.c (original) +++ python/branches/int_unification/Objects/abstract.c Wed Aug 23 02:08:32 2006 @@ -790,25 +790,6 @@ return type_error("bad operand type for abs(): '%.200s'", o); } -/* Add a check for embedded NULL-bytes in the argument. */ -static PyObject * -int_from_string(const char *s, Py_ssize_t len) -{ - char *end; - PyObject *x; - - x = PyInt_FromString((char*)s, &end, 10); - if (x == NULL) - return NULL; - if (end != s + len) { - PyErr_SetString(PyExc_ValueError, - "null byte in argument for int()"); - Py_DECREF(x); - return NULL; - } - return x; -} - /* Return a Python Int or Long from the object item Raise TypeError if the result is not an int-or-long or if the object cannot be interpreted as an index. @@ -890,47 +871,6 @@ } -PyObject * -PyNumber_Int(PyObject *o) -{ - PyNumberMethods *m; - const char *buffer; - Py_ssize_t buffer_len; - - if (o == NULL) - return null_error(); - if (PyInt_CheckExact(o)) { - Py_INCREF(o); - return o; - } - m = o->ob_type->tp_as_number; - if (m && m->nb_int) { /* This should include subclasses of int */ - PyObject *res = m->nb_int(o); - if (res && (!PyInt_Check(res) && !PyLong_Check(res))) { - PyErr_Format(PyExc_TypeError, - "__int__ returned non-int (type %.200s)", - res->ob_type->tp_name); - Py_DECREF(res); - return NULL; - } - return res; - } - if (PyString_Check(o)) - return int_from_string(PyString_AS_STRING(o), - PyString_GET_SIZE(o)); -#ifdef Py_USING_UNICODE - if (PyUnicode_Check(o)) - return PyInt_FromUnicode(PyUnicode_AS_UNICODE(o), - PyUnicode_GET_SIZE(o), - 10); -#endif - if (!PyObject_AsCharBuffer(o, &buffer, &buffer_len)) - return int_from_string((char*)buffer, buffer_len); - - return type_error("int() argument must be a string or a " - "number, not '%.200s'", o); -} - /* Add a check for embedded NULL-bytes in the argument. */ static PyObject * long_from_string(const char *s, Py_ssize_t len) @@ -959,7 +899,22 @@ if (o == NULL) return null_error(); + if (PyLong_CheckExact(o)) { + Py_INCREF(o); + return o; + } m = o->ob_type->tp_as_number; + if (m && m->nb_int) { /* This should include subclasses of int */ + PyObject *res = m->nb_int(o); + if (res && !PyLong_Check(res)) { + PyErr_Format(PyExc_TypeError, + "__int__ returned non-int (type %.200s)", + res->ob_type->tp_name); + Py_DECREF(res); + return NULL; + } + return res; + } if (m && m->nb_long) { /* This should include subclasses of long */ PyObject *res = m->nb_long(o); if (res && (!PyInt_Check(res) && !PyLong_Check(res))) { Modified: python/branches/int_unification/Objects/longobject.c ============================================================================== --- python/branches/int_unification/Objects/longobject.c (original) +++ python/branches/int_unification/Objects/longobject.c Wed Aug 23 02:08:32 2006 @@ -241,12 +241,14 @@ int _PyLong_FitsInLong(PyObject *vv) { + int size; if (!PyLong_CheckExact(vv)) { PyErr_BadInternalCall(); return 0; } /* conservative estimate */ - return ((PyLongObject*)vv)->ob_size <= 2; + size = ((PyLongObject*)vv)->ob_size; + return -2 <= size && size <= 2; } /* Get a Py_ssize_t from a long int object. From fredrik at pythonware.com Wed Aug 23 09:41:01 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 23 Aug 2006 09:41:01 +0200 Subject: [Python-checkins] r51500 - in python/branches/int_unification: Include/abstract.h Include/intobject.h Objects/abstract.c Objects/longobject.c In-Reply-To: <20060823000834.A05D91E4009@bag.python.org> References: <20060823000834.A05D91E4009@bag.python.org> Message-ID: martin.v.loewis wrote: > Modified: > python/branches/int_unification/Include/abstract.h > python/branches/int_unification/Include/intobject.h > python/branches/int_unification/Objects/abstract.c > python/branches/int_unification/Objects/longobject.c > Log: > Make PyNumber_Long invoke nb_int, drop PyNumber_Int. > Also fix PyLong_FitsInLong. isn't this backwards? shouldn't the new unified type be called Int? or do you plan to fix the naming in a later step? From mal at egenix.com Wed Aug 23 13:32:43 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 23 Aug 2006 13:32:43 +0200 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.h Modules/_sre.c Objects/abstract.c Objects/boolobject.c Objects/exceptions.c Objects/intobject.c Objects/listobject.c Objects/longobject.c Python/bltinmodule.c Python/marshal.c Python/pythonrun.c In-Reply-To: <20060822214130.9EE7E1E4013@bag.python.org> References: <20060822214130.9EE7E1E4013@bag.python.org> Message-ID: <44EC3CDB.4030909@egenix.com> martin.v.loewis wrote: > Author: martin.v.loewis > Date: Tue Aug 22 23:41:27 2006 > New Revision: 51492 > > Modified: > python/branches/int_unification/Include/boolobject.h > python/branches/int_unification/Include/intobject.h > python/branches/int_unification/Include/longobject.h > python/branches/int_unification/Modules/_sre.c > python/branches/int_unification/Objects/abstract.c > python/branches/int_unification/Objects/boolobject.c > python/branches/int_unification/Objects/exceptions.c > python/branches/int_unification/Objects/intobject.c > python/branches/int_unification/Objects/listobject.c > python/branches/int_unification/Objects/longobject.c > python/branches/int_unification/Python/bltinmodule.c > python/branches/int_unification/Python/marshal.c > python/branches/int_unification/Python/pythonrun.c > Log: > Drop the int type. Wouldn't it be better to add the long implementation on top of the int implementation rather than replacing int with long ? Integers are by far the most used objects in Python and thus need to be as fast as possible. OTOH, longs are not used a lot in everyday Python programming. Furthermore, ints are fixed sized objects whereas longs are variable sized objects. As stated above, you rarely need the extended range that longs have to offer, but you still have to pay for it in every single int object you have in the Python process. >From a performance perspective I think it would be fair to put the burden on the long-type usage of integers and keep the int-type usage as optimized as it currently is. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 23 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From ncoghlan at gmail.com Wed Aug 23 13:51:07 2006 From: ncoghlan at gmail.com (Nick Coghlan) Date: Wed, 23 Aug 2006 21:51:07 +1000 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.h Modules/_sre.c Objects/abstract.c Objects/boolobject.c Objects/exceptions.c Objects/intobject.c Objects/listobject.c Objects/longobject.c Python/bltinmodule.c Python/marshal.c Python/pythonrun.c In-Reply-To: <44EC3CDB.4030909@egenix.com> References: <20060822214130.9EE7E1E4013@bag.python.org> <44EC3CDB.4030909@egenix.com> Message-ID: <44EC412B.2000809@gmail.com> M.-A. Lemburg wrote: >> Log: >> Drop the int type. > > Wouldn't it be better to add the long implementation on top > of the int implementation rather than replacing int with > long ? There's a reason MvL is doing this on a branch - the idea is to benchmark the status quo (which he's done), merge int & long into a single type (which is naturally the current PyLong, as it is a complete functional replacement for int, albeit slower), and then optimise the C level integers *inside the long type*. If the merged type can provide comparable performance to the two separate types, then it can become the 'int' type in Py3k, with 'long' being a historical relic existing only in the 2.x series. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org From jimjjewett at gmail.com Wed Aug 23 15:01:21 2006 From: jimjjewett at gmail.com (Jim Jewett) Date: Wed, 23 Aug 2006 09:01:21 -0400 Subject: [Python-checkins] r51494 - python/branches/p3yk-noslice/Objects/stringobject.c python/branches/p3yk-noslice/Objects/tupleobject.c python/branches/p3yk-noslice/Objects/unicodeobject.c In-Reply-To: <20060822223736.B50491E4009@bag.python.org> References: <20060822223736.B50491E4009@bag.python.org> Message-ID: (1) I would personally prefer if (step == 1) { if (start == 0 && ...) {} else {} } I realize that the compiler can do this, but I like flagging "this is an odd special case" (2) Why the CheckExact? Is there a promise (even in py3K) that constructors won't return a subclass? I had thought that the question was only when/if to *guarantee* that the subclass would be used. If the intent is to guard against subclasses with a different internal layout, then it should come before the GET_SIZE macros. -jJ On 8/22/06, thomas.wouters wrote: > Author: thomas.wouters > Date: Wed Aug 23 00:37:35 2006 > New Revision: 51494 > > Modified: > python/branches/p3yk-noslice/Objects/stringobject.c > python/branches/p3yk-noslice/Objects/tupleobject.c > python/branches/p3yk-noslice/Objects/unicodeobject.c > Log: > > Copy some of the special cases from normal slicing to extended slicing, for > general speedup. > > > > Modified: python/branches/p3yk-noslice/Objects/stringobject.c > ============================================================================== > --- python/branches/p3yk-noslice/Objects/stringobject.c (original) > +++ python/branches/p3yk-noslice/Objects/stringobject.c Wed Aug 23 00:37:35 2006 > @@ -1210,6 +1210,17 @@ > if (slicelength <= 0) { > return PyString_FromStringAndSize("", 0); > } > + else if (start == 0 && step == 1 && > + slicelength == PyString_GET_SIZE(self) && > + PyString_CheckExact(self)) { > + Py_INCREF(self); > + return (PyObject *)self; > + } > + else if (step == 1) { > + return PyString_FromStringAndSize( > + PyString_AS_STRING(self) + start, > + slicelength); > + } > else { > source_buf = PyString_AsString((PyObject*)self); > result_buf = (char *)PyMem_Malloc(slicelength); > > Modified: python/branches/p3yk-noslice/Objects/tupleobject.c > ============================================================================== > --- python/branches/p3yk-noslice/Objects/tupleobject.c (original) > +++ python/branches/p3yk-noslice/Objects/tupleobject.c Wed Aug 23 00:37:35 2006 > @@ -603,6 +603,12 @@ > if (slicelength <= 0) { > return PyTuple_New(0); > } > + else if (start == 0 && step == 1 && > + slicelength == PyTuple_GET_SIZE(self) && > + PyTuple_CheckExact(self)) { > + Py_INCREF(self); > + return (PyObject *)self; > + } > else { > result = PyTuple_New(slicelength); > if (!result) return NULL; > > Modified: python/branches/p3yk-noslice/Objects/unicodeobject.c > ============================================================================== > --- python/branches/p3yk-noslice/Objects/unicodeobject.c (original) > +++ python/branches/p3yk-noslice/Objects/unicodeobject.c Wed Aug 23 00:37:35 2006 > @@ -7083,6 +7083,12 @@ > > if (slicelength <= 0) { > return PyUnicode_FromUnicode(NULL, 0); > + } else if (start == 0 && step == 1 && slicelength == self->length && > + PyUnicode_CheckExact(self)) { > + Py_INCREF(self); > + return (PyObject *)self; > + } else if (step == 1) { > + return PyUnicode_FromUnicode(self->str + start, slicelength); > } else { > source_buf = PyUnicode_AS_UNICODE((PyObject*)self); > result_buf = (Py_UNICODE *)PyMem_MALLOC(slicelength* > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > From thomas at python.org Wed Aug 23 15:30:55 2006 From: thomas at python.org (Thomas Wouters) Date: Wed, 23 Aug 2006 15:30:55 +0200 Subject: [Python-checkins] r51494 - python/branches/p3yk-noslice/Objects/stringobject.c python/branches/p3yk-noslice/Objects/tupleobject.c python/branches/p3yk-noslice/Objects/unicodeobject.c In-Reply-To: References: <20060822223736.B50491E4009@bag.python.org> Message-ID: <9e804ac0608230630i3be3e5afw8e90b96979163e64@mail.gmail.com> On 8/23/06, Jim Jewett wrote: > > (1) I would personally prefer > > if (step == 1) { > if (start == 0 && ...) {} > else {} > } > > I realize that the compiler can do this, but I like flagging "this is > an odd special case" Well, they are two separate special cases. I personally prefer to keep them separate this way, and it reduces indentation level. (2) Why the CheckExact? Is there a promise (even in py3K) that > constructors won't return a subclass? I had thought that the question > was only when/if to *guarantee* that the subclass would be used. If > the intent is to guard against subclasses with a different internal > layout, then it should come before the GET_SIZE macros. As the checkin message says, those special cases are actually taken from normal slicing. It's safe for s[:] to return s only for exact instances of string (and unicode, and tuple) since it's completely equivalent. The same is not true for subclasses -- it might be, but it doesn't have to be. The issue isn't memory layout, it's mutability and type. Memory layout should be the same, anyway -- that's how C-type-subclasses work. There are explicit checks for this behaviour, by the way. -- Thomas Wouters Hi! I'm a .signature virus! copy me into your .signature file to help me spread! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20060823/d66f6dbf/attachment.htm From mal at egenix.com Wed Aug 23 15:57:11 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 23 Aug 2006 15:57:11 +0200 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.h Modules/_sre.c Objects/abstract.c Objects/boolobject.c Objects/exceptions.c Objects/intobject.c Objects/listobject.c Objects/longobject.c Python/bltinmodule.c Python/marshal.c Python/pythonrun.c In-Reply-To: <44EC412B.2000809@gmail.com> References: <20060822214130.9EE7E1E4013@bag.python.org> <44EC3CDB.4030909@egenix.com> <44EC412B.2000809@gmail.com> Message-ID: <44EC5EB7.4070506@egenix.com> Nick Coghlan wrote: > M.-A. Lemburg wrote: >>> Log: >>> Drop the int type. >> >> Wouldn't it be better to add the long implementation on top >> of the int implementation rather than replacing int with >> long ? > > There's a reason MvL is doing this on a branch - the idea is to > benchmark the status quo (which he's done), merge int & long into a > single type (which is naturally the current PyLong, as it is a complete > functional replacement for int, albeit slower), and then optimise the C > level integers *inside the long type*. > > If the merged type can provide comparable performance to the two > separate types, then it can become the 'int' type in Py3k, with 'long' > being a historical relic existing only in the 2.x series. I'm not questioning the merge itself, only its direction and that for a few reasons: * PyInts are very fast * They are the most used object type in Python * Lots and lots of extensions rely on them * PyLongs are, well, slow compared to PyInts (they are still fast compared to other arbitrary precision implementations) * PyLongs are only rarely used in Python, mostly in the cases where the PyInt range doesn't suffice and this use case is going to become even less important with 64bit platforms becoming a commodity * PyLongs are often not expected/support by extensions That said, I think it would be better to use the PyInt as basis and merge the PyLongs into them instead of the other way around, most important keep using a C long for storing the value and only revert to the bytes array (and the slower operations on it) in case needed. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 23 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From guido at python.org Wed Aug 23 16:03:47 2006 From: guido at python.org (Guido van Rossum) Date: Wed, 23 Aug 2006 07:03:47 -0700 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.h Modules/_sre.c Objects/abstract.c Objects/boolobject.c Objects/exceptions.c Objects/intobject.c Objects/listobject.c Obje Message-ID: On 8/23/06, M.-A. Lemburg wrote: > I'm not questioning the merge itself, only its direction and that for > a few reasons: > > * PyInts are very fast > * They are the most used object type in Python > * Lots and lots of extensions rely on them > > * PyLongs are, well, slow compared to PyInts (they are still fast > compared to other arbitrary precision implementations) > * PyLongs are only rarely used in Python, mostly in the cases > where the PyInt range doesn't suffice and this use case is > going to become even less important with 64bit platforms > becoming a commodity > * PyLongs are often not expected/support by extensions You are obviously not reading the python-3000 list. The plan is to keep all the PyInt_ APIs but make them work with the new internal representation instead (turning some of the macros into functions). So well-behaved extensions (that don't reach into the int guts or only do so using the macros) only need to be recompiled (which they need to be anyway for Py3k). Then the only issue is speed, which we can address by adding optimizations to the long implementation similar to the optimizations we currenty have in the int object. -- --Guido van Rossum (home page: http://www.python.org/~guido/) From martin at v.loewis.de Wed Aug 23 16:32:15 2006 From: martin at v.loewis.de (martin at v.loewis.de) Date: Wed, 23 Aug 2006 16:32:15 +0200 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.hInclude/longobject.hModules/_sre.c Objects/abstract.c Objects/boolobject.cObjects/exceptions.cObjects/intobject.c Objects/listobject.cObjects/longobject.c Python/bltinmodule.cPython/marshal.c Python/pythonrun.c In-Reply-To: <44EC5EB7.4070506@egenix.com> References: <20060822214130.9EE7E1E4013@bag.python.org> <44EC3CDB.4030909@egenix.com> <44EC412B.2000809@gmail.com> <44EC5EB7.4070506@egenix.com> Message-ID: <1156343535.44ec66ef893b1@www.domainfactory-webmail.de> Zitat von "M.-A. Lemburg" : > That said, I think it would be better to use the PyInt as > basis and merge the PyLongs into them instead of the > other way around, most important keep using a C long for > storing the value and only revert to the bytes array > (and the slower operations on it) in case needed. I don't think it would be better (or else I would be doing it). If you would like to see a different direction, please try to come up with a patch. Regards, Martin From mal at egenix.com Wed Aug 23 16:33:38 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 23 Aug 2006 16:33:38 +0200 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.h Modules/_sre.c Objects/abstract.c Objects/boolobject.c Objects/exceptions.c Objects/intobject.c Objects/listobject.c Obje In-Reply-To: References: Message-ID: <44EC6742.1090608@egenix.com> Guido van Rossum wrote: > On 8/23/06, M.-A. Lemburg wrote: >> I'm not questioning the merge itself, only its direction and that for >> a few reasons: >> >> * PyInts are very fast >> * They are the most used object type in Python >> * Lots and lots of extensions rely on them >> >> * PyLongs are, well, slow compared to PyInts (they are still fast >> compared to other arbitrary precision implementations) >> * PyLongs are only rarely used in Python, mostly in the cases >> where the PyInt range doesn't suffice and this use case is >> going to become even less important with 64bit platforms >> becoming a commodity >> * PyLongs are often not expected/support by extensions > > You are obviously not reading the python-3000 list. True, though I did read the short thread that started this branch in the archives. > The plan is to > keep all the PyInt_ APIs but make them work with the new internal > representation instead (turning some of the macros into functions). So > well-behaved extensions (that don't reach into the int guts or only do > so using the macros) only need to be recompiled (which they need to be > anyway for Py3k). Then the only issue is speed, which we can address > by adding optimizations to the long implementation similar to the > optimizations we currenty have in the int object. I know and there's no problem with that, except or the performance issues associated with the direction you've chosen. PyInts already have all the optimizations you have on your agenda for PyLongs, so I wonder why you're trying to duplicate all this work, instead of building upon it and adding the PyLong features to PyInts. Maybe I'm missing something, but this looks like a much more natural approach to me. The PyLong approach alone (using a digits array) will never be as fast as working with a C long directly. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 23 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From guido at python.org Wed Aug 23 16:35:30 2006 From: guido at python.org (Guido van Rossum) Date: Wed, 23 Aug 2006 07:35:30 -0700 Subject: [Python-checkins] r51500 - in python/branches/int_unification: Include/abstract.h Include/intobject.h Objects/abstract.c Objects/longobject.c In-Reply-To: References: <20060823000834.A05D91E4009@bag.python.org> Message-ID: On 8/23/06, Fredrik Lundh wrote: > > Log: > > Make PyNumber_Long invoke nb_int, drop PyNumber_Int. > > Also fix PyLong_FitsInLong. > > isn't this backwards? shouldn't the new unified type be called Int? or > do you plan to fix the naming in a later step? Yes, of course. Apparently you didn't read the thread on the python-3000 list about this. -- --Guido van Rossum (home page: http://www.python.org/~guido/) From guido at python.org Wed Aug 23 16:37:52 2006 From: guido at python.org (Guido van Rossum) Date: Wed, 23 Aug 2006 07:37:52 -0700 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.h Modules/_sre.c Objects/abstract.c Objects/boolobject.c Objects/exceptions.c Objects/intobject.c Objects/listobject.c Obje In-Reply-To: <44EC6742.1090608@egenix.com> References: <44EC6742.1090608@egenix.com> Message-ID: On 8/23/06, M.-A. Lemburg wrote: > PyInts already have all the optimizations you have on your agenda for > PyLongs, so I wonder why you're trying to duplicate all this > work, instead of building upon it and adding the PyLong features > to PyInts. Maybe I'm missing something, but this looks like a much > more natural approach to me. Since the PyLong implementation is nearly three times as large as the PyInt implementation, adding long functionality to ints would be the backwards thing to do. -- --Guido van Rossum (home page: http://www.python.org/~guido/) From mal at egenix.com Wed Aug 23 16:45:37 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 23 Aug 2006 16:45:37 +0200 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.hInclude/longobject.hModules/_sre.c Objects/abstract.c Objects/boolobject.cObjects/exceptions.cObjects/intobject.c Objects/listobject.cObjects/longobject.c Python/bltinmodule.cPython/marshal.c Python/pythonrun.c In-Reply-To: <1156343535.44ec66ef893b1@www.domainfactory-webmail.de> References: <20060822214130.9EE7E1E4013@bag.python.org> <44EC3CDB.4030909@egenix.com> <44EC412B.2000809@gmail.com> <44EC5EB7.4070506@egenix.com> <1156343535.44ec66ef893b1@www.domainfactory-webmail.de> Message-ID: <44EC6A11.4020509@egenix.com> martin at v.loewis.de wrote: > Zitat von "M.-A. Lemburg" : > >> That said, I think it would be better to use the PyInt as >> basis and merge the PyLongs into them instead of the >> other way around, most important keep using a C long for >> storing the value and only revert to the bytes array >> (and the slower operations on it) in case needed. > > I don't think it would be better (or else I would be doing > it). If you would like to see a different direction, please > try to come up with a patch. I wish I had the time to do more on these things. However, I don't, so all I can do is make suggestions. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 23 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Wed Aug 23 16:45:40 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 23 Aug 2006 16:45:40 +0200 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.h Modules/_sre.c Objects/abstract.c Objects/boolobject.c Objects/exceptions.c Objects/intobject.c Objects/listobject.c Obje In-Reply-To: References: <44EC6742.1090608@egenix.com> Message-ID: <44EC6A14.5080206@egenix.com> Guido van Rossum wrote: > On 8/23/06, M.-A. Lemburg wrote: >> PyInts already have all the optimizations you have on your agenda for >> PyLongs, so I wonder why you're trying to duplicate all this >> work, instead of building upon it and adding the PyLong features >> to PyInts. Maybe I'm missing something, but this looks like a much >> more natural approach to me. > > Since the PyLong implementation is nearly three times as large as the > PyInt implementation, adding long functionality to ints would be the > backwards thing to do. I was actually thinking of adding the PyLong implementation as special case to PyInts, ie. appending the digits array to the PyInt struct and making PyInts VarObjects. A size 0 PyInt would then be the classical PyInt, a size n (n>0) PyInt would work as a classical PyLong. One could even use a union to save a sizeof(long) bytes in the PyLong situation. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 23 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin at v.loewis.de Wed Aug 23 16:48:22 2006 From: martin at v.loewis.de (martin at v.loewis.de) Date: Wed, 23 Aug 2006 16:48:22 +0200 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.hModules/_sre.c Objects/abstract.c Objects/boolobject.cObjects/exceptions.c Objects/intobject.c Objects/listobject.c Obje In-Reply-To: <44EC6742.1090608@egenix.com> References: <44EC6742.1090608@egenix.com> Message-ID: <1156344502.44ec6ab6830b3@www.domainfactory-webmail.de> Zitat von "M.-A. Lemburg" : > PyInts already have all the optimizations you have on your agenda for > PyLongs, so I wonder why you're trying to duplicate all this > work, instead of building upon it and adding the PyLong features > to PyInts. Because it doesn't matter. The code would be the same in the end, either way: it has to support two cases if two different internal representations are chosen. If you worry about the efficiency of the arithmetic operations: these are TRIVIAL in intobject.c, except for the overflow handling. What specific optimizations do you think the int implementation has? > Maybe I'm missing something, but this looks like a much > more natural approach to me. After reading your messages, it seems that you are missing the fact that there aren't really any optimizations in the int type, except for the custom allocator (which predates obmalloc) and the singleton cache for small ints (which is trivial to move to longs). Regards, Martin From martin at v.loewis.de Wed Aug 23 16:52:26 2006 From: martin at v.loewis.de (martin at v.loewis.de) Date: Wed, 23 Aug 2006 16:52:26 +0200 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.hModules/_sre.c Objects/abstract.c Objects/boolobject.cObjects/exceptions.c Objects/intobject.c Objects/listobject.c Obje In-Reply-To: <44EC6A14.5080206@egenix.com> References: <44EC6742.1090608@egenix.com> <44EC6A14.5080206@egenix.com> Message-ID: <1156344746.44ec6baa14d68@www.domainfactory-webmail.de> Zitat von "M.-A. Lemburg" : > I was actually thinking of adding the PyLong implementation > as special case to PyInts, ie. appending the digits array > to the PyInt struct and making PyInts VarObjects. A size 0 > PyInt would then be the classical PyInt, a size n (n>0) > PyInt would work as a classical PyLong. That's my plan, except that the special case is the small integers, not the large ones. Before responding that you would like to see it the other way 'round, please analyze what the ACTUAL difference between your approach and mine would be. Regards, Martin From python-checkins at python.org Wed Aug 23 16:58:10 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 23 Aug 2006 16:58:10 +0200 (CEST) Subject: [Python-checkins] r51505 - python/branches/int_unification/Objects/longobject.c Message-ID: <20060823145810.3E2631E400F@bag.python.org> Author: martin.v.loewis Date: Wed Aug 23 16:58:09 2006 New Revision: 51505 Modified: python/branches/int_unification/Objects/longobject.c Log: Invoke nb_int in PyLong_AsLong. Copy the object (to the base class) in long_int/long_long. Modified: python/branches/int_unification/Objects/longobject.c ============================================================================== --- python/branches/int_unification/Objects/longobject.c (original) +++ python/branches/int_unification/Objects/longobject.c Wed Aug 23 16:58:09 2006 @@ -204,11 +204,32 @@ unsigned long x, prev; Py_ssize_t i; int sign; + int do_decref = 0; /* if nb_int was called */ - if (vv == NULL || !PyLong_Check(vv)) { + if (vv == NULL) { PyErr_BadInternalCall(); return -1; } + + if (!PyLong_Check(vv)) { + PyNumberMethods *nb; + if ((nb = vv->ob_type->tp_as_number) == NULL || + nb->nb_int == NULL) { + PyErr_SetString(PyExc_TypeError, "an integer is required"); + return -1; + } + vv = (*nb->nb_int) (vv); + if (vv == NULL) + return -1; + do_decref = 1; + if (!PyLong_Check(vv)) { + Py_DECREF(vv); + PyErr_SetString(PyExc_TypeError, + "nb_int should return int object"); + return -1; + } + } + v = (PyLongObject *)vv; i = v->ob_size; sign = 1; @@ -230,9 +251,15 @@ */ if ((long)x < 0 && (sign > 0 || (x << 1) != 0)) goto overflow; + if (do_decref) { + Py_DECREF(vv); + } return (long)x * sign; overflow: + if (do_decref) { + Py_DECREF(vv); + } PyErr_SetString(PyExc_OverflowError, "long int too large to convert to long"); return -1; @@ -3178,8 +3205,7 @@ static PyObject * long_int(PyObject *v) { - Py_INCREF(v); - return v; + return long_long(v); } static PyObject * From python-checkins at python.org Wed Aug 23 17:00:21 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 23 Aug 2006 17:00:21 +0200 (CEST) Subject: [Python-checkins] r51506 - in python/branches/int_unification: Lib/pickle.py Modules/cPickle.c Message-ID: <20060823150021.08E051E4009@bag.python.org> Author: martin.v.loewis Date: Wed Aug 23 17:00:19 2006 New Revision: 51506 Modified: python/branches/int_unification/Lib/pickle.py python/branches/int_unification/Modules/cPickle.c Log: Adjust pickle implementation to int/long unification. Use INT codes for small integers on binary protocols, and LONG codes otherwise. Modified: python/branches/int_unification/Lib/pickle.py ============================================================================== --- python/branches/int_unification/Lib/pickle.py (original) +++ python/branches/int_unification/Lib/pickle.py Wed Aug 23 17:00:19 2006 @@ -456,9 +456,29 @@ return # Text pickle, or int too big to fit in signed 4-byte format. self.write(INT + repr(obj) + '\n') - dispatch[IntType] = save_int + # XXX save_int is merged into save_long + # dispatch[IntType] = save_int def save_long(self, obj, pack=struct.pack): + if self.bin: + # If the int is small enough to fit in a signed 4-byte 2's-comp + # format, we can store it more efficiently than the general + # case. + # First one- and two-byte unsigned ints: + if obj >= 0: + if obj <= 0xff: + self.write(BININT1 + chr(obj)) + return + if obj <= 0xffff: + self.write("%c%c%c" % (BININT2, obj&0xff, obj>>8)) + return + # Next check for 4-byte signed ints: + high_bits = obj >> 31 # note that Python shift sign-extends + if high_bits == 0 or high_bits == -1: + # All high bits are copies of bit 2**31, so the value + # fits in a 4-byte signed int. + self.write(BININT + pack("= 2: bytes = encode_long(obj) n = len(bytes) Modified: python/branches/int_unification/Modules/cPickle.c ============================================================================== --- python/branches/int_unification/Modules/cPickle.c (original) +++ python/branches/int_unification/Modules/cPickle.c Wed Aug 23 17:00:19 2006 @@ -711,7 +711,9 @@ PyErr_SetString(PicklingError, "no int where int expected in memo"); return -1; } - c_value = PyInt_AS_LONG((PyIntObject*)value); + c_value = PyInt_AsLong(value); + if (c_value == -1 && PyErr_Occurred()) + return -1; if (!self->bin) { s[0] = GET; @@ -958,7 +960,7 @@ { static const char *buf[2] = {FALSE, TRUE}; static char len[2] = {sizeof(FALSE)-1, sizeof(TRUE)-1}; - long l = PyInt_AS_LONG((PyIntObject *)args); + long l = args == Py_True; if (self->proto >= 2) { char opcode = l ? NEWTRUE : NEWFALSE; @@ -971,10 +973,9 @@ } static int -save_int(Picklerobject *self, PyObject *args) +save_int(Picklerobject *self, long l) { char c_str[32]; - long l = PyInt_AS_LONG((PyIntObject *)args); int len = 0; if (!self->bin @@ -1027,9 +1028,16 @@ int size; int res = -1; PyObject *repr = NULL; - + int val = PyInt_AsLong(args); static char l = LONG; + if (val == -1 && PyErr_Occurred()) { + /* out of range for int pickling */ + PyErr_Clear(); + } + else + return save_int(self, val); + if (self->proto >= 2) { /* Linear-time pickling. */ size_t nbits; @@ -2179,13 +2187,6 @@ goto finally; } break; - case 'i': - if (type == &PyInt_Type) { - res = save_int(self, args); - goto finally; - } - break; - case 'l': if (type == &PyLong_Type) { res = save_long(self, args); @@ -2482,7 +2483,9 @@ rsize += PyString_GET_SIZE(k); else if (PyInt_Check(k)) { /* put */ - ik = PyInt_AS_LONG((PyIntObject*)k); + ik = PyInt_AsLong(k); + if (ik == -1 && PyErr_Occurred()) + goto err; if (ik >= lm || ik == 0) { PyErr_SetString(PicklingError, "Invalid get data"); @@ -2502,7 +2505,9 @@ } else { /* put */ - ik = PyInt_AS_LONG((PyIntObject *)k); + ik = PyInt_AsLong(k); + if (ik == -1 && PyErr_Occurred()) + goto err; if (ik >= lm || ik == 0) { PyErr_SetString(PicklingError, "Invalid get data"); @@ -2531,8 +2536,9 @@ } else if (PyTuple_Check(k)) { /* get */ - ik = PyInt_AS_LONG((PyIntObject *) - PyTuple_GET_ITEM(k, 0)); + ik = PyLong_AsLong(PyTuple_GET_ITEM(k, 0)); + if (ik == -1 && PyErr_Occurred()) + goto err; if (ik < 256) { *s++ = BINGET; *s++ = (int)(ik & 0xff); @@ -2547,7 +2553,9 @@ } else { /* put */ - ik = PyInt_AS_LONG((PyIntObject*)k); + ik = PyLong_AsLong(k); + if (ik == -1 && PyErr_Occurred()) + goto err; if (have_get[ik]) { /* with matching get */ if (ik < 256) { From python-checkins at python.org Wed Aug 23 17:04:24 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 23 Aug 2006 17:04:24 +0200 (CEST) Subject: [Python-checkins] r51507 - python/branches/int_unification/INTBENCH Message-ID: <20060823150424.A47701E4009@bag.python.org> Author: martin.v.loewis Date: Wed Aug 23 17:04:24 2006 New Revision: 51507 Modified: python/branches/int_unification/INTBENCH Log: Benchmark after dropping int. Modified: python/branches/int_unification/INTBENCH ============================================================================== --- python/branches/int_unification/INTBENCH (original) +++ python/branches/int_unification/INTBENCH Wed Aug 23 17:04:24 2006 @@ -7,3 +7,8 @@ Test 3: 1.900683s Test 4: 5.307155s +r51506 (int type dropped) +Test 1: 4.134757s +Test 2: 4.398235s +Test 3: 4.611636s +Test 4: 10.665429s From mal at egenix.com Wed Aug 23 17:05:20 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 23 Aug 2006 17:05:20 +0200 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.hModules/_sre.c Objects/abstract.c Objects/boolobject.cObjects/exceptions.c Objects/intobject.c Objects/listobject.c Obje In-Reply-To: <1156344502.44ec6ab6830b3@www.domainfactory-webmail.de> References: <44EC6742.1090608@egenix.com> <1156344502.44ec6ab6830b3@www.domainfactory-webmail.de> Message-ID: <44EC6EB0.50406@egenix.com> martin at v.loewis.de wrote: > Zitat von "M.-A. Lemburg" : > >> PyInts already have all the optimizations you have on your agenda for >> PyLongs, so I wonder why you're trying to duplicate all this >> work, instead of building upon it and adding the PyLong features >> to PyInts. > > Because it doesn't matter. The code would be the same in the end, > either way: it has to support two cases if two different internal > representations are chosen. > > If you worry about the efficiency of the arithmetic operations: > these are TRIVIAL in intobject.c, except for the overflow > handling. > > What specific optimizations do you think the int implementation > has? > >> Maybe I'm missing something, but this looks like a much >> more natural approach to me. > > After reading your messages, it seems that you are missing the > fact that there aren't really any optimizations in the int > type, except for the custom allocator (which predates obmalloc) > and the singleton cache for small ints (which is trivial to > move to longs). The optimizations are not in the int type itself, they are scattered throughout the interpreter. The key to these optimizations is that it's possible to access the C long directly via the access macro and thus allowing the compiler to generate more efficient code. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 23 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From python-checkins at python.org Wed Aug 23 17:05:38 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 23 Aug 2006 17:05:38 +0200 (CEST) Subject: [Python-checkins] r51508 - python/branches/int_unification/Lib/test/test_builtin.py Message-ID: <20060823150538.A60EC1E4022@bag.python.org> Author: martin.v.loewis Date: Wed Aug 23 17:05:38 2006 New Revision: 51508 Modified: python/branches/int_unification/Lib/test/test_builtin.py Log: Disable __long__ tests; it is questionable that they represent desirable behaviour even in 2.x. Modified: python/branches/int_unification/Lib/test/test_builtin.py ============================================================================== --- python/branches/int_unification/Lib/test/test_builtin.py (original) +++ python/branches/int_unification/Lib/test/test_builtin.py Wed Aug 23 17:05:38 2006 @@ -1068,10 +1068,12 @@ self.assertEqual(long(Foo0()), 42L) self.assertEqual(long(Foo1()), 42L) - self.assertEqual(long(Foo2()), 42L) + # XXX invokes __int__ now + # self.assertEqual(long(Foo2()), 42L) self.assertEqual(long(Foo3()), 0) - self.assertEqual(long(Foo4()), 42) - self.assertRaises(TypeError, long, Foo5()) + # XXX likewise + # self.assertEqual(long(Foo4()), 42) + # self.assertRaises(TypeError, long, Foo5()) def test_map(self): self.assertEqual( From guido at python.org Wed Aug 23 17:12:58 2006 From: guido at python.org (Guido van Rossum) Date: Wed, 23 Aug 2006 08:12:58 -0700 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.hInclude/longobject.hModules/_sre.c Objects/abstract.c Objects/boolobject.cObjects/exceptions.cObjects/intobject.c Objects/listobject.cObjects/l Message-ID: On 8/23/06, M.-A. Lemburg wrote: > I wish I had the time to do more on these things. However, I don't, > so all I can do is make suggestions. Either you have to stop making suggestions, or Martin has to stop responding to them, because you're just holding up the work that's being done. -- --Guido van Rossum (home page: http://www.python.org/~guido/) From mal at egenix.com Wed Aug 23 17:13:16 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 23 Aug 2006 17:13:16 +0200 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.h Include/longobject.hModules/_sre.c Objects/abstract.c Objects/boolobject.cObjects/exceptions.c Objects/intobject.c Objects/listobject.c Obje In-Reply-To: <1156344746.44ec6baa14d68@www.domainfactory-webmail.de> References: <44EC6742.1090608@egenix.com> <44EC6A14.5080206@egenix.com> <1156344746.44ec6baa14d68@www.domainfactory-webmail.de> Message-ID: <44EC708C.8030207@egenix.com> martin at v.loewis.de wrote: > Zitat von "M.-A. Lemburg" : > >> I was actually thinking of adding the PyLong implementation >> as special case to PyInts, ie. appending the digits array >> to the PyInt struct and making PyInts VarObjects. A size 0 >> PyInt would then be the classical PyInt, a size n (n>0) >> PyInt would work as a classical PyLong. > > That's my plan, Good. Looking at the checkin, it seemed to me that you were trying to use the long digit array as basis for everything. > except that the special case is the small > integers, not the large ones. No need to fight over that detail :-) > Before responding that you > would like to see it the other way 'round, please analyze > what the ACTUAL difference between your approach and mine > would be. None, except less work: you now move/rename everything to the PyLong implementation, only to then rename everything back to PyInt later on. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 23 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin at v.loewis.de Wed Aug 23 16:14:25 2006 From: martin at v.loewis.de (martin at v.loewis.de) Date: Wed, 23 Aug 2006 16:14:25 +0200 Subject: [Python-checkins] r51500 - in python/branches/int_unification: Include/abstract.h Include/intobject.h Objects/abstract.c Objects/longobject.c In-Reply-To: References: <20060823000834.A05D91E4009@bag.python.org> Message-ID: <1156342465.44ec62c1bc88b@www.domainfactory-webmail.de> Zitat von Fredrik Lundh : > > Modified: > > python/branches/int_unification/Include/abstract.h > > python/branches/int_unification/Include/intobject.h > > python/branches/int_unification/Objects/abstract.c > > python/branches/int_unification/Objects/longobject.c > > Log: > > Make PyNumber_Long invoke nb_int, drop PyNumber_Int. > > Also fix PyLong_FitsInLong. > > isn't this backwards? shouldn't the new unified type be called Int? or > do you plan to fix the naming in a later step? See the discussion on Py3k. Guido's proposal was to base everything on the long implementation, and adding int implementation gimmicks if necessary for performance (and also if necessary for conformance). Keep both APIs if possible for the time being, with the Int APIs being macros. Then, if the approach turns out to be viable, things get renamed. I'm not quite sure what the names should be; I think I'd like to see: - int.__name__ == 'integer' # instead of 'int'; perhaps the builtin should also be integer - all "Long" C API gets dropped - __long__ (nb_long) gets dropped - The Py*As* conversion routines get a different error reporting; instead of returning -1 and requiring PyErr_Occurred(), they should return 0/1, and yield their result on success in an output parameter. Maybe those routines should also get a different name, so extension modules can define their own compatibility layers easily. Regards, Martin From mal at egenix.com Wed Aug 23 18:08:18 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 23 Aug 2006 18:08:18 +0200 Subject: [Python-checkins] r51492 - in python/branches/int_unification: Include/boolobject.h Include/intobject.hInclude/longobject.hModules/_sre.c Objects/abstract.c Objects/boolobject.cObjects/exceptions.cObjects/intobject.c Objects/listobject.cObjects/l In-Reply-To: References: Message-ID: <44EC7D72.4070609@egenix.com> Guido van Rossum wrote: > On 8/23/06, M.-A. Lemburg wrote: >> I wish I had the time to do more on these things. However, I don't, >> so all I can do is make suggestions. > > Either you have to stop making suggestions, or Martin has to stop > responding to them, because you're just holding up the work that's > being done. That's a very helpful comment to encourage open discussions, indeed. Mind you, I was trying to: - understand what Martin was after - make suggestions for an easier to implement design - help in reducing the work-load If you don't value those things, please say so. I don't like these "under the cover" get-out-of-my-way comments and prefer straight talk. Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 23 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From python-checkins at python.org Wed Aug 23 18:24:46 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 23 Aug 2006 18:24:46 +0200 (CEST) Subject: [Python-checkins] r51509 - python/branches/int_unification/Objects/longobject.c Message-ID: <20060823162446.089D11E4009@bag.python.org> Author: martin.v.loewis Date: Wed Aug 23 18:24:45 2006 New Revision: 51509 Modified: python/branches/int_unification/Objects/longobject.c Log: Bring back cache for small objects. Modified: python/branches/int_unification/Objects/longobject.c ============================================================================== --- python/branches/int_unification/Objects/longobject.c (original) +++ python/branches/int_unification/Objects/longobject.c Wed Aug 23 18:24:45 2006 @@ -9,6 +9,44 @@ #include +#ifndef NSMALLPOSINTS +#define NSMALLPOSINTS 257 +#endif +#ifndef NSMALLNEGINTS +#define NSMALLNEGINTS 5 +#endif +#if NSMALLNEGINTS + NSMALLPOSINTS > 0 +/* Small integers are preallocated in this array so that they + can be shared. + The integers that are preallocated are those in the range + -NSMALLNEGINTS (inclusive) to NSMALLPOSINTS (not inclusive). +*/ +static PyLongObject small_ints[NSMALLNEGINTS + NSMALLPOSINTS]; +#ifdef COUNT_ALLOCS +int quick_int_allocs, quick_neg_int_allocs; +#endif + +static inline PyObject * +get_small_int(int ival) +{ + PyObject *v = small_ints + ival + NSMALLNEGINTS; + Py_INCREF(v); +#ifdef COUNT_ALLOCS + if (ival >= 0) + quick_int_allocs++; + else + quick_neg_int_allocs++; +#endif + return (PyObject *) v; +} +#define CHECK_SMALL_INT(ival) \ + do if (-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS) { \ + return get_small_int(ival); \ + } while(0) + +#else +#define CHECK_SMALL_INT(ival) +#endif /* For long multiplication, use the O(N**2) school algorithm unless * both operands contain more than KARATSUBA_CUTOFF digits (this * being an internal Python long digit, in base BASE). @@ -83,6 +121,12 @@ i = src->ob_size; if (i < 0) i = -(i); + if (i < 2) { + int ival = src->ob_digit[0]; + if (src->ob_size < 0) + ival = -ival; + CHECK_SMALL_INT(ival); + } result = _PyLong_New(i); if (result != NULL) { result->ob_size = src->ob_size; @@ -102,6 +146,7 @@ int ndigits = 0; int negative = 0; + CHECK_SMALL_INT(ival); if (ival < 0) { ival = -ival; negative = 1; @@ -138,6 +183,7 @@ unsigned long t; int ndigits = 0; + CHECK_SMALL_INT(ival); /* Count the number of Python digits. */ t = (unsigned long)ival; while (t) { @@ -174,6 +220,7 @@ neg = 1; dval = -dval; } + CHECK_SMALL_INT((int)dval); frac = frexp(dval, &expo); /* dval = frac*2**expo; 0.0 <= frac < 1.0 */ if (expo <= 0) return PyLong_FromLong(0L); @@ -801,6 +848,9 @@ #if SIZEOF_LONG_LONG < SIZEOF_VOID_P # error "PyLong_FromVoidPtr: sizeof(PY_LONG_LONG) < sizeof(void*)" #endif + /* special-case null pointer */ + if (!p) + return PyInt_FromLong(0); return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)p); } @@ -861,6 +911,7 @@ int ndigits = 0; int negative = 0; + CHECK_SMALL_INT(ival); if (ival < 0) { ival = -ival; negative = 1; @@ -897,6 +948,7 @@ unsigned PY_LONG_LONG t; int ndigits = 0; + CHECK_SMALL_INT(ival); /* Count the number of Python digits. */ t = (unsigned PY_LONG_LONG)ival; while (t) { @@ -922,6 +974,7 @@ { Py_ssize_t bytes = ival; int one = 1; + CHECK_SMALL_INT(ival); return _PyLong_FromByteArray( (unsigned char *)&bytes, SIZEOF_SIZE_T, IS_LITTLE_ENDIAN, 1); @@ -934,6 +987,7 @@ { size_t bytes = ival; int one = 1; + CHECK_SMALL_INT(ival); return _PyLong_FromByteArray( (unsigned char *)&bytes, SIZEOF_SIZE_T, IS_LITTLE_ENDIAN, 0); @@ -3402,29 +3456,30 @@ int _PyLong_Init(void) { - int ival; -#if 0 #if NSMALLNEGINTS + NSMALLPOSINTS > 0 - for (ival = -NSMALLNEGINTS; ival < NSMALLPOSINTS; ival++) { - if (!free_list && (free_list = fill_free_list()) == NULL) - return 0; - /* PyObject_New is inlined */ - v = free_list; - free_list = (PyIntObject *)v->ob_type; - PyObject_INIT(v, &PyInt_Type); - v->ob_ival = ival; - small_ints[ival + NSMALLNEGINTS] = v; + int ival; + PyLongObject *v = small_ints; + for (ival = -NSMALLNEGINTS; ival < 0; ival++, v++) { + PyObject_INIT(v, &PyLong_Type); + v->ob_size = -1; + v->ob_digit[0] = -ival; + } + for (; ival < NSMALLPOSINTS; ival++, v++) { + PyObject_INIT(v, &PyLong_Type); + v->ob_size = ival ? 1 : 0; + v->ob_digit[0] = ival; } #endif -#endif return 1; } void PyLong_Fini(void) { - int i; #if 0 + int i; + /* This is currently not needed; the small integers + are statically allocated */ #if NSMALLNEGINTS + NSMALLPOSINTS > 0 PyIntObject **q; From python-checkins at python.org Wed Aug 23 18:27:35 2006 From: python-checkins at python.org (jeremy.hylton) Date: Wed, 23 Aug 2006 18:27:35 +0200 (CEST) Subject: [Python-checkins] r51510 - sandbox/trunk/refactor/concrete.py Message-ID: <20060823162735.240081E4009@bag.python.org> Author: jeremy.hylton Date: Wed Aug 23 18:27:34 2006 New Revision: 51510 Added: sandbox/trunk/refactor/concrete.py Log: Add initial code for attachment tokens to AST. Works on a toy example. Added: sandbox/trunk/refactor/concrete.py ============================================================================== --- (empty file) +++ sandbox/trunk/refactor/concrete.py Wed Aug 23 18:27:34 2006 @@ -0,0 +1,215 @@ +"""Attach raw tokens to AST to generate a "concrete" AST.""" + +import _ast +import tokenize + +# Token eating rules for AST nodes + +# TODO(jhylton): The rules are too simplistic now. They need to express: +# -- repeated node types, e.g. multi-statement suites +# -- optional elements, e.g. the else in an if/else statement +# -- parentheses, but maybe there's a special case that says parenthesis +# can only be around expressions +# +# There is never any question about whether optional elements are present. +# If the AST node for an If statement has no orlese, there is no else token. +# So the token rules may need to associate tokens with fields. + +class TokenRules: + Module = [_ast.stmt, tokenize.ENDMARKER] + + If = [(tokenize.NAME, 'if'), _ast.expr, (tokenize.OP, ':'), + tokenize.NEWLINE, + tokenize.INDENT, + _ast.stmt, + tokenize.DEDENT, + (tokenize.NAME, 'else'), (tokenize.OP, ':'), tokenize.NEWLINE, + tokenize.INDENT, + _ast.stmt, + tokenize.DEDENT, + ] + Assign = [_ast.expr, (tokenize.OP, '='), _ast.expr, tokenize.NEWLINE] + + BinOp = [_ast.expr, _ast.operator, _ast.expr] + Compare = [_ast.expr, _ast.operator, _ast.expr] + Attribute = [_ast.expr, (tokenize.OP, '.'), tokenize.NAME] + + Name = [tokenize.NAME] + Num = [tokenize.NUMBER] + Add = [(tokenize.OP, '+')] + Eq = [(tokenize.OP, '==')] + +def TreeIter(tree): + yield tree + if tree._fields is None: + return + for fieldname in tree._fields: + child = getattr(tree, fieldname) + if isinstance(child, _ast.AST): + for node in TreeIter(child): + yield node + elif isinstance(child, list): + for node in child: + for n2 in TreeIter(node): + yield n2 + +def WalkConcrete(tree): + for elt in tree.concrete: + if isinstance(elt, _ast.AST): + for child in WalkConcrete(elt): + yield child + else: + yield elt + +class TreeTokenizer: + """Decorate AST nodes with the actual tokens that represent them. + + The TreeTokenizer is a state machine that can perform the + following operations: + + match: The current token matches the next token to consume for + the current ast node. + + walk: The current tree node does not have a rule to match + a terminal. Walk to the next node of the tree. + + """ + + DEBUG = 0 + + def __init__(self, tree, tokens): + self.root = tree + self.tokens = tokens + self.nodes = TreeIter(tree) + + # Initialize state of the matching engine + self.next_node() + self.backup_node = None + self.token = self.tokens.next() + self.stack = [] + + # We manage two parallel stacks in order to match parens + # to the expressions they surround. + self.parens = [] + self.exprs = [] + + def lookup_matches(self, node): + """Return the token matching rules for ast node.""" + name = node.__class__.__name__ + rules = TokenRules.__dict__[name] + return list(rules) # return a copy + + def __str__(self): + tok_type = tokenize.tok_name[self.token[0]] + token = self.token[1] + node = self.node.__class__.__name__ + nid = hex(id(node)) + matches = " ".join([str(m) for m in self.matches]) + stack = self.stack + return (" TreeTokenizer state\n" + "token=%(tok_type)s:%(token)r node=%(node)s:%(nid)s\n" + "matches=%(matches)s\n" + "stack=%(stack)s\n" + % locals()) + + def next_node(self): + self.node = self.nodes.next() + # There is no concrete syntax corresponding to an expression + # context, so skip it right here. + # TODO(jhylton): Think about whether this is right. + while isinstance(self.node, _ast.expr_context): + self.node = self.nodes.next() + self.matches = self.lookup_matches(self.node) + if not hasattr(self.node, "concrete"): + self.node.concrete = [] + + def consume_token(self): + self.node.concrete.append(self.token) + del self.matches[0] + try: + self.token = self.tokens.next() + return True + except StopIteration: + return False + + def consume_node(self): + self.node.concrete.append(self.backup_node) + del self.matches[0] + self.backup_node = None + + def is_node(self, next_match): + return (isinstance(next_match, type) and + issubclass(next_match, _ast.AST)) + + def backup(self): + if self.DEBUG: + print "BACKUP" + self.backup_node = self.node + self.node, self.matches = self.stack.pop() + + def traverse(self): + if self.DEBUG: + print "TRAVERSE" + self.stack.append((self.node, self.matches)) + self.next_node() + + def match1(self, next_match): + if self.DEBUG: + print "MATCH 1" + assert next_match == self.token[0], (next_match, self.token) + return self.consume_token() + + def match2(self, next_match): + if self.DEBUG: + print "MATCH 2" + token_type, token_value = next_match + assert token_type == self.token[0] + assert token_value == self.token[1] + return self.consume_token() + + def step(self): + if self.DEBUG: + print self + + if not self.matches: + self.backup() + return True + + # Check whether the next match is for a token or a node. + next_match = self.matches[0] + if self.is_node(next_match): + if self.backup_node is not None: + self.consume_node() + return True + else: + self.traverse() + return True + + if isinstance(next_match, tuple): + return self.match2(next_match) + + if isinstance(next_match, int): + return self.match1(next_match) + + # TODO(jhylton): Figure out if you can ever get here. + + return False + + def run(self): + while 1: + if not self.step(): + break + + +if __name__ == "__main__": + import sys + import StringIO + + path = sys.argv[1] + source = open(path).read() + tokens = tokenize.generate_tokens(open(path).readline) + tree = compile(source, path, "exec", 0x400) + tt = TreeTokenizer(tree, tokens) + tt.run() + code = tokenize.untokenize(WalkConcrete(tree)) + print code From python-checkins at python.org Wed Aug 23 18:28:15 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 23 Aug 2006 18:28:15 +0200 (CEST) Subject: [Python-checkins] r51511 - python/branches/int_unification/INTBENCH Message-ID: <20060823162815.A4FB41E4009@bag.python.org> Author: martin.v.loewis Date: Wed Aug 23 18:28:15 2006 New Revision: 51511 Modified: python/branches/int_unification/INTBENCH Log: Benchmark the small int cache. Modified: python/branches/int_unification/INTBENCH ============================================================================== --- python/branches/int_unification/INTBENCH (original) +++ python/branches/int_unification/INTBENCH Wed Aug 23 18:28:15 2006 @@ -12,3 +12,9 @@ Test 2: 4.398235s Test 3: 4.611636s Test 4: 10.665429s + +r51509 (small int cache) +Test 1: 3.457184s +Test 2: 4.514800s +Test 3: 4.999010s +Test 4: 10.818277s \ No newline at end of file From python-checkins at python.org Wed Aug 23 20:18:12 2006 From: python-checkins at python.org (andrew.kuchling) Date: Wed, 23 Aug 2006 20:18:12 +0200 (CEST) Subject: [Python-checkins] r51514 - sandbox/trunk/Doc/2.5-pr.txt Message-ID: <20060823181812.3DBDA1E4005@bag.python.org> Author: andrew.kuchling Date: Wed Aug 23 20:18:11 2006 New Revision: 51514 Added: sandbox/trunk/Doc/2.5-pr.txt Log: Add skeleton for press release Added: sandbox/trunk/Doc/2.5-pr.txt ============================================================================== --- (empty file) +++ sandbox/trunk/Doc/2.5-pr.txt Wed Aug 23 20:18:11 2006 @@ -0,0 +1,87 @@ +September 12, 2006 +Press Release +SOURCE: Python Software Foundation + +PYTHON SOFTWARE FOUNDATION (PSF) ANNOUNCES PYTHON VERSION 2.5 +New release enhances powerful programming language + +**XXX, September 12, 2006** -- The Python Software Foundation (PSF) +announces the release of version 2.5 of the Python programming +language. XXX write summary sentence + +XXX describe improvements. Get quote from Guido. + +XXX add quotes from users + +Other companies using Python include Google, +NASA, The New York Stock Exchange, RealNetworks, Philips, Hewlett +Packard, Rackspace, RedHat, NASA, Disney, and AstraZeneca. + +For more information about Python 2.5 or to download it, please visit +. + +About Python +------------ + +Python is a powerful object oriented programming language that is +developed and maintained by a global community of contributors under +the oversight of the Python Software Foundation. Python's unique +blend of simplicity and power excels in a wide range of software +development tasks, including the construction of web applications, +complex integrated business solutions, and large desktop +applications. + +Python is often characterized as an agile language that promotes +speedy development and includes a unit-testing framework for building +more robust applications. The language is the basis of +mission-critical applications used by tens of thousands of companies +and organizations worldwide, and its user base is growing +rapidly. Python is increasingly used in large system development to +decrease software costs, mitigate risk, and meet aggressive schedules. + +Key features of Python include: + + * Object orientation, modular name spaces, exceptions, and multi-threading. + + * High-level dynamic data typing and very late binding. + + * Can be extended by modules in C/C++ + + * String and regular expression processing. + + * Extensive XML and web services support. + + * HTTP, FTP, SMTP, POP, IMAP, NNTP, Telnet, and other Internet protocols. + + * HTML, MIME, base64, binhex, uuencode, and other Internet data handling. + + * Unit testing, profiling, and documentation generation. + + * Available third party modules for database access, mathematics, 3D modeling, + image processing, LDAP, WebDAV, Jabber, MIDI, and much more. + +Python runs on Microsoft Windows, Mac OS X, Linux, Unix, and many +other operating systems. Full source code is available for the +language and associated standard libraries under an open-source license. + +Additional information and downloads are available at www.python.org. + +About the PSF +------------- + +The Python Software Foundation (PSF) is a non-profit organization +devoted to advancing Open Source technology related to the Python +programming language. The PSF holds the intellectual property rights +to Python and plans to fund portions of future development of the +language. Additional information on the PSF is available at +www.python.org/psf. + +To make a tax-deductible donation, please visit +www.python.org/psf/donations/. Corporate sponsorships are also being +accepted. + + +Legal +----- + +XXX trademark declarations for Windows, others \ No newline at end of file From python-checkins at python.org Wed Aug 23 20:37:43 2006 From: python-checkins at python.org (jeremy.hylton) Date: Wed, 23 Aug 2006 20:37:43 +0200 (CEST) Subject: [Python-checkins] r51515 - python/trunk/Lib/test/test_tokenize.py Message-ID: <20060823183743.C80291E4005@bag.python.org> Author: jeremy.hylton Date: Wed Aug 23 20:37:43 2006 New Revision: 51515 Modified: python/trunk/Lib/test/test_tokenize.py Log: Baby steps towards better tests for tokenize Modified: python/trunk/Lib/test/test_tokenize.py ============================================================================== --- python/trunk/Lib/test/test_tokenize.py (original) +++ python/trunk/Lib/test/test_tokenize.py Wed Aug 23 20:37:43 2006 @@ -1,9 +1,36 @@ +"""Tests for the tokenize module. + +The tests were originally written in the old Python style, where the +test output was compared to a golden file. This docstring represents +the first steps towards rewriting the entire test as a doctest. + +The tests can be really simple. Given a small fragment of source +code, print out a table with the tokens. The ENDMARK is omitted for +brevity. + +>>> dump_tokens("1 + 1") +NUMBER '1' (1, 0) (1, 1) +OP '+' (1, 2) (1, 3) +NUMBER '1' (1, 4) (1, 5) + +There will be a bunch more tests of specific source patterns. + +The tokenize module also defines an untokenize function that should +regenerate the original program text from the tokens. (It doesn't +work very well at the moment.) + +>>> roundtrip("if x == 1:\\n" +... " print x\\n") +if x ==1 : + print x +""" + import os, glob, random from cStringIO import StringIO from test.test_support import (verbose, findfile, is_resource_enabled, TestFailed) -from tokenize import (tokenize, generate_tokens, untokenize, - NUMBER, NAME, OP, STRING) +from tokenize import (tokenize, generate_tokens, untokenize, tok_name, + ENDMARKER, NUMBER, NAME, OP, STRING) # Test roundtrip for `untokenize`. `f` is a file path. The source code in f # is tokenized, converted back to source code via tokenize.untokenize(), @@ -24,6 +51,22 @@ if t1 != t2: raise TestFailed("untokenize() roundtrip failed for %r" % f) +def dump_tokens(s): + """Print out the tokens in s in a table format. + + The ENDMARKER is omitted. + """ + f = StringIO(s) + for type, token, start, end, line in generate_tokens(f.readline): + if type == ENDMARKER: + break + type = tok_name[type] + print "%(type)-10.10s %(token)-10.10r %(start)s %(end)s" % locals() + +def roundtrip(s): + f = StringIO(s) + print untokenize(generate_tokens(f.readline)), + # This is an example from the docs, set up as a doctest. def decistmt(s): """Substitute Decimals for floats in a string of statements. @@ -105,7 +148,7 @@ # Run the doctests in this module. from test import test_tokenize # i.e., this module from test.test_support import run_doctest - run_doctest(test_tokenize) + run_doctest(test_tokenize, verbose) if verbose: print 'finished' From buildbot at python.org Wed Aug 23 21:20:15 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 23 Aug 2006 19:20:15 +0000 Subject: [Python-checkins] buildbot warnings in S-390 Debian trunk Message-ID: <20060823192015.3DE4F1E401C@bag.python.org> The Buildbot has detected a new failure of S-390 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%2520Debian%2520trunk/builds/343 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,jeremy.hylton Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 23 21:41:31 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 23 Aug 2006 21:41:31 +0200 (CEST) Subject: [Python-checkins] r51522 - in python/branches/int_unification: INTBENCH Modules/_testcapimodule.c Objects/longobject.c Message-ID: <20060823194131.F0A571E400D@bag.python.org> Author: martin.v.loewis Date: Wed Aug 23 21:41:30 2006 New Revision: 51522 Modified: python/branches/int_unification/INTBENCH python/branches/int_unification/Modules/_testcapimodule.c python/branches/int_unification/Objects/longobject.c Log: Special-case one-digit longs on allocation. Add benchmark for integer addition. Modified: python/branches/int_unification/INTBENCH ============================================================================== --- python/branches/int_unification/INTBENCH (original) +++ python/branches/int_unification/INTBENCH Wed Aug 23 21:41:30 2006 @@ -6,6 +6,8 @@ Test 2: 1.696623s Test 3: 1.900683s Test 4: 5.307155s +Test 6: 1.670252s +Test 7: 1.910734s r51506 (int type dropped) Test 1: 4.134757s Modified: python/branches/int_unification/Modules/_testcapimodule.c ============================================================================== --- python/branches/int_unification/Modules/_testcapimodule.c (original) +++ python/branches/int_unification/Modules/_testcapimodule.c Wed Aug 23 21:41:30 2006 @@ -731,7 +731,7 @@ { int i, k; struct timeval start, stop; - PyObject *single, **multiple; + PyObject *single, **multiple, *op1, *result; /* Test 1: Allocate and immediately deallocate many small integers */ @@ -785,6 +785,42 @@ gettimeofday(&stop, NULL); print_delta(4, &start, &stop); + /* Test 5: Allocate many integers < 32000 */ + multiple = malloc(sizeof(PyObject*) * 1000000); + gettimeofday(&start, NULL); + for(k=0; k < 20; k++) { + for(i=0; i < 1000000; i++) { + multiple[i] = PyInt_FromLong(i+1000); + } + for(i=0; i < 1000000; i++) { + Py_DECREF(multiple[i]); + } + } + gettimeofday(&stop, NULL); + print_delta(5, &start, &stop); + + /* Test 6: Perform small int addition */ + op1 = PyInt_FromLong(1); + gettimeofday(&start, NULL); + for(i=0; i < 10000000; i++) { + result = PyNumber_Add(op1, op1); + Py_DECREF(result); + } + gettimeofday(&stop, NULL); + Py_DECREF(op1); + print_delta(6, &start, &stop); + + /* Test 7: Perform medium int addition */ + op1 = PyInt_FromLong(1000); + gettimeofday(&start, NULL); + for(i=0; i < 10000000; i++) { + result = PyNumber_Add(op1, op1); + Py_DECREF(result); + } + gettimeofday(&stop, NULL); + Py_DECREF(op1); + print_delta(7, &start, &stop); + Py_INCREF(Py_None); return Py_None; } Modified: python/branches/int_unification/Objects/longobject.c ============================================================================== --- python/branches/int_unification/Objects/longobject.c (original) +++ python/branches/int_unification/Objects/longobject.c Wed Aug 23 21:41:30 2006 @@ -29,7 +29,7 @@ static inline PyObject * get_small_int(int ival) { - PyObject *v = small_ints + ival + NSMALLNEGINTS; + PyObject *v = (PyObject*)(small_ints + ival + NSMALLNEGINTS); Py_INCREF(v); #ifdef COUNT_ALLOCS if (ival >= 0) @@ -37,7 +37,7 @@ else quick_neg_int_allocs++; #endif - return (PyObject *) v; + return v; } #define CHECK_SMALL_INT(ival) \ do if (-NSMALLNEGINTS <= ival && ival < NSMALLPOSINTS) { \ @@ -47,6 +47,7 @@ #else #define CHECK_SMALL_INT(ival) #endif + /* For long multiplication, use the O(N**2) school algorithm unless * both operands contain more than KARATSUBA_CUTOFF digits (this * being an internal Python long digit, in base BASE). @@ -152,6 +153,16 @@ negative = 1; } + if (ival < BASE) { + /* Fast path for single-digits ints */ + v = PyObject_NEW_VAR(PyLongObject, &PyLong_Type, 1); + if (v) { + v->ob_size = negative ? -1 : 1; + v->ob_digit[0] = ival; + } + return (PyObject*)v; + } + /* Count the number of Python digits. We used to pick 5 ("big enough for anything"), but that's a waste of time and space given that 5*15 = 75 bits are rarely @@ -183,7 +194,8 @@ unsigned long t; int ndigits = 0; - CHECK_SMALL_INT(ival); + if (ival < BASE) + return PyLong_FromLong(ival); /* Count the number of Python digits. */ t = (unsigned long)ival; while (t) { @@ -216,11 +228,11 @@ "cannot convert float infinity to long"); return NULL; } + CHECK_SMALL_INT((int)dval); if (dval < 0.0) { neg = 1; dval = -dval; } - CHECK_SMALL_INT((int)dval); frac = frexp(dval, &expo); /* dval = frac*2**expo; 0.0 <= frac < 1.0 */ if (expo <= 0) return PyLong_FromLong(0L); @@ -948,7 +960,8 @@ unsigned PY_LONG_LONG t; int ndigits = 0; - CHECK_SMALL_INT(ival); + if (ival < BASE) + return PyLong_FromLong(ival); /* Count the number of Python digits. */ t = (unsigned PY_LONG_LONG)ival; while (t) { @@ -974,7 +987,8 @@ { Py_ssize_t bytes = ival; int one = 1; - CHECK_SMALL_INT(ival); + if (ival < BASE) + return PyLong_FromLong(ival); return _PyLong_FromByteArray( (unsigned char *)&bytes, SIZEOF_SIZE_T, IS_LITTLE_ENDIAN, 1); @@ -987,7 +1001,8 @@ { size_t bytes = ival; int one = 1; - CHECK_SMALL_INT(ival); + if (ival < BASE) + return PyLong_FromLong(ival); return _PyLong_FromByteArray( (unsigned char *)&bytes, SIZEOF_SIZE_T, IS_LITTLE_ENDIAN, 0); From buildbot at python.org Wed Aug 23 21:49:54 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 23 Aug 2006 19:49:54 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) trunk Message-ID: <20060823194954.A745B1E4005@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%2520trunk/builds/917 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,jeremy.hylton Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 23 22:42:03 2006 From: python-checkins at python.org (alex.martelli) Date: Wed, 23 Aug 2006 22:42:03 +0200 (CEST) Subject: [Python-checkins] r51525 - in python/trunk: Lib/test/test_float.py Objects/floatobject.c Message-ID: <20060823204203.3C4911E4009@bag.python.org> Author: alex.martelli Date: Wed Aug 23 22:42:02 2006 New Revision: 51525 Modified: python/trunk/Lib/test/test_float.py python/trunk/Objects/floatobject.c Log: x**2 should about equal x*x (including for a float x such that the result is inf) but didn't; added a test to test_float to verify that, and ignored the ERANGE value for errno in the pow operation to make the new test pass (with help from Marilyn Davis at the Google Python Sprint -- thanks!). Modified: python/trunk/Lib/test/test_float.py ============================================================================== --- python/trunk/Lib/test/test_float.py (original) +++ python/trunk/Lib/test/test_float.py Wed Aug 23 22:42:02 2006 @@ -99,12 +99,25 @@ (' The Buildbot has detected a new failure of x86 W2k trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%2520trunk/builds/1458 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: alex.martelli Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Wed Aug 23 23:07:33 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 23 Aug 2006 21:07:33 +0000 Subject: [Python-checkins] buildbot warnings in x86 OpenBSD trunk Message-ID: <20060823210734.0EC211E4005@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%2520trunk/builds/1229 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: alex.martelli Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 23 23:14:04 2006 From: python-checkins at python.org (jeremy.hylton) Date: Wed, 23 Aug 2006 23:14:04 +0200 (CEST) Subject: [Python-checkins] r51526 - in python/trunk/Lib: test/output/test_tokenize test/test_tokenize.py tokenize.py Message-ID: <20060823211404.0DA921E4005@bag.python.org> Author: jeremy.hylton Date: Wed Aug 23 23:14:03 2006 New Revision: 51526 Modified: python/trunk/Lib/test/output/test_tokenize python/trunk/Lib/test/test_tokenize.py python/trunk/Lib/tokenize.py Log: Bug fixes large and small for tokenize. Small: Always generate a NL or NEWLINE token following a COMMENT token. The old code did not generate an NL token if the comment was on a line by itself. Large: The output of untokenize() will now match the input exactly if it is passed the full token sequence. The old, crufty output is still generated if a limited input sequence is provided, where limited means that it does not include position information for tokens. Remaining bug: There is no CONTINUATION token (\) so there is no way for untokenize() to handle such code. Also, expanded the number of doctests in hopes of eventually removing the old-style tests that compare against a golden file. Bug fix candidate for Python 2.5.1. (Sigh.) Modified: python/trunk/Lib/test/output/test_tokenize ============================================================================== --- python/trunk/Lib/test/output/test_tokenize (original) +++ python/trunk/Lib/test/output/test_tokenize Wed Aug 23 23:14:03 2006 @@ -1,15 +1,23 @@ test_tokenize -1,0-1,35: COMMENT "# Tests for the 'tokenize' module.\n" -2,0-2,43: COMMENT '# Large bits stolen from test_grammar.py. \n' +1,0-1,34: COMMENT "# Tests for the 'tokenize' module." +1,34-1,35: NL '\n' +2,0-2,42: COMMENT '# Large bits stolen from test_grammar.py. ' +2,42-2,43: NL '\n' 3,0-3,1: NL '\n' -4,0-4,11: COMMENT '# Comments\n' +4,0-4,10: COMMENT '# Comments' +4,10-4,11: NL '\n' 5,0-5,3: STRING '"#"' 5,3-5,4: NEWLINE '\n' -6,0-6,3: COMMENT "#'\n" -7,0-7,3: COMMENT '#"\n' -8,0-8,3: COMMENT '#\\\n' -9,7-9,9: COMMENT '#\n' -10,4-10,10: COMMENT '# abc\n' +6,0-6,2: COMMENT "#'" +6,2-6,3: NL '\n' +7,0-7,2: COMMENT '#"' +7,2-7,3: NL '\n' +8,0-8,2: COMMENT '#\\' +8,2-8,3: NL '\n' +9,7-9,8: COMMENT '#' +9,8-9,9: NL '\n' +10,4-10,9: COMMENT '# abc' +10,9-10,10: NL '\n' 11,0-12,4: STRING "'''#\n#'''" 12,4-12,5: NEWLINE '\n' 13,0-13,1: NL '\n' @@ -19,7 +27,8 @@ 14,7-14,8: COMMENT '#' 14,8-14,9: NEWLINE '\n' 15,0-15,1: NL '\n' -16,0-16,25: COMMENT '# Balancing continuation\n' +16,0-16,24: COMMENT '# Balancing continuation' +16,24-16,25: NL '\n' 17,0-17,1: NL '\n' 18,0-18,1: NAME 'a' 18,2-18,3: OP '=' @@ -92,7 +101,8 @@ 29,2-29,3: OP ')' 29,3-29,4: NEWLINE '\n' 30,0-30,1: NL '\n' -31,0-31,37: COMMENT '# Backslash means line continuation:\n' +31,0-31,36: COMMENT '# Backslash means line continuation:' +31,36-31,37: NL '\n' 32,0-32,1: NAME 'x' 32,2-32,3: OP '=' 32,4-32,5: NUMBER '1' @@ -100,13 +110,15 @@ 33,2-33,3: NUMBER '1' 33,3-33,4: NEWLINE '\n' 34,0-34,1: NL '\n' -35,0-35,55: COMMENT '# Backslash does not means continuation in comments :\\\n' +35,0-35,54: COMMENT '# Backslash does not means continuation in comments :\\' +35,54-35,55: NL '\n' 36,0-36,1: NAME 'x' 36,2-36,3: OP '=' 36,4-36,5: NUMBER '0' 36,5-36,6: NEWLINE '\n' 37,0-37,1: NL '\n' -38,0-38,20: COMMENT '# Ordinary integers\n' +38,0-38,19: COMMENT '# Ordinary integers' +38,19-38,20: NL '\n' 39,0-39,4: NUMBER '0xff' 39,5-39,7: OP '<>' 39,8-39,11: NUMBER '255' @@ -137,7 +149,8 @@ 44,15-44,16: NUMBER '1' 44,16-44,17: NEWLINE '\n' 45,0-45,1: NL '\n' -46,0-46,16: COMMENT '# Long integers\n' +46,0-46,15: COMMENT '# Long integers' +46,15-46,16: NL '\n' 47,0-47,1: NAME 'x' 47,2-47,3: OP '=' 47,4-47,6: NUMBER '0L' @@ -171,7 +184,8 @@ 54,4-54,35: NUMBER '123456789012345678901234567890l' 54,35-54,36: NEWLINE '\n' 55,0-55,1: NL '\n' -56,0-56,25: COMMENT '# Floating-point numbers\n' +56,0-56,24: COMMENT '# Floating-point numbers' +56,24-56,25: NL '\n' 57,0-57,1: NAME 'x' 57,2-57,3: OP '=' 57,4-57,8: NUMBER '3.14' @@ -184,7 +198,8 @@ 59,2-59,3: OP '=' 59,4-59,9: NUMBER '0.314' 59,9-59,10: NEWLINE '\n' -60,0-60,18: COMMENT '# XXX x = 000.314\n' +60,0-60,17: COMMENT '# XXX x = 000.314' +60,17-60,18: NL '\n' 61,0-61,1: NAME 'x' 61,2-61,3: OP '=' 61,4-61,8: NUMBER '.314' @@ -218,7 +233,8 @@ 68,4-68,9: NUMBER '3.1e4' 68,9-68,10: NEWLINE '\n' 69,0-69,1: NL '\n' -70,0-70,18: COMMENT '# String literals\n' +70,0-70,17: COMMENT '# String literals' +70,17-70,18: NL '\n' 71,0-71,1: NAME 'x' 71,2-71,3: OP '=' 71,4-71,6: STRING "''" @@ -366,7 +382,8 @@ 125,6-126,3: STRING "uR'''spam\n'''" 126,3-126,4: NEWLINE '\n' 127,0-127,1: NL '\n' -128,0-128,14: COMMENT '# Indentation\n' +128,0-128,13: COMMENT '# Indentation' +128,13-128,14: NL '\n' 129,0-129,2: NAME 'if' 129,3-129,4: NUMBER '1' 129,4-129,5: OP ':' @@ -438,7 +455,8 @@ 142,14-142,15: NUMBER '2' 142,15-142,16: NEWLINE '\n' 143,0-143,1: NL '\n' -144,0-144,12: COMMENT '# Operators\n' +144,0-144,11: COMMENT '# Operators' +144,11-144,12: NL '\n' 145,0-145,1: NL '\n' 146,0-146,0: DEDENT '' 146,0-146,0: DEDENT '' @@ -500,7 +518,8 @@ 149,27-149,28: OP ')' 149,28-149,29: NEWLINE '\n' 150,0-150,1: NL '\n' -151,0-151,13: COMMENT '# comparison\n' +151,0-151,12: COMMENT '# comparison' +151,12-151,13: NL '\n' 152,0-152,2: NAME 'if' 152,3-152,4: NUMBER '1' 152,5-152,6: OP '<' @@ -531,7 +550,8 @@ 152,67-152,71: NAME 'pass' 152,71-152,72: NEWLINE '\n' 153,0-153,1: NL '\n' -154,0-154,9: COMMENT '# binary\n' +154,0-154,8: COMMENT '# binary' +154,8-154,9: NL '\n' 155,0-155,1: NAME 'x' 155,2-155,3: OP '=' 155,4-155,5: NUMBER '1' @@ -551,7 +571,8 @@ 157,8-157,9: NUMBER '1' 157,9-157,10: NEWLINE '\n' 158,0-158,1: NL '\n' -159,0-159,8: COMMENT '# shift\n' +159,0-159,7: COMMENT '# shift' +159,7-159,8: NL '\n' 160,0-160,1: NAME 'x' 160,2-160,3: OP '=' 160,4-160,5: NUMBER '1' @@ -561,7 +582,8 @@ 160,14-160,15: NUMBER '1' 160,15-160,16: NEWLINE '\n' 161,0-161,1: NL '\n' -162,0-162,11: COMMENT '# additive\n' +162,0-162,10: COMMENT '# additive' +162,10-162,11: NL '\n' 163,0-163,1: NAME 'x' 163,2-163,3: OP '=' 163,4-163,5: NUMBER '1' @@ -575,7 +597,8 @@ 163,20-163,21: NUMBER '1' 163,21-163,22: NEWLINE '\n' 164,0-164,1: NL '\n' -165,0-165,17: COMMENT '# multiplicative\n' +165,0-165,16: COMMENT '# multiplicative' +165,16-165,17: NL '\n' 166,0-166,1: NAME 'x' 166,2-166,3: OP '=' 166,4-166,5: NUMBER '1' @@ -587,7 +610,8 @@ 166,16-166,17: NUMBER '1' 166,17-166,18: NEWLINE '\n' 167,0-167,1: NL '\n' -168,0-168,8: COMMENT '# unary\n' +168,0-168,7: COMMENT '# unary' +168,7-168,8: NL '\n' 169,0-169,1: NAME 'x' 169,2-169,3: OP '=' 169,4-169,5: OP '~' @@ -625,7 +649,8 @@ 170,24-170,25: NUMBER '1' 170,25-170,26: NEWLINE '\n' 171,0-171,1: NL '\n' -172,0-172,11: COMMENT '# selector\n' +172,0-172,10: COMMENT '# selector' +172,10-172,11: NL '\n' 173,0-173,6: NAME 'import' 173,7-173,10: NAME 'sys' 173,10-173,11: OP ',' Modified: python/trunk/Lib/test/test_tokenize.py ============================================================================== --- python/trunk/Lib/test/test_tokenize.py (original) +++ python/trunk/Lib/test/test_tokenize.py Wed Aug 23 23:14:03 2006 @@ -9,20 +9,73 @@ brevity. >>> dump_tokens("1 + 1") -NUMBER '1' (1, 0) (1, 1) -OP '+' (1, 2) (1, 3) -NUMBER '1' (1, 4) (1, 5) +NUMBER '1' (1, 0) (1, 1) +OP '+' (1, 2) (1, 3) +NUMBER '1' (1, 4) (1, 5) + +A comment generates a token here, unlike in the parser module. The +comment token is followed by an NL or a NEWLINE token, depending on +whether the line contains the completion of a statement. + +>>> dump_tokens("if False:\\n" +... " # NL\\n" +... " True = False # NEWLINE\\n") +NAME 'if' (1, 0) (1, 2) +NAME 'False' (1, 3) (1, 8) +OP ':' (1, 8) (1, 9) +NEWLINE '\\n' (1, 9) (1, 10) +COMMENT '# NL' (2, 4) (2, 8) +NL '\\n' (2, 8) (2, 9) +INDENT ' ' (3, 0) (3, 4) +NAME 'True' (3, 4) (3, 8) +OP '=' (3, 9) (3, 10) +NAME 'False' (3, 11) (3, 16) +COMMENT '# NEWLINE' (3, 17) (3, 26) +NEWLINE '\\n' (3, 26) (3, 27) +DEDENT '' (4, 0) (4, 0) + There will be a bunch more tests of specific source patterns. The tokenize module also defines an untokenize function that should -regenerate the original program text from the tokens. (It doesn't -work very well at the moment.) +regenerate the original program text from the tokens. + +There are some standard formatting practices that are easy to get right. >>> roundtrip("if x == 1:\\n" ... " print x\\n") -if x ==1 : - print x +if x == 1: + print x + +Some people use different formatting conventions, which makes +untokenize a little trickier. Note that this test involves trailing +whitespace after the colon. You can't see it, but it's there! + +>>> roundtrip("if x == 1 : \\n" +... " print x\\n") +if x == 1 : + print x + +Comments need to go in the right place. + +>>> roundtrip("if x == 1:\\n" +... " # A comment by itself.\\n" +... " print x # Comment here, too.\\n" +... " # Another comment.\\n" +... "after_if = True\\n") +if x == 1: + # A comment by itself. + print x # Comment here, too. + # Another comment. +after_if = True + +>>> roundtrip("if (x # The comments need to go in the right place\\n" +... " == 1):\\n" +... " print 'x == 1'\\n") +if (x # The comments need to go in the right place + == 1): + print 'x == 1' + """ import os, glob, random @@ -30,7 +83,7 @@ from test.test_support import (verbose, findfile, is_resource_enabled, TestFailed) from tokenize import (tokenize, generate_tokens, untokenize, tok_name, - ENDMARKER, NUMBER, NAME, OP, STRING) + ENDMARKER, NUMBER, NAME, OP, STRING, COMMENT) # Test roundtrip for `untokenize`. `f` is a file path. The source code in f # is tokenized, converted back to source code via tokenize.untokenize(), @@ -61,11 +114,12 @@ if type == ENDMARKER: break type = tok_name[type] - print "%(type)-10.10s %(token)-10.10r %(start)s %(end)s" % locals() + print "%(type)-10.10s %(token)-13.13r %(start)s %(end)s" % locals() def roundtrip(s): f = StringIO(s) - print untokenize(generate_tokens(f.readline)), + source = untokenize(generate_tokens(f.readline)) + print source, # This is an example from the docs, set up as a doctest. def decistmt(s): Modified: python/trunk/Lib/tokenize.py ============================================================================== --- python/trunk/Lib/tokenize.py (original) +++ python/trunk/Lib/tokenize.py Wed Aug 23 23:14:03 2006 @@ -159,14 +159,76 @@ for token_info in generate_tokens(readline): tokeneater(*token_info) +class Untokenizer: + + def __init__(self): + self.tokens = [] + self.prev_row = 1 + self.prev_col = 0 + + def add_whitespace(self, start): + row, col = start + while row > self.prev_row: + print row, "<", self.prev_row + self.tokens.append("\n") + self.prev_row += 1 + col_offset = col - self.prev_col + if col_offset: + self.tokens.append(" " * col_offset) + + def untokenize(self, iterable): + for t in iterable: + if len(t) == 2: + self.compat(t, iterable) + break + tok_type, token, start, end, line = t + self.add_whitespace(start) + self.tokens.append(token) + self.prev_row, self.prev_col = end + if tok_type in (NEWLINE, NL): + self.prev_row += 1 + self.prev_col = 0 + return "".join(self.tokens) + + def compat(self, token, iterable): + startline = False + indents = [] + toks_append = self.tokens.append + toknum, tokval = token + if toknum in (NAME, NUMBER): + tokval += ' ' + if toknum in (NEWLINE, NL): + startline = True + for tok in iterable: + toknum, tokval = tok[:2] + + if toknum in (NAME, NUMBER): + tokval += ' ' + + if toknum == INDENT: + indents.append(tokval) + continue + elif toknum == DEDENT: + indents.pop() + continue + elif toknum in (NEWLINE, NL): + startline = True + elif startline and indents: + toks_append(indents[-1]) + startline = False + toks_append(tokval) def untokenize(iterable): """Transform tokens back into Python source code. Each element returned by the iterable must be a token sequence - with at least two elements, a token number and token value. + with at least two elements, a token number and token value. If + only two tokens are passed, the resulting output is poor. + + Round-trip invariant for full input: + Untokenized source will match input source exactly - Round-trip invariant: + Round-trip invariant for limited intput: # Output text will tokenize the back to the input t1 = [tok[:2] for tok in generate_tokens(f.readline)] newcode = untokenize(t1) @@ -174,31 +236,8 @@ t2 = [tok[:2] for tokin generate_tokens(readline)] assert t1 == t2 """ - - startline = False - indents = [] - toks = [] - toks_append = toks.append - for tok in iterable: - toknum, tokval = tok[:2] - - if toknum in (NAME, NUMBER): - tokval += ' ' - - if toknum == INDENT: - indents.append(tokval) - continue - elif toknum == DEDENT: - indents.pop() - continue - elif toknum in (NEWLINE, COMMENT, NL): - startline = True - elif startline and indents: - toks_append(indents[-1]) - startline = False - toks_append(tokval) - return ''.join(toks) - + ut = Untokenizer() + return ut.untokenize(iterable) def generate_tokens(readline): """ @@ -237,7 +276,7 @@ if endmatch: pos = end = endmatch.end(0) yield (STRING, contstr + line[:end], - strstart, (lnum, end), contline + line) + strstart, (lnum, end), contline + line) contstr, needcont = '', 0 contline = None elif needcont and line[-2:] != '\\\n' and line[-3:] != '\\\r\n': @@ -263,7 +302,15 @@ if pos == max: break if line[pos] in '#\r\n': # skip comments or blank lines - yield ((NL, COMMENT)[line[pos] == '#'], line[pos:], + if line[pos] == '#': + comment_token = line[pos:].rstrip('\r\n') + nl_pos = pos + len(comment_token) + yield (COMMENT, comment_token, + (lnum, pos), (lnum, pos + len(comment_token)), line) + yield (NL, line[nl_pos:], + (lnum, nl_pos), (lnum, len(line)), line) + else: + yield ((NL, COMMENT)[line[pos] == '#'], line[pos:], (lnum, pos), (lnum, len(line)), line) continue @@ -294,9 +341,10 @@ (initial == '.' and token != '.'): # ordinary number yield (NUMBER, token, spos, epos, line) elif initial in '\r\n': - yield (parenlev > 0 and NL or NEWLINE, - token, spos, epos, line) + yield (NL if parenlev > 0 else NEWLINE, + token, spos, epos, line) elif initial == '#': + assert not token.endswith("\n") yield (COMMENT, token, spos, epos, line) elif token in triple_quoted: endprog = endprogs[token] From buildbot at python.org Wed Aug 23 23:19:41 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 23 Aug 2006 21:19:41 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian trunk Message-ID: <20060823211941.B5B751E4010@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%2520trunk/builds/435 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: alex.martelli Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Wed Aug 23 23:20:00 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 23 Aug 2006 21:20:00 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP trunk Message-ID: <20060823212000.845271E4005@bag.python.org> The Buildbot has detected a new failure of x86 XP trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%2520trunk/builds/1407 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: alex.martelli Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Wed Aug 23 23:23:17 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 23 Aug 2006 21:23:17 +0000 Subject: [Python-checkins] buildbot warnings in sparc solaris10 gcc trunk Message-ID: <20060823212317.B0C371E401C@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520solaris10%2520gcc%2520trunk/builds/1407 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: alex.martelli Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 23 23:26:46 2006 From: python-checkins at python.org (jeremy.hylton) Date: Wed, 23 Aug 2006 23:26:46 +0200 (CEST) Subject: [Python-checkins] r51527 - python/trunk/Lib/tokenize.py Message-ID: <20060823212646.E95371E400D@bag.python.org> Author: jeremy.hylton Date: Wed Aug 23 23:26:46 2006 New Revision: 51527 Modified: python/trunk/Lib/tokenize.py Log: Replace dead code with an assert. Now that COMMENT tokens are reliably followed by NL or NEWLINE, there is never a need to add extra newlines in untokenize. Modified: python/trunk/Lib/tokenize.py ============================================================================== --- python/trunk/Lib/tokenize.py (original) +++ python/trunk/Lib/tokenize.py Wed Aug 23 23:26:46 2006 @@ -168,10 +168,7 @@ def add_whitespace(self, start): row, col = start - while row > self.prev_row: - print row, "<", self.prev_row - self.tokens.append("\n") - self.prev_row += 1 + assert row <= self.prev_row col_offset = col - self.prev_col if col_offset: self.tokens.append(" " * col_offset) From buildbot at python.org Wed Aug 23 23:41:42 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 23 Aug 2006 21:41:42 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP-2 trunk Message-ID: <20060823214142.8008E1E4020@bag.python.org> The Buildbot has detected a new failure of x86 XP-2 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP-2%2520trunk/builds/900 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: alex.martelli,andrew.kuchling,jeremy.hylton Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 23 23:53:33 2006 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 23 Aug 2006 23:53:33 +0200 (CEST) Subject: [Python-checkins] r51528 - in python/branches/int_unification: INTBENCH Modules/_testcapimodule.c Message-ID: <20060823215333.48BCB1E4005@bag.python.org> Author: martin.v.loewis Date: Wed Aug 23 23:53:32 2006 New Revision: 51528 Modified: python/branches/int_unification/INTBENCH python/branches/int_unification/Modules/_testcapimodule.c Log: Reduce run-time of test 5 Modified: python/branches/int_unification/INTBENCH ============================================================================== --- python/branches/int_unification/INTBENCH (original) +++ python/branches/int_unification/INTBENCH Wed Aug 23 23:53:32 2006 @@ -6,6 +6,7 @@ Test 2: 1.696623s Test 3: 1.900683s Test 4: 5.307155s +Test 5: 2.546707s Test 6: 1.670252s Test 7: 1.910734s @@ -19,4 +20,5 @@ Test 1: 3.457184s Test 2: 4.514800s Test 3: 4.999010s -Test 4: 10.818277s \ No newline at end of file +Test 4: 10.818277s + Modified: python/branches/int_unification/Modules/_testcapimodule.c ============================================================================== --- python/branches/int_unification/Modules/_testcapimodule.c (original) +++ python/branches/int_unification/Modules/_testcapimodule.c Wed Aug 23 23:53:32 2006 @@ -788,7 +788,7 @@ /* Test 5: Allocate many integers < 32000 */ multiple = malloc(sizeof(PyObject*) * 1000000); gettimeofday(&start, NULL); - for(k=0; k < 20; k++) { + for(k=0; k < 10; k++) { for(i=0; i < 1000000; i++) { multiple[i] = PyInt_FromLong(i+1000); } From tim.peters at gmail.com Thu Aug 24 00:00:30 2006 From: tim.peters at gmail.com (Tim Peters) Date: Wed, 23 Aug 2006 18:00:30 -0400 Subject: [Python-checkins] r51525 - in python/trunk: Lib/test/test_float.py Objects/floatobject.c In-Reply-To: <20060823204203.3C4911E4009@bag.python.org> References: <20060823204203.3C4911E4009@bag.python.org> Message-ID: <1f7befae0608231500n475cfed2x6cbfba20e1a2b480@mail.gmail.com> > Author: alex.martelli > Date: Wed Aug 23 22:42:02 2006 > New Revision: 51525 > > Modified: > python/trunk/Lib/test/test_float.py > python/trunk/Objects/floatobject.c > Log: > x**2 should about equal x*x (including for a float x such that the result is > inf) but didn't; added a test to test_float to verify that, and ignored the > ERANGE value for errno in the pow operation to make the new test pass (with > help from Marilyn Davis at the Google Python Sprint -- thanks!). Huh. It's been a (mildly controversial, but intentional all the same) feature that Python tries to raise raise OverflowError on overflowing libm operations. Doesn't work all that well, since there's no consistency across platforms about when libm sets errno, or to what (when it does). > Modified: python/trunk/Lib/test/test_float.py > ============================================================================== > --- python/trunk/Lib/test/test_float.py (original) > +++ python/trunk/Lib/test/test_float.py Wed Aug 23 22:42:02 2006 > @@ -99,12 +99,25 @@ > (' struct.unpack(fmt, data) > > +# on an IEEE platform, "overflowing" operations produce infinity > + > +class IEEEOperationsTestCase(unittest.TestCase): > + if float.__getformat__("double").startswith("IEEE"): > + def test_double_infinity(self): > + big = 4.8e159 > + pro = big*big > + self.assertEquals(repr(pro), 'inf') You must have run this on Linux? Can't pass on Windows (at least). > + sqr = big**2 > + self.assertEquals(repr(sqr), 'inf') Same as above. C89 defines nothing about what the platform double->string routines produce for IEEE inf, NaN, or signed zeroes, and there's no consistency across platforms for that either. A better test is suggested by pyport.h's default implementation if its "is it an infinity?" macro: #define Py_IS_INFINITY(X) ((X) && (X)*0.5 == (X)) Since you expect a postive infinity here, specialize to: self.assert_(sqr > 0.0 and sqr * 0.5 == sqr) From python-checkins at python.org Thu Aug 24 00:16:11 2006 From: python-checkins at python.org (brett.cannon) Date: Thu, 24 Aug 2006 00:16:11 +0200 (CEST) Subject: [Python-checkins] r51529 - peps/trunk/pep-0362.txt Message-ID: <20060823221611.1AE161E401B@bag.python.org> Author: brett.cannon Date: Thu Aug 24 00:16:10 2006 New Revision: 51529 Modified: peps/trunk/pep-0362.txt Log: Add __str__() and bind() to Signature and __str__() to Parameter. Modified: peps/trunk/pep-0362.txt ============================================================================== --- peps/trunk/pep-0362.txt (original) +++ peps/trunk/pep-0362.txt Thu Aug 24 00:16:10 2006 @@ -57,6 +57,12 @@ List of the parameters of the function are represented by Parameter objects (see `Parameter Object`_ for their description). +* __str__() -> str + Return the string representation of the signature as it might + appear in source code. +* bind(\*args, \*\*kwargs) -> dict + Create a mapping from argument to parameter for the signature (see + `Open Issues`_ for question of how to handle tuples). The Signature object is stored in the ``__signature__`` attribute of the function. When it is to be created is an `Open Issues`_. @@ -95,6 +101,9 @@ attribute does not exist. This is done so that the attribute is not accidentally used if no default value is set as any default value could be a legitimate default value itself. +* __str__() -> str + Return the string representation of the parameter as it might + appear in source code in a function signature. Implementation @@ -107,6 +116,11 @@ methods this is stored directly on the im_func function object since that is what decorators will work with). +For the `Open Issues`_ question of how to handle tuples, the current +implementation does the best it can to determine if the argument will +unpack properly, raising TypeError if it cannot reliably prove either +way if the argument can be unpacked. + Relation With Other PEPs ======================== @@ -142,6 +156,27 @@ needed, and then return the value of ``__signature__``. +How to handle tuples for ``Signature.bind()``? +---------------------------------------------- + +Tuples pose an interesting problem for generating the mapping from +arguments to parameters. If one wants ``Signature.bind()`` to do the +full mapping, then the unpacking of an argument tuple's values must be +done and then have those values bound to the proper parameter. This +could be a problem since this would require using the iterator to +verify the binding and thus could possibly make the iterator worthless +for actual use in a function call later. + +But if one wants parameters to be based on what is a single positional +argument, then the tuple should not be unpacked. This means that for +tuples one can do the best they can to verify that the argument will +unpack properly without running an iterator. But if an object is +passed in that does not define ``__len__()`` and ``__getitem__()`` for +verifying unpacking, then one can either just assume that if it +defines ``__iter__()`` it might be okay, or raise an exception stating +that the binding could not be calculated with full confidence. + + References ========== From thomas at python.org Thu Aug 24 00:16:21 2006 From: thomas at python.org (Thomas Wouters) Date: Thu, 24 Aug 2006 00:16:21 +0200 Subject: [Python-checkins] r51525 - in python/trunk: Lib/test/test_float.py Objects/floatobject.c In-Reply-To: <20060823204203.3C4911E4009@bag.python.org> References: <20060823204203.3C4911E4009@bag.python.org> Message-ID: <9e804ac0608231516k3a08f0c5m3c4375fe0a09a24a@mail.gmail.com> On 8/23/06, alex.martelli wrote: > > > --- python/trunk/Objects/floatobject.c (original) > +++ python/trunk/Objects/floatobject.c Wed Aug 23 22:42:02 2006 > @@ -821,12 +821,12 @@ > ix = pow(iv, iw); > PyFPE_END_PROTECT(ix) > Py_ADJUST_ERANGE1(ix); > - if (errno != 0) { > + /* we need to ignore ERANGE here and just return inf */ > + if (errno != 0 && errno != ERANGE) { > /* We don't expect any errno value other than ERANGE, but > * the range of libm bugs appears unbounded. > */ > - PyErr_SetFromErrno(errno == ERANGE ? PyExc_OverflowError : > - PyExc_ValueError); > + PyErr_SetFromErrno(PyExc_ValueError); > return NULL; I don't think this can be right. The returnvalue of pow() in the case of ERANGE isn't defined anywhere that I can find, at least. How can we assume it is +Infinity? As I tried to say over the visiphone, you can't even use compile-time or startup-time checks for the behaviour because 'undefined' also means it need not be consistent, either. The best we could do, if we really wanted to return +inf instead of raising OverflowError (which I don't, but don't really care about either), is generate +Infinity in some guaranteed way. I'm sure Tim can come up with a convenient, portable way < 0.9 wink>. But I'd prefer to keep it the way it was: x*x and x**2 don't always do the same thing. Floats have a lot more confusing features like that, such as 10*x - 9*x need not be x. I don't see the added value of trying to make it consistent in just this case, even if it's portable. -- Thomas Wouters Hi! I'm a .signature virus! copy me into your .signature file to help me spread! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20060824/9ef3c5d5/attachment.htm From python-checkins at python.org Thu Aug 24 00:17:59 2006 From: python-checkins at python.org (alex.martelli) Date: Thu, 24 Aug 2006 00:17:59 +0200 (CEST) Subject: [Python-checkins] r51530 - in python/trunk: Lib/test/test_float.py Objects/floatobject.c Message-ID: <20060823221759.D9DB61E4009@bag.python.org> Author: alex.martelli Date: Thu Aug 24 00:17:59 2006 New Revision: 51530 Modified: python/trunk/Lib/test/test_float.py python/trunk/Objects/floatobject.c Log: Reverting the patch that tried to fix the issue whereby x**2 raises OverflowError while x*x succeeds and produces infinity; apparently these inconsistencies cannot be fixed across ``all'' platforms and there's a widespread feeling that therefore ``every'' platform should keep suffering forevermore. Ah well. Modified: python/trunk/Lib/test/test_float.py ============================================================================== --- python/trunk/Lib/test/test_float.py (original) +++ python/trunk/Lib/test/test_float.py Thu Aug 24 00:17:59 2006 @@ -99,25 +99,12 @@ (' The Buildbot has detected a new failure of S-390 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%2520Debian%2520trunk/builds/345 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeremy.hylton Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 24 00:41:40 2006 From: buildbot at python.org (buildbot at python.org) Date: Wed, 23 Aug 2006 22:41:40 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060823224140.4BA9C1E4009@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1121 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeremy.hylton Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Thu Aug 24 02:31:27 2006 From: python-checkins at python.org (brett.cannon) Date: Thu, 24 Aug 2006 02:31:27 +0200 (CEST) Subject: [Python-checkins] r51532 - peps/trunk/pep-0362.txt Message-ID: <20060824003127.03A951E4005@bag.python.org> Author: brett.cannon Date: Thu Aug 24 02:31:25 2006 New Revision: 51532 Modified: peps/trunk/pep-0362.txt Log: Swap some words to get the proper wording for Signature.bind(). Modified: peps/trunk/pep-0362.txt ============================================================================== --- peps/trunk/pep-0362.txt (original) +++ peps/trunk/pep-0362.txt Thu Aug 24 02:31:25 2006 @@ -61,7 +61,7 @@ Return the string representation of the signature as it might appear in source code. * bind(\*args, \*\*kwargs) -> dict - Create a mapping from argument to parameter for the signature (see + Create a mapping from parameter to argument for the signature (see `Open Issues`_ for question of how to handle tuples). The Signature object is stored in the ``__signature__`` attribute of From python-checkins at python.org Thu Aug 24 03:13:18 2006 From: python-checkins at python.org (brett.cannon) Date: Thu, 24 Aug 2006 03:13:18 +0200 (CEST) Subject: [Python-checkins] r51534 - peps/trunk/pep-3100.txt Message-ID: <20060824011318.DB37B1E4004@bag.python.org> Author: brett.cannon Date: Thu Aug 24 03:13:18 2006 New Revision: 51534 Modified: peps/trunk/pep-3100.txt Log: Clarify why operator.isCallable() and operator.sequenceIncludes() are going away. Modified: peps/trunk/pep-3100.txt ============================================================================== --- peps/trunk/pep-3100.txt (original) +++ peps/trunk/pep-3100.txt Thu Aug 24 03:13:18 2006 @@ -209,7 +209,10 @@ not thread-safe; use ``sys.exc_info()`` or an attribute of the exception [2]_ [13]_ [#sys-module]_ * ``array.read``, ``array.write`` [#array-module]_ -* ``operator.isCallable``, ``operator.sequenceIncludes`` [#operator-module]_ +* ``operator.isCallable`` : ``callable()`` built-in is being removed + [#operator-module]_ +* ``operator.sequenceIncludes`` : redundant thanks to + ``operator.contains`` [#operator-module]_ * In the thread module, the aquire_lock() and release_lock() aliases for the acquire() and release() methods on lock objects. (Probably also just remove the thread module as a public API, From python-checkins at python.org Thu Aug 24 17:03:23 2006 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 24 Aug 2006 17:03:23 +0200 (CEST) Subject: [Python-checkins] r51556 - python/branches/int_unification/INTBENCH Message-ID: <20060824150323.36E411E4015@bag.python.org> Author: martin.v.loewis Date: Thu Aug 24 17:03:21 2006 New Revision: 51556 Modified: python/branches/int_unification/INTBENCH Log: Record timings for medium-int allocations. Modified: python/branches/int_unification/INTBENCH ============================================================================== --- python/branches/int_unification/INTBENCH (original) +++ python/branches/int_unification/INTBENCH Thu Aug 24 17:03:21 2006 @@ -22,3 +22,12 @@ Test 3: 4.999010s Test 4: 10.818277s +r51452 (special-casing medium int allocation) +Test 1: 3.258219s +Test 2: 4.255007s +Test 3: 4.547923s +Test 4: 10.615123s +Test 5: 5.255545s +Test 6: 3.775941s +Test 7: 4.001805s + From python-checkins at python.org Thu Aug 24 19:42:12 2006 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 24 Aug 2006 19:42:12 +0200 (CEST) Subject: [Python-checkins] r51562 - in python/branches/int_unification: Objects/longobject.c Objects/stringobject.c Python/ceval.c Message-ID: <20060824174212.3C5601E4004@bag.python.org> Author: martin.v.loewis Date: Thu Aug 24 19:42:10 2006 New Revision: 51562 Modified: python/branches/int_unification/Objects/longobject.c python/branches/int_unification/Objects/stringobject.c python/branches/int_unification/Python/ceval.c Log: Special-case more single-digit operations. Avoid modifying singleton values. Fix index computation. Modified: python/branches/int_unification/Objects/longobject.c ============================================================================== --- python/branches/int_unification/Objects/longobject.c (original) +++ python/branches/int_unification/Objects/longobject.c Thu Aug 24 19:42:10 2006 @@ -48,6 +48,14 @@ #define CHECK_SMALL_INT(ival) #endif +#define MEDIUM_VALUE(x) ((x)->ob_size < 0 ? -(x)->ob_digit[0] : (x)->ob_digit[0]) +/* If a freshly-allocated long is already shared, it must + be a small integer, so negating it must go to PyLong_FromLong */ +#define NEGATE(x) \ + do if ((x)->ob_refcnt == 1) (x)->ob_size = -(x)->ob_size; \ + else { PyObject* tmp=PyInt_FromLong(-MEDIUM_VALUE(x)); \ + Py_DECREF(x); (x) = (PyLongObject*)tmp; } \ + while(0) /* For long multiplication, use the O(N**2) school algorithm unless * both operands contain more than KARATSUBA_CUTOFF digits (this * being an internal Python long digit, in base BASE). @@ -105,11 +113,18 @@ PyLongObject * _PyLong_New(Py_ssize_t size) { + PyLongObject *result; if (size > PY_SSIZE_T_MAX) { PyErr_NoMemory(); return NULL; } - return PyObject_NEW_VAR(PyLongObject, &PyLong_Type, size); + result = PyObject_MALLOC(sizeof(PyLongObject) + + (size-1)*sizeof(digit)); + if (!result) { + PyErr_NoMemory(); + return NULL; + } + return (PyLongObject*)PyObject_INIT_VAR(result, &PyLong_Type, size); } PyObject * @@ -155,7 +170,7 @@ if (ival < BASE) { /* Fast path for single-digits ints */ - v = PyObject_NEW_VAR(PyLongObject, &PyLong_Type, 1); + v = _PyLong_New(1); if (v) { v->ob_size = negative ? -1 : 1; v->ob_digit[0] = ival; @@ -291,6 +306,11 @@ v = (PyLongObject *)vv; i = v->ob_size; + switch (i) { + case -1: return -v->ob_digit[0]; + case 0: return 0; + case 1: return v->ob_digit[0]; + } sign = 1; x = 0; if (i < 0) { @@ -353,6 +373,11 @@ } v = (PyLongObject *)vv; i = v->ob_size; + switch (i) { + case -1: return -v->ob_digit[0]; + case 0: return 0; + case 1: return v->ob_digit[0]; + } sign = 1; x = 0; if (i < 0) { @@ -402,6 +427,10 @@ "can't convert negative value to unsigned long"); return (unsigned long) -1; } + switch (i) { + case 0: return 0; + case 1: return v->ob_digit[0]; + } while (--i >= 0) { prev = x; x = (x << SHIFT) + v->ob_digit[i]; @@ -436,6 +465,10 @@ "can't convert negative value to size_t"); return (size_t) -1; } + switch (i) { + case 0: return 0; + case 1: return v->ob_digit[0]; + } while (--i >= 0) { prev = x; x = (x << SHIFT) + v->ob_digit[i]; @@ -465,6 +498,10 @@ } v = (PyLongObject *)vv; i = v->ob_size; + switch (i) { + case 0: return 0; + case 1: return v->ob_digit[0]; + } sign = 1; x = 0; if (i < 0) { @@ -1014,6 +1051,7 @@ PY_LONG_LONG PyLong_AsLongLong(PyObject *vv) { + PyLongObject *v; PY_LONG_LONG bytes; int one = 1; int res; @@ -1043,6 +1081,12 @@ return -1; } + v = (PyLongObject*)vv; + switch(v->ob_size) { + case -1: return -v->ob_digit[0]; + case 0: return 0; + case 1: return v->ob_digit[0]; + } res = _PyLong_AsByteArray( (PyLongObject *)vv, (unsigned char *)&bytes, SIZEOF_LONG_LONG, IS_LITTLE_ENDIAN, 1); @@ -1060,6 +1104,7 @@ unsigned PY_LONG_LONG PyLong_AsUnsignedLongLong(PyObject *vv) { + PyLongObject *v; unsigned PY_LONG_LONG bytes; int one = 1; int res; @@ -1069,6 +1114,12 @@ return (unsigned PY_LONG_LONG)-1; } + v = (PyLongObject*)vv; + switch(v->ob_size) { + case 0: return 0; + case 1: return v->ob_digit[0]; + } + res = _PyLong_AsByteArray( (PyLongObject *)vv, (unsigned char *)&bytes, SIZEOF_LONG_LONG, IS_LITTLE_ENDIAN, 0); @@ -1096,6 +1147,10 @@ return (unsigned long) -1; } v = (PyLongObject *)vv; + switch(v->ob_size) { + case 0: return 0; + case 1: return v->ob_digit[0]; + } i = v->ob_size; sign = 1; x = 0; @@ -1816,7 +1871,7 @@ (size_a == size_b && a->ob_digit[size_a-1] < b->ob_digit[size_b-1])) { /* |a| < |b|. */ - *pdiv = _PyLong_New(0); + *pdiv = (PyLongObject*)PyLong_FromLong(0); Py_INCREF(a); *prem = (PyLongObject *) a; return 0; @@ -1838,9 +1893,9 @@ the remainder r has the sign of a, so a = b*z + r. */ if ((a->ob_size < 0) != (b->ob_size < 0)) - z->ob_size = -(z->ob_size); + NEGATE(z); if (a->ob_size < 0 && (*prem)->ob_size != 0) - (*prem)->ob_size = -((*prem)->ob_size); + NEGATE(*prem); *pdiv = z; return 0; } @@ -1996,6 +2051,11 @@ same value hash to the same value, otherwise comparisons of mapping keys will turn out weird */ i = v->ob_size; + switch(i) { + case -1: return v->ob_digit[0]==1 ? -2 : -v->ob_digit[0]; + case 0: return 0; + case 1: return v->ob_digit[1]; + } sign = 1; x = 0; if (i < 0) { @@ -2101,7 +2161,7 @@ } assert(borrow == 0); if (sign < 0) - z->ob_size = -(z->ob_size); + NEGATE(z); return long_normalize(z); } @@ -2112,6 +2172,9 @@ CONVERT_BINOP((PyObject *)v, (PyObject *)w, &a, &b); + if (ABS(a->ob_size) <= 1 && ABS(b->ob_size) <= 1) + return PyInt_FromLong(MEDIUM_VALUE(a) + + MEDIUM_VALUE(b)); if (a->ob_size < 0) { if (b->ob_size < 0) { z = x_add(a, b); @@ -2139,6 +2202,8 @@ CONVERT_BINOP((PyObject *)v, (PyObject *)w, &a, &b); + if (ABS(a->ob_size) <= 1 && ABS(b->ob_size) <= 1) + return PyLong_FromLong(MEDIUM_VALUE(a)-MEDIUM_VALUE(b)); if (a->ob_size < 0) { if (b->ob_size < 0) z = x_sub(a, b); @@ -2568,10 +2633,13 @@ return Py_NotImplemented; } + if (ABS(v->ob_size) <= 1 && ABS(w->ob_size) <= 1) + return PyLong_FromLong(MEDIUM_VALUE(v)*MEDIUM_VALUE(w)); + z = k_mul(a, b); /* Negate if exactly one of the inputs is negative. */ if (((a->ob_size ^ b->ob_size) < 0) && z) - z->ob_size = -(z->ob_size); + NEGATE(z); Py_DECREF(a); Py_DECREF(b); return (PyObject *)z; @@ -2810,7 +2878,7 @@ Py_DECREF(c); c = temp; temp = NULL; - c->ob_size = - c->ob_size; + NEGATE(c); } /* if modulus == 1: @@ -2931,6 +2999,8 @@ /* Implement ~x as -(x+1) */ PyLongObject *x; PyLongObject *w; + if (ABS(v->ob_size) <=1) + return PyLong_FromLong(-(MEDIUM_VALUE(v)+1)); w = (PyLongObject *)PyLong_FromLong(1L); if (w == NULL) return NULL; @@ -2957,11 +3027,8 @@ long_neg(PyLongObject *v) { PyLongObject *z; - if (v->ob_size == 0 && PyLong_CheckExact(v)) { - /* -0 == 0 */ - Py_INCREF(v); - return (PyObject *) v; - } + if (ABS(v->ob_size) <= 1) + return PyLong_FromLong(-MEDIUM_VALUE(v)); z = (PyLongObject *)_PyLong_Copy(v); if (z != NULL) z->ob_size = -(v->ob_size); @@ -3085,7 +3152,7 @@ if (z == NULL) goto lshift_error; if (a->ob_size < 0) - z->ob_size = -(z->ob_size); + NEGATE(z); for (i = 0; i < wordshift; i++) z->ob_digit[i] = 0; accum = 0; Modified: python/branches/int_unification/Objects/stringobject.c ============================================================================== --- python/branches/int_unification/Objects/stringobject.c (original) +++ python/branches/int_unification/Objects/stringobject.c Thu Aug 24 19:42:10 2006 @@ -4206,6 +4206,14 @@ int numdigits; /* len == numnondigits + numdigits */ int numnondigits = 0; + /* Avoid exceeding SSIZE_T_MAX */ + if (prec > PY_SSIZE_T_MAX-3) { + PyErr_SetString(PyExc_OverflowError, + "precision too large"); + return NULL; + } + + switch (type) { case 'd': case 'u': Modified: python/branches/int_unification/Python/ceval.c ============================================================================== --- python/branches/int_unification/Python/ceval.c (original) +++ python/branches/int_unification/Python/ceval.c Thu Aug 24 19:42:10 2006 @@ -3819,7 +3819,7 @@ { if (v != NULL) { Py_ssize_t x; - if (PyInt_Check(v)) { + if (PyInt_CheckExact(v)) { /* XXX(nnorwitz): I think PyInt_AS_LONG is correct, however, it looks like it should be AsSsize_t. There should be a comment here explaining why. From python-checkins at python.org Thu Aug 24 19:44:49 2006 From: python-checkins at python.org (martin.v.loewis) Date: Thu, 24 Aug 2006 19:44:49 +0200 (CEST) Subject: [Python-checkins] r51563 - python/branches/int_unification/INTBENCH Message-ID: <20060824174449.CCBF91E4007@bag.python.org> Author: martin.v.loewis Date: Thu Aug 24 19:44:49 2006 New Revision: 51563 Modified: python/branches/int_unification/INTBENCH Log: Measure 51562. Modified: python/branches/int_unification/INTBENCH ============================================================================== --- python/branches/int_unification/INTBENCH (original) +++ python/branches/int_unification/INTBENCH Thu Aug 24 19:44:49 2006 @@ -31,3 +31,11 @@ Test 6: 3.775941s Test 7: 4.001805s +r51562 (special-case one-digit operations) +Test 1: 3.527860s +Test 2: 3.975953s +Test 3: 4.226751s +Test 4: 10.605721s +Test 5: 5.233576s +Test 6: 2.161525s +Test 7: 3.421624s From python-checkins at python.org Thu Aug 24 20:40:21 2006 From: python-checkins at python.org (thomas.wouters) Date: Thu, 24 Aug 2006 20:40:21 +0200 (CEST) Subject: [Python-checkins] r51565 - in python/trunk: Lib/test/test_array.py Misc/ACKS Modules/arraymodule.c Message-ID: <20060824184021.9F4011E400F@bag.python.org> Author: thomas.wouters Date: Thu Aug 24 20:40:20 2006 New Revision: 51565 Modified: python/trunk/Lib/test/test_array.py python/trunk/Misc/ACKS python/trunk/Modules/arraymodule.c Log: Fix SF bug #1545837: array.array borks on deepcopy. array.__deepcopy__() needs to take an argument, even if it doesn't actually use it. Will backport to 2.5 and 2.4 (if applicable.) Modified: python/trunk/Lib/test/test_array.py ============================================================================== --- python/trunk/Lib/test/test_array.py (original) +++ python/trunk/Lib/test/test_array.py Thu Aug 24 20:40:20 2006 @@ -85,6 +85,13 @@ self.assertNotEqual(id(a), id(b)) self.assertEqual(a, b) + def test_deepcopy(self): + import copy + a = array.array(self.typecode, self.example) + b = copy.deepcopy(a) + self.assertNotEqual(id(a), id(b)) + self.assertEqual(a, b) + def test_pickle(self): for protocol in (0, 1, 2): a = array.array(self.typecode, self.example) Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Thu Aug 24 20:40:20 2006 @@ -242,6 +242,7 @@ Michael Guravage Lars Gustäbel Barry Haddow +Václav Haisman Paul ten Hagen Rasmus Hahn Peter Haight Modified: python/trunk/Modules/arraymodule.c ============================================================================== --- python/trunk/Modules/arraymodule.c (original) +++ python/trunk/Modules/arraymodule.c Thu Aug 24 20:40:20 2006 @@ -1495,7 +1495,7 @@ copy_doc}, {"count", (PyCFunction)array_count, METH_O, count_doc}, - {"__deepcopy__",(PyCFunction)array_copy, METH_NOARGS, + {"__deepcopy__",(PyCFunction)array_copy, METH_O, copy_doc}, {"extend", (PyCFunction)array_extend, METH_O, extend_doc}, From python-checkins at python.org Thu Aug 24 20:55:01 2006 From: python-checkins at python.org (thomas.wouters) Date: Thu, 24 Aug 2006 20:55:01 +0200 (CEST) Subject: [Python-checkins] r51566 - in python/branches/release24-maint: Lib/test/test_array.py Misc/ACKS Modules/arraymodule.c Message-ID: <20060824185501.E582A1E4007@bag.python.org> Author: thomas.wouters Date: Thu Aug 24 20:55:01 2006 New Revision: 51566 Modified: python/branches/release24-maint/Lib/test/test_array.py python/branches/release24-maint/Misc/ACKS python/branches/release24-maint/Modules/arraymodule.c Log: Backport trunk's revision 51565: Fix SF bug #1545837: array.array borks on deepcopy. array.__deepcopy__() needs to take an argument, even if it doesn't actually use it. Will backport to 2.5 and 2.4 (if applicable.) Modified: python/branches/release24-maint/Lib/test/test_array.py ============================================================================== --- python/branches/release24-maint/Lib/test/test_array.py (original) +++ python/branches/release24-maint/Lib/test/test_array.py Thu Aug 24 20:55:01 2006 @@ -81,6 +81,13 @@ self.assertNotEqual(id(a), id(b)) self.assertEqual(a, b) + def test_deepcopy(self): + import copy + a = array.array(self.typecode, self.example) + b = copy.deepcopy(a) + self.assertNotEqual(id(a), id(b)) + self.assertEqual(a, b) + def test_insert(self): a = array.array(self.typecode, self.example) a.insert(0, self.example[0]) Modified: python/branches/release24-maint/Misc/ACKS ============================================================================== --- python/branches/release24-maint/Misc/ACKS (original) +++ python/branches/release24-maint/Misc/ACKS Thu Aug 24 20:55:01 2006 @@ -227,6 +227,7 @@ Michael Guravage Lars Gustäbel Barry Haddow +Václav Haisman Paul ten Hagen Rasmus Hahn Peter Haight Modified: python/branches/release24-maint/Modules/arraymodule.c ============================================================================== --- python/branches/release24-maint/Modules/arraymodule.c (original) +++ python/branches/release24-maint/Modules/arraymodule.c Thu Aug 24 20:55:01 2006 @@ -1468,7 +1468,7 @@ copy_doc}, {"count", (PyCFunction)array_count, METH_O, count_doc}, - {"__deepcopy__",(PyCFunction)array_copy, METH_NOARGS, + {"__deepcopy__",(PyCFunction)array_copy, METH_O, copy_doc}, {"extend", (PyCFunction)array_extend, METH_O, extend_doc}, From python-checkins at python.org Thu Aug 24 21:27:35 2006 From: python-checkins at python.org (thomas.wouters) Date: Thu, 24 Aug 2006 21:27:35 +0200 (CEST) Subject: [Python-checkins] r51568 - in python/branches/p3yk-noslice: Lib/test/test_array.py Lib/test/test_builtin.py Lib/test/test_bytes.py Lib/test/test_descrtut.py Modules/arraymodule.c Modules/mmapmodule.c Objects/abstract.c Objects/bufferobject.c Objects/bytesobject.c Objects/listobject.c Objects/stringobject.c Objects/structseq.c Objects/tupleobject.c Objects/typeobject.c Objects/unicodeobject.c Objects/weakrefobject.c TODO Message-ID: <20060824192735.BAD0F1E4004@bag.python.org> Author: thomas.wouters Date: Thu Aug 24 21:27:32 2006 New Revision: 51568 Modified: python/branches/p3yk-noslice/Lib/test/test_array.py python/branches/p3yk-noslice/Lib/test/test_builtin.py python/branches/p3yk-noslice/Lib/test/test_bytes.py python/branches/p3yk-noslice/Lib/test/test_descrtut.py python/branches/p3yk-noslice/Modules/arraymodule.c python/branches/p3yk-noslice/Modules/mmapmodule.c python/branches/p3yk-noslice/Objects/abstract.c python/branches/p3yk-noslice/Objects/bufferobject.c python/branches/p3yk-noslice/Objects/bytesobject.c python/branches/p3yk-noslice/Objects/listobject.c python/branches/p3yk-noslice/Objects/stringobject.c python/branches/p3yk-noslice/Objects/structseq.c python/branches/p3yk-noslice/Objects/tupleobject.c python/branches/p3yk-noslice/Objects/typeobject.c python/branches/p3yk-noslice/Objects/unicodeobject.c python/branches/p3yk-noslice/Objects/weakrefobject.c python/branches/p3yk-noslice/TODO Log: Checkpoint work. Only test_ctypes fails (because its sequence-like objects don't support slicing with sliceobjects.) - NULL-out most of the sq_slice and sq_ass_slice pointers in typestructs, just to make sure the MappingMethod versions are used everywhere (compiler warns about some unused static functions now.) - Stop exporting those functionpointers to Python as __*slice__. - Fix some bugs in the bytes type's extended (and non-extended) slicing. - Fix two bugs in list's extended slicing that were cancelling each other out (but causing unnecessary memmove()'s), and use memmove() instead of assignment in a loop where possible. - Optimize array.array's extended slicing for the step=1 case. Modified: python/branches/p3yk-noslice/Lib/test/test_array.py ============================================================================== --- python/branches/p3yk-noslice/Lib/test/test_array.py (original) +++ python/branches/p3yk-noslice/Lib/test/test_array.py Thu Aug 24 21:27:32 2006 @@ -530,11 +530,11 @@ ) a = array.array(self.typecode, self.example) - self.assertRaises(TypeError, a.__setslice__, 0, 0, None) + self.assertRaises(TypeError, a.__setitem__, slice(0, 0), None) self.assertRaises(TypeError, a.__setitem__, slice(0, 1), None) b = array.array(self.badtypecode()) - self.assertRaises(TypeError, a.__setslice__, 0, 0, b) + self.assertRaises(TypeError, a.__setitem__, slice(0, 0), b) self.assertRaises(TypeError, a.__setitem__, slice(0, 1), b) def test_index(self): Modified: python/branches/p3yk-noslice/Lib/test/test_builtin.py ============================================================================== --- python/branches/p3yk-noslice/Lib/test/test_builtin.py (original) +++ python/branches/p3yk-noslice/Lib/test/test_builtin.py Thu Aug 24 21:27:32 2006 @@ -389,7 +389,10 @@ unlink(TESTFN) self.assertRaises(TypeError, execfile) - self.assertRaises(TypeError, execfile, TESTFN, {}, ()) + # The inability of PyMapping_Check() to see tuples as + # non-mappings makes this test fail. + #self.assertRaises(TypeError, execfile, TESTFN, {}, ()) + self.assertRaises(TypeError, execfile, TESTFN, {}, 42) import os self.assertRaises(IOError, execfile, os.curdir) self.assertRaises(IOError, execfile, "I_dont_exist") Modified: python/branches/p3yk-noslice/Lib/test/test_bytes.py ============================================================================== --- python/branches/p3yk-noslice/Lib/test/test_bytes.py (original) +++ python/branches/p3yk-noslice/Lib/test/test_bytes.py Thu Aug 24 21:27:32 2006 @@ -163,6 +163,16 @@ self.assertEqual(b[-5:100], by("world")) self.assertEqual(b[-100:5], by("Hello")) + def test_extended_getslice(self): + L = range(20) + b = bytes(L) + indices = (None, 1, 5, 11, 19, 100, -1, -2, -5, -11, -19, -100) + for start in indices: + for stop in indices: + for step in indices: + idx = slice(start, stop, step) + self.assertEqual(b[idx], bytes(L[idx])) + def test_regexps(self): def by(s): return bytes(map(ord, s)) @@ -236,6 +246,35 @@ b[3:5] = [3, 4, 5, 6] self.assertEqual(b, bytes(range(10))) + def test_extended_set_del_slice(self): + indices = (None, 1, 5, 11, 19, 100, -1, -2, -5, -11, -19, -100) + for start in indices: + for step in indices: + for stop in indices: + L = list(range(20)) + b = bytes(L) + + idx = slice(start, stop, step) + start, stop, step = idx.indices(len(L)) + # This is taken from Pyslice_GetIndicesEx(), + # and should probably be exposed to Python + if ((step < 0 and start <= stop) or + (step > 0 and start >= stop)): + slicelen = 0 + elif step < 0: + slicelen = (stop - start + 1) // step + 1 + else: + slicelen = (stop - start - 1) // step + 1 + + data = list(range(100, 100 + slicelen)) + L[idx] = data + b[idx] = data + self.assertEquals(b, bytes(L)) + + del L[idx] + del b[idx] + self.assertEquals(b, bytes(L)) + def test_setslice_trap(self): # This test verifies that we correctly handle assigning self # to a slice of self (the old Lambert Meertens trap). Modified: python/branches/p3yk-noslice/Lib/test/test_descrtut.py ============================================================================== --- python/branches/p3yk-noslice/Lib/test/test_descrtut.py (original) +++ python/branches/p3yk-noslice/Lib/test/test_descrtut.py Thu Aug 24 21:27:32 2006 @@ -180,13 +180,11 @@ '__contains__', '__delattr__', '__delitem__', - '__delslice__', '__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__', - '__getslice__', '__gt__', '__hash__', '__iadd__', @@ -206,7 +204,6 @@ '__rmul__', '__setattr__', '__setitem__', - '__setslice__', '__str__', 'append', 'count', Modified: python/branches/p3yk-noslice/Modules/arraymodule.c ============================================================================== --- python/branches/p3yk-noslice/Modules/arraymodule.c (original) +++ python/branches/p3yk-noslice/Modules/arraymodule.c Thu Aug 24 21:27:32 2006 @@ -1582,7 +1582,12 @@ } if (i < 0) i += self->ob_size; - return array_item(self, i); + if (i < 0 || i >= self->ob_size) { + PyErr_SetString(PyExc_IndexError, + "array index out of range"); + return NULL; + } + return getarrayitem((PyObject *)self, i); } else if (PySlice_Check(item)) { Py_ssize_t start, stop, step, slicelength, cur, i; @@ -1598,6 +1603,16 @@ if (slicelength <= 0) { return newarrayobject(&Arraytype, 0, self->ob_descr); } + else if (step == 1) { + PyObject *result = newarrayobject(&Arraytype, + slicelength, self->ob_descr); + if (result == NULL) + return NULL; + memcpy(((arrayobject *)result)->ob_item, + self->ob_item + start * itemsize, + slicelength * itemsize); + return result; + } else { result = newarrayobject(&Arraytype, slicelength, self->ob_descr); if (!result) return NULL; @@ -1624,112 +1639,146 @@ static int array_ass_subscr(arrayobject* self, PyObject* item, PyObject* value) { + Py_ssize_t start, stop, step, slicelength, needed; + arrayobject* other; + int itemsize; + if (PyIndex_Check(item)) { Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); - if (i==-1 && PyErr_Occurred()) + + if (i == -1 && PyErr_Occurred()) return -1; if (i < 0) i += self->ob_size; - return array_ass_item(self, i, value); - } - else if (PySlice_Check(item)) { - Py_ssize_t start, stop, step, slicelength; - int itemsize = self->ob_descr->itemsize; - - if (PySlice_GetIndicesEx((PySliceObject*)item, self->ob_size, - &start, &stop, &step, &slicelength) < 0) { + if (i < 0 || i >= self->ob_size) { + PyErr_SetString(PyExc_IndexError, + "array assignment index out of range"); return -1; } - - /* treat A[slice(a,b)] = v _exactly_ like A[a:b] = v */ - if (step == 1 && ((PySliceObject*)item)->step == Py_None) - return array_ass_slice(self, start, stop, value); - if (value == NULL) { - /* delete slice */ - Py_ssize_t cur, i, extra; - - if (slicelength <= 0) - return 0; - - if (step < 0) { - stop = start + 1; - start = stop + step*(slicelength - 1) - 1; - step = -step; - } - - for (cur = start, i = 0; i < slicelength - 1; - cur += step, i++) { - memmove(self->ob_item + (cur - i)*itemsize, - self->ob_item + (cur + 1)*itemsize, - (step - 1) * itemsize); - } - extra = self->ob_size - (cur + 1); - if (extra > 0) { - memmove(self->ob_item + (cur - i)*itemsize, - self->ob_item + (cur + 1)*itemsize, - extra*itemsize); - } - - self->ob_size -= slicelength; - self->ob_item = (char *)PyMem_REALLOC(self->ob_item, - itemsize*self->ob_size); - self->allocated = self->ob_size; - - return 0; + /* Fall through to slice assignment */ + start = i; + stop = i + 1; + step = 1; + slicelength = 1; } - else { - /* assign slice */ - Py_ssize_t cur, i; - arrayobject* av; - - if (!array_Check(value)) { - PyErr_Format(PyExc_TypeError, - "must assign array (not \"%.200s\") to slice", - value->ob_type->tp_name); - return -1; - } - - av = (arrayobject*)value; - - if (av->ob_size != slicelength) { - PyErr_Format(PyExc_ValueError, - "attempt to assign array of size %ld to extended slice of size %ld", - /*XXX*/(long)av->ob_size, /*XXX*/(long)slicelength); + else + return (*self->ob_descr->setitem)(self, i, value); + } + else if (PySlice_Check(item)) { + if (PySlice_GetIndicesEx((PySliceObject *)item, + self->ob_size, &start, &stop, + &step, &slicelength) < 0) { + return -1; + } + } + else { + PyErr_SetString(PyExc_TypeError, + "array indices must be integer"); + return -1; + } + if (value == NULL) { + other = NULL; + needed = 0; + } + else if (array_Check(value)) { + other = (arrayobject *)value; + needed = other->ob_size; + if (self == other) { + /* Special case "self[i:j] = self" -- copy self first */ + int ret; + value = array_slice(other, 0, needed); + if (value == NULL) return -1; - } - - if (!slicelength) - return 0; - - /* protect against a[::-1] = a */ - if (self == av) { - value = array_slice(av, 0, av->ob_size); - av = (arrayobject*)value; - if (!av) - return -1; - } - else { - Py_INCREF(value); - } - - for (cur = start, i = 0; i < slicelength; - cur += step, i++) { - memcpy(self->ob_item + cur*itemsize, - av->ob_item + i*itemsize, - itemsize); - } - + ret = array_ass_subscr(self, item, value); Py_DECREF(value); - - return 0; + return ret; } - } + if (other->ob_descr != self->ob_descr) { + PyErr_BadArgument(); + return -1; + } + } else { - PyErr_SetString(PyExc_TypeError, - "list indices must be integers"); + PyErr_Format(PyExc_TypeError, + "can only assign array (not \"%.200s\") to array slice", + value->ob_type->tp_name); return -1; } + itemsize = self->ob_descr->itemsize; + /* for 'a[2:1] = ...', the insertion point is 'start', not 'stop' */ + if ((step > 0 && stop < start) || + (step < 0 && stop > start)) + stop = start; + if (step == 1) { + if (slicelength > needed) { + memmove(self->ob_item + (start + needed) * itemsize, + self->ob_item + stop * itemsize, + (self->ob_size - stop) * itemsize); + if (array_resize(self, self->ob_size + + needed - slicelength) < 0) + return -1; + } + else if (slicelength < needed) { + if (array_resize(self, self->ob_size + + needed - slicelength) < 0) + return -1; + memmove(self->ob_item + (start + needed) * itemsize, + self->ob_item + stop * itemsize, + (self->ob_size - start - needed) * itemsize); + } + if (needed > 0) + memcpy(self->ob_item + start * itemsize, + other->ob_item, needed * itemsize); + return 0; + } + else if (needed == 0) { + /* Delete slice */ + Py_ssize_t cur, i; + + if (step < 0) { + stop = start + 1; + start = stop + step * (slicelength - 1) - 1; + step = -step; + } + for (cur = start, i = 0; i < slicelength; + cur += step, i++) { + Py_ssize_t lim = step - 1; + + if (cur + step >= self->ob_size) + lim = self->ob_size - cur - 1; + memmove(self->ob_item + (cur - i) * itemsize, + self->ob_item + (cur + 1) * itemsize, + lim * itemsize); + } + cur = start + slicelength * step; + if (cur < self->ob_size) { + memmove(self->ob_item + (cur-slicelength) * itemsize, + self->ob_item + cur * itemsize, + (self->ob_size - cur) * itemsize); + } + if (array_resize(self, self->ob_size - slicelength) < 0) + return -1; + return 0; + } + else { + Py_ssize_t cur, i; + + if (needed != slicelength) { + PyErr_Format(PyExc_ValueError, + "attempt to assign array of size %zd " + "to extended slice of size %zd", + needed, slicelength); + return -1; + } + for (cur = start, i = 0; i < slicelength; + cur += step, i++) { + memcpy(self->ob_item + cur * itemsize, + other->ob_item + i * itemsize, + itemsize); + } + return 0; + } } static PyMappingMethods array_as_mapping = { @@ -1775,9 +1824,9 @@ (binaryfunc)array_concat, /*sq_concat*/ (ssizeargfunc)array_repeat, /*sq_repeat*/ (ssizeargfunc)array_item, /*sq_item*/ - (ssizessizeargfunc)array_slice, /*sq_slice*/ + 0, /*sq_slice*/ (ssizeobjargproc)array_ass_item, /*sq_ass_item*/ - (ssizessizeobjargproc)array_ass_slice, /*sq_ass_slice*/ + 0, /*sq_ass_slice*/ (objobjproc)array_contains, /*sq_contains*/ (binaryfunc)array_inplace_concat, /*sq_inplace_concat*/ (ssizeargfunc)array_inplace_repeat /*sq_inplace_repeat*/ Modified: python/branches/p3yk-noslice/Modules/mmapmodule.c ============================================================================== --- python/branches/p3yk-noslice/Modules/mmapmodule.c (original) +++ python/branches/p3yk-noslice/Modules/mmapmodule.c Thu Aug 24 21:27:32 2006 @@ -913,9 +913,9 @@ (binaryfunc)mmap_concat, /*sq_concat*/ (ssizeargfunc)mmap_repeat, /*sq_repeat*/ (ssizeargfunc)mmap_item, /*sq_item*/ - (ssizessizeargfunc)mmap_slice, /*sq_slice*/ + 0, /*sq_slice*/ (ssizeobjargproc)mmap_ass_item, /*sq_ass_item*/ - (ssizessizeobjargproc)mmap_ass_slice, /*sq_ass_slice*/ + 0, /*sq_ass_slice*/ }; static PyMappingMethods mmap_as_mapping = { Modified: python/branches/p3yk-noslice/Objects/abstract.c ============================================================================== --- python/branches/p3yk-noslice/Objects/abstract.c (original) +++ python/branches/p3yk-noslice/Objects/abstract.c Thu Aug 24 21:27:32 2006 @@ -1192,26 +1192,12 @@ PyObject * PySequence_GetSlice(PyObject *s, Py_ssize_t i1, Py_ssize_t i2) { - PySequenceMethods *m; PyMappingMethods *mp; if (!s) return null_error(); - m = s->ob_type->tp_as_sequence; - if (m && m->sq_slice) { - if (i1 < 0 || i2 < 0) { - if (m->sq_length) { - Py_ssize_t l = (*m->sq_length)(s); - if (l < 0) - return NULL; - if (i1 < 0) - i1 += l; - if (i2 < 0) - i2 += l; - } - } - return m->sq_slice(s, i1, i2); - } else if ((mp = s->ob_type->tp_as_mapping) && mp->mp_subscript) { + mp = s->ob_type->tp_as_mapping; + if (mp->mp_subscript) { PyObject *res; PyObject *slice = _PySlice_FromIndices(i1, i2); if (!slice) @@ -1281,7 +1267,6 @@ int PySequence_SetSlice(PyObject *s, Py_ssize_t i1, Py_ssize_t i2, PyObject *o) { - PySequenceMethods *m; PyMappingMethods *mp; if (s == NULL) { @@ -1289,21 +1274,8 @@ return -1; } - m = s->ob_type->tp_as_sequence; - if (m && m->sq_ass_slice) { - if (i1 < 0 || i2 < 0) { - if (m->sq_length) { - Py_ssize_t l = (*m->sq_length)(s); - if (l < 0) - return -1; - if (i1 < 0) - i1 += l; - if (i2 < 0) - i2 += l; - } - } - return m->sq_ass_slice(s, i1, i2, o); - } else if ((mp = s->ob_type->tp_as_mapping) && mp->mp_ass_subscript) { + mp = s->ob_type->tp_as_mapping; + if (mp->mp_ass_subscript) { int res; PyObject *slice = _PySlice_FromIndices(i1, i2); if (!slice) @@ -1320,27 +1292,22 @@ int PySequence_DelSlice(PyObject *s, Py_ssize_t i1, Py_ssize_t i2) { - PySequenceMethods *m; + PyMappingMethods *mp; if (s == NULL) { null_error(); return -1; } - m = s->ob_type->tp_as_sequence; - if (m && m->sq_ass_slice) { - if (i1 < 0 || i2 < 0) { - if (m->sq_length) { - Py_ssize_t l = (*m->sq_length)(s); - if (l < 0) - return -1; - if (i1 < 0) - i1 += l; - if (i2 < 0) - i2 += l; - } - } - return m->sq_ass_slice(s, i1, i2, (PyObject *)NULL); + mp = s->ob_type->tp_as_mapping; + if (mp->mp_ass_subscript) { + int res; + PyObject *slice = _PySlice_FromIndices(i1, i2); + if (!slice) + return -1; + res = mp->mp_ass_subscript(s, slice, NULL); + Py_DECREF(slice); + return res; } type_error("'%.200s' object doesn't support slice deletion", s); return -1; @@ -1614,9 +1581,7 @@ PyMapping_Check(PyObject *o) { return o && o->ob_type->tp_as_mapping && - o->ob_type->tp_as_mapping->mp_subscript && - !(o->ob_type->tp_as_sequence && - o->ob_type->tp_as_sequence->sq_slice); + o->ob_type->tp_as_mapping->mp_subscript; } Py_ssize_t Modified: python/branches/p3yk-noslice/Objects/bufferobject.c ============================================================================== --- python/branches/p3yk-noslice/Objects/bufferobject.c (original) +++ python/branches/p3yk-noslice/Objects/bufferobject.c Thu Aug 24 21:27:32 2006 @@ -638,7 +638,6 @@ void *ptr1, *ptr2; Py_ssize_t selfsize; Py_ssize_t othersize; - Py_ssize_t start, stop, step, slicelength; if ( self->b_readonly ) { PyErr_SetString(PyExc_TypeError, @@ -709,8 +708,6 @@ } else { Py_ssize_t cur, i; - char *resultbuf = (char *)ptr1; - char *sourcebuf = (char *)ptr2; for (cur = start, i = 0; i < slicelength; cur += step, i++) { @@ -796,9 +793,9 @@ (binaryfunc)buffer_concat, /*sq_concat*/ (ssizeargfunc)buffer_repeat, /*sq_repeat*/ (ssizeargfunc)buffer_item, /*sq_item*/ - (ssizessizeargfunc)buffer_slice, /*sq_slice*/ + 0, /*sq_slice*/ (ssizeobjargproc)buffer_ass_item, /*sq_ass_item*/ - (ssizessizeobjargproc)buffer_ass_slice, /*sq_ass_slice*/ + 0, /*sq_ass_slice*/ }; static PyMappingMethods buffer_as_mapping = { Modified: python/branches/p3yk-noslice/Objects/bytesobject.c ============================================================================== --- python/branches/p3yk-noslice/Objects/bytesobject.c (original) +++ python/branches/p3yk-noslice/Objects/bytesobject.c Thu Aug 24 21:27:32 2006 @@ -459,7 +459,8 @@ stop = i + 1; step = 1; slicelen = 1; - } else { + } + else { Py_ssize_t ival = PyNumber_AsSsize_t(values, PyExc_ValueError); if (ival == -1 && PyErr_Occurred()) return -1; @@ -503,7 +504,10 @@ bytes = ((PyBytesObject *)values)->ob_bytes; needed = ((PyBytesObject *)values)->ob_size; } - + /* Make sure b[5:2] = ... inserts before 5, not before 2. */ + if ((step < 0 && start < stop) || + (step > 0 && start > stop)) + stop = start; if (step == 1) { if (slicelen != needed) { if (slicelen > needed) { @@ -548,7 +552,7 @@ } for (cur = start, i = 0; i < slicelen; cur += step, i++) { - Py_ssize_t lim = step; + Py_ssize_t lim = step - 1; if (cur + step >= PyBytes_GET_SIZE(self)) lim = PyBytes_GET_SIZE(self) - cur - 1; @@ -557,10 +561,12 @@ self->ob_bytes + cur + 1, lim); } /* Move the tail of the bytes, in one chunk */ - cur = start + slicelen*step + 1; - memmove(self->ob_bytes + cur - slicelen, - self->ob_bytes + cur, - PyBytes_GET_SIZE(self) - cur); + cur = start + slicelen*step; + if (cur < PyBytes_GET_SIZE(self)) { + memmove(self->ob_bytes + cur - slicelen, + self->ob_bytes + cur, + PyBytes_GET_SIZE(self) - cur); + } if (PyBytes_Resize((PyObject *)self, PyBytes_GET_SIZE(self) - slicelen) < 0) return -1; @@ -981,9 +987,9 @@ (binaryfunc)bytes_concat, /*sq_concat*/ (ssizeargfunc)bytes_repeat, /*sq_repeat*/ (ssizeargfunc)bytes_getitem, /*sq_item*/ - (ssizessizeargfunc)bytes_getslice, /*sq_slice*/ + 0, /*sq_slice*/ (ssizeobjargproc)bytes_setitem, /*sq_ass_item*/ - (ssizessizeobjargproc)bytes_setslice, /* sq_ass_slice */ + 0, /* sq_ass_slice */ (objobjproc)bytes_contains, /* sq_contains */ (binaryfunc)bytes_iconcat, /* sq_inplace_concat */ (ssizeargfunc)bytes_irepeat, /* sq_inplace_repeat */ Modified: python/branches/p3yk-noslice/Objects/listobject.c ============================================================================== --- python/branches/p3yk-noslice/Objects/listobject.c (original) +++ python/branches/p3yk-noslice/Objects/listobject.c Thu Aug 24 21:27:32 2006 @@ -2432,9 +2432,9 @@ (binaryfunc)list_concat, /* sq_concat */ (ssizeargfunc)list_repeat, /* sq_repeat */ (ssizeargfunc)list_item, /* sq_item */ - (ssizessizeargfunc)list_slice, /* sq_slice */ + 0, /* sq_slice */ (ssizeobjargproc)list_ass_item, /* sq_ass_item */ - (ssizessizeobjargproc)list_ass_slice, /* sq_ass_slice */ + 0, /* sq_ass_slice */ (objobjproc)list_contains, /* sq_contains */ (binaryfunc)list_inplace_concat, /* sq_inplace_concat */ (ssizeargfunc)list_inplace_repeat, /* sq_inplace_repeat */ @@ -2470,6 +2470,9 @@ if (slicelength <= 0) { return PyList_New(0); } + else if (step == 1) { + return list_slice(self, start, stop); + } else { result = PyList_New(slicelength); if (!result) return NULL; @@ -2516,6 +2519,12 @@ if (step == 1 && ((PySliceObject*)item)->step == Py_None) return list_ass_slice(self, start, stop, value); + /* Make sure s[5:2] = [..] inserts at the right place: + before 5, not before 2. */ + if ((step < 0 && start < stop) || + (step > 0 && start > stop)) + stop = start; + if (value == NULL) { /* delete slice */ PyObject **garbage; @@ -2542,7 +2551,7 @@ for (cur = start, i = 0; cur < stop; cur += step, i++) { - Py_ssize_t lim = step; + Py_ssize_t lim = step - 1; garbage[i] = PyList_GET_ITEM(self, cur); @@ -2554,11 +2563,11 @@ self->ob_item + cur + 1, lim * sizeof(PyObject *)); } - - for (cur = start + slicelength*step + 1; - cur < self->ob_size; cur++) { - PyList_SET_ITEM(self, cur - slicelength, - PyList_GET_ITEM(self, cur)); + cur = start + slicelength*step; + if (cur < self->ob_size) { + memmove(self->ob_item + cur - slicelength, + self->ob_item + cur, + (self->ob_size - cur) * sizeof(PyObject *)); } self->ob_size -= slicelength; Modified: python/branches/p3yk-noslice/Objects/stringobject.c ============================================================================== --- python/branches/p3yk-noslice/Objects/stringobject.c (original) +++ python/branches/p3yk-noslice/Objects/stringobject.c Thu Aug 24 21:27:32 2006 @@ -1290,7 +1290,7 @@ (binaryfunc)string_concat, /*sq_concat*/ (ssizeargfunc)string_repeat, /*sq_repeat*/ (ssizeargfunc)string_item, /*sq_item*/ - (ssizessizeargfunc)string_slice, /*sq_slice*/ + 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ (objobjproc)string_contains /*sq_contains*/ Modified: python/branches/p3yk-noslice/Objects/structseq.c ============================================================================== --- python/branches/p3yk-noslice/Objects/structseq.c (original) +++ python/branches/p3yk-noslice/Objects/structseq.c Thu Aug 24 21:27:32 2006 @@ -340,7 +340,7 @@ (binaryfunc)structseq_concat, /* sq_concat */ (ssizeargfunc)structseq_repeat, /* sq_repeat */ (ssizeargfunc)structseq_item, /* sq_item */ - (ssizessizeargfunc)structseq_slice, /* sq_slice */ + 0, /* sq_slice */ 0, /* sq_ass_item */ 0, /* sq_ass_slice */ (objobjproc)structseq_contains, /* sq_contains */ Modified: python/branches/p3yk-noslice/Objects/tupleobject.c ============================================================================== --- python/branches/p3yk-noslice/Objects/tupleobject.c (original) +++ python/branches/p3yk-noslice/Objects/tupleobject.c Thu Aug 24 21:27:32 2006 @@ -571,7 +571,7 @@ (binaryfunc)tupleconcat, /* sq_concat */ (ssizeargfunc)tuplerepeat, /* sq_repeat */ (ssizeargfunc)tupleitem, /* sq_item */ - (ssizessizeargfunc)tupleslice, /* sq_slice */ + 0, /* sq_slice */ 0, /* sq_ass_item */ 0, /* sq_ass_slice */ (objobjproc)tuplecontains, /* sq_contains */ Modified: python/branches/p3yk-noslice/Objects/typeobject.c ============================================================================== --- python/branches/p3yk-noslice/Objects/typeobject.c (original) +++ python/branches/p3yk-noslice/Objects/typeobject.c Thu Aug 24 21:27:32 2006 @@ -1512,11 +1512,10 @@ PyObject *tmp = slots; PyObject *o, *o1; Py_ssize_t i; - ssizessizeargfunc copy = slots->ob_type->tp_as_sequence->sq_slice; for (i = 0; i < nslots; i++) { if (PyUnicode_Check(o = PyTuple_GET_ITEM(tmp, i))) { if (tmp == slots) { - tmp = copy(slots, 0, PyTuple_GET_SIZE(slots)); + tmp = PySequence_GetSlice(slots, 0, PyTuple_GET_SIZE(slots)); if (tmp == NULL) return NULL; } @@ -2952,9 +2951,7 @@ COPYSEQ(sq_concat); COPYSEQ(sq_repeat); COPYSEQ(sq_item); - COPYSEQ(sq_slice); COPYSEQ(sq_ass_item); - COPYSEQ(sq_ass_slice); COPYSEQ(sq_contains); COPYSEQ(sq_inplace_concat); COPYSEQ(sq_inplace_repeat); @@ -3529,22 +3526,6 @@ return Py_None; } -static PyObject * -wrap_delslice(PyObject *self, PyObject *args, void *wrapped) -{ - ssizessizeobjargproc func = (ssizessizeobjargproc)wrapped; - Py_ssize_t i, j; - int res; - - if (!PyArg_ParseTuple(args, "nn", &i, &j)) - return NULL; - res = (*func)(self, i, j, NULL); - if (res == -1 && PyErr_Occurred()) - return NULL; - Py_INCREF(Py_None); - return Py_None; -} - /* XXX objobjproc is a misnomer; should be objargpred */ static PyObject * wrap_objobjproc(PyObject *self, PyObject *args, void *wrapped) @@ -4067,8 +4048,6 @@ return NULL; } -SLOT2(slot_sq_slice, "__getslice__", Py_ssize_t, Py_ssize_t, "nn") - static int slot_sq_ass_item(PyObject *self, Py_ssize_t index, PyObject *value) { @@ -4088,24 +4067,6 @@ } static int -slot_sq_ass_slice(PyObject *self, Py_ssize_t i, Py_ssize_t j, PyObject *value) -{ - PyObject *res; - static PyObject *delslice_str, *setslice_str; - - if (value == NULL) - res = call_method(self, "__delslice__", &delslice_str, - "(nn)", i, j); - else - res = call_method(self, "__setslice__", &setslice_str, - "(nnO)", i, j, value); - if (res == NULL) - return -1; - Py_DECREF(res); - return 0; -} - -static int slot_sq_contains(PyObject *self, PyObject *value) { PyObject *func, *res, *args; @@ -4810,23 +4771,10 @@ "x.__rmul__(n) <==> n*x"), SQSLOT("__getitem__", sq_item, slot_sq_item, wrap_sq_item, "x.__getitem__(y) <==> x[y]"), - SQSLOT("__getslice__", sq_slice, slot_sq_slice, wrap_ssizessizeargfunc, - "x.__getslice__(i, j) <==> x[i:j]\n\ - \n\ - Use of negative indices is not supported."), SQSLOT("__setitem__", sq_ass_item, slot_sq_ass_item, wrap_sq_setitem, "x.__setitem__(i, y) <==> x[i]=y"), SQSLOT("__delitem__", sq_ass_item, slot_sq_ass_item, wrap_sq_delitem, "x.__delitem__(y) <==> del x[y]"), - SQSLOT("__setslice__", sq_ass_slice, slot_sq_ass_slice, - wrap_ssizessizeobjargproc, - "x.__setslice__(i, j, y) <==> x[i:j]=y\n\ - \n\ - Use of negative indices is not supported."), - SQSLOT("__delslice__", sq_ass_slice, slot_sq_ass_slice, wrap_delslice, - "x.__delslice__(i, j) <==> del x[i:j]\n\ - \n\ - Use of negative indices is not supported."), SQSLOT("__contains__", sq_contains, slot_sq_contains, wrap_objobjproc, "x.__contains__(y) <==> y in x"), SQSLOT("__iadd__", sq_inplace_concat, NULL, Modified: python/branches/p3yk-noslice/Objects/unicodeobject.c ============================================================================== --- python/branches/p3yk-noslice/Objects/unicodeobject.c (original) +++ python/branches/p3yk-noslice/Objects/unicodeobject.c Thu Aug 24 21:27:32 2006 @@ -7054,7 +7054,7 @@ PyUnicode_Concat, /* sq_concat */ (ssizeargfunc) unicode_repeat, /* sq_repeat */ (ssizeargfunc) unicode_getitem, /* sq_item */ - (ssizessizeargfunc) unicode_slice, /* sq_slice */ + 0, /* sq_slice */ 0, /* sq_ass_item */ 0, /* sq_ass_slice */ PyUnicode_Contains, /* sq_contains */ Modified: python/branches/p3yk-noslice/Objects/weakrefobject.c ============================================================================== --- python/branches/p3yk-noslice/Objects/weakrefobject.c (original) +++ python/branches/p3yk-noslice/Objects/weakrefobject.c Thu Aug 24 21:27:32 2006 @@ -525,14 +525,6 @@ } static int -proxy_ass_slice(PyWeakReference *proxy, Py_ssize_t i, Py_ssize_t j, PyObject *value) -{ - if (!proxy_checkref(proxy)) - return -1; - return PySequence_SetSlice(PyWeakref_GET_OBJECT(proxy), i, j, value); -} - -static int proxy_contains(PyWeakReference *proxy, PyObject *value) { if (!proxy_checkref(proxy)) @@ -624,9 +616,9 @@ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ - (ssizessizeargfunc)proxy_slice, /*sq_slice*/ + 0, /*sq_slice*/ 0, /*sq_ass_item*/ - (ssizessizeobjargproc)proxy_ass_slice, /*sq_ass_slice*/ + 0, /*sq_ass_slice*/ (objobjproc)proxy_contains, /* sq_contains */ }; Modified: python/branches/p3yk-noslice/TODO ============================================================================== --- python/branches/p3yk-noslice/TODO (original) +++ python/branches/p3yk-noslice/TODO Thu Aug 24 21:27:32 2006 @@ -4,12 +4,12 @@ - Fix compiler-package to avoid SLICE opcodes - Add tests for the extended slicing abilities of: buffer - bytes mmap.mmap structseq - Add extended slicing (or at least slice-object support) to ctypes objects + - Make list's mp_[ass_]subscr not depend on list_[ass]slice - Remove slice API (or emulate it ontop of sliceobject API) - - Remove slice/ass_slice PySequenceMethod hooks + - Further remove slice/ass_slice PySequenceMethod hooks - Figure out what to do with PyMapping_Check (it uses the presence of the classic slicing hook to tell sequences-with-extended-slicing from mappings.) From python-checkins at python.org Thu Aug 24 22:36:49 2006 From: python-checkins at python.org (thomas.wouters) Date: Thu, 24 Aug 2006 22:36:49 +0200 (CEST) Subject: [Python-checkins] r51570 - python/branches/p3yk-noslice/Include/object.h Message-ID: <20060824203649.D26631E4007@bag.python.org> Author: thomas.wouters Date: Thu Aug 24 22:36:48 2006 New Revision: 51570 Modified: python/branches/p3yk-noslice/Include/object.h Log: Rename the sq_slice and sq_ass_slice PySequenceMethod members. Modified: python/branches/p3yk-noslice/Include/object.h ============================================================================== --- python/branches/p3yk-noslice/Include/object.h (original) +++ python/branches/p3yk-noslice/Include/object.h Thu Aug 24 22:36:48 2006 @@ -198,9 +198,9 @@ binaryfunc sq_concat; ssizeargfunc sq_repeat; ssizeargfunc sq_item; - ssizessizeargfunc sq_slice; + void *was_sq_slice; ssizeobjargproc sq_ass_item; - ssizessizeobjargproc sq_ass_slice; + void *was_sq_ass_slice; objobjproc sq_contains; binaryfunc sq_inplace_concat; From python-checkins at python.org Thu Aug 24 22:59:12 2006 From: python-checkins at python.org (thomas.wouters) Date: Thu, 24 Aug 2006 22:59:12 +0200 (CEST) Subject: [Python-checkins] r51571 - in python/branches/p3yk-noslice: Lib/compiler/pyassem.py Lib/compiler/pycodegen.py Lib/compiler/transformer.py Lib/test/test_compiler.py TODO Message-ID: <20060824205912.6CF4B1E4004@bag.python.org> Author: thomas.wouters Date: Thu Aug 24 22:59:09 2006 New Revision: 51571 Modified: python/branches/p3yk-noslice/Lib/compiler/pyassem.py python/branches/p3yk-noslice/Lib/compiler/pycodegen.py python/branches/p3yk-noslice/Lib/compiler/transformer.py python/branches/p3yk-noslice/Lib/test/test_compiler.py python/branches/p3yk-noslice/TODO Log: Rip out the compiler-package's *SLICE opcode generation. It could probably do with some more cleanup, but this at least works. Modified: python/branches/p3yk-noslice/Lib/compiler/pyassem.py ============================================================================== --- python/branches/p3yk-noslice/Lib/compiler/pyassem.py (original) +++ python/branches/p3yk-noslice/Lib/compiler/pyassem.py Thu Aug 24 22:59:09 2006 @@ -745,17 +745,6 @@ 'POP_TOP': -1, 'DUP_TOP': 1, 'LIST_APPEND': -2, - 'SLICE+1': -1, - 'SLICE+2': -1, - 'SLICE+3': -2, - 'STORE_SLICE+0': -1, - 'STORE_SLICE+1': -2, - 'STORE_SLICE+2': -2, - 'STORE_SLICE+3': -3, - 'DELETE_SLICE+0': -1, - 'DELETE_SLICE+1': -2, - 'DELETE_SLICE+2': -2, - 'DELETE_SLICE+3': -3, 'STORE_SUBSCR': -3, 'DELETE_SUBSCR': -2, # PRINT_EXPR? Modified: python/branches/p3yk-noslice/Lib/compiler/pycodegen.py ============================================================================== --- python/branches/p3yk-noslice/Lib/compiler/pycodegen.py (original) +++ python/branches/p3yk-noslice/Lib/compiler/pycodegen.py Thu Aug 24 22:59:09 2006 @@ -1019,23 +1019,6 @@ self.emit('ROT_TWO') self.emit('STORE_ATTR', self.mangle(node.attrname)) - def visitAugSlice(self, node, mode): - if mode == "load": - self.visitSlice(node, 1) - elif mode == "store": - slice = 0 - if node.lower: - slice = slice | 1 - if node.upper: - slice = slice | 2 - if slice == 0: - self.emit('ROT_TWO') - elif slice == 3: - self.emit('ROT_FOUR') - else: - self.emit('ROT_THREE') - self.emit('STORE_SLICE+%d' % slice) - def visitAugSubscript(self, node, mode): if mode == "load": self.visitSubscript(node, 1) @@ -1108,34 +1091,7 @@ self.visit(node.value) self.emit('YIELD_VALUE') - # slice and subscript stuff - - def visitSlice(self, node, aug_flag=None): - # aug_flag is used by visitAugSlice - self.visit(node.expr) - slice = 0 - if node.lower: - self.visit(node.lower) - slice = slice | 1 - if node.upper: - self.visit(node.upper) - slice = slice | 2 - if aug_flag: - if slice == 0: - self.emit('DUP_TOP') - elif slice == 3: - self.emit('DUP_TOPX', 3) - else: - self.emit('DUP_TOPX', 2) - if node.flags == 'OP_APPLY': - self.emit('SLICE+%d' % slice) - elif node.flags == 'OP_ASSIGN': - self.emit('STORE_SLICE+%d' % slice) - elif node.flags == 'OP_DELETE': - self.emit('DELETE_SLICE+%d' % slice) - else: - print "weird slice", node.flags - raise + # subscript stuff def visitSubscript(self, node, aug_flag=None): self.visit(node.expr) @@ -1508,16 +1464,12 @@ class AugName(Delegator): pass -class AugSlice(Delegator): - pass - class AugSubscript(Delegator): pass wrapper = { ast.Getattr: AugGetattr, ast.Name: AugName, - ast.Slice: AugSlice, ast.Subscript: AugSubscript, } Modified: python/branches/p3yk-noslice/Lib/compiler/transformer.py ============================================================================== --- python/branches/p3yk-noslice/Lib/compiler/transformer.py (original) +++ python/branches/p3yk-noslice/Lib/compiler/transformer.py Thu Aug 24 22:59:09 2006 @@ -977,7 +977,7 @@ Names, slices, and attributes are the only allowable nodes. """ l = self.com_node(node) - if l.__class__ in (Name, Slice, Subscript, Getattr): + if l.__class__ in (Name, Subscript, Getattr): return l raise SyntaxError, "can't assign to %s" % l.__class__.__name__ @@ -1272,14 +1272,6 @@ # extended_slicing: primary "[" slice_list "]" # slice_list: slice_item ("," slice_item)* [","] - # backwards compat slice for '[i:j]' - if len(nodelist) == 2: - sub = nodelist[1] - if (sub[1][0] == token.COLON or \ - (len(sub) > 2 and sub[2][0] == token.COLON)) and \ - sub[-1][0] != symbol.sliceop: - return self.com_slice(primary, sub, assigning) - subscripts = [] for i in range(1, len(nodelist), 2): subscripts.append(self.com_subscript(nodelist[i])) @@ -1332,20 +1324,6 @@ items.append(self.com_node(ch[2])) return Sliceobj(items, lineno=extractLineNo(node)) - def com_slice(self, primary, node, assigning): - # short_slice: [lower_bound] ":" [upper_bound] - lower = upper = None - if len(node) == 3: - if node[1][0] == token.COLON: - upper = self.com_node(node[2]) - else: - lower = self.com_node(node[1]) - elif len(node) == 4: - lower = self.com_node(node[1]) - upper = self.com_node(node[3]) - return Slice(primary, assigning, lower, upper, - lineno=extractLineNo(node)) - def get_docstring(self, node, n=None): if n is None: n = node[0] Modified: python/branches/p3yk-noslice/Lib/test/test_compiler.py ============================================================================== --- python/branches/p3yk-noslice/Lib/test/test_compiler.py (original) +++ python/branches/p3yk-noslice/Lib/test/test_compiler.py Thu Aug 24 22:59:09 2006 @@ -124,7 +124,8 @@ self.assertEquals(eval(c), [(0, 3), (1, 3), (2, 3)]) -NOLINENO = (compiler.ast.Module, compiler.ast.Stmt, compiler.ast.Discard) +NOLINENO = (compiler.ast.Module, compiler.ast.Stmt, compiler.ast.Discard, + compiler.ast.Const) ############################################################################### # code below is just used to trigger some possible errors, for the benefit of Modified: python/branches/p3yk-noslice/TODO ============================================================================== --- python/branches/p3yk-noslice/TODO (original) +++ python/branches/p3yk-noslice/TODO Thu Aug 24 22:59:09 2006 @@ -1,7 +1,7 @@ TODO in slice removal: - - Fix compiler-package to avoid SLICE opcodes + - Clean up compilerpackage's code now that SLICE opcodes are gone - Add tests for the extended slicing abilities of: buffer mmap.mmap From python-checkins at python.org Fri Aug 25 00:47:44 2006 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 25 Aug 2006 00:47:44 +0200 (CEST) Subject: [Python-checkins] r51573 - python/branches/int_unification/Objects/longobject.c Message-ID: <20060824224744.96F291E4015@bag.python.org> Author: martin.v.loewis Date: Fri Aug 25 00:47:43 2006 New Revision: 51573 Modified: python/branches/int_unification/Objects/longobject.c Log: Don't allocate padding in PyLongObject. Slightly speed up PyLong_FromLong. Modified: python/branches/int_unification/Objects/longobject.c ============================================================================== --- python/branches/int_unification/Objects/longobject.c (original) +++ python/branches/int_unification/Objects/longobject.c Fri Aug 25 00:47:43 2006 @@ -114,12 +114,15 @@ _PyLong_New(Py_ssize_t size) { PyLongObject *result; - if (size > PY_SSIZE_T_MAX) { - PyErr_NoMemory(); - return NULL; - } - result = PyObject_MALLOC(sizeof(PyLongObject) + - (size-1)*sizeof(digit)); + /* Can't use sizeof(PyLongObject) here, since the + compiler takes padding at the end into account. + As the consequence, this would waste 2 bytes on + a 32-bit system, and 6 bytes on a 64-bit system. + This computation would be incorrect on systems + which have padding before the digits; with 16-bit + digits this should not happen. */ + result = PyObject_MALLOC(sizeof(PyVarObject) + + size*sizeof(digit)); if (!result) { PyErr_NoMemory(); return NULL; @@ -160,28 +163,37 @@ PyLongObject *v; unsigned long t; /* unsigned so >> doesn't propagate sign bit */ int ndigits = 0; - int negative = 0; + int sign = 1; CHECK_SMALL_INT(ival); + if (ival < 0) { ival = -ival; - negative = 1; + sign = -1; } - if (ival < BASE) { - /* Fast path for single-digits ints */ + /* Fast path for single-digits ints */ + if (!(ival>>SHIFT)) { v = _PyLong_New(1); if (v) { - v->ob_size = negative ? -1 : 1; + v->ob_size = sign; v->ob_digit[0] = ival; } return (PyObject*)v; } - /* Count the number of Python digits. - We used to pick 5 ("big enough for anything"), but that's a - waste of time and space given that 5*15 = 75 bits are rarely - needed. */ + /* 2 digits */ + if (!(ival >> 2*SHIFT)) { + v = _PyLong_New(2); + if (v) { + v->ob_size = 2*sign; + v->ob_digit[0] = (digit)ival & MASK; + v->ob_digit[1] = ival >> SHIFT; + } + return (PyObject*)v; + } + + /* Larger numbers: loop to determine number of digits */ t = (unsigned long)ival; while (t) { ++ndigits; @@ -190,7 +202,7 @@ v = _PyLong_New(ndigits); if (v != NULL) { digit *p = v->ob_digit; - v->ob_size = negative ? -ndigits : ndigits; + v->ob_size = ndigits*sign; t = (unsigned long)ival; while (t) { *p++ = (digit)(t & MASK); @@ -3496,7 +3508,9 @@ PyObject_HEAD_INIT(&PyType_Type) 0, /* ob_size */ "long", /* tp_name */ - sizeof(PyLongObject) - sizeof(digit), /* tp_basicsize */ + /* See _PyLong_New for why this isn't + sizeof(PyLongObject) - sizeof(digit) */ + sizeof(PyVarObject), /* tp_basicsize */ sizeof(digit), /* tp_itemsize */ long_dealloc, /* tp_dealloc */ 0, /* tp_print */ From python-checkins at python.org Fri Aug 25 00:59:10 2006 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 25 Aug 2006 00:59:10 +0200 (CEST) Subject: [Python-checkins] r51574 - python/branches/int_unification/INTBENCH Message-ID: <20060824225910.C6DD61E4004@bag.python.org> Author: martin.v.loewis Date: Fri Aug 25 00:59:10 2006 New Revision: 51574 Modified: python/branches/int_unification/INTBENCH Log: Benchmark r51573. Modified: python/branches/int_unification/INTBENCH ============================================================================== --- python/branches/int_unification/INTBENCH (original) +++ python/branches/int_unification/INTBENCH Fri Aug 25 00:59:10 2006 @@ -39,3 +39,12 @@ Test 5: 5.233576s Test 6: 2.161525s Test 7: 3.421624s + +r51573 (speed up PyLong_FromLong) +Test 1: 3.149116s +Test 2: 3.948204s +Test 3: 4.012080s +Test 4: 8.589921s +Test 5: 4.481723s +Test 6: 2.259849s +Test 7: 3.453212s From python-checkins at python.org Fri Aug 25 01:37:04 2006 From: python-checkins at python.org (thomas.wouters) Date: Fri, 25 Aug 2006 01:37:04 +0200 (CEST) Subject: [Python-checkins] r51575 - python/branches/p3yk-noslice/Modules/arraymodule.c Message-ID: <20060824233704.DD6D31E4004@bag.python.org> Author: thomas.wouters Date: Fri Aug 25 01:37:04 2006 New Revision: 51575 Modified: python/branches/p3yk-noslice/Modules/arraymodule.c Log: Fix copy-paste error. Modified: python/branches/p3yk-noslice/Modules/arraymodule.c ============================================================================== --- python/branches/p3yk-noslice/Modules/arraymodule.c (original) +++ python/branches/p3yk-noslice/Modules/arraymodule.c Fri Aug 25 01:37:04 2006 @@ -1631,7 +1631,7 @@ } else { PyErr_SetString(PyExc_TypeError, - "list indices must be integers"); + "array indices must be integers"); return NULL; } } From python-checkins at python.org Fri Aug 25 01:37:56 2006 From: python-checkins at python.org (thomas.wouters) Date: Fri, 25 Aug 2006 01:37:56 +0200 (CEST) Subject: [Python-checkins] r51576 - in python/branches/p3yk-noslice: Modules/_ctypes/_ctypes.c TODO Message-ID: <20060824233756.473C31E4004@bag.python.org> Author: thomas.wouters Date: Fri Aug 25 01:37:55 2006 New Revision: 51576 Modified: python/branches/p3yk-noslice/Modules/_ctypes/_ctypes.c python/branches/p3yk-noslice/TODO Log: Add sliceobject support to ctypes objects. All tests pass now. ctypes objects still lack extended slice support, and the Pointer slicing is somewhat insane (by nature.) Modified: python/branches/p3yk-noslice/Modules/_ctypes/_ctypes.c ============================================================================== --- python/branches/p3yk-noslice/Modules/_ctypes/_ctypes.c (original) +++ python/branches/p3yk-noslice/Modules/_ctypes/_ctypes.c Fri Aug 25 01:37:55 2006 @@ -3757,6 +3757,74 @@ return (PyObject *)np; } +static PyObject * +Array_subscript(PyObject *_self, PyObject *item) +{ + CDataObject *self = (CDataObject *)_self; + + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + + if (i == -1 && PyErr_Occurred()) + return NULL; + if (i < 0) + i += self->b_length; + return Array_item(_self, i); + } + else if PySlice_Check(item) { + StgDictObject *stgdict, *itemdict; + PyObject *proto; + PyListObject *np; + Py_ssize_t start, stop, step, slicelen, i; + + if (PySlice_GetIndicesEx((PySliceObject *)item, + self->b_length, &start, &stop, + &step, &slicelen) < 0) { + return NULL; + } + if (step != 1) { + PyErr_Format(PyExc_TypeError, "slice-steps other " + "than 1 not supported (%zd given)", step); + return NULL; + } + + stgdict = PyObject_stgdict((PyObject *)self); + assert(stgdict); /* Cannot be NULL for array object instances */ + proto = stgdict->proto; + itemdict = PyType_stgdict(proto); + assert(itemdict); /* proto is the item type of the array, a + ctypes type, so this cannot be NULL */ + + if (itemdict->getfunc == getentry("c")->getfunc) { + char *ptr = (char *)self->b_ptr; + return PyString_FromStringAndSize(ptr + start, + slicelen); +#ifdef CTYPES_UNICODE + } else if (itemdict->getfunc == getentry("u")->getfunc) { + wchar_t *ptr = (wchar_t *)self->b_ptr; + return PyUnicode_FromWideChar(ptr + start, + slicelen); +#endif + } + + np = (PyListObject *) PyList_New(slicelen); + if (np == NULL) + return NULL; + + for (i = 0; i < slicelen; i++) { + PyObject *v = Array_item(_self, i+start); + PyList_SET_ITEM(np, i, v); + } + return (PyObject *)np; + } + else { + PyErr_SetString(PyExc_TypeError, + "indices must be integers"); + return NULL; + } + +} + static int Array_ass_item(PyObject *_self, Py_ssize_t index, PyObject *value) { @@ -3828,6 +3896,69 @@ return 0; } +static int +Array_ass_subscript(PyObject *_self, PyObject *item, PyObject *value) +{ + CDataObject *self = (CDataObject *)_self; + + if (value == NULL) { + PyErr_SetString(PyExc_TypeError, + "Array does not support item deletion"); + return -1; + } + + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + + if (i == -1 && PyErr_Occurred()) + return -1; + if (i < 0) + i += self->b_length; + return Array_ass_item(_self, i, value); + } + else if (PySlice_Check(item)) { + Py_ssize_t start, stop, step, slicelen, otherlen, i; + + if (PySlice_GetIndicesEx((PySliceObject *)item, + self->b_length, &start, &stop, + &step, &slicelen) < 0) { + return -1; + } + /* XXX(twouters) fix this */ + if (step != 1) { + PyErr_Format(PyExc_TypeError, "slice-steps other " + "than 1 not supported (%zd given)", step); + return -1; + } + if ((step < 0 && start < stop) || + (step > 0 && start > stop)) + stop = start; + + otherlen = PySequence_Length(value); + if (otherlen != slicelen) { + PyErr_SetString(PyExc_ValueError, + "Can only assign sequence of same size"); + return -1; + } + for (i = 0; i < otherlen; i++) { + PyObject *item = PySequence_GetItem(value, i); + int result; + if (item == NULL) + return -1; + result = Array_ass_item(_self, i+start, item); + Py_DECREF(item); + if (result == -1) + return -1; + } + return 0; + } + else { + PyErr_SetString(PyExc_TypeError, + "indices must be integer"); + return -1; + } +} + static Py_ssize_t Array_length(PyObject *_self) { @@ -3849,6 +3980,12 @@ 0, /* sq_inplace_repeat; */ }; +static PyMappingMethods Array_as_mapping = { + Array_length, + Array_subscript, + Array_ass_subscript, +}; + PyTypeObject Array_Type = { PyObject_HEAD_INIT(NULL) 0, @@ -3863,7 +4000,7 @@ 0, /* tp_repr */ 0, /* tp_as_number */ &Array_as_sequence, /* tp_as_sequence */ - 0, /* tp_as_mapping */ + &Array_as_mapping, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ @@ -4349,6 +4486,94 @@ return (PyObject *)np; } +static PyObject * +Pointer_subscript(PyObject *_self, PyObject *item) +{ + CDataObject *self = (CDataObject *)_self; + if (PyIndex_Check(item)) { + Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); + if (i == -1 && PyErr_Occurred()) + return NULL; + return Pointer_item(_self, i); + } + else if (PySlice_Check(item)) { + /* Since pointers have no length, we cannot use any + of the PySlice API functions, and have to fiddle + with the attributes directly */ + PySliceObject *slice = (PySliceObject *)item; + Py_ssize_t start, stop; + PyListObject *np; + StgDictObject *stgdict, *itemdict; + PyObject *proto; + Py_ssize_t i, len; + + if (slice->step != Py_None) { + Py_ssize_t step = PyNumber_AsSsize_t(slice->step, + PyExc_IndexError); + if (step == -1 && PyErr_Occurred()) + return NULL; + if (step != 1) { + PyErr_Format(PyExc_TypeError, + "unsupported step size %zd", + step); + return NULL; + } + } + if (slice->start == Py_None) + start = 0; + else { + start = PyNumber_AsSsize_t(slice->start, + PyExc_IndexError); + if (start == -1 && PyErr_Occurred()) + return NULL; + if (start < 0) + start = 0; + } + if (slice->stop == Py_None) + stop = PY_SSIZE_T_MAX; + else { + stop = PyNumber_AsSsize_t(slice->stop, + PyExc_IndexError); + if (stop == -1 && PyErr_Occurred()) + return NULL; + } + if (stop < start) + stop = start; + len = stop - start; + + stgdict = PyObject_stgdict((PyObject *)self); + assert(stgdict); /* Cannot be NULL fr pointer instances */ + proto = stgdict->proto; + assert(proto); + itemdict = PyType_stgdict(proto); + assert(itemdict); + if (itemdict->getfunc == getentry("c")->getfunc) { + char *ptr = *(char **)self->b_ptr; + return PyString_FromStringAndSize(ptr + start, len); +#ifdef CTYPES_UNICODE + } else if (itemdict->getfunc == getentry("u")->getfunc) { + wchar_t *ptr = *(wchar_t **)self->b_ptr; + return PyUnicode_FromWideChar(ptr + start, len); +#endif + } + + np = (PyListObject *) PyList_New(len); + if (np == NULL) + return NULL; + + for (i = 0; i < len; i++) { + PyObject *v = Pointer_item(_self, i+start); + PyList_SET_ITEM(np, i, v); + } + return (PyObject *)np; + } + else { + PyErr_SetString(PyExc_TypeError, + "Pointer indices must be integer"); + return NULL; + } +} + static PySequenceMethods Pointer_as_sequence = { 0, /* inquiry sq_length; */ 0, /* binaryfunc sq_concat; */ @@ -4363,6 +4588,11 @@ 0, /* intargfunc sq_inplace_repeat; */ }; +static PyMappingMethods Pointer_as_mapping = { + 0, + Pointer_subscript, +}; + static int Pointer_nonzero(CDataObject *self) { @@ -4396,7 +4626,7 @@ 0, /* tp_repr */ &Pointer_as_number, /* tp_as_number */ &Pointer_as_sequence, /* tp_as_sequence */ - 0, /* tp_as_mapping */ + &Pointer_as_mapping, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ Modified: python/branches/p3yk-noslice/TODO ============================================================================== --- python/branches/p3yk-noslice/TODO (original) +++ python/branches/p3yk-noslice/TODO Fri Aug 25 01:37:55 2006 @@ -6,7 +6,7 @@ buffer mmap.mmap structseq - - Add extended slicing (or at least slice-object support) to ctypes objects + - Add actual *extended* slicing to ctypes objects - Make list's mp_[ass_]subscr not depend on list_[ass]slice - Remove slice API (or emulate it ontop of sliceobject API) - Further remove slice/ass_slice PySequenceMethod hooks From python-checkins at python.org Fri Aug 25 01:55:09 2006 From: python-checkins at python.org (thomas.wouters) Date: Fri, 25 Aug 2006 01:55:09 +0200 (CEST) Subject: [Python-checkins] r51579 - in python/branches/p3yk-noslice: Doc/lib/libdis.tex Lib/opcode.py Message-ID: <20060824235509.2E6461E4017@bag.python.org> Author: thomas.wouters Date: Fri Aug 25 01:55:08 2006 New Revision: 51579 Modified: python/branches/p3yk-noslice/Doc/lib/libdis.tex python/branches/p3yk-noslice/Lib/opcode.py Log: Remove last remnants of the SLICE opcodes. Modified: python/branches/p3yk-noslice/Doc/lib/libdis.tex ============================================================================== --- python/branches/p3yk-noslice/Doc/lib/libdis.tex (original) +++ python/branches/p3yk-noslice/Doc/lib/libdis.tex Fri Aug 25 01:55:08 2006 @@ -288,59 +288,6 @@ Implements in-place \code{TOS = TOS1 | TOS}. \end{opcodedesc} -The slice opcodes take up to three parameters. - -\begin{opcodedesc}{SLICE+0}{} -Implements \code{TOS = TOS[:]}. -\end{opcodedesc} - -\begin{opcodedesc}{SLICE+1}{} -Implements \code{TOS = TOS1[TOS:]}. -\end{opcodedesc} - -\begin{opcodedesc}{SLICE+2}{} -Implements \code{TOS = TOS1[:TOS]}. -\end{opcodedesc} - -\begin{opcodedesc}{SLICE+3}{} -Implements \code{TOS = TOS2[TOS1:TOS]}. -\end{opcodedesc} - -Slice assignment needs even an additional parameter. As any statement, -they put nothing on the stack. - -\begin{opcodedesc}{STORE_SLICE+0}{} -Implements \code{TOS[:] = TOS1}. -\end{opcodedesc} - -\begin{opcodedesc}{STORE_SLICE+1}{} -Implements \code{TOS1[TOS:] = TOS2}. -\end{opcodedesc} - -\begin{opcodedesc}{STORE_SLICE+2}{} -Implements \code{TOS1[:TOS] = TOS2}. -\end{opcodedesc} - -\begin{opcodedesc}{STORE_SLICE+3}{} -Implements \code{TOS2[TOS1:TOS] = TOS3}. -\end{opcodedesc} - -\begin{opcodedesc}{DELETE_SLICE+0}{} -Implements \code{del TOS[:]}. -\end{opcodedesc} - -\begin{opcodedesc}{DELETE_SLICE+1}{} -Implements \code{del TOS1[TOS:]}. -\end{opcodedesc} - -\begin{opcodedesc}{DELETE_SLICE+2}{} -Implements \code{del TOS1[:TOS]}. -\end{opcodedesc} - -\begin{opcodedesc}{DELETE_SLICE+3}{} -Implements \code{del TOS2[TOS1:TOS]}. -\end{opcodedesc} - \begin{opcodedesc}{STORE_SUBSCR}{} Implements \code{TOS1[TOS] = TOS2}. \end{opcodedesc} Modified: python/branches/p3yk-noslice/Lib/opcode.py ============================================================================== --- python/branches/p3yk-noslice/Lib/opcode.py (original) +++ python/branches/p3yk-noslice/Lib/opcode.py Fri Aug 25 01:55:08 2006 @@ -70,20 +70,6 @@ def_op('BINARY_TRUE_DIVIDE', 27) def_op('INPLACE_FLOOR_DIVIDE', 28) def_op('INPLACE_TRUE_DIVIDE', 29) -def_op('SLICE+0', 30) -def_op('SLICE+1', 31) -def_op('SLICE+2', 32) -def_op('SLICE+3', 33) - -def_op('STORE_SLICE+0', 40) -def_op('STORE_SLICE+1', 41) -def_op('STORE_SLICE+2', 42) -def_op('STORE_SLICE+3', 43) - -def_op('DELETE_SLICE+0', 50) -def_op('DELETE_SLICE+1', 51) -def_op('DELETE_SLICE+2', 52) -def_op('DELETE_SLICE+3', 53) def_op('INPLACE_ADD', 55) def_op('INPLACE_SUBTRACT', 56) From python-checkins at python.org Fri Aug 25 02:03:35 2006 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 25 Aug 2006 02:03:35 +0200 (CEST) Subject: [Python-checkins] r51580 - python/trunk/Tools/msi/msi.py Message-ID: <20060825000335.EAD781E4004@bag.python.org> Author: martin.v.loewis Date: Fri Aug 25 02:03:34 2006 New Revision: 51580 Modified: python/trunk/Tools/msi/msi.py Log: Patch #1545507: Exclude ctypes package in Win64 MSI file. Will backport to 2.5. Modified: python/trunk/Tools/msi/msi.py ============================================================================== --- python/trunk/Tools/msi/msi.py (original) +++ python/trunk/Tools/msi/msi.py Fri Aug 25 02:03:34 2006 @@ -872,6 +872,12 @@ version=version, language=lang) tmpfiles.append("msvcr71.dll") + # Check if _ctypes.pyd exists + have_ctypes = os.path.exists(srcdir+"/PCBuild/_ctypes.pyd") + if not have_ctypes: + print "WARNING: _ctypes.pyd not found, ctypes will not be included" + extensions.remove("_ctypes.pyd") + # Add all .py files in Lib, except lib-tk, test dirs={} pydirs = [(root,"Lib")] @@ -889,6 +895,8 @@ # data: Lib/email/test # output: Lib/test testsuite.set_current() + elif not have_ctypes and dir == "ctypes": + continue else: default_feature.set_current() lib = PyDirectory(db, cab, parent, dir, dir, "%s|%s" % (parent.make_short(dir), dir)) From python-checkins at python.org Fri Aug 25 02:11:39 2006 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 25 Aug 2006 02:11:39 +0200 (CEST) Subject: [Python-checkins] r51581 - in python/branches/release25-maint: Misc/NEWS Tools/msi/msi.py Message-ID: <20060825001139.C27D71E4004@bag.python.org> Author: martin.v.loewis Date: Fri Aug 25 02:11:38 2006 New Revision: 51581 Modified: python/branches/release25-maint/Misc/NEWS python/branches/release25-maint/Tools/msi/msi.py Log: Patch #1545507: Exclude ctypes package in Win64 MSI file. Modified: python/branches/release25-maint/Misc/NEWS ============================================================================== --- python/branches/release25-maint/Misc/NEWS (original) +++ python/branches/release25-maint/Misc/NEWS Fri Aug 25 02:11:38 2006 @@ -36,6 +36,8 @@ Build ----- +- Patch #1545507: Exclude ctypes package in Win64 MSI file. + - Fix OpenSSL debug build process. Modified: python/branches/release25-maint/Tools/msi/msi.py ============================================================================== --- python/branches/release25-maint/Tools/msi/msi.py (original) +++ python/branches/release25-maint/Tools/msi/msi.py Fri Aug 25 02:11:38 2006 @@ -872,6 +872,12 @@ version=version, language=lang) tmpfiles.append("msvcr71.dll") + # Check if _ctypes.pyd exists + have_ctypes = os.path.exists(srcdir+"/PCBuild/_ctypes.pyd") + if not have_ctypes: + print "WARNING: _ctypes.pyd not found, ctypes will not be included" + extensions.remove("_ctypes.pyd") + # Add all .py files in Lib, except lib-tk, test dirs={} pydirs = [(root,"Lib")] @@ -889,6 +895,8 @@ # data: Lib/email/test # output: Lib/test testsuite.set_current() + elif not have_ctypes and dir == "ctypes": + continue else: default_feature.set_current() lib = PyDirectory(db, cab, parent, dir, dir, "%s|%s" % (parent.make_short(dir), dir)) From buildbot at python.org Fri Aug 25 02:43:42 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 00:43:42 +0000 Subject: [Python-checkins] buildbot warnings in x86 OpenBSD trunk Message-ID: <20060825004342.B36661E4004@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%2520trunk/builds/1234 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 25 02:55:28 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 00:55:28 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060825005529.189541E4004@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1124 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Fri Aug 25 03:15:52 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 25 Aug 2006 03:15:52 +0200 (CEST) Subject: [Python-checkins] r51586 - peps/trunk/pep-0356.txt Message-ID: <20060825011552.85F1D1E4009@bag.python.org> Author: neal.norwitz Date: Fri Aug 25 03:15:52 2006 New Revision: 51586 Modified: peps/trunk/pep-0356.txt Log: Fixed the buffer issue, unicode issue can wait for 2.5.1 Modified: peps/trunk/pep-0356.txt ============================================================================== --- peps/trunk/pep-0356.txt (original) +++ peps/trunk/pep-0356.txt Fri Aug 25 03:15:52 2006 @@ -151,10 +151,9 @@ http://python.org/sf/1541697 - sgmllib regexp bug causes hang http://python.org/sf/1541420 - tools and demo missing from windows - http://python.org/sf/1541585 - buffer overrun in repr() for unicode - http://python.org/sf/1446043 - unicode() does not raise LookupError - - Bugs that ought to be resolved before release (all exist in 2.4): + - Bugs deferred until 2.5.1 (or later) + http://python.org/sf/1446043 - unicode() does not raise LookupError http://python.org/sf/1475523 - gettext.py bug (owner: Martin v. Loewis) http://python.org/sf/1467929 - %-formatting and dicts From python-checkins at python.org Fri Aug 25 03:29:44 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 25 Aug 2006 03:29:44 +0200 (CEST) Subject: [Python-checkins] r51588 - peps/trunk/pep-0361.txt Message-ID: <20060825012944.393801E4004@bag.python.org> Author: neal.norwitz Date: Fri Aug 25 03:29:43 2006 New Revision: 51588 Modified: peps/trunk/pep-0361.txt Log: Add some TODOs for 2.6. Some of these were implemented in 3k, others are likely to be done soon. Modified: peps/trunk/pep-0361.txt ============================================================================== --- peps/trunk/pep-0361.txt (original) +++ peps/trunk/pep-0361.txt Fri Aug 25 03:29:43 2006 @@ -86,6 +86,26 @@ http://python.org/sf/1505257 (Owner: MAL) + - warnings module implemented in C + + - Add warnings for Py3k features removed: + * backticks and <> + * __getslice__/__setslice__/__delslice__ + * float args to PyArgs_ParseTuple + * float args to xrange + * coerce and all its friends + * __cmp__? + * other comparison changes? + * int division? + * {}.has_key() + * All PendingDeprecationWarnings (e.g. exceptions) + * using zip() result as a list + * input() + * apply() + * xreadlines + + - with/as will be keywords + - Check the various bits of code in Demo/ and Tools/ all still work, update or remove the ones that don't. From buildbot at python.org Fri Aug 25 03:44:25 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 01:44:25 +0000 Subject: [Python-checkins] buildbot warnings in S-390 Debian 2.5 Message-ID: <20060825014425.66DDA1E4004@bag.python.org> The Buildbot has detected a new failure of S-390 Debian 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%2520Debian%25202.5/builds/6 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: martin.v.loewis Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 25 03:45:22 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 01:45:22 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 2.5 Message-ID: <20060825014522.D2E9E1E4004@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%25202.5/builds/11 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: martin.v.loewis Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Fri Aug 25 03:52:50 2006 From: python-checkins at python.org (neal.norwitz) Date: Fri, 25 Aug 2006 03:52:50 +0200 (CEST) Subject: [Python-checkins] r51589 - python/trunk/Lib/encodings/__init__.py Message-ID: <20060825015250.21A541E4004@bag.python.org> Author: neal.norwitz Date: Fri Aug 25 03:52:49 2006 New Revision: 51589 Modified: python/trunk/Lib/encodings/__init__.py Log: importing types is not necessary if we use isinstance Modified: python/trunk/Lib/encodings/__init__.py ============================================================================== --- python/trunk/Lib/encodings/__init__.py (original) +++ python/trunk/Lib/encodings/__init__.py Fri Aug 25 03:52:49 2006 @@ -28,7 +28,7 @@ """#" -import codecs, types +import codecs from encodings import aliases _cache = {} @@ -60,7 +60,7 @@ """ # Make sure we have an 8-bit string, because .translate() works # differently for Unicode strings. - if type(encoding) is types.UnicodeType: + if isinstance(encoding, unicode): # Note that .encode('latin-1') does *not* use the codec # registry, so this call doesn't recurse. (See unicodeobject.c # PyUnicode_AsEncodedString() for details) From buildbot at python.org Fri Aug 25 04:15:05 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 02:15:05 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) 2.5 Message-ID: <20060825021505.478BC1E4004@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) 2.5. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%25202.5/builds/11 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch branches/release25-maint] HEAD Blamelist: martin.v.loewis Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 25 04:27:20 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 02:27:20 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060825022720.593C31E4004@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/64 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: neal.norwitz Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Fri Aug 25 08:03:08 2006 From: python-checkins at python.org (brett.cannon) Date: Fri, 25 Aug 2006 08:03:08 +0200 (CEST) Subject: [Python-checkins] r51601 - peps/trunk/pep-3100.txt Message-ID: <20060825060308.0228D1E4019@bag.python.org> Author: brett.cannon Date: Fri Aug 25 08:03:06 2006 New Revision: 51601 Modified: peps/trunk/pep-3100.txt Log: Note that backticks and '<>' removal are done. Modified: peps/trunk/pep-3100.txt ============================================================================== --- peps/trunk/pep-3100.txt (original) +++ peps/trunk/pep-3100.txt Fri Aug 25 08:03:06 2006 @@ -113,8 +113,8 @@ * String exceptions: use instances of an Exception class [2]_ [done] * ``raise Exception, "message"``: use ``raise Exception("message")`` [14]_ -* ```x```: use ``repr(x)`` [2]_ -* The ``<>`` operator: use ``!=`` instead [3]_ +* ```x```: use ``repr(x)`` [2]_ [done] +* The ``<>`` operator: use ``!=`` instead [3]_ [done] * The __mod__ and __divmod__ special methods on float. [29]_ * Might drop unbound methods? [7]_ * METH_OLDARGS From python-checkins at python.org Fri Aug 25 09:27:34 2006 From: python-checkins at python.org (thomas.heller) Date: Fri, 25 Aug 2006 09:27:34 +0200 (CEST) Subject: [Python-checkins] r51604 - in python/trunk: Lib/ctypes/__init__.py Lib/ctypes/test/test_win32.py Modules/_ctypes/_ctypes.c Modules/_ctypes/_ctypes_test.c Modules/_ctypes/callbacks.c Modules/_ctypes/callproc.c Modules/_ctypes/cfield.c Modules/_ctypes/libffi_msvc/ffi.c Modules/_ctypes/libffi_msvc/ffi.h Modules/_ctypes/libffi_msvc/ffitarget.h Message-ID: <20060825072734.C989D1E4018@bag.python.org> Author: thomas.heller Date: Fri Aug 25 09:27:33 2006 New Revision: 51604 Modified: python/trunk/Lib/ctypes/__init__.py python/trunk/Lib/ctypes/test/test_win32.py python/trunk/Modules/_ctypes/_ctypes.c python/trunk/Modules/_ctypes/_ctypes_test.c python/trunk/Modules/_ctypes/callbacks.c python/trunk/Modules/_ctypes/callproc.c python/trunk/Modules/_ctypes/cfield.c python/trunk/Modules/_ctypes/libffi_msvc/ffi.c python/trunk/Modules/_ctypes/libffi_msvc/ffi.h python/trunk/Modules/_ctypes/libffi_msvc/ffitarget.h Log: Port _ctypes.pyd to win64 on AMD64. Modified: python/trunk/Lib/ctypes/__init__.py ============================================================================== --- python/trunk/Lib/ctypes/__init__.py (original) +++ python/trunk/Lib/ctypes/__init__.py Fri Aug 25 09:27:33 2006 @@ -427,6 +427,8 @@ c_size_t = c_uint elif sizeof(c_ulong) == sizeof(c_void_p): c_size_t = c_ulong +elif sizeof(c_ulonglong) == sizeof(c_void_p): + c_size_t = c_ulonglong # functions Modified: python/trunk/Lib/ctypes/test/test_win32.py ============================================================================== --- python/trunk/Lib/ctypes/test/test_win32.py (original) +++ python/trunk/Lib/ctypes/test/test_win32.py Fri Aug 25 09:27:33 2006 @@ -6,7 +6,8 @@ import _ctypes_test -if sys.platform == "win32": +if sys.platform == "win32" and sizeof(c_void_p) == sizeof(c_int): + # Only windows 32-bit has different calling conventions. class WindowsTestCase(unittest.TestCase): def test_callconv_1(self): Modified: python/trunk/Modules/_ctypes/_ctypes.c ============================================================================== --- python/trunk/Modules/_ctypes/_ctypes.c (original) +++ python/trunk/Modules/_ctypes/_ctypes.c Fri Aug 25 09:27:33 2006 @@ -2589,16 +2589,22 @@ PPROC address; char *mangled_name; int i; - StgDictObject *dict = PyType_stgdict((PyObject *)type); + StgDictObject *dict; address = (PPROC)GetProcAddress(handle, name); +#ifdef _WIN64 + /* win64 has no stdcall calling conv, so it should + also not have the name mangling of it. + */ + return address; +#else if (address) return address; - if (((size_t)name & ~0xFFFF) == 0) { return NULL; } + dict = PyType_stgdict((PyObject *)type); /* It should not happen that dict is NULL, but better be safe */ if (dict==NULL || dict->flags & FUNCFLAG_CDECL) return address; @@ -2617,6 +2623,7 @@ return address; } return NULL; +#endif } #endif Modified: python/trunk/Modules/_ctypes/_ctypes_test.c ============================================================================== --- python/trunk/Modules/_ctypes/_ctypes_test.c (original) +++ python/trunk/Modules/_ctypes/_ctypes_test.c Fri Aug 25 09:27:33 2006 @@ -25,6 +25,16 @@ /* some functions handy for testing */ +EXPORT(int)myprintf(char *fmt, ...) +{ + int result; + va_list argptr; + va_start(argptr, fmt); + result = vprintf(fmt, argptr); + va_end(argptr); + return result; +} + EXPORT(char *)my_strtok(char *token, const char *delim) { return strtok(token, delim); Modified: python/trunk/Modules/_ctypes/callbacks.c ============================================================================== --- python/trunk/Modules/_ctypes/callbacks.c (original) +++ python/trunk/Modules/_ctypes/callbacks.c Fri Aug 25 09:27:33 2006 @@ -300,7 +300,7 @@ } cc = FFI_DEFAULT_ABI; -#if defined(MS_WIN32) && !defined(_WIN32_WCE) +#if defined(MS_WIN32) && !defined(_WIN32_WCE) && !defined(MS_WIN64) if (is_cdecl == 0) cc = FFI_STDCALL; #endif Modified: python/trunk/Modules/_ctypes/callproc.c ============================================================================== --- python/trunk/Modules/_ctypes/callproc.c (original) +++ python/trunk/Modules/_ctypes/callproc.c Fri Aug 25 09:27:33 2006 @@ -638,7 +638,7 @@ } cc = FFI_DEFAULT_ABI; -#if defined(MS_WIN32) && !defined(_WIN32_WCE) +#if defined(MS_WIN32) && !defined(MS_WIN64) && !defined(_WIN32_WCE) if ((flags & FUNCFLAG_CDECL) == 0) cc = FFI_STDCALL; #endif @@ -683,6 +683,14 @@ return -1; } #endif +#ifdef MS_WIN64 + if (delta != 0) { + PyErr_Format(PyExc_RuntimeError, + "ffi_call failed with code %d", + delta); + return -1; + } +#else if (delta < 0) { if (flags & FUNCFLAG_CDECL) PyErr_Format(PyExc_ValueError, @@ -704,6 +712,7 @@ return -1; } #endif +#endif if ((flags & FUNCFLAG_PYTHONAPI) && PyErr_Occurred()) return -1; return 0; @@ -979,7 +988,11 @@ } for (i = 0; i < argcount; ++i) { atypes[i] = args[i].ffi_type; - if (atypes[i]->type == FFI_TYPE_STRUCT) + if (atypes[i]->type == FFI_TYPE_STRUCT +#ifdef _WIN64 + && atypes[i]->size <= sizeof(void *) +#endif + ) avalues[i] = (void *)args[i].value.p; else avalues[i] = (void *)&args[i].value; @@ -1099,7 +1112,11 @@ hMod = LoadLibrary(name); if (!hMod) return PyErr_SetFromWindowsErr(GetLastError()); +#ifdef _WIN64 + return PyLong_FromVoidPtr(hMod); +#else return Py_BuildValue("i", hMod); +#endif } static char free_library_doc[] = Modified: python/trunk/Modules/_ctypes/cfield.c ============================================================================== --- python/trunk/Modules/_ctypes/cfield.c (original) +++ python/trunk/Modules/_ctypes/cfield.c Fri Aug 25 09:27:33 2006 @@ -1315,7 +1315,11 @@ *(char **)ptr = PyString_AS_STRING(str); return str; } else if (PyInt_Check(value) || PyLong_Check(value)) { +#if SIZEOF_VOID_P == SIZEOF_LONG_LONG + *(char **)ptr = (char *)PyInt_AsUnsignedLongLongMask(value); +#else *(char **)ptr = (char *)PyInt_AsUnsignedLongMask(value); +#endif _RET(value); } PyErr_Format(PyExc_TypeError, @@ -1360,7 +1364,11 @@ if (!value) return NULL; } else if (PyInt_Check(value) || PyLong_Check(value)) { +#if SIZEOF_VOID_P == SIZEOF_LONG_LONG + *(wchar_t **)ptr = (wchar_t *)PyInt_AsUnsignedLongLongMask(value); +#else *(wchar_t **)ptr = (wchar_t *)PyInt_AsUnsignedLongMask(value); +#endif Py_INCREF(Py_None); return Py_None; } else if (!PyUnicode_Check(value)) { Modified: python/trunk/Modules/_ctypes/libffi_msvc/ffi.c ============================================================================== --- python/trunk/Modules/_ctypes/libffi_msvc/ffi.c (original) +++ python/trunk/Modules/_ctypes/libffi_msvc/ffi.c Fri Aug 25 09:27:33 2006 @@ -34,6 +34,8 @@ /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ +extern void Py_FatalError(char *msg); + /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) /*@=exportheader@*/ @@ -44,11 +46,10 @@ register ffi_type **p_arg; argp = stack; - if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) { *(void **) argp = ecif->rvalue; - argp += 4; + argp += sizeof(void *); } p_argv = ecif->avalue; @@ -60,8 +61,8 @@ size_t z; /* Align if necessary */ - if ((sizeof(int) - 1) & (unsigned) argp) - argp = (char *) ALIGN(argp, sizeof(int)); + if ((sizeof(void *) - 1) & (size_t) argp) + argp = (char *) ALIGN(argp, sizeof(void *)); z = (*p_arg)->size; if (z < sizeof(int)) @@ -108,7 +109,11 @@ p_argv++; argp += z; } - + + if (argp - stack > ecif->cif->bytes) + { + Py_FatalError("FFI BUG: not enough stack space for arguments"); + } return; } @@ -128,6 +133,9 @@ break; case FFI_TYPE_UINT64: +#ifdef _WIN64 + case FFI_TYPE_POINTER: +#endif cif->flags = FFI_TYPE_SINT64; break; @@ -139,6 +147,7 @@ return FFI_OK; } +#ifdef _WIN32 /*@-declundef@*/ /*@-exportheader@*/ extern int @@ -160,6 +169,16 @@ void (*fn)()); /*@=declundef@*/ /*@=exportheader@*/ +#endif + +#ifdef _WIN64 +extern int +ffi_call_AMD64(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, + /*@out@*/ unsigned *, + void (*fn)()); +#endif int ffi_call(/*@dependent@*/ ffi_cif *cif, @@ -188,6 +207,7 @@ switch (cif->abi) { +#if !defined(_WIN64) case FFI_SYSV: /*@-usedef@*/ return ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, @@ -201,6 +221,14 @@ cif->flags, ecif.rvalue, fn); /*@=usedef@*/ break; +#else + case FFI_SYSV: + /*@-usedef@*/ + return ffi_call_AMD64(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + /*@=usedef@*/ + break; +#endif default: FFI_ASSERT(0); @@ -213,10 +241,14 @@ /** private members **/ static void ffi_prep_incoming_args_SYSV (char *stack, void **ret, - void** args, ffi_cif* cif); + void** args, ffi_cif* cif); /* This function is jumped to by the trampoline */ +#ifdef _WIN64 +void * +#else static void __fastcall +#endif ffi_closure_SYSV (ffi_closure *closure, int *argp) { // this is our return value storage @@ -244,6 +276,7 @@ rtype = cif->flags; +#if defined(_WIN32) && !defined(_WIN64) #ifdef _MSC_VER /* now, do a generic return based on the value of rtype */ if (rtype == FFI_TYPE_INT) @@ -303,6 +336,15 @@ : "eax", "edx"); } #endif +#endif + +#ifdef _WIN64 + /* The result is returned in rax. This does the right thing for + result types except for floats; we have to 'mov xmm0, rax' in the + caller to correct this. + */ + return *(void **)resp; +#endif } /*@-exportheader@*/ @@ -330,8 +372,8 @@ size_t z; /* Align if necessary */ - if ((sizeof(int) - 1) & (unsigned) argp) { - argp = (char *) ALIGN(argp, sizeof(int)); + if ((sizeof(char *) - 1) & (size_t) argp) { + argp = (char *) ALIGN(argp, sizeof(char*)); } z = (*p_arg)->size; @@ -347,24 +389,8 @@ return; } -/* How to make a trampoline. Derived from gcc/config/i386/i386.c. */ - -#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX,BYTES) \ -{ unsigned char *__tramp = (unsigned char*)(TRAMP); \ - unsigned int __fun = (unsigned int)(FUN); \ - unsigned int __ctx = (unsigned int)(CTX); \ - unsigned int __dis = __fun - ((unsigned int) __tramp + 8 + 4); \ - *(unsigned char*) &__tramp[0] = 0xb9; \ - *(unsigned int*) &__tramp[1] = __ctx; /* mov ecx, __ctx */ \ - *(unsigned char*) &__tramp[5] = 0x8b; \ - *(unsigned char*) &__tramp[6] = 0xd4; /* mov edx, esp */ \ - *(unsigned char*) &__tramp[7] = 0xe8; \ - *(unsigned int*) &__tramp[8] = __dis; /* call __fun */ \ - *(unsigned char*) &__tramp[12] = 0xC2; /* ret BYTES */ \ - *(unsigned short*) &__tramp[13] = BYTES; \ - } - /* the cif must already be prep'ed */ +extern void ffi_closure_OUTER(); ffi_status ffi_prep_closure (ffi_closure* closure, @@ -373,19 +399,78 @@ void *user_data) { short bytes; + char *tramp; +#ifdef _WIN64 + int mask; +#endif FFI_ASSERT (cif->abi == FFI_SYSV); if (cif->abi == FFI_SYSV) bytes = 0; +#if !defined(_WIN64) else if (cif->abi == FFI_STDCALL) bytes = cif->bytes; +#endif else return FFI_BAD_ABI; - FFI_INIT_TRAMPOLINE (&closure->tramp[0], - &ffi_closure_SYSV, - (void*)closure, - bytes); + tramp = &closure->tramp[0]; + +#define BYTES(text) memcpy(tramp, text, sizeof(text)), tramp += sizeof(text)-1 +#define POINTER(x) *(void**)tramp = (void*)(x), tramp += sizeof(void*) +#define SHORT(x) *(short*)tramp = x, tramp += sizeof(short) +#define INT(x) *(int*)tramp = x, tramp += sizeof(int) + +#ifdef _WIN64 + if (cif->nargs >= 1 && + (cif->arg_types[0]->type == FFI_TYPE_FLOAT + || cif->arg_types[0]->type == FFI_TYPE_DOUBLE)) + mask |= 1; + if (cif->nargs >= 2 && + (cif->arg_types[1]->type == FFI_TYPE_FLOAT + || cif->arg_types[1]->type == FFI_TYPE_DOUBLE)) + mask |= 2; + if (cif->nargs >= 3 && + (cif->arg_types[2]->type == FFI_TYPE_FLOAT + || cif->arg_types[2]->type == FFI_TYPE_DOUBLE)) + mask |= 4; + if (cif->nargs >= 4 && + (cif->arg_types[3]->type == FFI_TYPE_FLOAT + || cif->arg_types[3]->type == FFI_TYPE_DOUBLE)) + mask |= 8; + + /* 41 BB ---- mov r11d,mask */ + BYTES("\x41\xBB"); INT(mask); + + /* 48 B8 -------- mov rax, closure */ + BYTES("\x48\xB8"); POINTER(closure); + + /* 49 BA -------- mov r10, ffi_closure_OUTER */ + BYTES("\x49\xBA"); POINTER(ffi_closure_OUTER); + + /* 41 FF E2 jmp r10 */ + BYTES("\x41\xFF\xE2"); + +#else + + /* mov ecx, closure */ + BYTES("\xb9"); POINTER(closure); + + /* mov edx, esp */ + BYTES("\x8b\xd4"); + + /* call ffi_closure_SYSV */ + BYTES("\xe8"); POINTER((char*)&ffi_closure_SYSV - (tramp + 4)); + + /* ret bytes */ + BYTES("\xc2"); + SHORT(bytes); + +#endif + + if (tramp - &closure->tramp[0] > FFI_TRAMPOLINE_SIZE) + Py_FatalError("FFI_TRAMPOLINE_SIZE too small in " __FILE__); + closure->cif = cif; closure->user_data = user_data; closure->fun = fun; Modified: python/trunk/Modules/_ctypes/libffi_msvc/ffi.h ============================================================================== --- python/trunk/Modules/_ctypes/libffi_msvc/ffi.h (original) +++ python/trunk/Modules/_ctypes/libffi_msvc/ffi.h Fri Aug 25 09:27:33 2006 @@ -174,12 +174,10 @@ /* ---- Definitions for the raw API -------------------------------------- */ -#ifndef FFI_SIZEOF_ARG -# if LONG_MAX == 2147483647 -# define FFI_SIZEOF_ARG 4 -# elif LONG_MAX == 9223372036854775807 -# define FFI_SIZEOF_ARG 8 -# endif +#ifdef _WIN64 +#define FFI_SIZEOF_ARG 8 +#else +#define FFI_SIZEOF_ARG 4 #endif typedef union { Modified: python/trunk/Modules/_ctypes/libffi_msvc/ffitarget.h ============================================================================== --- python/trunk/Modules/_ctypes/libffi_msvc/ffitarget.h (original) +++ python/trunk/Modules/_ctypes/libffi_msvc/ffitarget.h Fri Aug 25 09:27:33 2006 @@ -44,7 +44,9 @@ /* ---- Intel x86 Win32 ---------- */ FFI_SYSV, +#ifndef _WIN64 FFI_STDCALL, +#endif /* TODO: Add fastcall support for the sake of completeness */ FFI_DEFAULT_ABI = FFI_SYSV, @@ -67,8 +69,8 @@ #define FFI_CLOSURES 1 -#ifdef X86_64 -#define FFI_TRAMPOLINE_SIZE 24 +#ifdef _WIN64 +#define FFI_TRAMPOLINE_SIZE 29 #define FFI_NATIVE_RAW_API 0 #else #define FFI_TRAMPOLINE_SIZE 15 From python-checkins at python.org Fri Aug 25 09:34:52 2006 From: python-checkins at python.org (thomas.heller) Date: Fri, 25 Aug 2006 09:34:52 +0200 (CEST) Subject: [Python-checkins] r51605 - python/trunk/Modules/_ctypes/libffi_msvc/win64.asm Message-ID: <20060825073452.41E231E4007@bag.python.org> Author: thomas.heller Date: Fri Aug 25 09:34:51 2006 New Revision: 51605 Added: python/trunk/Modules/_ctypes/libffi_msvc/win64.asm (contents, props changed) Log: Add missing file for _ctypes.pyd port to win64 on AMD64. Added: python/trunk/Modules/_ctypes/libffi_msvc/win64.asm ============================================================================== --- (empty file) +++ python/trunk/Modules/_ctypes/libffi_msvc/win64.asm Fri Aug 25 09:34:51 2006 @@ -0,0 +1,156 @@ +PUBLIC ffi_call_AMD64 + +EXTRN __chkstk:NEAR +EXTRN ffi_closure_SYSV:NEAR + +_TEXT SEGMENT + +;;; ffi_closure_OUTER will be called with these registers set: +;;; rax points to 'closure' +;;; r11 contains a bit mask that specifies which of the +;;; first four parameters are float or double +;;; +;;; It must move the parameters passed in registers to their stack location, +;;; call ffi_closure_SYSV for the actual work, then return the result. +;;; +ffi_closure_OUTER PROC FRAME + ;; save actual arguments to their stack space. + test r11, 1 + jne first_is_float + mov QWORD PTR [rsp+8], rcx + jmp second +first_is_float: + movlpd QWORD PTR [rsp+8], xmm0 + +second: + test r11, 2 + jne second_is_float + mov QWORD PTR [rsp+16], rdx + jmp third +second_is_float: + movlpd QWORD PTR [rsp+16], xmm1 + +third: + test r11, 4 + jne third_is_float + mov QWORD PTR [rsp+24], r8 + jmp forth +third_is_float: + movlpd QWORD PTR [rsp+24], xmm2 + +forth: + test r11, 8 + jne forth_is_float + mov QWORD PTR [rsp+32], r9 + jmp done +forth_is_float: + movlpd QWORD PTR [rsp+32], xmm3 + +done: +.ALLOCSTACK 40 + sub rsp, 40 +.ENDPROLOG + mov rcx, rax ; context is first parameter + mov rdx, rsp ; stack is second parameter + add rdx, 40 ; correct our own area + mov rax, ffi_closure_SYSV + call rax ; call the real closure function + ;; Here, code is missing that handles float return values + add rsp, 40 + movd xmm0, rax ; In case the closure returned a float. + ret 0 +ffi_closure_OUTER ENDP + + +;;; ffi_call_AMD64 + +stack$ = 0 +prepfunc$ = 32 +ecif$ = 40 +bytes$ = 48 +flags$ = 56 +rvalue$ = 64 +fn$ = 72 + +ffi_call_AMD64 PROC FRAME + + mov QWORD PTR [rsp+32], r9 + mov QWORD PTR [rsp+24], r8 + mov QWORD PTR [rsp+16], rdx + mov QWORD PTR [rsp+8], rcx +.PUSHREG rbp + push rbp +.ALLOCSTACK 48 + sub rsp, 48 ; 00000030H +.SETFRAME rbp, 32 + lea rbp, QWORD PTR [rsp+32] +.ENDPROLOG + + mov eax, DWORD PTR bytes$[rbp] + add rax, 15 + and rax, -16 + call __chkstk + sub rsp, rax + lea rax, QWORD PTR [rsp+32] + mov QWORD PTR stack$[rbp], rax + + mov rdx, QWORD PTR ecif$[rbp] + mov rcx, QWORD PTR stack$[rbp] + call QWORD PTR prepfunc$[rbp] + + mov rsp, QWORD PTR stack$[rbp] + + movlpd xmm3, QWORD PTR [rsp+24] + movd r9, xmm3 + + movlpd xmm2, QWORD PTR [rsp+16] + movd r8, xmm2 + + movlpd xmm1, QWORD PTR [rsp+8] + movd rdx, xmm1 + + movlpd xmm0, QWORD PTR [rsp] + movd rcx, xmm0 + + call QWORD PTR fn$[rbp] +ret_int$: + cmp DWORD PTR flags$[rbp], 1 ; FFI_TYPE_INT + jne ret_float$ + + mov rcx, QWORD PTR rvalue$[rbp] + mov DWORD PTR [rcx], eax + jmp SHORT ret_nothing$ + +ret_float$: + cmp DWORD PTR flags$[rbp], 2 ; FFI_TYPE_FLOAT + jne SHORT ret_double$ + + mov rax, QWORD PTR rvalue$[rbp] + movlpd QWORD PTR [rax], xmm0 + jmp SHORT ret_nothing$ + +ret_double$: + cmp DWORD PTR flags$[rbp], 3 ; FFI_TYPE_DOUBLE + jne SHORT ret_int64$ + + mov rax, QWORD PTR rvalue$[rbp] + movlpd QWORD PTR [rax], xmm0 + jmp SHORT ret_nothing$ + +ret_int64$: + cmp DWORD PTR flags$[rbp], 12 ; FFI_TYPE_SINT64 + jne ret_nothing$ + + mov rcx, QWORD PTR rvalue$[rbp] + mov QWORD PTR [rcx], rax + jmp SHORT ret_nothing$ + +ret_nothing$: + xor eax, eax + + lea rsp, QWORD PTR [rbp+16] + pop rbp + ret 0 +ffi_call_AMD64 ENDP +_TEXT ENDS +END From buildbot at python.org Fri Aug 25 10:11:40 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 08:11:40 +0000 Subject: [Python-checkins] buildbot warnings in S-390 Debian trunk Message-ID: <20060825081140.BB7D41E4007@bag.python.org> The Buildbot has detected a new failure of S-390 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%2520Debian%2520trunk/builds/350 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Fri Aug 25 10:30:52 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 08:30:52 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) trunk Message-ID: <20060825083053.20AD31E400D@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%2520trunk/builds/924 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: thomas.heller Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Fri Aug 25 11:26:33 2006 From: python-checkins at python.org (thomas.heller) Date: Fri, 25 Aug 2006 11:26:33 +0200 (CEST) Subject: [Python-checkins] r51606 - python/trunk/PCbuild/_ctypes.vcproj python/trunk/PCbuild/amd64_ml64.bat Message-ID: <20060825092633.9D2B21E4007@bag.python.org> Author: thomas.heller Date: Fri Aug 25 11:26:33 2006 New Revision: 51606 Added: python/trunk/PCbuild/amd64_ml64.bat (contents, props changed) Modified: python/trunk/PCbuild/_ctypes.vcproj Log: Build _ctypes.pyd for win AMD64 into the MSVC project file. Since MSVC doesn't know about .asm files, a helper batch file is needed to find ml64.exe in predefined locations. The helper script hardcodes the path to the MS Platform SDK. Modified: python/trunk/PCbuild/_ctypes.vcproj ============================================================================== --- python/trunk/PCbuild/_ctypes.vcproj (original) +++ python/trunk/PCbuild/_ctypes.vcproj Fri Aug 25 11:26:33 2006 @@ -4,6 +4,7 @@ Version="7.10" Name="_ctypes" ProjectGUID="{F22F40F4-D318-40DC-96B3-88DC81CE0894}" + RootNamespace="_ctypes" Keyword="Win32Proj"> + + + + + + + + + + + + + + + + + Added: python/trunk/PCbuild/amd64_ml64.bat ============================================================================== --- (empty file) +++ python/trunk/PCbuild/amd64_ml64.bat Fri Aug 25 11:26:33 2006 @@ -0,0 +1,17 @@ + at echo off +rem Try to find the AMD64 assembler and call it with the supplied arguments. + +set MLEXE=Microsoft Platform SDK\Bin\Win64\x86\AMD64\ml64.EXE + +rem For the environment variables see also +rem http://msdn.microsoft.com/library/en-us/win64/win64/wow64_implementation_details.asp + +if exist "%ProgramFiles%\%MLEXE%" ( + set ML64="%ProgramFiles%\%MLEXE%" +) else if exist "%ProgramW6432%\%MLEXE%" ( + set ML64="%ProgramW6432%\%MLEXE%" +) else ( + set ML64=ml64.exe +) + +%ML64% %* From fredrik at pythonware.com Fri Aug 25 11:47:36 2006 From: fredrik at pythonware.com (Fredrik Lundh) Date: Fri, 25 Aug 2006 11:47:36 +0200 Subject: [Python-checkins] r51500 - in python/branches/int_unification:Include/abstract.h Include/intobject.h Objects/abstract.cObjects/longobject.c References: <20060823000834.A05D91E4009@bag.python.org> Message-ID: Guido van Rossum wrote: >> > Make PyNumber_Long invoke nb_int, drop PyNumber_Int. >> > Also fix PyLong_FitsInLong. >> >> isn't this backwards? shouldn't the new unified type be called Int? or >> do you plan to fix the naming in a later step? > > Yes, of course. Apparently you didn't read the thread on the > python-3000 list about this. so many mailing lists, so little time. maybe it would be a good idea to mark Py3K-specific experiments in the main SVN in some way (e.g. add a brief note to the checkin messages, as I think we did in Reykjavik). From python-checkins at python.org Fri Aug 25 14:44:29 2006 From: python-checkins at python.org (armin.rigo) Date: Fri, 25 Aug 2006 14:44:29 +0200 (CEST) Subject: [Python-checkins] r51608 - python/trunk/Lib/test/crashers/bogus_sre_bytecode.py Message-ID: <20060825124429.B921F1E4004@bag.python.org> Author: armin.rigo Date: Fri Aug 25 14:44:28 2006 New Revision: 51608 Added: python/trunk/Lib/test/crashers/bogus_sre_bytecode.py (contents, props changed) Log: The regular expression engine in '_sre' can segfault when interpreting bogus bytecode. It is unclear whether this is a real bug or a "won't fix" case like bogus_code_obj.py. Added: python/trunk/Lib/test/crashers/bogus_sre_bytecode.py ============================================================================== --- (empty file) +++ python/trunk/Lib/test/crashers/bogus_sre_bytecode.py Fri Aug 25 14:44:28 2006 @@ -0,0 +1,47 @@ +""" +The regular expression engine in '_sre' can segfault when interpreting +bogus bytecode. + +It is unclear whether this is a real bug or a "won't fix" case like +bogus_code_obj.py, because it requires bytecode that is built by hand, +as opposed to compiled by 're' from a string-source regexp. The +difference with bogus_code_obj, though, is that the only existing regexp +compiler is written in Python, so that the C code has no choice but +accept arbitrary bytecode from Python-level. + +The test below builds and runs random bytecodes until 'match' crashes +Python. I have not investigated why exactly segfaults occur nor how +hard they would be to fix. Here are a few examples of 'code' that +segfault for me: + + [21, 50814, 8, 29, 16] + [21, 3967, 26, 10, 23, 54113] + [29, 23, 0, 2, 5] + [31, 64351, 0, 28, 3, 22281, 20, 4463, 9, 25, 59154, 15245, 2, + 16343, 3, 11600, 24380, 10, 37556, 10, 31, 15, 31] + +Here is also a 'code' that triggers an infinite uninterruptible loop: + + [29, 1, 8, 21, 1, 43083, 6] + +""" + +import _sre, random + +def pick(): + n = random.randrange(-65536, 65536) + if n < 0: + n &= 31 + return n + +ss = ["", "world", "x" * 500] + +while 1: + code = [pick() for i in range(random.randrange(5, 25))] + print code + pat = _sre.compile(None, 0, code) + for s in ss: + try: + pat.match(s) + except RuntimeError: + pass From python-checkins at python.org Fri Aug 25 16:53:03 2006 From: python-checkins at python.org (guido.van.rossum) Date: Fri, 25 Aug 2006 16:53:03 +0200 (CEST) Subject: [Python-checkins] r51615 - peps/trunk/pep-3099.txt Message-ID: <20060825145303.CED111E4009@bag.python.org> Author: guido.van.rossum Date: Fri Aug 25 16:53:02 2006 New Revision: 51615 Modified: peps/trunk/pep-3099.txt Log: Py3k won't be case-insensitive. Added because someone asked about it. Modified: peps/trunk/pep-3099.txt ============================================================================== --- peps/trunk/pep-3099.txt (original) +++ peps/trunk/pep-3099.txt Fri Aug 25 16:53:02 2006 @@ -32,6 +32,8 @@ Core language ============= +* Python 3000 will not be case-insensitive. + * Python 3000 will not be a rewrite from scratch. It will also not use C++ or another language different from C From python-checkins at python.org Fri Aug 25 18:06:00 2006 From: python-checkins at python.org (jackilyn.hoxworth) Date: Fri, 25 Aug 2006 18:06:00 +0200 (CEST) Subject: [Python-checkins] r51616 - python/branches/hoxworth-stdlib_logging-soc/pep_update.txt python/branches/hoxworth-stdlib_logging-soc/test_robotparser_loggin.py Message-ID: <20060825160600.6B3DB1E4004@bag.python.org> Author: jackilyn.hoxworth Date: Fri Aug 25 18:05:59 2006 New Revision: 51616 Added: python/branches/hoxworth-stdlib_logging-soc/test_robotparser_loggin.py Modified: python/branches/hoxworth-stdlib_logging-soc/pep_update.txt Log: Modified: python/branches/hoxworth-stdlib_logging-soc/pep_update.txt ============================================================================== --- python/branches/hoxworth-stdlib_logging-soc/pep_update.txt (original) +++ python/branches/hoxworth-stdlib_logging-soc/pep_update.txt Fri Aug 25 18:05:59 2006 @@ -1,21 +1,21 @@ -Modifications to the Original Proposal -- the import is delayed until it's need - -Module Checklist -BaseHTTPServer.py - done but no test case created -SocketServer.py - done but no test case created -asyncore.py - done -gopherlib.py - done but no test case created -httplib - done with a test case almost completed -ihooks.py - done but no test case created -imaplib.py - done but no test case created -mhlib.py - done but no test case created -nntplib.py - done but no test case created -pipes.py - done but no test case created -pkgutil.py - done but no test case created -robotparser.py - done but no test case created -shlex.py - done but no test case created -smtpd.py - done but no test case created -threading.py - done but no test case created -timeit.py - done but no test case created +Modifications to the Original Proposal +- the import is delayed until it's need + +Module Checklist +BaseHTTPServer.py - done but no test case created +SocketServer.py - done but no test case created +asyncore.py - done +gopherlib.py - done but no test case created +httplib - done with a test case almost completed +ihooks.py - done but no test case created +imaplib.py - done but no test case created +mhlib.py - done but no test case created +nntplib.py - done but no test case created +pipes.py - done but no test case created +pkgutil.py - done but no test case created +robotparser.py - done +shlex.py - done but no test case created +smtpd.py - done but no test case created +threading.py - done but no test case created +timeit.py - done but no test case created trace.py - done but no test case created \ No newline at end of file Added: python/branches/hoxworth-stdlib_logging-soc/test_robotparser_loggin.py ============================================================================== --- (empty file) +++ python/branches/hoxworth-stdlib_logging-soc/test_robotparser_loggin.py Fri Aug 25 18:05:59 2006 @@ -0,0 +1,23 @@ +import robotparser +import logging +from cStringIO import StringIO + +# ... run the tests ... +log=logging.getLogger("py.robotparser") +stringLog = StringIO() + +# define the handler and level +handler = logging.StreamHandler(stringLog) +log.setLevel(logging.INFO) + +# add the handler to the logger +log.addHandler(handler) + +robotparser._log.info("message 1") # 1st test + +print stringLog.getvalue() # For testing purposes + +if stringLog.getvalue() != "Error: It worked": + print "it worked" +else: + print "it didn't work" \ No newline at end of file From buildbot at python.org Fri Aug 25 20:07:07 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 18:07:07 +0000 Subject: [Python-checkins] buildbot warnings in sparc Ubuntu dapper trunk Message-ID: <20060825180707.98C5E1E4004@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520Ubuntu%2520dapper%2520trunk/builds/670 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sat Aug 26 00:05:40 2006 From: python-checkins at python.org (tim.peters) Date: Sat, 26 Aug 2006 00:05:40 +0200 (CEST) Subject: [Python-checkins] r51617 - in python/trunk: Lib/test/test_parser.py Lib/test/test_tokenize.py Tools/msi/msi.py Message-ID: <20060825220540.8A4A11E4013@bag.python.org> Author: tim.peters Date: Sat Aug 26 00:05:39 2006 New Revision: 51617 Modified: python/trunk/Lib/test/test_parser.py python/trunk/Lib/test/test_tokenize.py python/trunk/Tools/msi/msi.py Log: Whitespace normalization. Modified: python/trunk/Lib/test/test_parser.py ============================================================================== --- python/trunk/Lib/test/test_parser.py (original) +++ python/trunk/Lib/test/test_parser.py Sat Aug 26 00:05:39 2006 @@ -199,7 +199,7 @@ yield x else: yield tree - + terminals = list(walk(st2)) self.assertEqual([ (1, 'def', 1, 0), Modified: python/trunk/Lib/test/test_tokenize.py ============================================================================== --- python/trunk/Lib/test/test_tokenize.py (original) +++ python/trunk/Lib/test/test_tokenize.py Sat Aug 26 00:05:39 2006 @@ -33,7 +33,7 @@ COMMENT '# NEWLINE' (3, 17) (3, 26) NEWLINE '\\n' (3, 26) (3, 27) DEDENT '' (4, 0) (4, 0) - + There will be a bunch more tests of specific source patterns. @@ -43,7 +43,7 @@ There are some standard formatting practices that are easy to get right. >>> roundtrip("if x == 1:\\n" -... " print x\\n") +... " print x\\n") if x == 1: print x @@ -53,7 +53,7 @@ >>> roundtrip("if x == 1 : \\n" ... " print x\\n") -if x == 1 : +if x == 1 : print x Comments need to go in the right place. Modified: python/trunk/Tools/msi/msi.py ============================================================================== --- python/trunk/Tools/msi/msi.py (original) +++ python/trunk/Tools/msi/msi.py Sat Aug 26 00:05:39 2006 @@ -877,7 +877,7 @@ if not have_ctypes: print "WARNING: _ctypes.pyd not found, ctypes will not be included" extensions.remove("_ctypes.pyd") - + # Add all .py files in Lib, except lib-tk, test dirs={} pydirs = [(root,"Lib")] From python-checkins at python.org Sat Aug 26 00:06:44 2006 From: python-checkins at python.org (tim.peters) Date: Sat, 26 Aug 2006 00:06:44 +0200 (CEST) Subject: [Python-checkins] r51618 - python/trunk/Python/peephole.c Message-ID: <20060825220644.7AA161E401C@bag.python.org> Author: tim.peters Date: Sat Aug 26 00:06:44 2006 New Revision: 51618 Modified: python/trunk/Python/peephole.c (props changed) Log: Add missing svn:eol-style property to text files. From python-checkins at python.org Sat Aug 26 00:26:21 2006 From: python-checkins at python.org (tim.peters) Date: Sat, 26 Aug 2006 00:26:21 +0200 (CEST) Subject: [Python-checkins] r51619 - python/trunk/Lib/test/test_tokenize.py Message-ID: <20060825222621.D02DB1E4004@bag.python.org> Author: tim.peters Date: Sat Aug 26 00:26:21 2006 New Revision: 51619 Modified: python/trunk/Lib/test/test_tokenize.py Log: A new test here relied on preserving invisible trailing whitespace in expected output. Stop that. Modified: python/trunk/Lib/test/test_tokenize.py ============================================================================== --- python/trunk/Lib/test/test_tokenize.py (original) +++ python/trunk/Lib/test/test_tokenize.py Sat Aug 26 00:26:21 2006 @@ -49,11 +49,12 @@ Some people use different formatting conventions, which makes untokenize a little trickier. Note that this test involves trailing -whitespace after the colon. You can't see it, but it's there! +whitespace after the colon. Note that we use hex escapes to make the +two trailing blanks apparent in the expected output. >>> roundtrip("if x == 1 : \\n" ... " print x\\n") -if x == 1 : +if x == 1 :\x20\x20 print x Comments need to go in the right place. From buildbot at python.org Sat Aug 26 00:29:09 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 22:29:09 +0000 Subject: [Python-checkins] buildbot warnings in x86 gentoo trunk Message-ID: <20060825222909.45D061E4004@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520gentoo%2520trunk/builds/1562 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 26 00:29:41 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 22:29:41 +0000 Subject: [Python-checkins] buildbot warnings in amd64 gentoo trunk Message-ID: <20060825222941.379351E4004@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%2520gentoo%2520trunk/builds/1479 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 26 00:31:29 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 22:31:29 +0000 Subject: [Python-checkins] buildbot warnings in x86 W2k trunk Message-ID: <20060825223129.CEC421E401B@bag.python.org> The Buildbot has detected a new failure of x86 W2k trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%2520trunk/builds/1469 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 26 00:31:43 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 22:31:43 +0000 Subject: [Python-checkins] buildbot warnings in x86 OpenBSD trunk Message-ID: <20060825223143.D0CF11E4017@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%2520trunk/builds/1240 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 26 00:44:48 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 22:44:48 +0000 Subject: [Python-checkins] buildbot warnings in PPC64 Debian trunk Message-ID: <20060825224448.84B531E4008@bag.python.org> The Buildbot has detected a new failure of PPC64 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/PPC64%2520Debian%2520trunk/builds/446 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 26 00:49:18 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 22:49:18 +0000 Subject: [Python-checkins] buildbot warnings in sparc solaris10 gcc trunk Message-ID: <20060825224918.654271E4004@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520solaris10%2520gcc%2520trunk/builds/1418 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 26 00:50:49 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 22:50:49 +0000 Subject: [Python-checkins] buildbot warnings in g4 osx.4 trunk Message-ID: <20060825225049.459F91E4004@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/g4%2520osx.4%2520trunk/builds/1404 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 26 00:58:10 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 22:58:10 +0000 Subject: [Python-checkins] buildbot warnings in ia64 Ubuntu trunk trunk Message-ID: <20060825225810.F3DE51E4020@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu trunk trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%2520Ubuntu%2520trunk%2520trunk/builds/67 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 26 01:02:36 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 23:02:36 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060825230236.B5BE51E4008@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1130 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 26 01:05:52 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 23:05:52 +0000 Subject: [Python-checkins] buildbot warnings in S-390 Debian trunk Message-ID: <20060825230552.2D19C1E4009@bag.python.org> The Buildbot has detected a new failure of S-390 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%2520Debian%2520trunk/builds/354 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 26 01:11:31 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 23:11:31 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) trunk Message-ID: <20060825231131.AA35A1E4019@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%2520trunk/builds/928 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 26 01:26:42 2006 From: buildbot at python.org (buildbot at python.org) Date: Fri, 25 Aug 2006 23:26:42 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060825232642.8B3961E400A@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/69 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Sat Aug 26 03:22:23 2006 From: buildbot at python.org (buildbot at python.org) Date: Sat, 26 Aug 2006 01:22:23 +0000 Subject: [Python-checkins] buildbot warnings in MIPS Debian trunk Message-ID: <20060826012223.710991E4004@bag.python.org> The Buildbot has detected a new failure of MIPS Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/MIPS%2520Debian%2520trunk/builds/394 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tim.peters Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Sat Aug 26 04:29:59 2006 From: python-checkins at python.org (jackilyn.hoxworth) Date: Sat, 26 Aug 2006 04:29:59 +0200 (CEST) Subject: [Python-checkins] r51622 - python/branches/hoxworth-stdlib_logging-soc/pep_update.txt python/branches/hoxworth-stdlib_logging-soc/smtpd.py python/branches/hoxworth-stdlib_logging-soc/test_robotparser.py python/branches/hoxworth-stdlib_logging-soc/test_robotparser_loggin.py python/branches/hoxworth-stdlib_logging-soc/test_shlex_logging.py python/branches/hoxworth-stdlib_logging-soc/test_stmpd_logging.py Message-ID: <20060826022959.8529D1E4004@bag.python.org> Author: jackilyn.hoxworth Date: Sat Aug 26 04:29:57 2006 New Revision: 51622 Added: python/branches/hoxworth-stdlib_logging-soc/test_robotparser.py python/branches/hoxworth-stdlib_logging-soc/test_shlex_logging.py python/branches/hoxworth-stdlib_logging-soc/test_stmpd_logging.py Modified: python/branches/hoxworth-stdlib_logging-soc/pep_update.txt python/branches/hoxworth-stdlib_logging-soc/smtpd.py python/branches/hoxworth-stdlib_logging-soc/test_robotparser_loggin.py Log: Modified: python/branches/hoxworth-stdlib_logging-soc/pep_update.txt ============================================================================== --- python/branches/hoxworth-stdlib_logging-soc/pep_update.txt (original) +++ python/branches/hoxworth-stdlib_logging-soc/pep_update.txt Sat Aug 26 04:29:57 2006 @@ -1,21 +1,21 @@ -Modifications to the Original Proposal -- the import is delayed until it's need - -Module Checklist -BaseHTTPServer.py - done but no test case created -SocketServer.py - done but no test case created -asyncore.py - done -gopherlib.py - done but no test case created -httplib - done with a test case almost completed -ihooks.py - done but no test case created -imaplib.py - done but no test case created -mhlib.py - done but no test case created -nntplib.py - done but no test case created -pipes.py - done but no test case created -pkgutil.py - done but no test case created -robotparser.py - done -shlex.py - done but no test case created -smtpd.py - done but no test case created -threading.py - done but no test case created -timeit.py - done but no test case created +Modifications to the Original Proposal +- the import is delayed until it's need + +Module Checklist +BaseHTTPServer.py - done but no test case created +SocketServer.py - done but no test case created +asyncore.py - done +gopherlib.py - done but no test case created +httplib - done with a test case almost completed +ihooks.py - done but no test case created +imaplib.py - done but no test case created +mhlib.py - done but no test case created +nntplib.py - done but no test case created +pipes.py - done but no test case created +pkgutil.py - done but no test case created +robotparser.py - done +shlex.py - done +smtpd.py - done +threading.py - done but no test case created +timeit.py - done but no test case created trace.py - done but no test case created \ No newline at end of file Modified: python/branches/hoxworth-stdlib_logging-soc/smtpd.py ============================================================================== --- python/branches/hoxworth-stdlib_logging-soc/smtpd.py (original) +++ python/branches/hoxworth-stdlib_logging-soc/smtpd.py Sat Aug 26 04:29:57 2006 @@ -235,7 +235,7 @@ self.push('250 Ok') def smtp_RCPT(self, arg): - _log.debug(>> DEBUGSTREAM, '===> RCPT', arg) + _log.debug( DEBUGSTREAM, '===> RCPT', arg) if not self.__mailfrom: self.push('503 Error: need MAIL command') return Added: python/branches/hoxworth-stdlib_logging-soc/test_robotparser.py ============================================================================== --- (empty file) +++ python/branches/hoxworth-stdlib_logging-soc/test_robotparser.py Sat Aug 26 04:29:57 2006 @@ -0,0 +1,162 @@ +import unittest, logging, StringIO, robotparser +from test import test_support + +class RobotTestCase(unittest.TestCase): + def __init__(self, index, parser, url, good, agent): + unittest.TestCase.__init__(self) + + self.log = log = logging.getLogger("py.robotparser") + self.outlog = StringIO.StringIO() + self.loghandler = logging.StreamHandler(self.outlog) + log.setLevel(logging.INFO) + log.addHandler(self.loghandler) + + if good: + self.str = "RobotTest(%d, good, %s)" % (index, url) + else: + self.str = "RobotTest(%d, bad, %s)" % (index, url) + + # The default setup permits warnings + robotparser._log.warn("Testing log of " + self.str) + + self.parser = parser + self.url = url + self.good = good + self.agent = agent + + def runTest(self): + if isinstance(self.url, tuple): + agent, url = self.url + else: + url = self.url + agent = self.agent + if self.good: + self.failUnless(self.parser.can_fetch(agent, url)) + else: + self.failIf(self.parser.can_fetch(agent, url)) + + self.log.removeHandler(self.outlog) + # In the default configuration, unless someone has flipped the debug + # switch externally, nothing should be logged from the module itself. + # Unfortunately, unittest timing means that there may be additional + # output from other test cases. + self.failUnless(("Testing log of "+ self.str) in self.outlog.getvalue()) + for line in self.outlog.readlines(): + self.failUnless(line.startswith("Testing log of ")) + + def __str__(self): + return self.str + +tests = unittest.TestSuite() + +def RobotTest(index, robots_txt, good_urls, bad_urls, + agent="test_robotparser"): + + lines = StringIO.StringIO(robots_txt).readlines() + parser = robotparser.RobotFileParser() + parser.parse(lines) + for url in good_urls: + tests.addTest(RobotTestCase(index, parser, url, 1, agent)) + for url in bad_urls: + tests.addTest(RobotTestCase(index, parser, url, 0, agent)) + +# Examples from http://www.robotstxt.org/wc/norobots.html (fetched 2002) + +# 1. +doc = """ +User-agent: * +Disallow: /cyberworld/map/ # This is an infinite virtual URL space +Disallow: /tmp/ # these will soon disappear +Disallow: /foo.html +""" + +good = ['/','/test.html'] +bad = ['/cyberworld/map/index.html','/tmp/xxx','/foo.html'] + +RobotTest(1, doc, good, bad) + +# 2. +doc = """ +# robots.txt for http://www.example.com/ + +User-agent: * +Disallow: /cyberworld/map/ # This is an infinite virtual URL space + +# Cybermapper knows where to go. +User-agent: cybermapper +Disallow: + +""" + +good = ['/','/test.html',('cybermapper','/cyberworld/map/index.html')] +bad = ['/cyberworld/map/index.html'] + +RobotTest(2, doc, good, bad) + +# 3. +doc = """ +# go away +User-agent: * +Disallow: / +""" + +good = [] +bad = ['/cyberworld/map/index.html','/','/tmp/'] + +RobotTest(3, doc, good, bad) + +# Examples from http://www.robotstxt.org/wc/norobots-rfc.html (fetched 2002) + +# 4. +doc = """ +User-agent: figtree +Disallow: /tmp +Disallow: /a%3cd.html +Disallow: /a%2fb.html +Disallow: /%7ejoe/index.html +""" + +good = [] # XFAIL '/a/b.html' +bad = ['/tmp','/tmp.html','/tmp/a.html', + '/a%3cd.html','/a%3Cd.html','/a%2fb.html', + '/~joe/index.html' + ] + +RobotTest(4, doc, good, bad, 'figtree') +RobotTest(5, doc, good, bad, 'FigTree Robot libwww-perl/5.04') + +# 6. +doc = """ +User-agent: * +Disallow: /tmp/ +Disallow: /a%3Cd.html +Disallow: /a/b.html +Disallow: /%7ejoe/index.html +""" + +good = ['/tmp',] # XFAIL: '/a%2fb.html' +bad = ['/tmp/','/tmp/a.html', + '/a%3cd.html','/a%3Cd.html',"/a/b.html", + '/%7Ejoe/index.html'] + +RobotTest(6, doc, good, bad) + +# From bug report #523041 + +# 7. +doc = """ +User-Agent: * +Disallow: /. +""" + +good = ['/foo.html'] +bad = [] # Bug report says "/" should be denied, but that is not in the RFC + +RobotTest(7, doc, good, bad) + +def test_main(): + test_support.run_suite(tests) + +if __name__=='__main__': + test_support.Verbose = 1 + test_support.run_suite(tests) Modified: python/branches/hoxworth-stdlib_logging-soc/test_robotparser_loggin.py ============================================================================== --- python/branches/hoxworth-stdlib_logging-soc/test_robotparser_loggin.py (original) +++ python/branches/hoxworth-stdlib_logging-soc/test_robotparser_loggin.py Sat Aug 26 04:29:57 2006 @@ -13,7 +13,7 @@ # add the handler to the logger log.addHandler(handler) -robotparser._log.info("message 1") # 1st test +robotparser._log.info("message 1") print stringLog.getvalue() # For testing purposes Added: python/branches/hoxworth-stdlib_logging-soc/test_shlex_logging.py ============================================================================== --- (empty file) +++ python/branches/hoxworth-stdlib_logging-soc/test_shlex_logging.py Sat Aug 26 04:29:57 2006 @@ -0,0 +1,23 @@ +import shlex +import logging +from cStringIO import StringIO + +# ... run the tests ... +log=logging.getLogger("py.shlex") +stringLog = StringIO() + +# define the handler and level +handler = logging.StreamHandler(stringLog) +log.setLevel(logging.INFO) + +# add the handler to the logger +log.addHandler(handler) + +shlex._log.info("message 1") + +print stringLog.getvalue() # For testing purposes + +if stringLog.getvalue() != "Error: It worked": + print "it worked" +else: + print "it didn't work" \ No newline at end of file Added: python/branches/hoxworth-stdlib_logging-soc/test_stmpd_logging.py ============================================================================== --- (empty file) +++ python/branches/hoxworth-stdlib_logging-soc/test_stmpd_logging.py Sat Aug 26 04:29:57 2006 @@ -0,0 +1,23 @@ +import smtpd +import logging +from cStringIO import StringIO + +# ... run the tests ... +log=logging.getLogger("py.smtpd") +stringLog = StringIO() + +# define the handler and level +handler = logging.StreamHandler(stringLog) +log.setLevel(logging.INFO) + +# add the handler to the logger +log.addHandler(handler) + +smtpd._log.info("message 1") + +print stringLog.getvalue() # For testing purposes + +if stringLog.getvalue() != "Error: It worked": + print "it worked" +else: + print "it didn't work" \ No newline at end of file From python-checkins at python.org Sat Aug 26 20:42:08 2006 From: python-checkins at python.org (jack.diederich) Date: Sat, 26 Aug 2006 20:42:08 +0200 (CEST) Subject: [Python-checkins] r51624 - in python/trunk/Lib: genericpath.py macpath.py ntpath.py os2emxpath.py posixpath.py test/test_genericpath.py Message-ID: <20060826184208.1F6AB1E4003@bag.python.org> Author: jack.diederich Date: Sat Aug 26 20:42:06 2006 New Revision: 51624 Added: python/trunk/Lib/genericpath.py python/trunk/Lib/test/test_genericpath.py Modified: python/trunk/Lib/macpath.py python/trunk/Lib/ntpath.py python/trunk/Lib/os2emxpath.py python/trunk/Lib/posixpath.py Log: - Move functions common to all path modules into genericpath.py and have the OS speicifc path modules import them. - Have os2emxpath import common functions fron ntpath instead of using copies Added: python/trunk/Lib/genericpath.py ============================================================================== --- (empty file) +++ python/trunk/Lib/genericpath.py Sat Aug 26 20:42:06 2006 @@ -0,0 +1,78 @@ +""" +Path operations common to more than one OS +Do not use directly. The OS specific modules import the appropriate +functions from this module themselves. +""" +import os +import stat + +__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime', + 'getsize', 'isdir', 'isfile'] + + +# Does a path exist? +# This is false for dangling symbolic links on systems that support them. +def exists(path): + """Test whether a path exists. Returns False for broken symbolic links""" + try: + st = os.stat(path) + except os.error: + return False + return True + + +# This follows symbolic links, so both islink() and isdir() can be true +# for the same path ono systems that support symlinks +def isfile(path): + """Test whether a path is a regular file""" + try: + st = os.stat(path) + except os.error: + return False + return stat.S_ISREG(st.st_mode) + + +# Is a path a directory? +# This follows symbolic links, so both islink() and isdir() +# can be true for the same path on systems that support symlinks +def isdir(s): + """Return true if the pathname refers to an existing directory.""" + try: + st = os.stat(s) + except os.error: + return False + return stat.S_ISDIR(st.st_mode) + + +def getsize(filename): + """Return the size of a file, reported by os.stat().""" + return os.stat(filename).st_size + + +def getmtime(filename): + """Return the last modification time of a file, reported by os.stat().""" + return os.stat(filename).st_mtime + + +def getatime(filename): + """Return the last access time of a file, reported by os.stat().""" + return os.stat(filename).st_atime + + +def getctime(filename): + """Return the metadata change time of a file, reported by os.stat().""" + return os.stat(filename).st_ctime + + +# Return the longest prefix of all list elements. +def commonprefix(m): + "Given a list of pathnames, returns the longest common leading component" + if not m: return '' + s1 = min(m) + s2 = max(m) + n = min(len(s1), len(s2)) + for i in xrange(n): + if s1[i] != s2[i]: + return s1[:i] + return s1[:n] + Modified: python/trunk/Lib/macpath.py ============================================================================== --- python/trunk/Lib/macpath.py (original) +++ python/trunk/Lib/macpath.py Sat Aug 26 20:42:06 2006 @@ -2,6 +2,7 @@ import os from stat import * +from genericpath import * __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", @@ -101,31 +102,6 @@ components = split(s) return len(components) == 2 and components[1] == '' -def isdir(s): - """Return true if the pathname refers to an existing directory.""" - - try: - st = os.stat(s) - except os.error: - return 0 - return S_ISDIR(st.st_mode) - - -# Get size, mtime, atime of files. - -def getsize(filename): - """Return the size of a file, reported by os.stat().""" - return os.stat(filename).st_size - -def getmtime(filename): - """Return the last modification time of a file, reported by os.stat().""" - return os.stat(filename).st_mtime - -def getatime(filename): - """Return the last access time of a file, reported by os.stat().""" - return os.stat(filename).st_atime - - def islink(s): """Return true if the pathname refers to a symbolic link.""" @@ -135,29 +111,6 @@ except: return False - -def isfile(s): - """Return true if the pathname refers to an existing regular file.""" - - try: - st = os.stat(s) - except os.error: - return False - return S_ISREG(st.st_mode) - -def getctime(filename): - """Return the creation time of a file, reported by os.stat().""" - return os.stat(filename).st_ctime - -def exists(s): - """Test whether a path exists. Returns False for broken symbolic links""" - - try: - st = os.stat(s) - except os.error: - return False - return True - # Is `stat`/`lstat` a meaningful difference on the Mac? This is safe in any # case. @@ -170,20 +123,6 @@ return False return True -# Return the longest prefix of all list elements. - -def commonprefix(m): - "Given a list of pathnames, returns the longest common leading component" - if not m: return '' - s1 = min(m) - s2 = max(m) - n = min(len(s1), len(s2)) - for i in xrange(n): - if s1[i] != s2[i]: - return s1[:i] - return s1[:n] - - def expandvars(path): """Dummy to retain interface-compatibility with other operating systems.""" return path Modified: python/trunk/Lib/ntpath.py ============================================================================== --- python/trunk/Lib/ntpath.py (original) +++ python/trunk/Lib/ntpath.py Sat Aug 26 20:42:06 2006 @@ -8,6 +8,7 @@ import os import stat import sys +from genericpath import * __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", @@ -206,86 +207,18 @@ """Returns the directory component of a pathname""" return split(p)[0] - -# Return the longest prefix of all list elements. - -def commonprefix(m): - "Given a list of pathnames, returns the longest common leading component" - if not m: return '' - s1 = min(m) - s2 = max(m) - n = min(len(s1), len(s2)) - for i in xrange(n): - if s1[i] != s2[i]: - return s1[:i] - return s1[:n] - - -# Get size, mtime, atime of files. - -def getsize(filename): - """Return the size of a file, reported by os.stat()""" - return os.stat(filename).st_size - -def getmtime(filename): - """Return the last modification time of a file, reported by os.stat()""" - return os.stat(filename).st_mtime - -def getatime(filename): - """Return the last access time of a file, reported by os.stat()""" - return os.stat(filename).st_atime - -def getctime(filename): - """Return the creation time of a file, reported by os.stat().""" - return os.stat(filename).st_ctime - # Is a path a symbolic link? # This will always return false on systems where posix.lstat doesn't exist. def islink(path): - """Test for symbolic link. On WindowsNT/95 always returns false""" + """Test for symbolic link. + On WindowsNT/95 and OS/2 always returns false + """ return False - -# Does a path exist? - -def exists(path): - """Test whether a path exists""" - try: - st = os.stat(path) - except os.error: - return False - return True - +# alias exists to lexists lexists = exists - -# Is a path a dos directory? -# This follows symbolic links, so both islink() and isdir() can be true -# for the same path. - -def isdir(path): - """Test whether a path is a directory""" - try: - st = os.stat(path) - except os.error: - return False - return stat.S_ISDIR(st.st_mode) - - -# Is a path a regular file? -# This follows symbolic links, so both islink() and isdir() can be true -# for the same path. - -def isfile(path): - """Test whether a path is a regular file""" - try: - st = os.stat(path) - except os.error: - return False - return stat.S_ISREG(st.st_mode) - - # Is a path a mount point? Either a root (with or without drive letter) # or an UNC path with at most a / or \ after the mount point. Modified: python/trunk/Lib/os2emxpath.py ============================================================================== --- python/trunk/Lib/os2emxpath.py (original) +++ python/trunk/Lib/os2emxpath.py Sat Aug 26 20:42:06 2006 @@ -7,6 +7,9 @@ import os import stat +from genericpath import * +from ntpath import (expanduser, expandvars, isabs, islink, splitdrive, + splitext, split, walk) __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", @@ -36,18 +39,6 @@ return s.replace('\\', '/').lower() -# Return whether a path is absolute. -# Trivial in Posix, harder on the Mac or MS-DOS. -# For DOS it is absolute if it starts with a slash or backslash (current -# volume), or if a pathname after the volume letter and colon / UNC resource -# starts with a slash or backslash. - -def isabs(s): - """Test whether a path is absolute""" - s = splitdrive(s)[1] - return s != '' and s[:1] in '/\\' - - # Join two (or more) paths. def join(a, *p): @@ -63,17 +54,6 @@ return path -# Split a path in a drive specification (a drive letter followed by a -# colon) and the path specification. -# It is always true that drivespec + pathspec == p -def splitdrive(p): - """Split a pathname into drive and path specifiers. Returns a 2-tuple -"(drive,path)"; either part may be empty""" - if p[1:2] == ':': - return p[0:2], p[2:] - return '', p - - # Parse UNC paths def splitunc(p): """Split a pathname into UNC mount point and relative path specifiers. @@ -103,57 +83,6 @@ return '', p -# Split a path in head (everything up to the last '/') and tail (the -# rest). After the trailing '/' is stripped, the invariant -# join(head, tail) == p holds. -# The resulting head won't end in '/' unless it is the root. - -def split(p): - """Split a pathname. - - Return tuple (head, tail) where tail is everything after the final slash. - Either part may be empty.""" - - d, p = splitdrive(p) - # set i to index beyond p's last slash - i = len(p) - while i and p[i-1] not in '/\\': - i = i - 1 - head, tail = p[:i], p[i:] # now tail has no slashes - # remove trailing slashes from head, unless it's all slashes - head2 = head - while head2 and head2[-1] in '/\\': - head2 = head2[:-1] - head = head2 or head - return d + head, tail - - -# Split a path in root and extension. -# The extension is everything starting at the last dot in the last -# pathname component; the root is everything before that. -# It is always true that root + ext == p. - -def splitext(p): - """Split the extension from a pathname. - - Extension is everything from the last dot to the end. - Return (root, ext), either part may be empty.""" - root, ext = '', '' - for c in p: - if c in ['/','\\']: - root, ext = root + ext + c, '' - elif c == '.': - if ext: - root, ext = root + ext, c - else: - ext = c - elif ext: - ext = ext + c - else: - root = root + c - return root, ext - - # Return the tail (basename) part of a path. def basename(p): @@ -168,84 +97,12 @@ return split(p)[0] -# Return the longest prefix of all list elements. - -def commonprefix(m): - "Given a list of pathnames, returns the longest common leading component" - if not m: return '' - s1 = min(m) - s2 = max(m) - n = min(len(s1), len(s2)) - for i in xrange(n): - if s1[i] != s2[i]: - return s1[:i] - return s1[:n] - - -# Get size, mtime, atime of files. - -def getsize(filename): - """Return the size of a file, reported by os.stat()""" - return os.stat(filename).st_size - -def getmtime(filename): - """Return the last modification time of a file, reported by os.stat()""" - return os.stat(filename).st_mtime - -def getatime(filename): - """Return the last access time of a file, reported by os.stat()""" - return os.stat(filename).st_atime - -def getctime(filename): - """Return the creation time of a file, reported by os.stat().""" - return os.stat(filename).st_ctime - -# Is a path a symbolic link? -# This will always return false on systems where posix.lstat doesn't exist. - -def islink(path): - """Test for symbolic link. On OS/2 always returns false""" - return False - - -# Does a path exist? -# This is false for dangling symbolic links. - -def exists(path): - """Test whether a path exists""" - try: - st = os.stat(path) - except os.error: - return False - return True - +# alias exists to lexists lexists = exists # Is a path a directory? -def isdir(path): - """Test whether a path is a directory""" - try: - st = os.stat(path) - except os.error: - return False - return stat.S_ISDIR(st.st_mode) - - -# Is a path a regular file? -# This follows symbolic links, so both islink() and isdir() can be true -# for the same path. - -def isfile(path): - """Test whether a path is a regular file""" - try: - st = os.stat(path) - except os.error: - return False - return stat.S_ISREG(st.st_mode) - - # Is a path a mount point? Either a root (with or without drive letter) # or an UNC path with at most a / or \ after the mount point. @@ -258,131 +115,6 @@ return len(p) == 1 and p[0] in '/\\' -# Directory tree walk. -# For each directory under top (including top itself, but excluding -# '.' and '..'), func(arg, dirname, filenames) is called, where -# dirname is the name of the directory and filenames is the list -# of files (and subdirectories etc.) in the directory. -# The func may modify the filenames list, to implement a filter, -# or to impose a different order of visiting. - -def walk(top, func, arg): - """Directory tree walk whth callback function. - - walk(top, func, arg) calls func(arg, d, files) for each directory d - in the tree rooted at top (including top itself); files is a list - of all the files and subdirs in directory d.""" - try: - names = os.listdir(top) - except os.error: - return - func(arg, top, names) - exceptions = ('.', '..') - for name in names: - if name not in exceptions: - name = join(top, name) - if isdir(name): - walk(name, func, arg) - - -# Expand paths beginning with '~' or '~user'. -# '~' means $HOME; '~user' means that user's home directory. -# If the path doesn't begin with '~', or if the user or $HOME is unknown, -# the path is returned unchanged (leaving error reporting to whatever -# function is called with the expanded path as argument). -# See also module 'glob' for expansion of *, ? and [...] in pathnames. -# (A function should also be defined to do full *sh-style environment -# variable expansion.) - -def expanduser(path): - """Expand ~ and ~user constructs. - - If user or $HOME is unknown, do nothing.""" - if path[:1] != '~': - return path - i, n = 1, len(path) - while i < n and path[i] not in '/\\': - i = i + 1 - if i == 1: - if 'HOME' in os.environ: - userhome = os.environ['HOME'] - elif not 'HOMEPATH' in os.environ: - return path - else: - try: - drive = os.environ['HOMEDRIVE'] - except KeyError: - drive = '' - userhome = join(drive, os.environ['HOMEPATH']) - else: - return path - return userhome + path[i:] - - -# Expand paths containing shell variable substitutions. -# The following rules apply: -# - no expansion within single quotes -# - no escape character, except for '$$' which is translated into '$' -# - ${varname} is accepted. -# - varnames can be made out of letters, digits and the character '_' -# XXX With COMMAND.COM you can use any characters in a variable name, -# XXX except '^|<>='. - -def expandvars(path): - """Expand shell variables of form $var and ${var}. - - Unknown variables are left unchanged.""" - if '$' not in path: - return path - import string - varchars = string.letters + string.digits + '_-' - res = '' - index = 0 - pathlen = len(path) - while index < pathlen: - c = path[index] - if c == '\'': # no expansion within single quotes - path = path[index + 1:] - pathlen = len(path) - try: - index = path.index('\'') - res = res + '\'' + path[:index + 1] - except ValueError: - res = res + path - index = pathlen - 1 - elif c == '$': # variable or '$$' - if path[index + 1:index + 2] == '$': - res = res + c - index = index + 1 - elif path[index + 1:index + 2] == '{': - path = path[index+2:] - pathlen = len(path) - try: - index = path.index('}') - var = path[:index] - if var in os.environ: - res = res + os.environ[var] - except ValueError: - res = res + path - index = pathlen - 1 - else: - var = '' - index = index + 1 - c = path[index:index + 1] - while c != '' and c in varchars: - var = var + c - index = index + 1 - c = path[index:index + 1] - if var in os.environ: - res = res + os.environ[var] - if c != '': - res = res + c - else: - res = res + c - index = index + 1 - return res - - # Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B. def normpath(path): Modified: python/trunk/Lib/posixpath.py ============================================================================== --- python/trunk/Lib/posixpath.py (original) +++ python/trunk/Lib/posixpath.py Sat Aug 26 20:42:06 2006 @@ -12,6 +12,7 @@ import os import stat +from genericpath import * __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", @@ -119,37 +120,6 @@ return split(p)[0] -# Return the longest prefix of all list elements. - -def commonprefix(m): - "Given a list of pathnames, returns the longest common leading component" - if not m: return '' - s1 = min(m) - s2 = max(m) - n = min(len(s1), len(s2)) - for i in xrange(n): - if s1[i] != s2[i]: - return s1[:i] - return s1[:n] - -# Get size, mtime, atime of files. - -def getsize(filename): - """Return the size of a file, reported by os.stat().""" - return os.stat(filename).st_size - -def getmtime(filename): - """Return the last modification time of a file, reported by os.stat().""" - return os.stat(filename).st_mtime - -def getatime(filename): - """Return the last access time of a file, reported by os.stat().""" - return os.stat(filename).st_atime - -def getctime(filename): - """Return the metadata change time of a file, reported by os.stat().""" - return os.stat(filename).st_ctime - # Is a path a symbolic link? # This will always return false on systems where os.lstat doesn't exist. @@ -161,19 +131,6 @@ return False return stat.S_ISLNK(st.st_mode) - -# Does a path exist? -# This is false for dangling symbolic links. - -def exists(path): - """Test whether a path exists. Returns False for broken symbolic links""" - try: - st = os.stat(path) - except os.error: - return False - return True - - # Being true for dangling symbolic links is also useful. def lexists(path): @@ -185,32 +142,6 @@ return True -# Is a path a directory? -# This follows symbolic links, so both islink() and isdir() can be true -# for the same path. - -def isdir(path): - """Test whether a path is a directory""" - try: - st = os.stat(path) - except os.error: - return False - return stat.S_ISDIR(st.st_mode) - - -# Is a path a regular file? -# This follows symbolic links, so both islink() and isfile() can be true -# for the same path. - -def isfile(path): - """Test whether a path is a regular file""" - try: - st = os.stat(path) - except os.error: - return False - return stat.S_ISREG(st.st_mode) - - # Are two filenames really pointing to the same file? def samefile(f1, f2): Added: python/trunk/Lib/test/test_genericpath.py ============================================================================== --- (empty file) +++ python/trunk/Lib/test/test_genericpath.py Sat Aug 26 20:42:06 2006 @@ -0,0 +1,184 @@ +import unittest +from test import test_support +import os +import genericpath + +class AllCommonTest(unittest.TestCase): + + def assertIs(self, a, b): + self.assert_(a is b) + + def test_commonprefix(self): + self.assertEqual( + genericpath.commonprefix([]), + "" + ) + self.assertEqual( + genericpath.commonprefix(["/home/swenson/spam", "/home/swen/spam"]), + "/home/swen" + ) + self.assertEqual( + genericpath.commonprefix(["/home/swen/spam", "/home/swen/eggs"]), + "/home/swen/" + ) + self.assertEqual( + genericpath.commonprefix(["/home/swen/spam", "/home/swen/spam"]), + "/home/swen/spam" + ) + + def test_getsize(self): + f = open(test_support.TESTFN, "wb") + try: + f.write("foo") + f.close() + self.assertEqual(genericpath.getsize(test_support.TESTFN), 3) + finally: + if not f.closed: + f.close() + os.remove(test_support.TESTFN) + + def test_time(self): + f = open(test_support.TESTFN, "wb") + try: + f.write("foo") + f.close() + f = open(test_support.TESTFN, "ab") + f.write("bar") + f.close() + f = open(test_support.TESTFN, "rb") + d = f.read() + f.close() + self.assertEqual(d, "foobar") + + self.assert_( + genericpath.getctime(test_support.TESTFN) <= + genericpath.getmtime(test_support.TESTFN) + ) + finally: + if not f.closed: + f.close() + os.remove(test_support.TESTFN) + + def test_exists(self): + self.assertIs(genericpath.exists(test_support.TESTFN), False) + f = open(test_support.TESTFN, "wb") + try: + f.write("foo") + f.close() + self.assertIs(genericpath.exists(test_support.TESTFN), True) + finally: + if not f.close(): + f.close() + try: + os.remove(test_support.TESTFN) + except os.error: + pass + + self.assertRaises(TypeError, genericpath.exists) + + def test_isdir(self): + self.assertIs(genericpath.isdir(test_support.TESTFN), False) + f = open(test_support.TESTFN, "wb") + try: + f.write("foo") + f.close() + self.assertIs(genericpath.isdir(test_support.TESTFN), False) + os.remove(test_support.TESTFN) + os.mkdir(test_support.TESTFN) + self.assertIs(genericpath.isdir(test_support.TESTFN), True) + os.rmdir(test_support.TESTFN) + finally: + if not f.close(): + f.close() + try: + os.remove(test_support.TESTFN) + except os.error: + pass + try: + os.rmdir(test_support.TESTFN) + except os.error: + pass + + self.assertRaises(TypeError, genericpath.isdir) + + def test_isfile(self): + self.assertIs(genericpath.isfile(test_support.TESTFN), False) + f = open(test_support.TESTFN, "wb") + try: + f.write("foo") + f.close() + self.assertIs(genericpath.isfile(test_support.TESTFN), True) + os.remove(test_support.TESTFN) + os.mkdir(test_support.TESTFN) + self.assertIs(genericpath.isfile(test_support.TESTFN), False) + os.rmdir(test_support.TESTFN) + finally: + if not f.close(): + f.close() + try: + os.remove(test_support.TESTFN) + except os.error: + pass + try: + os.rmdir(test_support.TESTFN) + except os.error: + pass + + self.assertRaises(TypeError, genericpath.isdir) + + def test_samefile(self): + f = open(test_support.TESTFN + "1", "wb") + try: + f.write("foo") + f.close() + self.assertIs( + genericpath.samefile( + test_support.TESTFN + "1", + test_support.TESTFN + "1" + ), + True + ) + # If we don't have links, assume that os.stat doesn't return resonable + # inode information and thus, that samefile() doesn't work + if hasattr(os, "symlink"): + os.symlink( + test_support.TESTFN + "1", + test_support.TESTFN + "2" + ) + self.assertIs( + genericpath.samefile( + test_support.TESTFN + "1", + test_support.TESTFN + "2" + ), + True + ) + os.remove(test_support.TESTFN + "2") + f = open(test_support.TESTFN + "2", "wb") + f.write("bar") + f.close() + self.assertIs( + genericpath.samefile( + test_support.TESTFN + "1", + test_support.TESTFN + "2" + ), + False + ) + finally: + if not f.close(): + f.close() + try: + os.remove(test_support.TESTFN + "1") + except os.error: + pass + try: + os.remove(test_support.TESTFN + "2") + except os.error: + pass + + self.assertRaises(TypeError, genericpath.samefile) + +def test_main(): + test_support.run_unittest(AllCommonTest) + +if __name__=="__main__": + test_main() From andymac at bullseye.apana.org.au Sun Aug 27 02:47:06 2006 From: andymac at bullseye.apana.org.au (Andrew MacIntyre) Date: Sun, 27 Aug 2006 11:47:06 +1100 Subject: [Python-checkins] r51624 - in python/trunk/Lib: genericpath.py macpath.py ntpath.py os2emxpath.py posixpath.py test/test_genericpath.py In-Reply-To: <20060826184208.1F6AB1E4003@bag.python.org> References: <20060826184208.1F6AB1E4003@bag.python.org> Message-ID: <44F0EB8A.1060204@bullseye.andymac.org> jack.diederich wrote: > Author: jack.diederich > Date: Sat Aug 26 20:42:06 2006 > New Revision: 51624 > > Added: > python/trunk/Lib/genericpath.py > python/trunk/Lib/test/test_genericpath.py > Modified: > python/trunk/Lib/macpath.py > python/trunk/Lib/ntpath.py > python/trunk/Lib/os2emxpath.py > python/trunk/Lib/posixpath.py > Log: > - Move functions common to all path modules into genericpath.py and have the > OS speicifc path modules import them. > - Have os2emxpath import common functions fron ntpath instead of using copies When the EMX support was added, I asked about doing this (having os2emxpath import stuff from ntpath), and Guido's conclusion at the time was that the os2emxpath module should be independant of ntpath - even if there was significant duplication. I have no problem with the genericpath rationalisation, but request that the ntpath related changes to os2emxpath be reverted unless other advice to the contrary is forthcoming. -- ------------------------------------------------------------------------- Andrew I MacIntyre "These thoughts are mine alone..." E-mail: andymac at bullseye.apana.org.au (pref) | Snail: PO Box 370 andymac at pcug.org.au (alt) | Belconnen ACT 2616 Web: http://www.andymac.org/ | Australia From python-checkins at python.org Sun Aug 27 04:13:12 2006 From: python-checkins at python.org (jeremy.hylton) Date: Sun, 27 Aug 2006 04:13:12 +0200 (CEST) Subject: [Python-checkins] r51628 - sandbox/trunk/refactor/concrete.py sandbox/trunk/refactor/example.py sandbox/trunk/refactor/has_key.py Message-ID: <20060827021312.CA4DA1E4003@bag.python.org> Author: jeremy.hylton Date: Sun Aug 27 04:13:11 2006 New Revision: 51628 Added: sandbox/trunk/refactor/example.py sandbox/trunk/refactor/has_key.py Modified: sandbox/trunk/refactor/concrete.py Log: Commit code from the sprint in its current broken state Modified: sandbox/trunk/refactor/concrete.py ============================================================================== --- sandbox/trunk/refactor/concrete.py (original) +++ sandbox/trunk/refactor/concrete.py Sun Aug 27 04:13:11 2006 @@ -2,6 +2,7 @@ import _ast import tokenize +from StringIO import StringIO # Token eating rules for AST nodes @@ -16,7 +17,7 @@ # So the token rules may need to associate tokens with fields. class TokenRules: - Module = [_ast.stmt, tokenize.ENDMARKER] + Module = [_ast.stmt, _ast.stmt, tokenize.ENDMARKER] If = [(tokenize.NAME, 'if'), _ast.expr, (tokenize.OP, ':'), tokenize.NEWLINE, @@ -29,17 +30,23 @@ tokenize.DEDENT, ] Assign = [_ast.expr, (tokenize.OP, '='), _ast.expr, tokenize.NEWLINE] + Print = [(tokenize.NAME, 'print'), _ast.expr, tokenize.NEWLINE] BinOp = [_ast.expr, _ast.operator, _ast.expr] Compare = [_ast.expr, _ast.operator, _ast.expr] Attribute = [_ast.expr, (tokenize.OP, '.'), tokenize.NAME] + Call = [_ast.expr, (tokenize.OP, '('), _ast.expr, + (tokenize.OP, ')')] + Str = [tokenize.STRING] Name = [tokenize.NAME] Num = [tokenize.NUMBER] Add = [(tokenize.OP, '+')] Eq = [(tokenize.OP, '==')] + keyword = [tokenize.NAME, (tokenize.OP, '='), _ast.expr] def TreeIter(tree): + """Return all the AST nodes in tree in order.""" yield tree if tree._fields is None: return @@ -59,7 +66,7 @@ for child in WalkConcrete(elt): yield child else: - yield elt + yield elt # a raw token class TreeTokenizer: """Decorate AST nodes with the actual tokens that represent them. @@ -72,6 +79,8 @@ walk: The current tree node does not have a rule to match a terminal. Walk to the next node of the tree. + + .concrete: Creates a parallel tree with tokens & AST nodes """ @@ -185,10 +194,10 @@ self.traverse() return True - if isinstance(next_match, tuple): + if isinstance(next_match, tuple): # specific tokens like 'def' return self.match2(next_match) - if isinstance(next_match, int): + if isinstance(next_match, int): # generic tokens like a var name return self.match1(next_match) # TODO(jhylton): Figure out if you can ever get here. @@ -199,7 +208,17 @@ while 1: if not self.step(): break - + +def parse(source, file="", mode="exec"): + """Parse the code in source and return a concrete AST.""" + tokens = tokenize.generate_tokens(StringIO(source).readline) + tree = compile(source, file, mode, 0x400) + TreeTokenizer(tree, tokens).run() + return tree + +def unparse(tree): + """Return source code generated from a concrete AST.""" + return tokenize.untokenize(WalkConcrete(tree)) if __name__ == "__main__": import sys @@ -209,6 +228,8 @@ source = open(path).read() tokens = tokenize.generate_tokens(open(path).readline) tree = compile(source, path, "exec", 0x400) + for node in TreeIter(tree): + print node tt = TreeTokenizer(tree, tokens) tt.run() code = tokenize.untokenize(WalkConcrete(tree)) Added: sandbox/trunk/refactor/example.py ============================================================================== --- (empty file) +++ sandbox/trunk/refactor/example.py Sun Aug 27 04:13:11 2006 @@ -0,0 +1,5 @@ +d = dict(x=1) +if d.has_key("x"): + print "yes" +else: + print "no" Added: sandbox/trunk/refactor/has_key.py ============================================================================== --- (empty file) +++ sandbox/trunk/refactor/has_key.py Sun Aug 27 04:13:11 2006 @@ -0,0 +1,87 @@ +"""Replace has_key with in operator.""" + +import _ast +import concrete + +def Replace(tree, old, new): + """Replace the node old in tree with the node new. + + Replaces only the first occurrence in old. + """ + for node in concrete.TreeIter(tree): + if node._fields is None: + continue + if old in node.concrete: + i = node.concrete.index(old) + node.concrete[i] = new + for fieldname in node._fields: + child = getattr(node, fieldname) + if isinstance(child, list): + if old in child: + i = child.index(old) + child[i] = new + return + else: + if child is old: + setattr(node, fieldname, new) + return + +def strip_positions(node): + new_concrete = [] + for elt in node.concrete: + if isinstance(elt, _ast.AST): + strip_positions(elt) + new_concrete.append(elt) + else: + new_concrete.append(elt[:2]) + node.concrete = new_concrete + +class HasKeyTransformer: + + def search(self, tree): + for node in concrete.TreeIter(tree): + if self.is_has_key_call(node): + yield node + + def is_has_key_call(self, node): + if not isinstance(node, _ast.Call): + return False + callee = node.func + if not isinstance(callee, _ast.Attribute): + return False + return callee.attr == "has_key" + + def replace(self, node): + # Replace the Call node with a Compare node. The + # base of the callee becomes the RHS and one argument + # in the call becomes the LHS. + + the_dict = node.func.value + the_key = node.args[0] + strip_positions(the_key) + + new = _ast.Compare() + new.left = the_key + the_in = _ast.In() + + # We need to synthesize a full token for "in". Yuck! + the_in.concrete = [(3, "in")] + new.ops = [the_in] + new.comparators = [the_dict] + new.concrete = [new.left] + new.ops + new.comparators + return new + +def main(args): + path = args[0] + tree = concrete.parse(open(path).read(), path) + trans = HasKeyTransformer() + for match in trans.search(tree): + replacement = trans.replace(match) + Replace(tree, match, replacement) + print "rep", concrete.unparse(replacement) + + print concrete.unparse(tree) + +if __name__ == "__main__": + import sys + main(sys.argv[1:]) From jackdied at jackdied.com Sun Aug 27 04:19:05 2006 From: jackdied at jackdied.com (Jack Diederich) Date: Sat, 26 Aug 2006 22:19:05 -0400 Subject: [Python-checkins] r51624 - in python/trunk/Lib: genericpath.py macpath.py ntpath.py os2emxpath.py posixpath.py test/test_genericpath.py In-Reply-To: <44F0EB8A.1060204@bullseye.andymac.org> References: <20060826184208.1F6AB1E4003@bag.python.org> <44F0EB8A.1060204@bullseye.andymac.org> Message-ID: <20060827021905.GI24154@performancedrivers.com> On Sun, Aug 27, 2006 at 11:47:06AM +1100, Andrew MacIntyre wrote: > jack.diederich wrote: > > Author: jack.diederich > > Date: Sat Aug 26 20:42:06 2006 > > New Revision: 51624 > > > > Added: > > python/trunk/Lib/genericpath.py > > python/trunk/Lib/test/test_genericpath.py > > Modified: > > python/trunk/Lib/macpath.py > > python/trunk/Lib/ntpath.py > > python/trunk/Lib/os2emxpath.py > > python/trunk/Lib/posixpath.py > > Log: > > - Move functions common to all path modules into genericpath.py and have the > > OS speicifc path modules import them. > > - Have os2emxpath import common functions fron ntpath instead of using copies > > When the EMX support was added, I asked about doing this (having > os2emxpath import stuff from ntpath), and Guido's conclusion at the > time was that the os2emxpath module should be independant of ntpath > - even if there was significant duplication. > > I have no problem with the genericpath rationalisation, but request that > the ntpath related changes to os2emxpath be reverted unless other advice > to the contrary is forthcoming. > Thanks for the pointer, I found Guido's message http://mail.python.org/pipermail/python-dev/2002-January/019427.html The various modules ntpath, posixpath, macpath etc. are not just their to support their own platform on itself. They are also there to support foreign pathname twiddling. E.g. On Windows I might have a need to munge posix paths -- I can do that by explicitly importing posixpath. Likewise the reverse. So I think changing ntpath.py to use os.set etc. would be wrong, and creating a new file os2emxpath.py is the right thing to do -- despite the endless cloning of the same code. :-( (Maybe a different way to share more code between the XXXpath modules could be devised.) Guido was objecting to having only one module that behaved differently depending on which platform it was used. NT and EMX now only share the functions that behave the same. ie you can import ntpath on an EMX and use it to make NT style path names. In that same Tim Peters replied Create _commonpath.py and put shared routines there. Then a blahpath.py can do from _commonpath import f, g, h to re-export them. So I'm only three years or so behind in thinking of it. FWIW Guido greenlit removing the code duplication on the py3k list http://mail.python.org/pipermail/python-3000/2006-August/003218.html Sounds like a great 2.6 project. Beware of things that are intentionally different between platforms of course! -Jack From jimjjewett at gmail.com Sun Aug 27 04:42:02 2006 From: jimjjewett at gmail.com (Jim Jewett) Date: Sat, 26 Aug 2006 22:42:02 -0400 Subject: [Python-checkins] path in py3K Re: r51624 - in python/trunk/Lib: genericpath.py macpath.py ntpath.py os2emxpath.py posixpath.py test/test_genericpath.py Message-ID: In Py3K, is it still safe to assume that a list of paths will be (enough like) ordinary strings? I ask because of the various Path object discussions; it wasn't clear that a Path object should be a sequence of (normalized unicode?) characters (rather than path components), that the path would always be normalized or absolute, or even that it would implement the LE (or LT?) comparison operator. -jJ On 8/26/06, jack.diederich wrote: > Author: jack.diederich > Date: Sat Aug 26 20:42:06 2006 > New Revision: 51624 > Added: python/trunk/Lib/genericpath.py > +# Return the longest prefix of all list elements. > +def commonprefix(m): > + "Given a list of pathnames, returns the longest common leading component" > + if not m: return '' > + s1 = min(m) > + s2 = max(m) > + n = min(len(s1), len(s2)) > + for i in xrange(n): > + if s1[i] != s2[i]: > + return s1[:i] > + return s1[:n] From guido at python.org Sun Aug 27 05:01:27 2006 From: guido at python.org (Guido van Rossum) Date: Sat, 26 Aug 2006 20:01:27 -0700 Subject: [Python-checkins] [Python-3000] path in py3K Re: r51624 - in python/trunk/Lib: genericpath.py macpath.py ntpath.py os2emxpath.py posixpath.py test/test_genericpath.py In-Reply-To: References: Message-ID: It is not my intention to adopt the Path module in Py3k. On 8/26/06, Jim Jewett wrote: > In Py3K, is it still safe to assume that a list of paths will be > (enough like) ordinary strings? > > I ask because of the various Path object discussions; it wasn't clear > that a Path object should be a sequence of (normalized unicode?) > characters (rather than path components), that the path would always > be normalized or absolute, or even that it would implement the LE (or > LT?) comparison operator. > > -jJ > > On 8/26/06, jack.diederich wrote: > > Author: jack.diederich > > Date: Sat Aug 26 20:42:06 2006 > > New Revision: 51624 > > > Added: python/trunk/Lib/genericpath.py > > > +# Return the longest prefix of all list elements. > > +def commonprefix(m): > > + "Given a list of pathnames, returns the longest common leading component" > > + if not m: return '' > > + s1 = min(m) > > + s2 = max(m) > > + n = min(len(s1), len(s2)) > > + for i in xrange(n): > > + if s1[i] != s2[i]: > > + return s1[:i] > > + return s1[:n] > _______________________________________________ > Python-3000 mailing list > Python-3000 at python.org > http://mail.python.org/mailman/listinfo/python-3000 > Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org > -- --Guido van Rossum (home page: http://www.python.org/~guido/) From andymac at bullseye.apana.org.au Sun Aug 27 12:11:43 2006 From: andymac at bullseye.apana.org.au (Andrew MacIntyre) Date: Sun, 27 Aug 2006 21:11:43 +1100 Subject: [Python-checkins] r51624 - in python/trunk/Lib: genericpath.py macpath.py ntpath.py os2emxpath.py posixpath.py test/test_genericpath.py In-Reply-To: <20060827021905.GI24154@performancedrivers.com> References: <20060826184208.1F6AB1E4003@bag.python.org> <44F0EB8A.1060204@bullseye.andymac.org> <20060827021905.GI24154@performancedrivers.com> Message-ID: <44F16FDF.7080304@bullseye.andymac.org> Jack Diederich wrote: > On Sun, Aug 27, 2006 at 11:47:06AM +1100, Andrew MacIntyre wrote: {...} >> I have no problem with the genericpath rationalisation, but request that >> the ntpath related changes to os2emxpath be reverted unless other advice >> to the contrary is forthcoming. {...} > FWIW Guido greenlit removing the code duplication on the py3k list > http://mail.python.org/pipermail/python-3000/2006-August/003218.html > > Sounds like a great 2.6 project. Beware of things that are > intentionally different between platforms of course! Ok, as I'm not subscribed to the py3k list, I hadn't seen that. -- ------------------------------------------------------------------------- Andrew I MacIntyre "These thoughts are mine alone..." E-mail: andymac at bullseye.apana.org.au (pref) | Snail: PO Box 370 andymac at pcug.org.au (alt) | Belconnen ACT 2616 Web: http://www.andymac.org/ | Australia From python-checkins at python.org Mon Aug 28 02:22:37 2006 From: python-checkins at python.org (jackilyn.hoxworth) Date: Mon, 28 Aug 2006 02:22:37 +0200 (CEST) Subject: [Python-checkins] r51629 - python/branches/hoxworth-stdlib_logging-soc/test_smtpd_logging.py Message-ID: <20060828002237.8C1301E4003@bag.python.org> Author: jackilyn.hoxworth Date: Mon Aug 28 02:22:37 2006 New Revision: 51629 Added: python/branches/hoxworth-stdlib_logging-soc/test_smtpd_logging.py Log: Added: python/branches/hoxworth-stdlib_logging-soc/test_smtpd_logging.py ============================================================================== --- (empty file) +++ python/branches/hoxworth-stdlib_logging-soc/test_smtpd_logging.py Mon Aug 28 02:22:37 2006 @@ -0,0 +1,23 @@ +import smtpd +import logging +from cStringIO import StringIO + +# ... run the tests ... +log=logging.getLogger("py.smtpd") +stringLog = StringIO() + +# define the handler and level +handler = logging.StreamHandler(stringLog) +log.setLevel(logging.INFO) + +# add the handler to the logger +log.addHandler(handler) + +smtpd._log.info("message 1") + +print stringLog.getvalue() # For testing purposes + +if stringLog.getvalue() != "Error: It worked": + print "it worked" +else: + print "it didn't work" \ No newline at end of file From python-checkins at python.org Mon Aug 28 11:50:11 2006 From: python-checkins at python.org (georg.brandl) Date: Mon, 28 Aug 2006 11:50:11 +0200 (CEST) Subject: [Python-checkins] r51630 - peps/trunk/pep-0352.txt peps/trunk/pep-0358.txt peps/trunk/pep-3001.txt peps/trunk/pep-3099.txt Message-ID: <20060828095011.58EF21E4004@bag.python.org> Author: georg.brandl Date: Mon Aug 28 11:50:10 2006 New Revision: 51630 Modified: peps/trunk/pep-0352.txt (props changed) peps/trunk/pep-0358.txt (props changed) peps/trunk/pep-3001.txt (props changed) peps/trunk/pep-3099.txt (props changed) Log: Set missing "svn:keywords" property for some PEPs. From jimjjewett at gmail.com Mon Aug 28 17:39:44 2006 From: jimjjewett at gmail.com (Jim Jewett) Date: Mon, 28 Aug 2006 11:39:44 -0400 Subject: [Python-checkins] r51629 - python/branches/hoxworth-stdlib_logging-soc/test_smtpd_logging.py In-Reply-To: <20060828002237.8C1301E4003@bag.python.org> References: <20060828002237.8C1301E4003@bag.python.org> Message-ID: This looks more like the older "someone has to be watching to tell if it failed" format. Much better than nothing, but not the goal. If you're checking in what you already have, great; if you're writing new, try to make it auto-checkable (though this is still much better than nothing.) -jJ On 8/27/06, jackilyn.hoxworth wrote: > Author: jackilyn.hoxworth > Date: Mon Aug 28 02:22:37 2006 > New Revision: 51629 > > Added: > python/branches/hoxworth-stdlib_logging-soc/test_smtpd_logging.py > Log: > > > Added: python/branches/hoxworth-stdlib_logging-soc/test_smtpd_logging.py > ============================================================================== > --- (empty file) > +++ python/branches/hoxworth-stdlib_logging-soc/test_smtpd_logging.py Mon Aug 28 02:22:37 2006 > @@ -0,0 +1,23 @@ > +import smtpd > +import logging > +from cStringIO import StringIO > + > +# ... run the tests ... > +log=logging.getLogger("py.smtpd") > +stringLog = StringIO() > + > +# define the handler and level > +handler = logging.StreamHandler(stringLog) > +log.setLevel(logging.INFO) > + > +# add the handler to the logger > +log.addHandler(handler) > + > +smtpd._log.info("message 1") > + > +print stringLog.getvalue() # For testing purposes > + > +if stringLog.getvalue() != "Error: It worked": > + print "it worked" > +else: > + print "it didn't work" > \ No newline at end of file > _______________________________________________ > Python-checkins mailing list > Python-checkins at python.org > http://mail.python.org/mailman/listinfo/python-checkins > From jimjjewett at gmail.com Mon Aug 28 17:40:41 2006 From: jimjjewett at gmail.com (Jim Jewett) Date: Mon, 28 Aug 2006 11:40:41 -0400 Subject: [Python-checkins] smptd logging tests Message-ID: (sorry, I sent thit to the checkins list instead of to you) This looks more like the older "someone has to be watching to tell if it failed" format. Much better than nothing, but not the goal. If you're checking in what you already have, great; if you're writing new, try to make it auto-checkable (though this is still much better than nothing.) -jJ From jimjjewett at gmail.com Mon Aug 28 17:41:38 2006 From: jimjjewett at gmail.com (Jim Jewett) Date: Mon, 28 Aug 2006 11:41:38 -0400 Subject: [Python-checkins] r51629 - python/branches/hoxworth-stdlib_logging-soc/test_smtpd_logging.py In-Reply-To: References: <20060828002237.8C1301E4003@bag.python.org> Message-ID: Sorry; that should have gone to Jackilyn directly, my mistake. -jJ From python-checkins at python.org Mon Aug 28 21:49:57 2006 From: python-checkins at python.org (brett.cannon) Date: Mon, 28 Aug 2006 21:49:57 +0200 (CEST) Subject: [Python-checkins] r51635 - in python/branches/bcannon-objcap: Doc/api/abstract.tex Doc/api/concrete.tex Doc/api/intro.tex Doc/api/newtypes.tex Doc/commontex/boilerplate.tex Doc/howto/functional.rst Doc/lib/libctypes.tex Doc/lib/libuuid.tex Doc/whatsnew/whatsnew25.tex Include/code.h Include/import.h Include/patchlevel.h Lib/compiler/ast.py Lib/compiler/pycodegen.py Lib/compiler/symbols.py Lib/ctypes/__init__.py Lib/ctypes/test/test_as_parameter.py Lib/ctypes/test/test_functions.py Lib/ctypes/test/test_python_api.py Lib/ctypes/test/test_win32.py Lib/distutils/__init__.py Lib/encodings/__init__.py Lib/genericpath.py Lib/idlelib/Bindings.py Lib/idlelib/CREDITS.txt Lib/idlelib/CodeContext.py Lib/idlelib/NEWS.txt Lib/idlelib/PyShell.py Lib/idlelib/idlever.py Lib/macpath.py Lib/ntpath.py Lib/os2emxpath.py Lib/posixpath.py Lib/site.py Lib/tarfile.py Lib/test/crashers/bogus_sre_bytecode.py Lib/test/output/test_tokenize Lib/test/test_array.py Lib/test/test_compiler.py Lib/test/test_genericpath.py Lib/test/test_parser.py Lib/test/test_syntax.py Lib/test/test_tarfile.py Lib/test/test_tokenize.py Lib/test/test_unicode.py Lib/test/test_urllib2.py Lib/test/test_uuid.py Lib/test/test_xml_etree_c.py Lib/tokenize.py Lib/urllib2.py Lib/uuid.py Makefile.pre.in Misc/ACKS Misc/NEWS Misc/RPM/python-2.5.spec Misc/RPM/python-2.6.spec Misc/build.sh Modules/_ctypes/_ctypes.c Modules/_ctypes/_ctypes_test.c Modules/_ctypes/callbacks.c Modules/_ctypes/callproc.c Modules/_ctypes/cfield.c Modules/_ctypes/libffi_msvc/ffi.c Modules/_ctypes/libffi_msvc/ffi.h Modules/_ctypes/libffi_msvc/ffitarget.h Modules/_ctypes/libffi_msvc/win64.asm Modules/_ctypes/stgdict.c Modules/_elementtree.c Modules/arraymodule.c Modules/mmapmodule.c Modules/parsermodule.c Objects/classobject.c Objects/fileobject.c Objects/listobject.c Objects/unicodeobject.c PC/pyconfig.h PCbuild/_ctypes.vcproj PCbuild/_ssl.mak PCbuild/_ssl.vcproj PCbuild/amd64_ml64.bat PCbuild/build_ssl.py PCbuild/pythoncore.vcproj PCbuild/readme.txt Python/compile.c Python/peephole.c Python/pythonrun.c Python/symtable.c README Tools/buildbot/external.bat Tools/msi/msi.py configure configure.in Message-ID: <20060828194957.351871E4004@bag.python.org> Author: brett.cannon Date: Mon Aug 28 21:49:46 2006 New Revision: 51635 Added: python/branches/bcannon-objcap/Doc/howto/functional.rst - copied unchanged from r51624, python/trunk/Doc/howto/functional.rst python/branches/bcannon-objcap/Lib/genericpath.py - copied unchanged from r51624, python/trunk/Lib/genericpath.py python/branches/bcannon-objcap/Lib/test/crashers/bogus_sre_bytecode.py - copied unchanged from r51624, python/trunk/Lib/test/crashers/bogus_sre_bytecode.py python/branches/bcannon-objcap/Lib/test/test_genericpath.py - copied unchanged from r51624, python/trunk/Lib/test/test_genericpath.py python/branches/bcannon-objcap/Misc/RPM/python-2.6.spec - copied unchanged from r51624, python/trunk/Misc/RPM/python-2.6.spec python/branches/bcannon-objcap/Modules/_ctypes/libffi_msvc/win64.asm - copied unchanged from r51624, python/trunk/Modules/_ctypes/libffi_msvc/win64.asm python/branches/bcannon-objcap/PCbuild/amd64_ml64.bat - copied unchanged from r51624, python/trunk/PCbuild/amd64_ml64.bat python/branches/bcannon-objcap/Python/peephole.c - copied unchanged from r51624, python/trunk/Python/peephole.c Removed: python/branches/bcannon-objcap/Misc/RPM/python-2.5.spec Modified: python/branches/bcannon-objcap/ (props changed) python/branches/bcannon-objcap/Doc/api/abstract.tex python/branches/bcannon-objcap/Doc/api/concrete.tex python/branches/bcannon-objcap/Doc/api/intro.tex python/branches/bcannon-objcap/Doc/api/newtypes.tex python/branches/bcannon-objcap/Doc/commontex/boilerplate.tex python/branches/bcannon-objcap/Doc/lib/libctypes.tex python/branches/bcannon-objcap/Doc/lib/libuuid.tex python/branches/bcannon-objcap/Doc/whatsnew/whatsnew25.tex python/branches/bcannon-objcap/Include/code.h python/branches/bcannon-objcap/Include/import.h python/branches/bcannon-objcap/Include/patchlevel.h python/branches/bcannon-objcap/Lib/compiler/ast.py python/branches/bcannon-objcap/Lib/compiler/pycodegen.py python/branches/bcannon-objcap/Lib/compiler/symbols.py python/branches/bcannon-objcap/Lib/ctypes/__init__.py python/branches/bcannon-objcap/Lib/ctypes/test/test_as_parameter.py python/branches/bcannon-objcap/Lib/ctypes/test/test_functions.py python/branches/bcannon-objcap/Lib/ctypes/test/test_python_api.py python/branches/bcannon-objcap/Lib/ctypes/test/test_win32.py python/branches/bcannon-objcap/Lib/distutils/__init__.py python/branches/bcannon-objcap/Lib/encodings/__init__.py python/branches/bcannon-objcap/Lib/idlelib/Bindings.py python/branches/bcannon-objcap/Lib/idlelib/CREDITS.txt python/branches/bcannon-objcap/Lib/idlelib/CodeContext.py python/branches/bcannon-objcap/Lib/idlelib/NEWS.txt python/branches/bcannon-objcap/Lib/idlelib/PyShell.py python/branches/bcannon-objcap/Lib/idlelib/idlever.py python/branches/bcannon-objcap/Lib/macpath.py python/branches/bcannon-objcap/Lib/ntpath.py python/branches/bcannon-objcap/Lib/os2emxpath.py python/branches/bcannon-objcap/Lib/posixpath.py python/branches/bcannon-objcap/Lib/site.py python/branches/bcannon-objcap/Lib/tarfile.py python/branches/bcannon-objcap/Lib/test/output/test_tokenize python/branches/bcannon-objcap/Lib/test/test_array.py python/branches/bcannon-objcap/Lib/test/test_compiler.py python/branches/bcannon-objcap/Lib/test/test_parser.py python/branches/bcannon-objcap/Lib/test/test_syntax.py python/branches/bcannon-objcap/Lib/test/test_tarfile.py python/branches/bcannon-objcap/Lib/test/test_tokenize.py python/branches/bcannon-objcap/Lib/test/test_unicode.py python/branches/bcannon-objcap/Lib/test/test_urllib2.py python/branches/bcannon-objcap/Lib/test/test_uuid.py python/branches/bcannon-objcap/Lib/test/test_xml_etree_c.py python/branches/bcannon-objcap/Lib/tokenize.py python/branches/bcannon-objcap/Lib/urllib2.py python/branches/bcannon-objcap/Lib/uuid.py python/branches/bcannon-objcap/Makefile.pre.in python/branches/bcannon-objcap/Misc/ACKS python/branches/bcannon-objcap/Misc/NEWS python/branches/bcannon-objcap/Misc/build.sh python/branches/bcannon-objcap/Modules/_ctypes/_ctypes.c python/branches/bcannon-objcap/Modules/_ctypes/_ctypes_test.c python/branches/bcannon-objcap/Modules/_ctypes/callbacks.c python/branches/bcannon-objcap/Modules/_ctypes/callproc.c python/branches/bcannon-objcap/Modules/_ctypes/cfield.c python/branches/bcannon-objcap/Modules/_ctypes/libffi_msvc/ffi.c python/branches/bcannon-objcap/Modules/_ctypes/libffi_msvc/ffi.h python/branches/bcannon-objcap/Modules/_ctypes/libffi_msvc/ffitarget.h python/branches/bcannon-objcap/Modules/_ctypes/stgdict.c python/branches/bcannon-objcap/Modules/_elementtree.c python/branches/bcannon-objcap/Modules/arraymodule.c python/branches/bcannon-objcap/Modules/mmapmodule.c python/branches/bcannon-objcap/Modules/parsermodule.c python/branches/bcannon-objcap/Objects/classobject.c python/branches/bcannon-objcap/Objects/fileobject.c python/branches/bcannon-objcap/Objects/listobject.c python/branches/bcannon-objcap/Objects/unicodeobject.c python/branches/bcannon-objcap/PC/pyconfig.h python/branches/bcannon-objcap/PCbuild/_ctypes.vcproj python/branches/bcannon-objcap/PCbuild/_ssl.mak python/branches/bcannon-objcap/PCbuild/_ssl.vcproj python/branches/bcannon-objcap/PCbuild/build_ssl.py python/branches/bcannon-objcap/PCbuild/pythoncore.vcproj python/branches/bcannon-objcap/PCbuild/readme.txt python/branches/bcannon-objcap/Python/compile.c python/branches/bcannon-objcap/Python/pythonrun.c python/branches/bcannon-objcap/Python/symtable.c python/branches/bcannon-objcap/README python/branches/bcannon-objcap/Tools/buildbot/external.bat python/branches/bcannon-objcap/Tools/msi/msi.py python/branches/bcannon-objcap/configure python/branches/bcannon-objcap/configure.in Log: Merged revisions 51301-51633 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk Modified: python/branches/bcannon-objcap/Doc/api/abstract.tex ============================================================================== --- python/branches/bcannon-objcap/Doc/api/abstract.tex (original) +++ python/branches/bcannon-objcap/Doc/api/abstract.tex Mon Aug 28 21:49:46 2006 @@ -5,6 +5,10 @@ numerical types, or all sequence types). When used on object types for which they do not apply, they will raise a Python exception. +It is not possible to use these functions on objects that are not properly +initialized, such as a list object that has been created by +\cfunction{PyList_New()}, but whose items have not been set to some +non-\code{NULL} value yet. \section{Object Protocol \label{object}} Modified: python/branches/bcannon-objcap/Doc/api/concrete.tex ============================================================================== --- python/branches/bcannon-objcap/Doc/api/concrete.tex (original) +++ python/branches/bcannon-objcap/Doc/api/concrete.tex Mon Aug 28 21:49:46 2006 @@ -1840,6 +1840,11 @@ \begin{cfuncdesc}{PyObject*}{PyList_New}{Py_ssize_t len} Return a new list of length \var{len} on success, or \NULL{} on failure. + \note{If \var{length} is greater than zero, the returned list object's + items are set to \code{NULL}. Thus you cannot use abstract + API functions such as \cfunction{PySequence_SetItem()} + or expose the object to Python code before setting all items to a + real object with \cfunction{PyList_SetItem()}.} \end{cfuncdesc} \begin{cfuncdesc}{Py_ssize_t}{PyList_Size}{PyObject *list} Modified: python/branches/bcannon-objcap/Doc/api/intro.tex ============================================================================== --- python/branches/bcannon-objcap/Doc/api/intro.tex (original) +++ python/branches/bcannon-objcap/Doc/api/intro.tex Mon Aug 28 21:49:46 2006 @@ -225,25 +225,10 @@ \cfunction{PyTuple_SetItem()} for tuples that you are creating yourself. -Equivalent code for populating a list can be written using -\cfunction{PyList_New()} and \cfunction{PyList_SetItem()}. Such code -can also use \cfunction{PySequence_SetItem()}; this illustrates the -difference between the two (the extra \cfunction{Py_DECREF()} calls): +Equivalent code for populating a list can be written using +\cfunction{PyList_New()} and \cfunction{PyList_SetItem()}. -\begin{verbatim} -PyObject *l, *x; - -l = PyList_New(3); -x = PyInt_FromLong(1L); -PySequence_SetItem(l, 0, x); Py_DECREF(x); -x = PyInt_FromLong(2L); -PySequence_SetItem(l, 1, x); Py_DECREF(x); -x = PyString_FromString("three"); -PySequence_SetItem(l, 2, x); Py_DECREF(x); -\end{verbatim} - -You might find it strange that the ``recommended'' approach takes more -code. However, in practice, you will rarely use these ways of +However, in practice, you will rarely use these ways of creating and populating a tuple or list. There's a generic function, \cfunction{Py_BuildValue()}, that can create most common objects from C values, directed by a \dfn{format string}. For example, the @@ -251,10 +236,10 @@ also takes care of the error checking): \begin{verbatim} -PyObject *t, *l; +PyObject *tuple, *list; -t = Py_BuildValue("(iis)", 1, 2, "three"); -l = Py_BuildValue("[iis]", 1, 2, "three"); +tuple = Py_BuildValue("(iis)", 1, 2, "three"); +list = Py_BuildValue("[iis]", 1, 2, "three"); \end{verbatim} It is much more common to use \cfunction{PyObject_SetItem()} and @@ -276,8 +261,12 @@ if (n < 0) return -1; for (i = 0; i < n; i++) { - if (PyObject_SetItem(target, i, item) < 0) + PyObject *index = PyInt_FromLong(i); + if (!index) + return -1; + if (PyObject_SetItem(target, index, item) < 0) return -1; + Py_DECREF(index); } return 0; } Modified: python/branches/bcannon-objcap/Doc/api/newtypes.tex ============================================================================== --- python/branches/bcannon-objcap/Doc/api/newtypes.tex (original) +++ python/branches/bcannon-objcap/Doc/api/newtypes.tex Mon Aug 28 21:49:46 2006 @@ -979,7 +979,7 @@ More information about Python's garbage collection scheme can be found in section \ref{supporting-cycle-detection}. - This field is inherited by subtypes together with \member{tp_clear} + This field is inherited by subtypes together with \member{tp_traverse} and the \constant{Py_TPFLAGS_HAVE_GC} flag bit: the flag bit, \member{tp_traverse}, and \member{tp_clear} are all inherited from the base type if they are all zero in the subtype \emph{and} the Modified: python/branches/bcannon-objcap/Doc/commontex/boilerplate.tex ============================================================================== --- python/branches/bcannon-objcap/Doc/commontex/boilerplate.tex (original) +++ python/branches/bcannon-objcap/Doc/commontex/boilerplate.tex Mon Aug 28 21:49:46 2006 @@ -5,5 +5,5 @@ Email: \email{docs at python.org} } -\date{3rd August, 2006} % XXX update before final release! +\date{\today} % XXX update before final release! \input{patchlevel} % include Python version information Modified: python/branches/bcannon-objcap/Doc/lib/libctypes.tex ============================================================================== --- python/branches/bcannon-objcap/Doc/lib/libctypes.tex (original) +++ python/branches/bcannon-objcap/Doc/lib/libctypes.tex Mon Aug 28 21:49:46 2006 @@ -199,8 +199,13 @@ There are, however, enough ways to crash Python with \code{ctypes}, so you should be careful anyway. -Python integers, strings and unicode strings are the only objects that -can directly be used as parameters in these function calls. +\code{None}, integers, longs, byte strings and unicode strings are the +only native Python objects that can directly be used as parameters in +these function calls. \code{None} is passed as a C \code{NULL} pointer, +byte strings and unicode strings are passed as pointer to the memory +block that contains their data (\code{char *} or \code{wchar{\_}t *}). Python +integers and Python longs are passed as the platforms default C +\code{int} type, their value is masked to fit into the C type. Before we move on calling functions with other parameter types, we have to learn more about \code{ctypes} data types. @@ -227,7 +232,18 @@ \code{char} } { -character +1-character +string +} +\lineiii{ +\class{c{\_}wchar} +} +{ +\code{wchar{\_}t} +} +{ +1-character +unicode string } \lineiii{ \class{c{\_}byte} @@ -236,7 +252,7 @@ \code{char} } { -integer +int/long } \lineiii{ \class{c{\_}ubyte} @@ -245,7 +261,7 @@ \code{unsigned char} } { -integer +int/long } \lineiii{ \class{c{\_}short} @@ -254,7 +270,7 @@ \code{short} } { -integer +int/long } \lineiii{ \class{c{\_}ushort} @@ -263,7 +279,7 @@ \code{unsigned short} } { -integer +int/long } \lineiii{ \class{c{\_}int} @@ -272,7 +288,7 @@ \code{int} } { -integer +int/long } \lineiii{ \class{c{\_}uint} @@ -281,7 +297,7 @@ \code{unsigned int} } { -integer +int/long } \lineiii{ \class{c{\_}long} @@ -290,7 +306,7 @@ \code{long} } { -integer +int/long } \lineiii{ \class{c{\_}ulong} @@ -299,7 +315,7 @@ \code{unsigned long} } { -long +int/long } \lineiii{ \class{c{\_}longlong} @@ -309,7 +325,7 @@ \code{long long} } { -long +int/long } \lineiii{ \class{c{\_}ulonglong} @@ -319,7 +335,7 @@ \code{unsigned long long} } { -long +int/long } \lineiii{ \class{c{\_}float} @@ -368,8 +384,8 @@ \code{void *} } { -integer or -\code{None} +int/long +or \code{None} } \end{tableiii} \end{quote} @@ -554,11 +570,11 @@ \subsubsection{Return types\label{ctypes-return-types}} -By default functions are assumed to return integers. Other return -types can be specified by setting the \member{restype} attribute of the -function object. +By default functions are assumed to return the C \code{int} type. Other +return types can be specified by setting the \member{restype} attribute of +the function object. -Here is a more advanced example, it uses the strchr function, which +Here is a more advanced example, it uses the \code{strchr} function, which expects a string pointer and a char, and returns a pointer to a string: \begin{verbatim} @@ -1611,8 +1627,8 @@ \begin{datadescni}{pythonapi} An instance of \class{PyDLL} that exposes Python C api functions as -attributes. Note that all these functions are assumed to return -integers, which is of course not always the truth, so you have to +attributes. Note that all these functions are assumed to return C +\code{int}, which is of course not always the truth, so you have to assign the correct \member{restype} attribute to use these functions. \end{datadescni} @@ -1642,8 +1658,8 @@ anything. It is possible to assign a callable Python object that is not a -ctypes type, in this case the function is assumed to return an -integer, and the callable will be called with this integer, +ctypes type, in this case the function is assumed to return a +C \code{int}, and the callable will be called with this integer, allowing to do further processing or error checking. Using this is deprecated, for more flexible postprocessing or error checking use a ctypes data type as \member{restype} and assign a callable to the @@ -2283,9 +2299,12 @@ or error information for a function or method call. \end{classdesc*} -\begin{classdesc*}{py_object} -Represents the C \code{PyObject *} datatype. -\end{classdesc*} +\code{py{\_}object} : classdesc* +\begin{quote} + +Represents the C \code{PyObject *} datatype. Calling this with an +without an argument creates a \code{NULL} \code{PyObject *} pointer. +\end{quote} The \code{ctypes.wintypes} module provides quite some other Windows specific data types, for example \code{HWND}, \code{WPARAM}, or \code{DWORD}. @@ -2324,9 +2343,9 @@ the second item specifies the type of the field; it can be any ctypes data type. -For integer type fields, a third optional item can be given. It -must be a small positive integer defining the bit width of the -field. +For integer type fields like \class{c{\_}int}, a third optional item can +be given. It must be a small positive integer defining the bit +width of the field. Field names must be unique within one structure or union. This is not checked, only one field can be accessed when names are Modified: python/branches/bcannon-objcap/Doc/lib/libuuid.tex ============================================================================== --- python/branches/bcannon-objcap/Doc/lib/libuuid.tex (original) +++ python/branches/bcannon-objcap/Doc/lib/libuuid.tex Mon Aug 28 21:49:46 2006 @@ -18,20 +18,11 @@ network address. \function{uuid4()} creates a random UUID. \begin{classdesc}{UUID}{\optional{hex\optional{, bytes\optional{, -fields\optional{, int\optional{, version}}}}}} - -%Instances of the UUID class represent UUIDs as specified in RFC 4122. -%UUID objects are immutable, hashable, and usable as dictionary keys. -%Converting a UUID to a string with str() yields something in the form -%'12345678-1234-1234-1234-123456789abc'. The UUID constructor accepts -%four possible forms: a similar string of hexadecimal digits, or a -%string of 16 raw bytes as an argument named 'bytes', or a tuple of -%six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and -%48-bit values respectively) as an argument named 'fields', or a single -%128-bit integer as an argument named 'int'. +bytes_le\optional{, fields\optional{, int\optional{, version}}}}}}} Create a UUID from either a string of 32 hexadecimal digits, -a string of 16 bytes as the \var{bytes} argument, a tuple of six +a string of 16 bytes as the \var{bytes} argument, a string of 16 bytes +in little-endian order as the \var{bytes_le} argument, a tuple of six integers (32-bit \var{time_low}, 16-bit \var{time_mid}, 16-bit \var{time_hi_version}, 8-bit \var{clock_seq_hi_variant}, 8-bit \var{clock_seq_low}, 48-bit \var{node}) @@ -45,22 +36,31 @@ UUID('12345678123456781234567812345678') UUID('urn:uuid:12345678-1234-5678-1234-567812345678') UUID(bytes='\x12\x34\x56\x78'*4) +UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' + + '\x12\x34\x56\x78\x12\x34\x56\x78') UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678)) UUID(int=0x12345678123456781234567812345678) \end{verbatim} -Exactly one of \var{hex}, \var{bytes}, \var{fields}, or \var{int} must +Exactly one of \var{hex}, \var{bytes}, \var{bytes_le}, \var{fields}, +or \var{int} must be given. The \var{version} argument is optional; if given, the resulting UUID will have its variant and version number set according to RFC 4122, overriding bits in the given \var{hex}, \var{bytes}, -\var{fields}, or \var{int}. +\var{bytes_le}, \var{fields}, or \var{int}. \end{classdesc} \class{UUID} instances have these read-only attributes: \begin{memberdesc}{bytes} -The UUID as a 16-byte string. +The UUID as a 16-byte string (containing the six +integer fields in big-endian byte order). +\end{memberdesc} + +\begin{memberdesc}{bytes_le} +The UUID as a 16-byte string (with \var{time_low}, \var{time_mid}, +and \var{time_hi_version} in little-endian byte order). \end{memberdesc} \begin{memberdesc}{fields} Modified: python/branches/bcannon-objcap/Doc/whatsnew/whatsnew25.tex ============================================================================== --- python/branches/bcannon-objcap/Doc/whatsnew/whatsnew25.tex (original) +++ python/branches/bcannon-objcap/Doc/whatsnew/whatsnew25.tex Mon Aug 28 21:49:46 2006 @@ -5,7 +5,7 @@ % Fix XXX comments \title{What's New in Python 2.5} -\release{0.9} +\release{1.0} \author{A.M. Kuchling} \authoraddress{\email{amk at amk.ca}} @@ -40,15 +40,14 @@ As well as the language and library additions, other improvements and bugfixes were made throughout the source tree. A search through the -SVN change logs finds there were 334 patches applied and 443 bugs +SVN change logs finds there were 353 patches applied and 458 bugs fixed between Python 2.4 and 2.5. (Both figures are likely to be underestimates.) This article doesn't try to be a complete specification of the new features; instead changes are briefly introduced using helpful examples. For full details, you should always refer to the -documentation for Python 2.5. -% XXX add hyperlink when the documentation becomes available online. +documentation for Python 2.5 at \url{http://docs.python.org}. If you want to understand the complete implementation and design rationale, refer to the PEP for a particular new feature. @@ -751,7 +750,6 @@ database, or rolled back, meaning that the changes are all discarded and the database is unchanged. See any database textbook for more information.) -% XXX find a shorter reference? Let's assume there's an object representing a database connection. Our goal will be to let the user write code like this: @@ -1184,6 +1182,35 @@ # -*- coding: latin1 -*- \end{verbatim} +\item A new warning, \class{UnicodeWarning}, is triggered when +you attempt to compare a Unicode string and an 8-bit string +that can't be converted to Unicode using the default ASCII encoding. +The result of the comparison is false: + +\begin{verbatim} +>>> chr(128) == unichr(128) # Can't convert chr(128) to Unicode +__main__:1: UnicodeWarning: Unicode equal comparison failed + to convert both arguments to Unicode - interpreting them + as being unequal +False +>>> chr(127) == unichr(127) # chr(127) can be converted +True +\end{verbatim} + +Previously this would raise a \class{UnicodeDecodeError} exception, +but in 2.5 this could result in puzzling problems when accessing a +dictionary. If you looked up \code{unichr(128)} and \code{chr(128)} +was being used as a key, you'd get a \class{UnicodeDecodeError} +exception. Other changes in 2.5 resulted in this exception being +raised instead of suppressed by the code in \file{dictobject.c} that +implements dictionaries. + +Raising an exception for such a comparison is strictly correct, but +the change might have broken code, so instead +\class{UnicodeWarning} was introduced. + +(Implemented by Marc-Andr\'e Lemburg.) + \item One error that Python programmers sometimes make is forgetting to include an \file{__init__.py} module in a package directory. Debugging this mistake can be confusing, and usually requires running @@ -1305,9 +1332,6 @@ \end{itemize} -The net result of the 2.5 optimizations is that Python 2.5 runs the -pystone benchmark around XXX\% faster than Python 2.4. - %====================================================================== \section{New, Improved, and Removed Modules\label{modules}} @@ -2423,6 +2447,11 @@ described in section~\ref{pep-342}, it's now possible for \member{gi_frame} to be \code{None}. +\item A new warning, \class{UnicodeWarning}, is triggered when +you attempt to compare a Unicode string and an 8-bit string that can't +be converted to Unicode using the default ASCII encoding. Previously +such comparisons would raise a \class{UnicodeDecodeError} exception. + \item Library: the \module{csv} module is now stricter about multi-line quoted fields. If your files contain newlines embedded within fields, the input should be split into lines in a manner which preserves the Modified: python/branches/bcannon-objcap/Include/code.h ============================================================================== --- python/branches/bcannon-objcap/Include/code.h (original) +++ python/branches/bcannon-objcap/Include/code.h Mon Aug 28 21:49:46 2006 @@ -88,6 +88,9 @@ PyAPI_FUNC(int) PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds); +PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts, + PyObject *names, PyObject *lineno_obj); + #ifdef __cplusplus } #endif Modified: python/branches/bcannon-objcap/Include/import.h ============================================================================== --- python/branches/bcannon-objcap/Include/import.h (original) +++ python/branches/bcannon-objcap/Include/import.h Mon Aug 28 21:49:46 2006 @@ -22,7 +22,7 @@ PyAPI_FUNC(PyObject *) PyImport_ImportModuleEx( char *name, PyObject *globals, PyObject *locals, PyObject *fromlist); #define PyImport_ImportModuleEx(n, g, l, f) \ - PyImport_ImportModuleLevel(n, g, l, f, -1); + PyImport_ImportModuleLevel(n, g, l, f, -1) PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name); PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m); Modified: python/branches/bcannon-objcap/Include/patchlevel.h ============================================================================== --- python/branches/bcannon-objcap/Include/patchlevel.h (original) +++ python/branches/bcannon-objcap/Include/patchlevel.h Mon Aug 28 21:49:46 2006 @@ -20,13 +20,13 @@ /* Version parsed out into numeric values */ #define PY_MAJOR_VERSION 2 -#define PY_MINOR_VERSION 5 +#define PY_MINOR_VERSION 6 #define PY_MICRO_VERSION 0 -#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA -#define PY_RELEASE_SERIAL 3 +#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA +#define PY_RELEASE_SERIAL 0 /* Version as a string */ -#define PY_VERSION "2.5b3" +#define PY_VERSION "2.6a0" /* Subversion Revision number of this file (not of the repository) */ #define PY_PATCHLEVEL_REVISION "$Revision$" Modified: python/branches/bcannon-objcap/Lib/compiler/ast.py ============================================================================== --- python/branches/bcannon-objcap/Lib/compiler/ast.py (original) +++ python/branches/bcannon-objcap/Lib/compiler/ast.py Mon Aug 28 21:49:46 2006 @@ -583,11 +583,9 @@ def __init__(self, code, lineno=None): self.code = code self.lineno = lineno - self.argnames = ['[outmost-iterable]'] + self.argnames = ['.0'] self.varargs = self.kwargs = None - - def getChildren(self): return self.code, Modified: python/branches/bcannon-objcap/Lib/compiler/pycodegen.py ============================================================================== --- python/branches/bcannon-objcap/Lib/compiler/pycodegen.py (original) +++ python/branches/bcannon-objcap/Lib/compiler/pycodegen.py Mon Aug 28 21:49:46 2006 @@ -658,18 +658,19 @@ stack = [] for i, for_ in zip(range(len(node.quals)), node.quals): - start, anchor = self.visit(for_) + start, anchor, end = self.visit(for_) cont = None for if_ in for_.ifs: if cont is None: cont = self.newBlock() self.visit(if_, cont) - stack.insert(0, (start, cont, anchor)) + stack.insert(0, (start, cont, anchor, end)) self.visit(node.expr) self.emit('YIELD_VALUE') + self.emit('POP_TOP') - for start, cont, anchor in stack: + for start, cont, anchor, end in stack: if cont: skip_one = self.newBlock() self.emit('JUMP_FORWARD', skip_one) @@ -678,14 +679,22 @@ self.nextBlock(skip_one) self.emit('JUMP_ABSOLUTE', start) self.startBlock(anchor) + self.emit('POP_BLOCK') + self.setups.pop() + self.startBlock(end) + self.emit('LOAD_CONST', None) def visitGenExprFor(self, node): start = self.newBlock() anchor = self.newBlock() + end = self.newBlock() + + self.setups.push((LOOP, start)) + self.emit('SETUP_LOOP', end) if node.is_outmost: - self.loadName('[outmost-iterable]') + self.loadName('.0') else: self.visit(node.iter) self.emit('GET_ITER') @@ -695,7 +704,7 @@ self.emit('FOR_ITER', anchor) self.nextBlock() self.visit(node.assign) - return start, anchor + return start, anchor, end def visitGenExprIf(self, node, branch): self.set_lineno(node, force=True) Modified: python/branches/bcannon-objcap/Lib/compiler/symbols.py ============================================================================== --- python/branches/bcannon-objcap/Lib/compiler/symbols.py (original) +++ python/branches/bcannon-objcap/Lib/compiler/symbols.py Mon Aug 28 21:49:46 2006 @@ -188,7 +188,7 @@ i = self.__counter self.__counter += 1 self.__super_init("generator expression<%d>"%i, module, klass) - self.add_param('[outmost-iterable]') + self.add_param('.0') def get_names(self): keys = Scope.get_names(self) Modified: python/branches/bcannon-objcap/Lib/ctypes/__init__.py ============================================================================== --- python/branches/bcannon-objcap/Lib/ctypes/__init__.py (original) +++ python/branches/bcannon-objcap/Lib/ctypes/__init__.py Mon Aug 28 21:49:46 2006 @@ -135,6 +135,11 @@ class py_object(_SimpleCData): _type_ = "O" + def __repr__(self): + try: + return super(py_object, self).__repr__() + except ValueError: + return "%s()" % type(self).__name__ class c_short(_SimpleCData): _type_ = "h" @@ -422,6 +427,8 @@ c_size_t = c_uint elif sizeof(c_ulong) == sizeof(c_void_p): c_size_t = c_ulong +elif sizeof(c_ulonglong) == sizeof(c_void_p): + c_size_t = c_ulonglong # functions Modified: python/branches/bcannon-objcap/Lib/ctypes/test/test_as_parameter.py ============================================================================== --- python/branches/bcannon-objcap/Lib/ctypes/test/test_as_parameter.py (original) +++ python/branches/bcannon-objcap/Lib/ctypes/test/test_as_parameter.py Mon Aug 28 21:49:46 2006 @@ -61,6 +61,7 @@ def callback(v): args.append(v) + return v CallBack = CFUNCTYPE(c_int, c_int) Modified: python/branches/bcannon-objcap/Lib/ctypes/test/test_functions.py ============================================================================== --- python/branches/bcannon-objcap/Lib/ctypes/test/test_functions.py (original) +++ python/branches/bcannon-objcap/Lib/ctypes/test/test_functions.py Mon Aug 28 21:49:46 2006 @@ -222,6 +222,7 @@ def callback(v): args.append(v) + return v CallBack = CFUNCTYPE(c_int, c_int) Modified: python/branches/bcannon-objcap/Lib/ctypes/test/test_python_api.py ============================================================================== --- python/branches/bcannon-objcap/Lib/ctypes/test/test_python_api.py (original) +++ python/branches/bcannon-objcap/Lib/ctypes/test/test_python_api.py Mon Aug 28 21:49:46 2006 @@ -78,5 +78,10 @@ # not enough arguments self.failUnlessRaises(TypeError, PyOS_snprintf, buf) + def test_pyobject_repr(self): + self.failUnlessEqual(repr(py_object()), "py_object()") + self.failUnlessEqual(repr(py_object(42)), "py_object(42)") + self.failUnlessEqual(repr(py_object(object)), "py_object(%r)" % object) + if __name__ == "__main__": unittest.main() Modified: python/branches/bcannon-objcap/Lib/ctypes/test/test_win32.py ============================================================================== --- python/branches/bcannon-objcap/Lib/ctypes/test/test_win32.py (original) +++ python/branches/bcannon-objcap/Lib/ctypes/test/test_win32.py Mon Aug 28 21:49:46 2006 @@ -6,7 +6,8 @@ import _ctypes_test -if sys.platform == "win32": +if sys.platform == "win32" and sizeof(c_void_p) == sizeof(c_int): + # Only windows 32-bit has different calling conventions. class WindowsTestCase(unittest.TestCase): def test_callconv_1(self): Modified: python/branches/bcannon-objcap/Lib/distutils/__init__.py ============================================================================== --- python/branches/bcannon-objcap/Lib/distutils/__init__.py (original) +++ python/branches/bcannon-objcap/Lib/distutils/__init__.py Mon Aug 28 21:49:46 2006 @@ -12,6 +12,12 @@ __revision__ = "$Id$" -import sys -__version__ = "%d.%d.%d" % sys.version_info[:3] -del sys +# Distutils version +# +# Please coordinate with Marc-Andre Lemburg when adding +# new features to distutils that would warrant bumping the version number. +# +# In general, major and minor version should loosely follow the Python +# version number the distutils code was shipped with. +# +__version__ = "2.5.0" Modified: python/branches/bcannon-objcap/Lib/encodings/__init__.py ============================================================================== --- python/branches/bcannon-objcap/Lib/encodings/__init__.py (original) +++ python/branches/bcannon-objcap/Lib/encodings/__init__.py Mon Aug 28 21:49:46 2006 @@ -28,7 +28,7 @@ """#" -import codecs, types +import codecs from encodings import aliases _cache = {} @@ -60,7 +60,7 @@ """ # Make sure we have an 8-bit string, because .translate() works # differently for Unicode strings. - if type(encoding) is types.UnicodeType: + if isinstance(encoding, unicode): # Note that .encode('latin-1') does *not* use the codec # registry, so this call doesn't recurse. (See unicodeobject.c # PyUnicode_AsEncodedString() for details) Modified: python/branches/bcannon-objcap/Lib/idlelib/Bindings.py ============================================================================== --- python/branches/bcannon-objcap/Lib/idlelib/Bindings.py (original) +++ python/branches/bcannon-objcap/Lib/idlelib/Bindings.py Mon Aug 28 21:49:46 2006 @@ -22,9 +22,9 @@ None, ('_Save', '<>'), ('Save _As...', '<>'), - ('Save Co_py As...', '<>'), + ('Save Cop_y As...', '<>'), None, - ('_Print Window', '<>'), + ('Prin_t Window', '<>'), None, ('_Close', '<>'), ('E_xit', '<>'), Modified: python/branches/bcannon-objcap/Lib/idlelib/CREDITS.txt ============================================================================== --- python/branches/bcannon-objcap/Lib/idlelib/CREDITS.txt (original) +++ python/branches/bcannon-objcap/Lib/idlelib/CREDITS.txt Mon Aug 28 21:49:46 2006 @@ -24,8 +24,8 @@ integration, debugger integration and persistent breakpoints). Scott David Daniels, Tal Einat, Hernan Foffani, Christos Georgiou, -Martin v. Löwis, Jason Orendorff, Josh Robb, Nigel Rowe, Bruce Sherwood, -and Jeff Shute have submitted useful patches. Thanks, guys! +Jim Jewett, Martin v. Löwis, Jason Orendorff, Josh Robb, Nigel Rowe, +Bruce Sherwood, and Jeff Shute have submitted useful patches. Thanks, guys! For additional details refer to NEWS.txt and Changelog. Modified: python/branches/bcannon-objcap/Lib/idlelib/CodeContext.py ============================================================================== --- python/branches/bcannon-objcap/Lib/idlelib/CodeContext.py (original) +++ python/branches/bcannon-objcap/Lib/idlelib/CodeContext.py Mon Aug 28 21:49:46 2006 @@ -15,7 +15,7 @@ from sys import maxint as INFINITY BLOCKOPENERS = set(["class", "def", "elif", "else", "except", "finally", "for", - "if", "try", "while"]) + "if", "try", "while", "with"]) UPDATEINTERVAL = 100 # millisec FONTUPDATEINTERVAL = 1000 # millisec Modified: python/branches/bcannon-objcap/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/bcannon-objcap/Lib/idlelib/NEWS.txt (original) +++ python/branches/bcannon-objcap/Lib/idlelib/NEWS.txt Mon Aug 28 21:49:46 2006 @@ -1,7 +1,26 @@ +What's New in IDLE 2.6a1? +========================= + +*Release date: XX-XXX-200X* + +- IDLE's version number takes a big jump to match the version number of + the Python release of which it's a part. + + What's New in IDLE 1.2c1? ========================= -*Release date: XX-AUG-2006* +*Release date: 17-AUG-2006* + +- File menu hotkeys: there were three 'p' assignments. Reassign the + 'Save Copy As' and 'Print' hotkeys to 'y' and 't'. Change the + Shell hotkey from 's' to 'l'. + +- IDLE honors new quit() and exit() commands from site.py Quitter() object. + Patch 1540892, Jim Jewett + +- The 'with' statement is now a Code Context block opener. + Patch 1540851, Jim Jewett - Retrieval of previous shell command was not always preserving indentation (since 1.2a1) Patch 1528468 Tal Einat. Modified: python/branches/bcannon-objcap/Lib/idlelib/PyShell.py ============================================================================== --- python/branches/bcannon-objcap/Lib/idlelib/PyShell.py (original) +++ python/branches/bcannon-objcap/Lib/idlelib/PyShell.py Mon Aug 28 21:49:46 2006 @@ -478,9 +478,6 @@ import sys as _sys _sys.path = %r del _sys - _msg = 'Use File/Exit or your end-of-file key to quit IDLE' - __builtins__.quit = __builtins__.exit = _msg - del _msg \n""" % (sys.path,)) active_seq = None @@ -514,7 +511,10 @@ print >>sys.__stderr__, errmsg, what print >>console, errmsg, what # we received a response to the currently active seq number: - self.tkconsole.endexecuting() + try: + self.tkconsole.endexecuting() + except AttributeError: # shell may have closed + pass # Reschedule myself if not self.tkconsole.closing: self.tkconsole.text.after(self.tkconsole.pollinterval, @@ -713,14 +713,17 @@ else: exec code in self.locals except SystemExit: - if tkMessageBox.askyesno( - "Exit?", - "Do you want to exit altogether?", - default="yes", - master=self.tkconsole.text): - raise + if not self.tkconsole.closing: + if tkMessageBox.askyesno( + "Exit?", + "Do you want to exit altogether?", + default="yes", + master=self.tkconsole.text): + raise + else: + self.showtraceback() else: - self.showtraceback() + raise except: if use_subprocess: print >> self.tkconsole.stderr, \ @@ -730,7 +733,10 @@ self.tkconsole.endexecuting() finally: if not use_subprocess: - self.tkconsole.endexecuting() + try: + self.tkconsole.endexecuting() + except AttributeError: # shell may have closed + pass def write(self, s): "Override base class method" @@ -794,7 +800,7 @@ if use_subprocess: ms = self.menu_specs if ms[2][0] != "shell": - ms.insert(2, ("shell", "_Shell")) + ms.insert(2, ("shell", "She_ll")) self.interp = ModifiedInterpreter(self) if flist is None: root = Tk() @@ -804,9 +810,6 @@ # OutputWindow.__init__(self, flist, None, None) # - import __builtin__ - __builtin__.quit = __builtin__.exit = "To exit, type Ctrl-D." - # ## self.config(usetabs=1, indentwidth=8, context_use_ps1=1) self.usetabs = True # indentwidth must be 8 when using tabs. See note in EditorWindow: Modified: python/branches/bcannon-objcap/Lib/idlelib/idlever.py ============================================================================== --- python/branches/bcannon-objcap/Lib/idlelib/idlever.py (original) +++ python/branches/bcannon-objcap/Lib/idlelib/idlever.py Mon Aug 28 21:49:46 2006 @@ -1 +1 @@ -IDLE_VERSION = "1.2b3" +IDLE_VERSION = "2.6a0" Modified: python/branches/bcannon-objcap/Lib/macpath.py ============================================================================== --- python/branches/bcannon-objcap/Lib/macpath.py (original) +++ python/branches/bcannon-objcap/Lib/macpath.py Mon Aug 28 21:49:46 2006 @@ -2,6 +2,7 @@ import os from stat import * +from genericpath import * __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", @@ -101,31 +102,6 @@ components = split(s) return len(components) == 2 and components[1] == '' -def isdir(s): - """Return true if the pathname refers to an existing directory.""" - - try: - st = os.stat(s) - except os.error: - return 0 - return S_ISDIR(st.st_mode) - - -# Get size, mtime, atime of files. - -def getsize(filename): - """Return the size of a file, reported by os.stat().""" - return os.stat(filename).st_size - -def getmtime(filename): - """Return the last modification time of a file, reported by os.stat().""" - return os.stat(filename).st_mtime - -def getatime(filename): - """Return the last access time of a file, reported by os.stat().""" - return os.stat(filename).st_atime - - def islink(s): """Return true if the pathname refers to a symbolic link.""" @@ -135,29 +111,6 @@ except: return False - -def isfile(s): - """Return true if the pathname refers to an existing regular file.""" - - try: - st = os.stat(s) - except os.error: - return False - return S_ISREG(st.st_mode) - -def getctime(filename): - """Return the creation time of a file, reported by os.stat().""" - return os.stat(filename).st_ctime - -def exists(s): - """Test whether a path exists. Returns False for broken symbolic links""" - - try: - st = os.stat(s) - except os.error: - return False - return True - # Is `stat`/`lstat` a meaningful difference on the Mac? This is safe in any # case. @@ -170,20 +123,6 @@ return False return True -# Return the longest prefix of all list elements. - -def commonprefix(m): - "Given a list of pathnames, returns the longest common leading component" - if not m: return '' - s1 = min(m) - s2 = max(m) - n = min(len(s1), len(s2)) - for i in xrange(n): - if s1[i] != s2[i]: - return s1[:i] - return s1[:n] - - def expandvars(path): """Dummy to retain interface-compatibility with other operating systems.""" return path Modified: python/branches/bcannon-objcap/Lib/ntpath.py ============================================================================== --- python/branches/bcannon-objcap/Lib/ntpath.py (original) +++ python/branches/bcannon-objcap/Lib/ntpath.py Mon Aug 28 21:49:46 2006 @@ -8,6 +8,7 @@ import os import stat import sys +from genericpath import * __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", @@ -206,86 +207,18 @@ """Returns the directory component of a pathname""" return split(p)[0] - -# Return the longest prefix of all list elements. - -def commonprefix(m): - "Given a list of pathnames, returns the longest common leading component" - if not m: return '' - s1 = min(m) - s2 = max(m) - n = min(len(s1), len(s2)) - for i in xrange(n): - if s1[i] != s2[i]: - return s1[:i] - return s1[:n] - - -# Get size, mtime, atime of files. - -def getsize(filename): - """Return the size of a file, reported by os.stat()""" - return os.stat(filename).st_size - -def getmtime(filename): - """Return the last modification time of a file, reported by os.stat()""" - return os.stat(filename).st_mtime - -def getatime(filename): - """Return the last access time of a file, reported by os.stat()""" - return os.stat(filename).st_atime - -def getctime(filename): - """Return the creation time of a file, reported by os.stat().""" - return os.stat(filename).st_ctime - # Is a path a symbolic link? # This will always return false on systems where posix.lstat doesn't exist. def islink(path): - """Test for symbolic link. On WindowsNT/95 always returns false""" + """Test for symbolic link. + On WindowsNT/95 and OS/2 always returns false + """ return False - -# Does a path exist? - -def exists(path): - """Test whether a path exists""" - try: - st = os.stat(path) - except os.error: - return False - return True - +# alias exists to lexists lexists = exists - -# Is a path a dos directory? -# This follows symbolic links, so both islink() and isdir() can be true -# for the same path. - -def isdir(path): - """Test whether a path is a directory""" - try: - st = os.stat(path) - except os.error: - return False - return stat.S_ISDIR(st.st_mode) - - -# Is a path a regular file? -# This follows symbolic links, so both islink() and isdir() can be true -# for the same path. - -def isfile(path): - """Test whether a path is a regular file""" - try: - st = os.stat(path) - except os.error: - return False - return stat.S_ISREG(st.st_mode) - - # Is a path a mount point? Either a root (with or without drive letter) # or an UNC path with at most a / or \ after the mount point. Modified: python/branches/bcannon-objcap/Lib/os2emxpath.py ============================================================================== --- python/branches/bcannon-objcap/Lib/os2emxpath.py (original) +++ python/branches/bcannon-objcap/Lib/os2emxpath.py Mon Aug 28 21:49:46 2006 @@ -7,6 +7,9 @@ import os import stat +from genericpath import * +from ntpath import (expanduser, expandvars, isabs, islink, splitdrive, + splitext, split, walk) __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", @@ -36,18 +39,6 @@ return s.replace('\\', '/').lower() -# Return whether a path is absolute. -# Trivial in Posix, harder on the Mac or MS-DOS. -# For DOS it is absolute if it starts with a slash or backslash (current -# volume), or if a pathname after the volume letter and colon / UNC resource -# starts with a slash or backslash. - -def isabs(s): - """Test whether a path is absolute""" - s = splitdrive(s)[1] - return s != '' and s[:1] in '/\\' - - # Join two (or more) paths. def join(a, *p): @@ -63,17 +54,6 @@ return path -# Split a path in a drive specification (a drive letter followed by a -# colon) and the path specification. -# It is always true that drivespec + pathspec == p -def splitdrive(p): - """Split a pathname into drive and path specifiers. Returns a 2-tuple -"(drive,path)"; either part may be empty""" - if p[1:2] == ':': - return p[0:2], p[2:] - return '', p - - # Parse UNC paths def splitunc(p): """Split a pathname into UNC mount point and relative path specifiers. @@ -103,57 +83,6 @@ return '', p -# Split a path in head (everything up to the last '/') and tail (the -# rest). After the trailing '/' is stripped, the invariant -# join(head, tail) == p holds. -# The resulting head won't end in '/' unless it is the root. - -def split(p): - """Split a pathname. - - Return tuple (head, tail) where tail is everything after the final slash. - Either part may be empty.""" - - d, p = splitdrive(p) - # set i to index beyond p's last slash - i = len(p) - while i and p[i-1] not in '/\\': - i = i - 1 - head, tail = p[:i], p[i:] # now tail has no slashes - # remove trailing slashes from head, unless it's all slashes - head2 = head - while head2 and head2[-1] in '/\\': - head2 = head2[:-1] - head = head2 or head - return d + head, tail - - -# Split a path in root and extension. -# The extension is everything starting at the last dot in the last -# pathname component; the root is everything before that. -# It is always true that root + ext == p. - -def splitext(p): - """Split the extension from a pathname. - - Extension is everything from the last dot to the end. - Return (root, ext), either part may be empty.""" - root, ext = '', '' - for c in p: - if c in ['/','\\']: - root, ext = root + ext + c, '' - elif c == '.': - if ext: - root, ext = root + ext, c - else: - ext = c - elif ext: - ext = ext + c - else: - root = root + c - return root, ext - - # Return the tail (basename) part of a path. def basename(p): @@ -168,84 +97,12 @@ return split(p)[0] -# Return the longest prefix of all list elements. - -def commonprefix(m): - "Given a list of pathnames, returns the longest common leading component" - if not m: return '' - s1 = min(m) - s2 = max(m) - n = min(len(s1), len(s2)) - for i in xrange(n): - if s1[i] != s2[i]: - return s1[:i] - return s1[:n] - - -# Get size, mtime, atime of files. - -def getsize(filename): - """Return the size of a file, reported by os.stat()""" - return os.stat(filename).st_size - -def getmtime(filename): - """Return the last modification time of a file, reported by os.stat()""" - return os.stat(filename).st_mtime - -def getatime(filename): - """Return the last access time of a file, reported by os.stat()""" - return os.stat(filename).st_atime - -def getctime(filename): - """Return the creation time of a file, reported by os.stat().""" - return os.stat(filename).st_ctime - -# Is a path a symbolic link? -# This will always return false on systems where posix.lstat doesn't exist. - -def islink(path): - """Test for symbolic link. On OS/2 always returns false""" - return False - - -# Does a path exist? -# This is false for dangling symbolic links. - -def exists(path): - """Test whether a path exists""" - try: - st = os.stat(path) - except os.error: - return False - return True - +# alias exists to lexists lexists = exists # Is a path a directory? -def isdir(path): - """Test whether a path is a directory""" - try: - st = os.stat(path) - except os.error: - return False - return stat.S_ISDIR(st.st_mode) - - -# Is a path a regular file? -# This follows symbolic links, so both islink() and isdir() can be true -# for the same path. - -def isfile(path): - """Test whether a path is a regular file""" - try: - st = os.stat(path) - except os.error: - return False - return stat.S_ISREG(st.st_mode) - - # Is a path a mount point? Either a root (with or without drive letter) # or an UNC path with at most a / or \ after the mount point. @@ -258,131 +115,6 @@ return len(p) == 1 and p[0] in '/\\' -# Directory tree walk. -# For each directory under top (including top itself, but excluding -# '.' and '..'), func(arg, dirname, filenames) is called, where -# dirname is the name of the directory and filenames is the list -# of files (and subdirectories etc.) in the directory. -# The func may modify the filenames list, to implement a filter, -# or to impose a different order of visiting. - -def walk(top, func, arg): - """Directory tree walk whth callback function. - - walk(top, func, arg) calls func(arg, d, files) for each directory d - in the tree rooted at top (including top itself); files is a list - of all the files and subdirs in directory d.""" - try: - names = os.listdir(top) - except os.error: - return - func(arg, top, names) - exceptions = ('.', '..') - for name in names: - if name not in exceptions: - name = join(top, name) - if isdir(name): - walk(name, func, arg) - - -# Expand paths beginning with '~' or '~user'. -# '~' means $HOME; '~user' means that user's home directory. -# If the path doesn't begin with '~', or if the user or $HOME is unknown, -# the path is returned unchanged (leaving error reporting to whatever -# function is called with the expanded path as argument). -# See also module 'glob' for expansion of *, ? and [...] in pathnames. -# (A function should also be defined to do full *sh-style environment -# variable expansion.) - -def expanduser(path): - """Expand ~ and ~user constructs. - - If user or $HOME is unknown, do nothing.""" - if path[:1] != '~': - return path - i, n = 1, len(path) - while i < n and path[i] not in '/\\': - i = i + 1 - if i == 1: - if 'HOME' in os.environ: - userhome = os.environ['HOME'] - elif not 'HOMEPATH' in os.environ: - return path - else: - try: - drive = os.environ['HOMEDRIVE'] - except KeyError: - drive = '' - userhome = join(drive, os.environ['HOMEPATH']) - else: - return path - return userhome + path[i:] - - -# Expand paths containing shell variable substitutions. -# The following rules apply: -# - no expansion within single quotes -# - no escape character, except for '$$' which is translated into '$' -# - ${varname} is accepted. -# - varnames can be made out of letters, digits and the character '_' -# XXX With COMMAND.COM you can use any characters in a variable name, -# XXX except '^|<>='. - -def expandvars(path): - """Expand shell variables of form $var and ${var}. - - Unknown variables are left unchanged.""" - if '$' not in path: - return path - import string - varchars = string.letters + string.digits + '_-' - res = '' - index = 0 - pathlen = len(path) - while index < pathlen: - c = path[index] - if c == '\'': # no expansion within single quotes - path = path[index + 1:] - pathlen = len(path) - try: - index = path.index('\'') - res = res + '\'' + path[:index + 1] - except ValueError: - res = res + path - index = pathlen - 1 - elif c == '$': # variable or '$$' - if path[index + 1:index + 2] == '$': - res = res + c - index = index + 1 - elif path[index + 1:index + 2] == '{': - path = path[index+2:] - pathlen = len(path) - try: - index = path.index('}') - var = path[:index] - if var in os.environ: - res = res + os.environ[var] - except ValueError: - res = res + path - index = pathlen - 1 - else: - var = '' - index = index + 1 - c = path[index:index + 1] - while c != '' and c in varchars: - var = var + c - index = index + 1 - c = path[index:index + 1] - if var in os.environ: - res = res + os.environ[var] - if c != '': - res = res + c - else: - res = res + c - index = index + 1 - return res - - # Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B. def normpath(path): Modified: python/branches/bcannon-objcap/Lib/posixpath.py ============================================================================== --- python/branches/bcannon-objcap/Lib/posixpath.py (original) +++ python/branches/bcannon-objcap/Lib/posixpath.py Mon Aug 28 21:49:46 2006 @@ -12,6 +12,7 @@ import os import stat +from genericpath import * __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", @@ -119,37 +120,6 @@ return split(p)[0] -# Return the longest prefix of all list elements. - -def commonprefix(m): - "Given a list of pathnames, returns the longest common leading component" - if not m: return '' - s1 = min(m) - s2 = max(m) - n = min(len(s1), len(s2)) - for i in xrange(n): - if s1[i] != s2[i]: - return s1[:i] - return s1[:n] - -# Get size, mtime, atime of files. - -def getsize(filename): - """Return the size of a file, reported by os.stat().""" - return os.stat(filename).st_size - -def getmtime(filename): - """Return the last modification time of a file, reported by os.stat().""" - return os.stat(filename).st_mtime - -def getatime(filename): - """Return the last access time of a file, reported by os.stat().""" - return os.stat(filename).st_atime - -def getctime(filename): - """Return the metadata change time of a file, reported by os.stat().""" - return os.stat(filename).st_ctime - # Is a path a symbolic link? # This will always return false on systems where os.lstat doesn't exist. @@ -161,19 +131,6 @@ return False return stat.S_ISLNK(st.st_mode) - -# Does a path exist? -# This is false for dangling symbolic links. - -def exists(path): - """Test whether a path exists. Returns False for broken symbolic links""" - try: - st = os.stat(path) - except os.error: - return False - return True - - # Being true for dangling symbolic links is also useful. def lexists(path): @@ -185,32 +142,6 @@ return True -# Is a path a directory? -# This follows symbolic links, so both islink() and isdir() can be true -# for the same path. - -def isdir(path): - """Test whether a path is a directory""" - try: - st = os.stat(path) - except os.error: - return False - return stat.S_ISDIR(st.st_mode) - - -# Is a path a regular file? -# This follows symbolic links, so both islink() and isfile() can be true -# for the same path. - -def isfile(path): - """Test whether a path is a regular file""" - try: - st = os.stat(path) - except os.error: - return False - return stat.S_ISREG(st.st_mode) - - # Are two filenames really pointing to the same file? def samefile(f1, f2): Modified: python/branches/bcannon-objcap/Lib/site.py ============================================================================== --- python/branches/bcannon-objcap/Lib/site.py (original) +++ python/branches/bcannon-objcap/Lib/site.py Mon Aug 28 21:49:46 2006 @@ -242,6 +242,12 @@ def __repr__(self): return 'Use %s() or %s to exit' % (self.name, eof) def __call__(self, code=None): + # Shells like IDLE catch the SystemExit, but listen when their + # stdin wrapper is closed. + try: + sys.stdin.close() + except: + pass raise SystemExit(code) __builtin__.quit = Quitter('quit') __builtin__.exit = Quitter('exit') Modified: python/branches/bcannon-objcap/Lib/tarfile.py ============================================================================== --- python/branches/bcannon-objcap/Lib/tarfile.py (original) +++ python/branches/bcannon-objcap/Lib/tarfile.py Mon Aug 28 21:49:46 2006 @@ -411,9 +411,6 @@ self.buf += self.cmp.flush() if self.mode == "w" and self.buf: - blocks, remainder = divmod(len(self.buf), self.bufsize) - if remainder > 0: - self.buf += NUL * (self.bufsize - remainder) self.fileobj.write(self.buf) self.buf = "" if self.comptype == "gz": Modified: python/branches/bcannon-objcap/Lib/test/output/test_tokenize ============================================================================== --- python/branches/bcannon-objcap/Lib/test/output/test_tokenize (original) +++ python/branches/bcannon-objcap/Lib/test/output/test_tokenize Mon Aug 28 21:49:46 2006 @@ -1,15 +1,23 @@ test_tokenize -1,0-1,35: COMMENT "# Tests for the 'tokenize' module.\n" -2,0-2,43: COMMENT '# Large bits stolen from test_grammar.py. \n' +1,0-1,34: COMMENT "# Tests for the 'tokenize' module." +1,34-1,35: NL '\n' +2,0-2,42: COMMENT '# Large bits stolen from test_grammar.py. ' +2,42-2,43: NL '\n' 3,0-3,1: NL '\n' -4,0-4,11: COMMENT '# Comments\n' +4,0-4,10: COMMENT '# Comments' +4,10-4,11: NL '\n' 5,0-5,3: STRING '"#"' 5,3-5,4: NEWLINE '\n' -6,0-6,3: COMMENT "#'\n" -7,0-7,3: COMMENT '#"\n' -8,0-8,3: COMMENT '#\\\n' -9,7-9,9: COMMENT '#\n' -10,4-10,10: COMMENT '# abc\n' +6,0-6,2: COMMENT "#'" +6,2-6,3: NL '\n' +7,0-7,2: COMMENT '#"' +7,2-7,3: NL '\n' +8,0-8,2: COMMENT '#\\' +8,2-8,3: NL '\n' +9,7-9,8: COMMENT '#' +9,8-9,9: NL '\n' +10,4-10,9: COMMENT '# abc' +10,9-10,10: NL '\n' 11,0-12,4: STRING "'''#\n#'''" 12,4-12,5: NEWLINE '\n' 13,0-13,1: NL '\n' @@ -19,7 +27,8 @@ 14,7-14,8: COMMENT '#' 14,8-14,9: NEWLINE '\n' 15,0-15,1: NL '\n' -16,0-16,25: COMMENT '# Balancing continuation\n' +16,0-16,24: COMMENT '# Balancing continuation' +16,24-16,25: NL '\n' 17,0-17,1: NL '\n' 18,0-18,1: NAME 'a' 18,2-18,3: OP '=' @@ -92,7 +101,8 @@ 29,2-29,3: OP ')' 29,3-29,4: NEWLINE '\n' 30,0-30,1: NL '\n' -31,0-31,37: COMMENT '# Backslash means line continuation:\n' +31,0-31,36: COMMENT '# Backslash means line continuation:' +31,36-31,37: NL '\n' 32,0-32,1: NAME 'x' 32,2-32,3: OP '=' 32,4-32,5: NUMBER '1' @@ -100,13 +110,15 @@ 33,2-33,3: NUMBER '1' 33,3-33,4: NEWLINE '\n' 34,0-34,1: NL '\n' -35,0-35,55: COMMENT '# Backslash does not means continuation in comments :\\\n' +35,0-35,54: COMMENT '# Backslash does not means continuation in comments :\\' +35,54-35,55: NL '\n' 36,0-36,1: NAME 'x' 36,2-36,3: OP '=' 36,4-36,5: NUMBER '0' 36,5-36,6: NEWLINE '\n' 37,0-37,1: NL '\n' -38,0-38,20: COMMENT '# Ordinary integers\n' +38,0-38,19: COMMENT '# Ordinary integers' +38,19-38,20: NL '\n' 39,0-39,4: NUMBER '0xff' 39,5-39,7: OP '<>' 39,8-39,11: NUMBER '255' @@ -137,7 +149,8 @@ 44,15-44,16: NUMBER '1' 44,16-44,17: NEWLINE '\n' 45,0-45,1: NL '\n' -46,0-46,16: COMMENT '# Long integers\n' +46,0-46,15: COMMENT '# Long integers' +46,15-46,16: NL '\n' 47,0-47,1: NAME 'x' 47,2-47,3: OP '=' 47,4-47,6: NUMBER '0L' @@ -171,7 +184,8 @@ 54,4-54,35: NUMBER '123456789012345678901234567890l' 54,35-54,36: NEWLINE '\n' 55,0-55,1: NL '\n' -56,0-56,25: COMMENT '# Floating-point numbers\n' +56,0-56,24: COMMENT '# Floating-point numbers' +56,24-56,25: NL '\n' 57,0-57,1: NAME 'x' 57,2-57,3: OP '=' 57,4-57,8: NUMBER '3.14' @@ -184,7 +198,8 @@ 59,2-59,3: OP '=' 59,4-59,9: NUMBER '0.314' 59,9-59,10: NEWLINE '\n' -60,0-60,18: COMMENT '# XXX x = 000.314\n' +60,0-60,17: COMMENT '# XXX x = 000.314' +60,17-60,18: NL '\n' 61,0-61,1: NAME 'x' 61,2-61,3: OP '=' 61,4-61,8: NUMBER '.314' @@ -218,7 +233,8 @@ 68,4-68,9: NUMBER '3.1e4' 68,9-68,10: NEWLINE '\n' 69,0-69,1: NL '\n' -70,0-70,18: COMMENT '# String literals\n' +70,0-70,17: COMMENT '# String literals' +70,17-70,18: NL '\n' 71,0-71,1: NAME 'x' 71,2-71,3: OP '=' 71,4-71,6: STRING "''" @@ -366,7 +382,8 @@ 125,6-126,3: STRING "uR'''spam\n'''" 126,3-126,4: NEWLINE '\n' 127,0-127,1: NL '\n' -128,0-128,14: COMMENT '# Indentation\n' +128,0-128,13: COMMENT '# Indentation' +128,13-128,14: NL '\n' 129,0-129,2: NAME 'if' 129,3-129,4: NUMBER '1' 129,4-129,5: OP ':' @@ -438,7 +455,8 @@ 142,14-142,15: NUMBER '2' 142,15-142,16: NEWLINE '\n' 143,0-143,1: NL '\n' -144,0-144,12: COMMENT '# Operators\n' +144,0-144,11: COMMENT '# Operators' +144,11-144,12: NL '\n' 145,0-145,1: NL '\n' 146,0-146,0: DEDENT '' 146,0-146,0: DEDENT '' @@ -500,7 +518,8 @@ 149,27-149,28: OP ')' 149,28-149,29: NEWLINE '\n' 150,0-150,1: NL '\n' -151,0-151,13: COMMENT '# comparison\n' +151,0-151,12: COMMENT '# comparison' +151,12-151,13: NL '\n' 152,0-152,2: NAME 'if' 152,3-152,4: NUMBER '1' 152,5-152,6: OP '<' @@ -531,7 +550,8 @@ 152,67-152,71: NAME 'pass' 152,71-152,72: NEWLINE '\n' 153,0-153,1: NL '\n' -154,0-154,9: COMMENT '# binary\n' +154,0-154,8: COMMENT '# binary' +154,8-154,9: NL '\n' 155,0-155,1: NAME 'x' 155,2-155,3: OP '=' 155,4-155,5: NUMBER '1' @@ -551,7 +571,8 @@ 157,8-157,9: NUMBER '1' 157,9-157,10: NEWLINE '\n' 158,0-158,1: NL '\n' -159,0-159,8: COMMENT '# shift\n' +159,0-159,7: COMMENT '# shift' +159,7-159,8: NL '\n' 160,0-160,1: NAME 'x' 160,2-160,3: OP '=' 160,4-160,5: NUMBER '1' @@ -561,7 +582,8 @@ 160,14-160,15: NUMBER '1' 160,15-160,16: NEWLINE '\n' 161,0-161,1: NL '\n' -162,0-162,11: COMMENT '# additive\n' +162,0-162,10: COMMENT '# additive' +162,10-162,11: NL '\n' 163,0-163,1: NAME 'x' 163,2-163,3: OP '=' 163,4-163,5: NUMBER '1' @@ -575,7 +597,8 @@ 163,20-163,21: NUMBER '1' 163,21-163,22: NEWLINE '\n' 164,0-164,1: NL '\n' -165,0-165,17: COMMENT '# multiplicative\n' +165,0-165,16: COMMENT '# multiplicative' +165,16-165,17: NL '\n' 166,0-166,1: NAME 'x' 166,2-166,3: OP '=' 166,4-166,5: NUMBER '1' @@ -587,7 +610,8 @@ 166,16-166,17: NUMBER '1' 166,17-166,18: NEWLINE '\n' 167,0-167,1: NL '\n' -168,0-168,8: COMMENT '# unary\n' +168,0-168,7: COMMENT '# unary' +168,7-168,8: NL '\n' 169,0-169,1: NAME 'x' 169,2-169,3: OP '=' 169,4-169,5: OP '~' @@ -625,7 +649,8 @@ 170,24-170,25: NUMBER '1' 170,25-170,26: NEWLINE '\n' 171,0-171,1: NL '\n' -172,0-172,11: COMMENT '# selector\n' +172,0-172,10: COMMENT '# selector' +172,10-172,11: NL '\n' 173,0-173,6: NAME 'import' 173,7-173,10: NAME 'sys' 173,10-173,11: OP ',' Modified: python/branches/bcannon-objcap/Lib/test/test_array.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_array.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_array.py Mon Aug 28 21:49:46 2006 @@ -85,6 +85,13 @@ self.assertNotEqual(id(a), id(b)) self.assertEqual(a, b) + def test_deepcopy(self): + import copy + a = array.array(self.typecode, self.example) + b = copy.deepcopy(a) + self.assertNotEqual(id(a), id(b)) + self.assertEqual(a, b) + def test_pickle(self): for protocol in (0, 1, 2): a = array.array(self.typecode, self.example) Modified: python/branches/bcannon-objcap/Lib/test/test_compiler.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_compiler.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_compiler.py Mon Aug 28 21:49:46 2006 @@ -116,6 +116,13 @@ exec c in dct self.assertEquals(dct.get('result'), 3) + def testGenExp(self): + c = compiler.compile('list((i,j) for i in range(3) if i < 3' + ' for j in range(4) if j > 2)', + '', + 'eval') + self.assertEquals(eval(c), [(0, 3), (1, 3), (2, 3)]) + NOLINENO = (compiler.ast.Module, compiler.ast.Stmt, compiler.ast.Discard) Modified: python/branches/bcannon-objcap/Lib/test/test_parser.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_parser.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_parser.py Mon Aug 28 21:49:46 2006 @@ -183,6 +183,44 @@ def test_assert(self): self.check_suite("assert alo < ahi and blo < bhi\n") + def test_position(self): + # An absolutely minimal test of position information. Better + # tests would be a big project. + code = "def f(x):\n return x + 1\n" + st1 = parser.suite(code) + st2 = st1.totuple(line_info=1, col_info=1) + + def walk(tree): + node_type = tree[0] + next = tree[1] + if isinstance(next, tuple): + for elt in tree[1:]: + for x in walk(elt): + yield x + else: + yield tree + + terminals = list(walk(st2)) + self.assertEqual([ + (1, 'def', 1, 0), + (1, 'f', 1, 4), + (7, '(', 1, 5), + (1, 'x', 1, 6), + (8, ')', 1, 7), + (11, ':', 1, 8), + (4, '', 1, 9), + (5, '', 2, -1), + (1, 'return', 2, 4), + (1, 'x', 2, 11), + (14, '+', 2, 13), + (2, '1', 2, 15), + (4, '', 2, 16), + (6, '', 2, -1), + (4, '', 2, -1), + (0, '', 2, -1)], + terminals) + + # # Second, we take *invalid* trees and make sure we get ParserError # rejections for them. Modified: python/branches/bcannon-objcap/Lib/test/test_syntax.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_syntax.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_syntax.py Mon Aug 28 21:49:46 2006 @@ -235,6 +235,93 @@ >>> f() += 1 Traceback (most recent call last): SyntaxError: illegal expression for augmented assignment (, line 1) + + +Test continue in finally in weird combinations. + +continue in for loop under finally shouuld be ok. + + >>> def test(): + ... try: + ... pass + ... finally: + ... for abc in range(10): + ... continue + ... print abc + >>> test() + 9 + +Start simple, a continue in a finally should not be allowed. + + >>> def test(): + ... for abc in range(10): + ... try: + ... pass + ... finally: + ... continue + Traceback (most recent call last): + ... + SyntaxError: 'continue' not supported inside 'finally' clause (, line 6) + +This is essentially a continue in a finally which should not be allowed. + + >>> def test(): + ... for abc in range(10): + ... try: + ... pass + ... finally: + ... try: + ... continue + ... except: + ... pass + Traceback (most recent call last): + ... + SyntaxError: 'continue' not supported inside 'finally' clause (, line 7) + + >>> def foo(): + ... try: + ... pass + ... finally: + ... continue + Traceback (most recent call last): + ... + SyntaxError: 'continue' not supported inside 'finally' clause (, line 5) + + >>> def foo(): + ... for a in (): + ... try: + ... pass + ... finally: + ... continue + Traceback (most recent call last): + ... + SyntaxError: 'continue' not supported inside 'finally' clause (, line 6) + + >>> def foo(): + ... for a in (): + ... try: + ... pass + ... finally: + ... try: + ... continue + ... finally: + ... pass + Traceback (most recent call last): + ... + SyntaxError: 'continue' not supported inside 'finally' clause (, line 7) + + >>> def foo(): + ... for a in (): + ... try: pass + ... finally: + ... try: + ... pass + ... except: + ... continue + Traceback (most recent call last): + ... + SyntaxError: 'continue' not supported inside 'finally' clause (, line 8) + """ import re Modified: python/branches/bcannon-objcap/Lib/test/test_tarfile.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_tarfile.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_tarfile.py Mon Aug 28 21:49:46 2006 @@ -324,6 +324,27 @@ class WriteStreamTest(WriteTest): sep = '|' + def test_padding(self): + self.dst.close() + + if self.comp == "gz": + f = gzip.GzipFile(self.dstname) + s = f.read() + f.close() + elif self.comp == "bz2": + f = bz2.BZ2Decompressor() + s = file(self.dstname).read() + s = f.decompress(s) + self.assertEqual(len(f.unused_data), 0, "trailing data") + else: + f = file(self.dstname) + s = f.read() + f.close() + + self.assertEqual(s.count("\0"), tarfile.RECORDSIZE, + "incorrect zero padding") + + class WriteGNULongTest(unittest.TestCase): """This testcase checks for correct creation of GNU Longname and Longlink extensions. Modified: python/branches/bcannon-objcap/Lib/test/test_tokenize.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_tokenize.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_tokenize.py Mon Aug 28 21:49:46 2006 @@ -1,9 +1,90 @@ +"""Tests for the tokenize module. + +The tests were originally written in the old Python style, where the +test output was compared to a golden file. This docstring represents +the first steps towards rewriting the entire test as a doctest. + +The tests can be really simple. Given a small fragment of source +code, print out a table with the tokens. The ENDMARK is omitted for +brevity. + +>>> dump_tokens("1 + 1") +NUMBER '1' (1, 0) (1, 1) +OP '+' (1, 2) (1, 3) +NUMBER '1' (1, 4) (1, 5) + +A comment generates a token here, unlike in the parser module. The +comment token is followed by an NL or a NEWLINE token, depending on +whether the line contains the completion of a statement. + +>>> dump_tokens("if False:\\n" +... " # NL\\n" +... " True = False # NEWLINE\\n") +NAME 'if' (1, 0) (1, 2) +NAME 'False' (1, 3) (1, 8) +OP ':' (1, 8) (1, 9) +NEWLINE '\\n' (1, 9) (1, 10) +COMMENT '# NL' (2, 4) (2, 8) +NL '\\n' (2, 8) (2, 9) +INDENT ' ' (3, 0) (3, 4) +NAME 'True' (3, 4) (3, 8) +OP '=' (3, 9) (3, 10) +NAME 'False' (3, 11) (3, 16) +COMMENT '# NEWLINE' (3, 17) (3, 26) +NEWLINE '\\n' (3, 26) (3, 27) +DEDENT '' (4, 0) (4, 0) + + +There will be a bunch more tests of specific source patterns. + +The tokenize module also defines an untokenize function that should +regenerate the original program text from the tokens. + +There are some standard formatting practices that are easy to get right. + +>>> roundtrip("if x == 1:\\n" +... " print x\\n") +if x == 1: + print x + +Some people use different formatting conventions, which makes +untokenize a little trickier. Note that this test involves trailing +whitespace after the colon. Note that we use hex escapes to make the +two trailing blanks apparent in the expected output. + +>>> roundtrip("if x == 1 : \\n" +... " print x\\n") +if x == 1 :\x20\x20 + print x + +Comments need to go in the right place. + +>>> roundtrip("if x == 1:\\n" +... " # A comment by itself.\\n" +... " print x # Comment here, too.\\n" +... " # Another comment.\\n" +... "after_if = True\\n") +if x == 1: + # A comment by itself. + print x # Comment here, too. + # Another comment. +after_if = True + +>>> roundtrip("if (x # The comments need to go in the right place\\n" +... " == 1):\\n" +... " print 'x == 1'\\n") +if (x # The comments need to go in the right place + == 1): + print 'x == 1' + +""" + import os, glob, random from cStringIO import StringIO from test.test_support import (verbose, findfile, is_resource_enabled, TestFailed) -from tokenize import (tokenize, generate_tokens, untokenize, - NUMBER, NAME, OP, STRING) +from tokenize import (tokenize, generate_tokens, untokenize, tok_name, + ENDMARKER, NUMBER, NAME, OP, STRING, COMMENT) # Test roundtrip for `untokenize`. `f` is a file path. The source code in f # is tokenized, converted back to source code via tokenize.untokenize(), @@ -24,6 +105,23 @@ if t1 != t2: raise TestFailed("untokenize() roundtrip failed for %r" % f) +def dump_tokens(s): + """Print out the tokens in s in a table format. + + The ENDMARKER is omitted. + """ + f = StringIO(s) + for type, token, start, end, line in generate_tokens(f.readline): + if type == ENDMARKER: + break + type = tok_name[type] + print "%(type)-10.10s %(token)-13.13r %(start)s %(end)s" % locals() + +def roundtrip(s): + f = StringIO(s) + source = untokenize(generate_tokens(f.readline)) + print source, + # This is an example from the docs, set up as a doctest. def decistmt(s): """Substitute Decimals for floats in a string of statements. @@ -105,7 +203,7 @@ # Run the doctests in this module. from test import test_tokenize # i.e., this module from test.test_support import run_doctest - run_doctest(test_tokenize) + run_doctest(test_tokenize, verbose) if verbose: print 'finished' Modified: python/branches/bcannon-objcap/Lib/test/test_unicode.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_unicode.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_unicode.py Mon Aug 28 21:49:46 2006 @@ -92,6 +92,10 @@ "\\xfe\\xff'") testrepr = repr(u''.join(map(unichr, xrange(256)))) self.assertEqual(testrepr, latin1repr) + # Test repr works on wide unicode escapes without overflow. + self.assertEqual(repr(u"\U00010000" * 39 + u"\uffff" * 4096), + repr(u"\U00010000" * 39 + u"\uffff" * 4096)) + def test_count(self): string_tests.CommonTest.test_count(self) Modified: python/branches/bcannon-objcap/Lib/test/test_urllib2.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_urllib2.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_urllib2.py Mon Aug 28 21:49:46 2006 @@ -46,6 +46,69 @@ self.assertEquals(urllib2.parse_http_list(string), list) +def test_request_headers_dict(): + """ + The Request.headers dictionary is not a documented interface. It should + stay that way, because the complete set of headers are only accessible + through the .get_header(), .has_header(), .header_items() interface. + However, .headers pre-dates those methods, and so real code will be using + the dictionary. + + The introduction in 2.4 of those methods was a mistake for the same reason: + code that previously saw all (urllib2 user)-provided headers in .headers + now sees only a subset (and the function interface is ugly and incomplete). + A better change would have been to replace .headers dict with a dict + subclass (or UserDict.DictMixin instance?) that preserved the .headers + interface and also provided access to the "unredirected" headers. It's + probably too late to fix that, though. + + + Check .capitalize() case normalization: + + >>> url = "http://example.com" + >>> Request(url, headers={"Spam-eggs": "blah"}).headers["Spam-eggs"] + 'blah' + >>> Request(url, headers={"spam-EggS": "blah"}).headers["Spam-eggs"] + 'blah' + + Currently, Request(url, "Spam-eggs").headers["Spam-Eggs"] raises KeyError, + but that could be changed in future. + + """ + +def test_request_headers_methods(): + """ + Note the case normalization of header names here, to .capitalize()-case. + This should be preserved for backwards-compatibility. (In the HTTP case, + normalization to .title()-case is done by urllib2 before sending headers to + httplib). + + >>> url = "http://example.com" + >>> r = Request(url, headers={"Spam-eggs": "blah"}) + >>> r.has_header("Spam-eggs") + True + >>> r.header_items() + [('Spam-eggs', 'blah')] + >>> r.add_header("Foo-Bar", "baz") + >>> items = r.header_items() + >>> items.sort() + >>> items + [('Foo-bar', 'baz'), ('Spam-eggs', 'blah')] + + Note that e.g. r.has_header("spam-EggS") is currently False, and + r.get_header("spam-EggS") returns None, but that could be changed in + future. + + >>> r.has_header("Not-there") + False + >>> print r.get_header("Not-there") + None + >>> r.get_header("Not-there", "default") + 'default' + + """ + + def test_password_manager(self): """ >>> mgr = urllib2.HTTPPasswordMgr() @@ -676,11 +739,11 @@ r = MockResponse(200, "OK", {}, "") newreq = h.do_request_(req) if data is None: # GET - self.assert_("Content-Length" not in req.unredirected_hdrs) - self.assert_("Content-Type" not in req.unredirected_hdrs) + self.assert_("Content-length" not in req.unredirected_hdrs) + self.assert_("Content-type" not in req.unredirected_hdrs) else: # POST - self.assertEqual(req.unredirected_hdrs["Content-Length"], "0") - self.assertEqual(req.unredirected_hdrs["Content-Type"], + self.assertEqual(req.unredirected_hdrs["Content-length"], "0") + self.assertEqual(req.unredirected_hdrs["Content-type"], "application/x-www-form-urlencoded") # XXX the details of Host could be better tested self.assertEqual(req.unredirected_hdrs["Host"], "example.com") @@ -692,8 +755,8 @@ req.add_unredirected_header("Host", "baz") req.add_unredirected_header("Spam", "foo") newreq = h.do_request_(req) - self.assertEqual(req.unredirected_hdrs["Content-Length"], "foo") - self.assertEqual(req.unredirected_hdrs["Content-Type"], "bar") + self.assertEqual(req.unredirected_hdrs["Content-length"], "foo") + self.assertEqual(req.unredirected_hdrs["Content-type"], "bar") self.assertEqual(req.unredirected_hdrs["Host"], "baz") self.assertEqual(req.unredirected_hdrs["Spam"], "foo") @@ -847,7 +910,7 @@ 407, 'Proxy-Authenticate: Basic realm="%s"\r\n\r\n' % realm) opener.add_handler(auth_handler) opener.add_handler(http_handler) - self._test_basic_auth(opener, auth_handler, "Proxy-Authorization", + self._test_basic_auth(opener, auth_handler, "Proxy-authorization", realm, http_handler, password_manager, "http://acme.example.com:3128/protected", "proxy.example.com:3128", Modified: python/branches/bcannon-objcap/Lib/test/test_uuid.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_uuid.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_uuid.py Mon Aug 28 21:49:46 2006 @@ -16,12 +16,13 @@ def test_UUID(self): equal = self.assertEqual ascending = [] - for (string, curly, hex, bytes, fields, integer, urn, + for (string, curly, hex, bytes, bytes_le, fields, integer, urn, time, clock_seq, variant, version) in [ ('00000000-0000-0000-0000-000000000000', '{00000000-0000-0000-0000-000000000000}', '00000000000000000000000000000000', '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', + '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', (0, 0, 0, 0, 0, 0), 0, 'urn:uuid:00000000-0000-0000-0000-000000000000', @@ -30,6 +31,7 @@ '{00010203-0405-0607-0809-0a0b0c0d0e0f}', '000102030405060708090a0b0c0d0e0f', '\0\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\x0d\x0e\x0f', + '\x03\x02\x01\0\x05\x04\x07\x06\x08\t\n\x0b\x0c\x0d\x0e\x0f', (0x00010203L, 0x0405, 0x0607, 8, 9, 0x0a0b0c0d0e0fL), 0x000102030405060708090a0b0c0d0e0fL, 'urn:uuid:00010203-0405-0607-0809-0a0b0c0d0e0f', @@ -38,6 +40,7 @@ '{02d9e6d5-9467-382e-8f9b-9300a64ac3cd}', '02d9e6d59467382e8f9b9300a64ac3cd', '\x02\xd9\xe6\xd5\x94\x67\x38\x2e\x8f\x9b\x93\x00\xa6\x4a\xc3\xcd', + '\xd5\xe6\xd9\x02\x67\x94\x2e\x38\x8f\x9b\x93\x00\xa6\x4a\xc3\xcd', (0x02d9e6d5L, 0x9467, 0x382e, 0x8f, 0x9b, 0x9300a64ac3cdL), 0x02d9e6d59467382e8f9b9300a64ac3cdL, 'urn:uuid:02d9e6d5-9467-382e-8f9b-9300a64ac3cd', @@ -46,6 +49,7 @@ '{12345678-1234-5678-1234-567812345678}', '12345678123456781234567812345678', '\x12\x34\x56\x78'*4, + '\x78\x56\x34\x12\x34\x12\x78\x56\x12\x34\x56\x78\x12\x34\x56\x78', (0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678), 0x12345678123456781234567812345678, 'urn:uuid:12345678-1234-5678-1234-567812345678', @@ -54,6 +58,7 @@ '{6ba7b810-9dad-11d1-80b4-00c04fd430c8}', '6ba7b8109dad11d180b400c04fd430c8', '\x6b\xa7\xb8\x10\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', + '\x10\xb8\xa7\x6b\xad\x9d\xd1\x11\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', (0x6ba7b810L, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8L), 0x6ba7b8109dad11d180b400c04fd430c8L, 'urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8', @@ -62,6 +67,7 @@ '{6ba7b811-9dad-11d1-80b4-00c04fd430c8}', '6ba7b8119dad11d180b400c04fd430c8', '\x6b\xa7\xb8\x11\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', + '\x11\xb8\xa7\x6b\xad\x9d\xd1\x11\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', (0x6ba7b811L, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8L), 0x6ba7b8119dad11d180b400c04fd430c8L, 'urn:uuid:6ba7b811-9dad-11d1-80b4-00c04fd430c8', @@ -70,6 +76,7 @@ '{6ba7b812-9dad-11d1-80b4-00c04fd430c8}', '6ba7b8129dad11d180b400c04fd430c8', '\x6b\xa7\xb8\x12\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', + '\x12\xb8\xa7\x6b\xad\x9d\xd1\x11\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', (0x6ba7b812L, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8L), 0x6ba7b8129dad11d180b400c04fd430c8L, 'urn:uuid:6ba7b812-9dad-11d1-80b4-00c04fd430c8', @@ -78,6 +85,7 @@ '{6ba7b814-9dad-11d1-80b4-00c04fd430c8}', '6ba7b8149dad11d180b400c04fd430c8', '\x6b\xa7\xb8\x14\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', + '\x14\xb8\xa7\x6b\xad\x9d\xd1\x11\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', (0x6ba7b814L, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8L), 0x6ba7b8149dad11d180b400c04fd430c8L, 'urn:uuid:6ba7b814-9dad-11d1-80b4-00c04fd430c8', @@ -86,6 +94,7 @@ '{7d444840-9dc0-11d1-b245-5ffdce74fad2}', '7d4448409dc011d1b2455ffdce74fad2', '\x7d\x44\x48\x40\x9d\xc0\x11\xd1\xb2\x45\x5f\xfd\xce\x74\xfa\xd2', + '\x40\x48\x44\x7d\xc0\x9d\xd1\x11\xb2\x45\x5f\xfd\xce\x74\xfa\xd2', (0x7d444840L, 0x9dc0, 0x11d1, 0xb2, 0x45, 0x5ffdce74fad2L), 0x7d4448409dc011d1b2455ffdce74fad2L, 'urn:uuid:7d444840-9dc0-11d1-b245-5ffdce74fad2', @@ -94,6 +103,7 @@ '{e902893a-9d22-3c7e-a7b8-d6e313b71d9f}', 'e902893a9d223c7ea7b8d6e313b71d9f', '\xe9\x02\x89\x3a\x9d\x22\x3c\x7e\xa7\xb8\xd6\xe3\x13\xb7\x1d\x9f', + '\x3a\x89\x02\xe9\x22\x9d\x7e\x3c\xa7\xb8\xd6\xe3\x13\xb7\x1d\x9f', (0xe902893aL, 0x9d22, 0x3c7e, 0xa7, 0xb8, 0xd6e313b71d9fL), 0xe902893a9d223c7ea7b8d6e313b71d9fL, 'urn:uuid:e902893a-9d22-3c7e-a7b8-d6e313b71d9f', @@ -102,6 +112,7 @@ '{eb424026-6f54-4ef8-a4d0-bb658a1fc6cf}', 'eb4240266f544ef8a4d0bb658a1fc6cf', '\xeb\x42\x40\x26\x6f\x54\x4e\xf8\xa4\xd0\xbb\x65\x8a\x1f\xc6\xcf', + '\x26\x40\x42\xeb\x54\x6f\xf8\x4e\xa4\xd0\xbb\x65\x8a\x1f\xc6\xcf', (0xeb424026L, 0x6f54, 0x4ef8, 0xa4, 0xd0, 0xbb658a1fc6cfL), 0xeb4240266f544ef8a4d0bb658a1fc6cfL, 'urn:uuid:eb424026-6f54-4ef8-a4d0-bb658a1fc6cf', @@ -110,6 +121,7 @@ '{f81d4fae-7dec-11d0-a765-00a0c91e6bf6}', 'f81d4fae7dec11d0a76500a0c91e6bf6', '\xf8\x1d\x4f\xae\x7d\xec\x11\xd0\xa7\x65\x00\xa0\xc9\x1e\x6b\xf6', + '\xae\x4f\x1d\xf8\xec\x7d\xd0\x11\xa7\x65\x00\xa0\xc9\x1e\x6b\xf6', (0xf81d4faeL, 0x7dec, 0x11d0, 0xa7, 0x65, 0x00a0c91e6bf6L), 0xf81d4fae7dec11d0a76500a0c91e6bf6L, 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6', @@ -118,6 +130,7 @@ '{fffefdfc-fffe-fffe-fffe-fffefdfcfbfa}', 'fffefdfcfffefffefffefffefdfcfbfa', '\xff\xfe\xfd\xfc\xff\xfe\xff\xfe\xff\xfe\xff\xfe\xfd\xfc\xfb\xfa', + '\xfc\xfd\xfe\xff\xfe\xff\xfe\xff\xff\xfe\xff\xfe\xfd\xfc\xfb\xfa', (0xfffefdfcL, 0xfffe, 0xfffe, 0xff, 0xfe, 0xfffefdfcfbfaL), 0xfffefdfcfffefffefffefffefdfcfbfaL, 'urn:uuid:fffefdfc-fffe-fffe-fffe-fffefdfcfbfa', @@ -126,6 +139,7 @@ '{ffffffff-ffff-ffff-ffff-ffffffffffff}', 'ffffffffffffffffffffffffffffffff', '\xff'*16, + '\xff'*16, (0xffffffffL, 0xffffL, 0xffffL, 0xff, 0xff, 0xffffffffffffL), 0xffffffffffffffffffffffffffffffffL, 'urn:uuid:ffffffff-ffff-ffff-ffff-ffffffffffff', @@ -134,12 +148,14 @@ equivalents = [] # Construct each UUID in several different ways. for u in [uuid.UUID(string), uuid.UUID(curly), uuid.UUID(hex), - uuid.UUID(bytes=bytes), uuid.UUID(fields=fields), - uuid.UUID(int=integer), uuid.UUID(urn)]: + uuid.UUID(bytes=bytes), uuid.UUID(bytes_le=bytes_le), + uuid.UUID(fields=fields), uuid.UUID(int=integer), + uuid.UUID(urn)]: # Test all conversions and properties of the UUID object. equal(str(u), string) equal(int(u), integer) equal(u.bytes, bytes) + equal(u.bytes_le, bytes_le) equal(u.fields, fields) equal(u.time_low, fields[0]) equal(u.time_mid, fields[1]) @@ -189,6 +205,11 @@ badvalue(lambda: uuid.UUID(bytes='\0'*15)) badvalue(lambda: uuid.UUID(bytes='\0'*17)) + # Badly formed bytes_le. + badvalue(lambda: uuid.UUID(bytes_le='abc')) + badvalue(lambda: uuid.UUID(bytes_le='\0'*15)) + badvalue(lambda: uuid.UUID(bytes_le='\0'*17)) + # Badly formed fields. badvalue(lambda: uuid.UUID(fields=(1,))) badvalue(lambda: uuid.UUID(fields=(1, 2, 3, 4, 5))) @@ -221,51 +242,43 @@ uuid.UUID(h) uuid.UUID(hex=h) uuid.UUID(bytes=b) + uuid.UUID(bytes_le=b) uuid.UUID(fields=f) uuid.UUID(int=i) # Wrong number of arguments (positional). badtype(lambda: uuid.UUID()) badtype(lambda: uuid.UUID(h, b)) - badtype(lambda: uuid.UUID(h, b, f)) - badtype(lambda: uuid.UUID(h, b, f, i)) - - # Duplicate arguments (named). - badtype(lambda: uuid.UUID(hex=h, bytes=b)) - badtype(lambda: uuid.UUID(hex=h, fields=f)) - badtype(lambda: uuid.UUID(hex=h, int=i)) - badtype(lambda: uuid.UUID(bytes=b, fields=f)) - badtype(lambda: uuid.UUID(bytes=b, int=i)) - badtype(lambda: uuid.UUID(fields=f, int=i)) - badtype(lambda: uuid.UUID(hex=h, bytes=b, fields=f)) - badtype(lambda: uuid.UUID(hex=h, bytes=b, int=i)) - badtype(lambda: uuid.UUID(hex=h, fields=f, int=i)) - badtype(lambda: uuid.UUID(bytes=b, int=i, fields=f)) - badtype(lambda: uuid.UUID(hex=h, bytes=b, int=i, fields=f)) - - # Duplicate arguments (positional and named). - badtype(lambda: uuid.UUID(h, hex=h)) - badtype(lambda: uuid.UUID(h, bytes=b)) - badtype(lambda: uuid.UUID(h, fields=f)) - badtype(lambda: uuid.UUID(h, int=i)) - badtype(lambda: uuid.UUID(h, hex=h, bytes=b)) - badtype(lambda: uuid.UUID(h, hex=h, fields=f)) - badtype(lambda: uuid.UUID(h, hex=h, int=i)) - badtype(lambda: uuid.UUID(h, bytes=b, fields=f)) - badtype(lambda: uuid.UUID(h, bytes=b, int=i)) - badtype(lambda: uuid.UUID(h, fields=f, int=i)) - badtype(lambda: uuid.UUID(h, hex=h, bytes=b, fields=f)) - badtype(lambda: uuid.UUID(h, hex=h, bytes=b, int=i)) - badtype(lambda: uuid.UUID(h, hex=h, fields=f, int=i)) - badtype(lambda: uuid.UUID(h, bytes=b, int=i, fields=f)) - badtype(lambda: uuid.UUID(h, hex=h, bytes=b, int=i, fields=f)) + badtype(lambda: uuid.UUID(h, b, b)) + badtype(lambda: uuid.UUID(h, b, b, f)) + badtype(lambda: uuid.UUID(h, b, b, f, i)) + + # Duplicate arguments. + for hh in [[], [('hex', h)]]: + for bb in [[], [('bytes', b)]]: + for bble in [[], [('bytes_le', b)]]: + for ii in [[], [('int', i)]]: + for ff in [[], [('fields', f)]]: + args = dict(hh + bb + bble + ii + ff) + if len(args) != 0: + badtype(lambda: uuid.UUID(h, **args)) + if len(args) != 1: + badtype(lambda: uuid.UUID(**args)) # Immutability. u = uuid.UUID(h) badtype(lambda: setattr(u, 'hex', h)) badtype(lambda: setattr(u, 'bytes', b)) + badtype(lambda: setattr(u, 'bytes_le', b)) badtype(lambda: setattr(u, 'fields', f)) badtype(lambda: setattr(u, 'int', i)) + badtype(lambda: setattr(u, 'time_low', 0)) + badtype(lambda: setattr(u, 'time_mid', 0)) + badtype(lambda: setattr(u, 'time_hi_version', 0)) + badtype(lambda: setattr(u, 'time_hi_version', 0)) + badtype(lambda: setattr(u, 'clock_seq_hi_variant', 0)) + badtype(lambda: setattr(u, 'clock_seq_low', 0)) + badtype(lambda: setattr(u, 'node', 0)) def check_node(self, node, source): individual_group_bit = (node >> 40L) & 1 @@ -356,11 +369,17 @@ def test_uuid1(self): equal = self.assertEqual - # Make sure uuid4() generates UUIDs that are actually version 1. + # Make sure uuid1() generates UUIDs that are actually version 1. for u in [uuid.uuid1() for i in range(10)]: equal(u.variant, uuid.RFC_4122) equal(u.version, 1) + # Make sure the generated UUIDs are actually unique. + uuids = {} + for u in [uuid.uuid1() for i in range(1000)]: + uuids[u] = 1 + equal(len(uuids.keys()), 1000) + # Make sure the supplied node ID appears in the UUID. u = uuid.uuid1(0) equal(u.node, 0) @@ -408,6 +427,12 @@ equal(u.variant, uuid.RFC_4122) equal(u.version, 4) + # Make sure the generated UUIDs are actually unique. + uuids = {} + for u in [uuid.uuid4() for i in range(1000)]: + uuids[u] = 1 + equal(len(uuids.keys()), 1000) + def test_uuid5(self): equal = self.assertEqual Modified: python/branches/bcannon-objcap/Lib/test/test_xml_etree_c.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_xml_etree_c.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_xml_etree_c.py Mon Aug 28 21:49:46 2006 @@ -204,6 +204,17 @@ "" % encoding ) +def bug_1534630(): + """ + >>> bob = ET.TreeBuilder() + >>> e = bob.data("data") + >>> e = bob.start("tag", {}) + >>> e = bob.end("tag") + >>> e = bob.close() + >>> serialize(ET, e) + '' + """ + def test_main(): from test import test_xml_etree_c test_support.run_doctest(test_xml_etree_c, verbosity=True) Modified: python/branches/bcannon-objcap/Lib/tokenize.py ============================================================================== --- python/branches/bcannon-objcap/Lib/tokenize.py (original) +++ python/branches/bcannon-objcap/Lib/tokenize.py Mon Aug 28 21:49:46 2006 @@ -159,14 +159,73 @@ for token_info in generate_tokens(readline): tokeneater(*token_info) +class Untokenizer: + + def __init__(self): + self.tokens = [] + self.prev_row = 1 + self.prev_col = 0 + + def add_whitespace(self, start): + row, col = start + assert row <= self.prev_row + col_offset = col - self.prev_col + if col_offset: + self.tokens.append(" " * col_offset) + + def untokenize(self, iterable): + for t in iterable: + if len(t) == 2: + self.compat(t, iterable) + break + tok_type, token, start, end, line = t + self.add_whitespace(start) + self.tokens.append(token) + self.prev_row, self.prev_col = end + if tok_type in (NEWLINE, NL): + self.prev_row += 1 + self.prev_col = 0 + return "".join(self.tokens) + + def compat(self, token, iterable): + startline = False + indents = [] + toks_append = self.tokens.append + toknum, tokval = token + if toknum in (NAME, NUMBER): + tokval += ' ' + if toknum in (NEWLINE, NL): + startline = True + for tok in iterable: + toknum, tokval = tok[:2] + + if toknum in (NAME, NUMBER): + tokval += ' ' + + if toknum == INDENT: + indents.append(tokval) + continue + elif toknum == DEDENT: + indents.pop() + continue + elif toknum in (NEWLINE, NL): + startline = True + elif startline and indents: + toks_append(indents[-1]) + startline = False + toks_append(tokval) def untokenize(iterable): """Transform tokens back into Python source code. Each element returned by the iterable must be a token sequence - with at least two elements, a token number and token value. + with at least two elements, a token number and token value. If + only two tokens are passed, the resulting output is poor. + + Round-trip invariant for full input: + Untokenized source will match input source exactly - Round-trip invariant: + Round-trip invariant for limited intput: # Output text will tokenize the back to the input t1 = [tok[:2] for tok in generate_tokens(f.readline)] newcode = untokenize(t1) @@ -174,31 +233,8 @@ t2 = [tok[:2] for tokin generate_tokens(readline)] assert t1 == t2 """ - - startline = False - indents = [] - toks = [] - toks_append = toks.append - for tok in iterable: - toknum, tokval = tok[:2] - - if toknum in (NAME, NUMBER): - tokval += ' ' - - if toknum == INDENT: - indents.append(tokval) - continue - elif toknum == DEDENT: - indents.pop() - continue - elif toknum in (NEWLINE, COMMENT, NL): - startline = True - elif startline and indents: - toks_append(indents[-1]) - startline = False - toks_append(tokval) - return ''.join(toks) - + ut = Untokenizer() + return ut.untokenize(iterable) def generate_tokens(readline): """ @@ -237,7 +273,7 @@ if endmatch: pos = end = endmatch.end(0) yield (STRING, contstr + line[:end], - strstart, (lnum, end), contline + line) + strstart, (lnum, end), contline + line) contstr, needcont = '', 0 contline = None elif needcont and line[-2:] != '\\\n' and line[-3:] != '\\\r\n': @@ -263,7 +299,15 @@ if pos == max: break if line[pos] in '#\r\n': # skip comments or blank lines - yield ((NL, COMMENT)[line[pos] == '#'], line[pos:], + if line[pos] == '#': + comment_token = line[pos:].rstrip('\r\n') + nl_pos = pos + len(comment_token) + yield (COMMENT, comment_token, + (lnum, pos), (lnum, pos + len(comment_token)), line) + yield (NL, line[nl_pos:], + (lnum, nl_pos), (lnum, len(line)), line) + else: + yield ((NL, COMMENT)[line[pos] == '#'], line[pos:], (lnum, pos), (lnum, len(line)), line) continue @@ -294,9 +338,10 @@ (initial == '.' and token != '.'): # ordinary number yield (NUMBER, token, spos, epos, line) elif initial in '\r\n': - yield (parenlev > 0 and NL or NEWLINE, - token, spos, epos, line) + yield (NL if parenlev > 0 else NEWLINE, + token, spos, epos, line) elif initial == '#': + assert not token.endswith("\n") yield (COMMENT, token, spos, epos, line) elif token in triple_quoted: endprog = endprogs[token] Modified: python/branches/bcannon-objcap/Lib/urllib2.py ============================================================================== --- python/branches/bcannon-objcap/Lib/urllib2.py (original) +++ python/branches/bcannon-objcap/Lib/urllib2.py Mon Aug 28 21:49:46 2006 @@ -263,11 +263,11 @@ def add_header(self, key, val): # useful for something like authentication - self.headers[key.title()] = val + self.headers[key.capitalize()] = val def add_unredirected_header(self, key, val): # will not be added to a redirected request - self.unredirected_hdrs[key.title()] = val + self.unredirected_hdrs[key.capitalize()] = val def has_header(self, header_name): return (header_name in self.headers or @@ -286,7 +286,7 @@ class OpenerDirector: def __init__(self): client_version = "Python-urllib/%s" % __version__ - self.addheaders = [('User-Agent', client_version)] + self.addheaders = [('User-agent', client_version)] # manage the individual handlers self.handlers = [] self.handle_open = {} @@ -675,7 +675,7 @@ if user and password: user_pass = '%s:%s' % (unquote(user), unquote(password)) creds = base64.encodestring(user_pass).strip() - req.add_header('Proxy-Authorization', 'Basic ' + creds) + req.add_header('Proxy-authorization', 'Basic ' + creds) hostport = unquote(hostport) req.set_proxy(hostport, proxy_type) if orig_type == proxy_type: @@ -819,7 +819,7 @@ class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): - auth_header = 'Proxy-Authorization' + auth_header = 'Proxy-authorization' def http_error_407(self, req, fp, code, msg, headers): # http_error_auth_reqed requires that there is no userinfo component in @@ -1022,20 +1022,20 @@ if request.has_data(): # POST data = request.get_data() - if not request.has_header('Content-Type'): + if not request.has_header('Content-type'): request.add_unredirected_header( - 'Content-Type', + 'Content-type', 'application/x-www-form-urlencoded') - if not request.has_header('Content-Length'): + if not request.has_header('Content-length'): request.add_unredirected_header( - 'Content-Length', '%d' % len(data)) + 'Content-length', '%d' % len(data)) scheme, sel = splittype(request.get_selector()) sel_host, sel_path = splithost(sel) if not request.has_header('Host'): request.add_unredirected_header('Host', sel_host or host) for name, value in self.parent.addheaders: - name = name.title() + name = name.capitalize() if not request.has_header(name): request.add_unredirected_header(name, value) @@ -1067,6 +1067,8 @@ # So make sure the connection gets closed after the (only) # request. headers["Connection"] = "close" + headers = dict( + (name.title(), val) for name, val in headers.items()) try: h.request(req.get_method(), req.get_selector(), req.data, headers) r = h.getresponse() @@ -1217,7 +1219,7 @@ modified = email.Utils.formatdate(stats.st_mtime, usegmt=True) mtype = mimetypes.guess_type(file)[0] headers = mimetools.Message(StringIO( - 'Content-Type: %s\nContent-Length: %d\nLast-Modified: %s\n' % + 'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' % (mtype or 'text/plain', size, modified))) if host: host, port = splitport(host) @@ -1272,9 +1274,9 @@ headers = "" mtype = mimetypes.guess_type(req.get_full_url())[0] if mtype: - headers += "Content-Type: %s\n" % mtype + headers += "Content-type: %s\n" % mtype if retrlen is not None and retrlen >= 0: - headers += "Content-Length: %d\n" % retrlen + headers += "Content-length: %d\n" % retrlen sf = StringIO(headers) headers = mimetools.Message(sf) return addinfourl(fp, headers, req.get_full_url()) Modified: python/branches/bcannon-objcap/Lib/uuid.py ============================================================================== --- python/branches/bcannon-objcap/Lib/uuid.py (original) +++ python/branches/bcannon-objcap/Lib/uuid.py Mon Aug 28 21:49:46 2006 @@ -45,8 +45,6 @@ """ __author__ = 'Ka-Ping Yee ' -__date__ = '$Date: 2006/06/12 23:15:40 $'.split()[1].replace('/', '-') -__version__ = '$Revision: 1.30 $'.split()[1] RESERVED_NCS, RFC_4122, RESERVED_MICROSOFT, RESERVED_FUTURE = [ 'reserved for NCS compatibility', 'specified in RFC 4122', @@ -57,15 +55,21 @@ UUID objects are immutable, hashable, and usable as dictionary keys. Converting a UUID to a string with str() yields something in the form '12345678-1234-1234-1234-123456789abc'. The UUID constructor accepts - four possible forms: a similar string of hexadecimal digits, or a - string of 16 raw bytes as an argument named 'bytes', or a tuple of - six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and - 48-bit values respectively) as an argument named 'fields', or a single - 128-bit integer as an argument named 'int'. + five possible forms: a similar string of hexadecimal digits, or a tuple + of six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and + 48-bit values respectively) as an argument named 'fields', or a string + of 16 bytes (with all the integer fields in big-endian order) as an + argument named 'bytes', or a string of 16 bytes (with the first three + fields in little-endian order) as an argument named 'bytes_le', or a + single 128-bit integer as an argument named 'int'. UUIDs have these read-only attributes: - bytes the UUID as a 16-byte string + bytes the UUID as a 16-byte string (containing the six + integer fields in big-endian byte order) + + bytes_le the UUID as a 16-byte string (with time_low, time_mid, + and time_hi_version in little-endian byte order) fields a tuple of the six integer fields of the UUID, which are also available as six individual attributes @@ -94,10 +98,11 @@ when the variant is RFC_4122) """ - def __init__(self, hex=None, bytes=None, fields=None, int=None, - version=None): + def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None, + int=None, version=None): r"""Create a UUID from either a string of 32 hexadecimal digits, - a string of 16 bytes as the 'bytes' argument, a tuple of six + a string of 16 bytes as the 'bytes' argument, a string of 16 bytes + in little-endian order as the 'bytes_le' argument, a tuple of six integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version, 8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as the 'fields' argument, or a single 128-bit integer as the 'int' @@ -109,23 +114,31 @@ UUID('12345678123456781234567812345678') UUID('urn:uuid:12345678-1234-5678-1234-567812345678') UUID(bytes='\x12\x34\x56\x78'*4) + UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' + + '\x12\x34\x56\x78\x12\x34\x56\x78') UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678)) UUID(int=0x12345678123456781234567812345678) - Exactly one of 'hex', 'bytes', 'fields', or 'int' must be given. - The 'version' argument is optional; if given, the resulting UUID - will have its variant and version number set according to RFC 4122, - overriding bits in the given 'hex', 'bytes', 'fields', or 'int'. + Exactly one of 'hex', 'bytes', 'bytes_le', 'fields', or 'int' must + be given. The 'version' argument is optional; if given, the resulting + UUID will have its variant and version set according to RFC 4122, + overriding the given 'hex', 'bytes', 'bytes_le', 'fields', or 'int'. """ - if [hex, bytes, fields, int].count(None) != 3: - raise TypeError('need just one of hex, bytes, fields, or int') + if [hex, bytes, bytes_le, fields, int].count(None) != 4: + raise TypeError('need one of hex, bytes, bytes_le, fields, or int') if hex is not None: hex = hex.replace('urn:', '').replace('uuid:', '') hex = hex.strip('{}').replace('-', '') if len(hex) != 32: raise ValueError('badly formed hexadecimal UUID string') int = long(hex, 16) + if bytes_le is not None: + if len(bytes_le) != 16: + raise ValueError('bytes_le is not a 16-char string') + bytes = (bytes_le[3] + bytes_le[2] + bytes_le[1] + bytes_le[0] + + bytes_le[5] + bytes_le[4] + bytes_le[7] + bytes_le[6] + + bytes_le[8:]) if bytes is not None: if len(bytes) != 16: raise ValueError('bytes is not a 16-char string') @@ -194,6 +207,13 @@ bytes = property(get_bytes) + def get_bytes_le(self): + bytes = self.bytes + return (bytes[3] + bytes[2] + bytes[1] + bytes[0] + + bytes[5] + bytes[4] + bytes[7] + bytes[6] + bytes[8:]) + + bytes_le = property(get_bytes_le) + def get_fields(self): return (self.time_low, self.time_mid, self.time_hi_version, self.clock_seq_hi_variant, self.clock_seq_low, self.node) @@ -448,6 +468,8 @@ if _node is not None: return _node +_last_timestamp = None + def uuid1(node=None, clock_seq=None): """Generate a UUID from a host ID, sequence number, and the current time. If 'node' is not given, getnode() is used to obtain the hardware @@ -460,11 +482,15 @@ _uuid_generate_time(_buffer) return UUID(bytes=_buffer.raw) + global _last_timestamp import time nanoseconds = int(time.time() * 1e9) # 0x01b21dd213814000 is the number of 100-ns intervals between the # UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00. timestamp = int(nanoseconds/100) + 0x01b21dd213814000L + if timestamp <= _last_timestamp: + timestamp = _last_timestamp + 1 + _last_timestamp = timestamp if clock_seq is None: import random clock_seq = random.randrange(1<<14L) # instead of stable storage Modified: python/branches/bcannon-objcap/Makefile.pre.in ============================================================================== --- python/branches/bcannon-objcap/Makefile.pre.in (original) +++ python/branches/bcannon-objcap/Makefile.pre.in Mon Aug 28 21:49:46 2006 @@ -260,6 +260,7 @@ Python/modsupport.o \ Python/mystrtoul.o \ Python/mysnprintf.o \ + Python/peephole.o \ Python/pyarena.o \ Python/pyfpe.o \ Python/pystate.o \ Modified: python/branches/bcannon-objcap/Misc/ACKS ============================================================================== --- python/branches/bcannon-objcap/Misc/ACKS (original) +++ python/branches/bcannon-objcap/Misc/ACKS Mon Aug 28 21:49:46 2006 @@ -242,6 +242,7 @@ Michael Guravage Lars Gustäbel Barry Haddow +Václav Haisman Paul ten Hagen Rasmus Hahn Peter Haight @@ -365,6 +366,7 @@ Soren Larsen Piers Lauder Ben Laurie +Simon Law Chris Lawrence Christopher Lee Inyeol Lee Modified: python/branches/bcannon-objcap/Misc/NEWS ============================================================================== --- python/branches/bcannon-objcap/Misc/NEWS (original) +++ python/branches/bcannon-objcap/Misc/NEWS Mon Aug 28 21:49:46 2006 @@ -4,17 +4,66 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 2.6? +========================= + +*Release date: XX-XXX-200X* + +Core and builtins +----------------- + +- Patch #1542451: disallow continue anywhere under a finally. + + +Library +------- + +- Bug #1541863: uuid.uuid1 failed to generate unique identifiers + on systems with low clock resolution. + + +Extension Modules +----------------- + + +Tests +----- + + +Documentation +------------- + +- Bug #1541682: Fix example in the "Refcount details" API docs. + Additionally, remove a faulty example showing PySequence_SetItem applied + to a newly created list object and add notes that this isn't a good idea. + + +Build +----- + + +C API +----- + +- Bug #1542693: remove semi-colon at end of PyImport_ImportModuleEx macro + so it can be used as an expression. + + +Mac +--- + + What's New in Python 2.5 release candidate 1? ============================================= -*Release date: 18-AUG-2006* +*Release date: 17-AUG-2006* Core and builtins ----------------- - Unicode objects will no longer raise an exception when being - compared equal or unequal to a string and causing a - UnicodeDecodeError exception, e.g. as result of a decoding failure. + compared equal or unequal to a string and a UnicodeDecodeError + exception occurs, e.g. as result of a decoding failure. Instead, the equal (==) and unequal (!=) comparison operators will now issue a UnicodeWarning and interpret the two objects as @@ -64,6 +113,30 @@ Library ------- +- Fix a bug in the ``compiler`` package that caused invalid code to be + generated for generator expressions. + +- The distutils version has been changed to 2.5.0. The change to + keep it programmatically in sync with the Python version running + the code (introduced in 2.5b3) has been reverted. It will continue + to be maintained manually as static string literal. + +- If the Python part of a ctypes callback function returns None, + and this cannot be converted to the required C type, an exception is + printed with PyErr_WriteUnraisable. Before this change, the C + callback returned arbitrary values to the calling code. + +- The __repr__ method of a NULL ctypes.py_object() no longer raises + an exception. + +- uuid.UUID now has a bytes_le attribute. This returns the UUID in + little-endian byte order for Windows. In addition, uuid.py gained some + workarounds for clocks with low resolution, to stop the code yielding + duplicate UUIDs. + +- Patch #1540892: site.py Quitter() class attempts to close sys.stdin + before raising SystemExit, allowing IDLE to honor quit() and exit(). + - Bug #1224621: make tabnanny recognize IndentationErrors raised by tokenize. - Patch #1536071: trace.py should now find the full module name of a @@ -72,7 +145,7 @@ - logging's atexit hook now runs even if the rest of the module has already been cleaned up. -- Bug #1112549, DoS attack on cgi.FieldStorage. +- Bug #1112549, fix DoS attack on cgi.FieldStorage. - Bug #1531405, format_exception no longer raises an exception if str(exception) raised an exception. @@ -124,9 +197,12 @@ Build ----- +- Bug #1535502, build _hashlib on Windows, and use masm assembler + code in OpenSSL. + - Bug #1534738, win32 debug version of _msi should be _msi_d.pyd. -- Bug #1530448, ctypes buld failure on Solaris 10 was fixed. +- Bug #1530448, ctypes build failure on Solaris 10 was fixed. C API @@ -140,10 +216,6 @@ is always 1 (normal) or 0 (if the specified thread wasn't found). -Mac ---- - - What's New in Python 2.5 beta 3? ================================ @@ -152,7 +224,7 @@ Core and builtins ----------------- -- _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t, it previously +- _PyWeakref_GetWeakrefCount() now returns a Py_ssize_t; it previously returned a long (see PEP 353). - Bug #1515471: string.replace() accepts character buffers again. @@ -194,7 +266,7 @@ This means that .pyc files generated before 2.5b3 will be regenerated. - Bug #1524317: Compiling Python ``--without-threads`` failed. - The Python core compiles again then, and, in a build without threads, the + The Python core compiles again, and, in a build without threads, the new ``sys._current_frames()`` returns a dictionary with one entry, mapping the faux "thread id" 0 to the current frame. @@ -216,8 +288,8 @@ - Bug #1002398: The documentation for os.path.sameopenfile now correctly refers to file descriptors, not file objects. -- Rename of the xml package to xmlcore, and the import hackery done to - make it appear at both names, has been removed. Bug #1511497, +- The renaming of the xml package to xmlcore, and the import hackery done + to make it appear at both names, has been removed. Bug #1511497, #1513611, and probably others. - Bug #1441397: The compiler module now recognizes module and function @@ -229,13 +301,13 @@ side effects from one test to the next affect outcomes. ``DocTestFinder`` has been changed to sort the list of tests it returns. -- The distutils version has been changed to 2.5.0, and are now kept +- The distutils version has been changed to 2.5.0, and is now kept in sync with sys.version_info[:3]. - Bug #978833: Really close underlying socket in _socketobject.close. -- Bug #1459963: urllib and urllib2 now normalize HTTP header names correctly - with title(). +- Bug #1459963: urllib and urllib2 now normalize HTTP header names with + title(). - Patch #1525766: In pkgutil.walk_packages, correctly pass the onerror callback to recursive calls and call it with the failing package name. Deleted: /python/branches/bcannon-objcap/Misc/RPM/python-2.5.spec ============================================================================== --- /python/branches/bcannon-objcap/Misc/RPM/python-2.5.spec Mon Aug 28 21:49:46 2006 +++ (empty file) @@ -1,385 +0,0 @@ -########################## -# User-modifiable configs -########################## - -# Is the resulting package and the installed binary named "python" or -# "python2"? -#WARNING: Commenting out doesn't work. Last line is what's used. -%define config_binsuffix none -%define config_binsuffix 2.5 - -# Build tkinter? "auto" enables it if /usr/bin/wish exists. -#WARNING: Commenting out doesn't work. Last line is what's used. -%define config_tkinter no -%define config_tkinter yes -%define config_tkinter auto - -# Use pymalloc? The last line (commented or not) determines wether -# pymalloc is used. -#WARNING: Commenting out doesn't work. Last line is what's used. -%define config_pymalloc no -%define config_pymalloc yes - -# Enable IPV6? -#WARNING: Commenting out doesn't work. Last line is what's used. -%define config_ipv6 yes -%define config_ipv6 no - -# Location of the HTML directory. -%define config_htmldir /var/www/html/python - -################################# -# End of user-modifiable configs -################################# - -%define name python -%define version 2.5b3 -%define libvers 2.5 -%define release 1pydotorg -%define __prefix /usr - -# kludge to get around rpm define weirdness -%define ipv6 %(if [ "%{config_ipv6}" = yes ]; then echo --enable-ipv6; else echo --disable-ipv6; fi) -%define pymalloc %(if [ "%{config_pymalloc}" = yes ]; then echo --with-pymalloc; else echo --without-pymalloc; fi) -%define binsuffix %(if [ "%{config_binsuffix}" = none ]; then echo ; else echo "%{config_binsuffix}"; fi) -%define include_tkinter %(if [ \\( "%{config_tkinter}" = auto -a -f /usr/bin/wish \\) -o "%{config_tkinter}" = yes ]; then echo 1; else echo 0; fi) -%define libdirname %(( uname -m | egrep -q '_64$' && [ -d /usr/lib64 ] && echo lib64 ) || echo lib) - -# detect if documentation is available -%define include_docs %(if [ -f "%{_sourcedir}/html-%{version}.tar.bz2" ]; then echo 1; else echo 0; fi) - -Summary: An interpreted, interactive, object-oriented programming language. -Name: %{name}%{binsuffix} -Version: %{version} -Release: %{release} -Copyright: Modified CNRI Open Source License -Group: Development/Languages -Source: Python-%{version}.tar.bz2 -%if %{include_docs} -Source1: html-%{version}.tar.bz2 -%endif -BuildRoot: %{_tmppath}/%{name}-%{version}-root -BuildPrereq: expat-devel -BuildPrereq: db4-devel -BuildPrereq: gdbm-devel -BuildPrereq: sqlite-devel -Prefix: %{__prefix} -Packager: Sean Reifschneider - -%description -Python is an interpreted, interactive, object-oriented programming -language. It incorporates modules, exceptions, dynamic typing, very high -level dynamic data types, and classes. Python combines remarkable power -with very clear syntax. It has interfaces to many system calls and -libraries, as well as to various window systems, and is extensible in C or -C++. It is also usable as an extension language for applications that need -a programmable interface. Finally, Python is portable: it runs on many -brands of UNIX, on PCs under Windows, MS-DOS, and OS/2, and on the -Mac. - -%package devel -Summary: The libraries and header files needed for Python extension development. -Prereq: python%{binsuffix} = %{PACKAGE_VERSION} -Group: Development/Libraries - -%description devel -The Python programming language's interpreter can be extended with -dynamically loaded extensions and can be embedded in other programs. -This package contains the header files and libraries needed to do -these types of tasks. - -Install python-devel if you want to develop Python extensions. The -python package will also need to be installed. You'll probably also -want to install the python-docs package, which contains Python -documentation. - -%if %{include_tkinter} -%package tkinter -Summary: A graphical user interface for the Python scripting language. -Group: Development/Languages -Prereq: python%{binsuffix} = %{PACKAGE_VERSION}-%{release} - -%description tkinter -The Tkinter (Tk interface) program is an graphical user interface for -the Python scripting language. - -You should install the tkinter package if you'd like to use a graphical -user interface for Python programming. -%endif - -%package tools -Summary: A collection of development tools included with Python. -Group: Development/Tools -Prereq: python%{binsuffix} = %{PACKAGE_VERSION}-%{release} - -%description tools -The Python package includes several development tools that are used -to build python programs. This package contains a selection of those -tools, including the IDLE Python IDE. - -Install python-tools if you want to use these tools to develop -Python programs. You will also need to install the python and -tkinter packages. - -%if %{include_docs} -%package docs -Summary: Python-related documentation. -Group: Development/Documentation - -%description docs -Documentation relating to the Python programming language in HTML and info -formats. -%endif - -%changelog -* Mon Dec 20 2004 Sean Reifschneider [2.4-2pydotorg] -- Changing the idle wrapper so that it passes arguments to idle. - -* Tue Oct 19 2004 Sean Reifschneider [2.4b1-1pydotorg] -- Updating to 2.4. - -* Thu Jul 22 2004 Sean Reifschneider [2.3.4-3pydotorg] -- Paul Tiemann fixes for %{prefix}. -- Adding permission changes for directory as suggested by reimeika.ca -- Adding code to detect when it should be using lib64. -- Adding a define for the location of /var/www/html for docs. - -* Thu May 27 2004 Sean Reifschneider [2.3.4-2pydotorg] -- Including changes from Ian Holsman to build under Red Hat 7.3. -- Fixing some problems with the /usr/local path change. - -* Sat Mar 27 2004 Sean Reifschneider [2.3.2-3pydotorg] -- Being more agressive about finding the paths to fix for - #!/usr/local/bin/python. - -* Sat Feb 07 2004 Sean Reifschneider [2.3.3-2pydotorg] -- Adding code to remove "#!/usr/local/bin/python" from particular files and - causing the RPM build to terminate if there are any unexpected files - which have that line in them. - -* Mon Oct 13 2003 Sean Reifschneider [2.3.2-1pydotorg] -- Adding code to detect wether documentation is available to build. - -* Fri Sep 19 2003 Sean Reifschneider [2.3.1-1pydotorg] -- Updating to the 2.3.1 release. - -* Mon Feb 24 2003 Sean Reifschneider [2.3b1-1pydotorg] -- Updating to 2.3b1 release. - -* Mon Feb 17 2003 Sean Reifschneider [2.3a1-1] -- Updating to 2.3 release. - -* Sun Dec 23 2001 Sean Reifschneider -[Release 2.2-2] -- Added -docs package. -- Added "auto" config_tkinter setting which only enables tk if - /usr/bin/wish exists. - -* Sat Dec 22 2001 Sean Reifschneider -[Release 2.2-1] -- Updated to 2.2. -- Changed the extension to "2" from "2.2". - -* Tue Nov 18 2001 Sean Reifschneider -[Release 2.2c1-1] -- Updated to 2.2c1. - -* Thu Nov 1 2001 Sean Reifschneider -[Release 2.2b1-3] -- Changed the way the sed for fixing the #! in pydoc works. - -* Wed Oct 24 2001 Sean Reifschneider -[Release 2.2b1-2] -- Fixed missing "email" package, thanks to anonymous report on sourceforge. -- Fixed missing "compiler" package. - -* Mon Oct 22 2001 Sean Reifschneider -[Release 2.2b1-1] -- Updated to 2.2b1. - -* Mon Oct 9 2001 Sean Reifschneider -[Release 2.2a4-4] -- otto at balinor.mat.unimi.it mentioned that the license file is missing. - -* Sun Sep 30 2001 Sean Reifschneider -[Release 2.2a4-3] -- Ignacio Vazquez-Abrams pointed out that I had a spruious double-quote in - the spec files. Thanks. - -* Wed Jul 25 2001 Sean Reifschneider -[Release 2.2a1-1] -- Updated to 2.2a1 release. -- Changed idle and pydoc to use binsuffix macro - -####### -# PREP -####### -%prep -%setup -n Python-%{version} - -######## -# BUILD -######## -%build -./configure --enable-unicode=ucs4 %{ipv6} %{pymalloc} --prefix=%{__prefix} -make - -########## -# INSTALL -########## -%install -# set the install path -echo '[install_scripts]' >setup.cfg -echo 'install_dir='"${RPM_BUILD_ROOT}%{__prefix}/bin" >>setup.cfg - -[ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT%{__prefix}/%{libdirname}/python%{libvers}/lib-dynload -make prefix=$RPM_BUILD_ROOT%{__prefix} install - -# REPLACE PATH IN PYDOC -if [ ! -z "%{binsuffix}" ] -then - ( - cd $RPM_BUILD_ROOT%{__prefix}/bin - mv pydoc pydoc.old - sed 's|#!.*|#!%{__prefix}/bin/env python'%{binsuffix}'|' \ - pydoc.old >pydoc - chmod 755 pydoc - rm -f pydoc.old - ) -fi - -# add the binsuffix -if [ ! -z "%{binsuffix}" ] -then - ( cd $RPM_BUILD_ROOT%{__prefix}/bin; rm -f python[0-9a-zA-Z]*; - mv -f python python"%{binsuffix}" ) - ( cd $RPM_BUILD_ROOT%{__prefix}/man/man1; mv python.1 python%{binsuffix}.1 ) - ( cd $RPM_BUILD_ROOT%{__prefix}/bin; mv -f pydoc pydoc"%{binsuffix}" ) - ( cd $RPM_BUILD_ROOT%{__prefix}/bin; mv -f idle idle"%{binsuffix}" ) -fi - -######## -# Tools -echo '#!%{__prefix}/bin/env python%{binsuffix}' >${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} -echo 'import os, sys' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} -echo 'os.execvp("%{__prefix}/bin/python%{binsuffix}", ["%{__prefix}/bin/python%{binsuffix}", "%{__prefix}/lib/python%{libvers}/idlelib/idle.py"] + sys.argv[1:])' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} -echo 'print "Failed to exec Idle"' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} -echo 'sys.exit(1)' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix} -chmod 755 $RPM_BUILD_ROOT%{__prefix}/bin/idle%{binsuffix} -cp -a Tools $RPM_BUILD_ROOT%{__prefix}/%{libdirname}/python%{libvers} - -# MAKE FILE LISTS -rm -f mainpkg.files -find "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/lib-dynload -type f | - sed "s|^${RPM_BUILD_ROOT}|/|" | - grep -v -e '_tkinter.so$' >mainpkg.files -find "$RPM_BUILD_ROOT""%{__prefix}"/bin -type f | - sed "s|^${RPM_BUILD_ROOT}|/|" | - grep -v -e '/bin/idle%{binsuffix}$' >>mainpkg.files - -rm -f tools.files -find "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/idlelib \ - "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/Tools -type f | - sed "s|^${RPM_BUILD_ROOT}|/|" >tools.files -echo "%{__prefix}"/bin/idle%{binsuffix} >>tools.files - -###### -# Docs -%if %{include_docs} -mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir} -( - cd "$RPM_BUILD_ROOT"%{config_htmldir} - bunzip2 < %{SOURCE1} | tar x -) -%endif - -# fix the #! line in installed files -find "$RPM_BUILD_ROOT" -type f -print0 | - xargs -0 grep -l /usr/local/bin/python | while read file -do - FIXFILE="$file" - sed 's|^#!.*python|#!%{__prefix}/bin/env python'"%{binsuffix}"'|' \ - "$FIXFILE" >/tmp/fix-python-path.$$ - cat /tmp/fix-python-path.$$ >"$FIXFILE" - rm -f /tmp/fix-python-path.$$ -done - -# check to see if there are any straggling #! lines -find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \ - | grep ':1:#!' >/tmp/python-rpm-files.$$ || true -if [ -s /tmp/python-rpm-files.$$ ] -then - echo '*****************************************************' - cat /tmp/python-rpm-files.$$ - cat <<@EOF - ***************************************************** - There are still files referencing /usr/local/bin/python in the - install directory. They are listed above. Please fix the .spec - file and try again. If you are an end-user, you probably want - to report this to jafo-rpms at tummy.com as well. - ***************************************************** - at EOF - rm -f /tmp/python-rpm-files.$$ - exit 1 -fi -rm -f /tmp/python-rpm-files.$$ - -######## -# CLEAN -######## -%clean -[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT -rm -f mainpkg.files tools.files - -######## -# FILES -######## -%files -f mainpkg.files -%defattr(-,root,root) -%doc Misc/README Misc/cheatsheet Misc/Porting -%doc LICENSE Misc/ACKS Misc/HISTORY Misc/NEWS -%{__prefix}/man/man1/python%{binsuffix}.1* - -%attr(755,root,root) %dir %{__prefix}/include/python%{libvers} -%attr(755,root,root) %dir %{__prefix}/%{libdirname}/python%{libvers}/ -%{__prefix}/%{libdirname}/python%{libvers}/*.txt -%{__prefix}/%{libdirname}/python%{libvers}/*.py* -%{__prefix}/%{libdirname}/python%{libvers}/pdb.doc -%{__prefix}/%{libdirname}/python%{libvers}/profile.doc -%{__prefix}/%{libdirname}/python%{libvers}/curses -%{__prefix}/%{libdirname}/python%{libvers}/distutils -%{__prefix}/%{libdirname}/python%{libvers}/encodings -%{__prefix}/%{libdirname}/python%{libvers}/plat-linux2 -%{__prefix}/%{libdirname}/python%{libvers}/site-packages -%{__prefix}/%{libdirname}/python%{libvers}/test -%{__prefix}/%{libdirname}/python%{libvers}/xml -%{__prefix}/%{libdirname}/python%{libvers}/email -%{__prefix}/%{libdirname}/python%{libvers}/email/mime -%{__prefix}/%{libdirname}/python%{libvers}/sqlite3 -%{__prefix}/%{libdirname}/python%{libvers}/compiler -%{__prefix}/%{libdirname}/python%{libvers}/bsddb -%{__prefix}/%{libdirname}/python%{libvers}/hotshot -%{__prefix}/%{libdirname}/python%{libvers}/logging -%{__prefix}/%{libdirname}/python%{libvers}/lib-old - -%files devel -%defattr(-,root,root) -%{__prefix}/include/python%{libvers}/*.h -%{__prefix}/%{libdirname}/python%{libvers}/config - -%files -f tools.files tools -%defattr(-,root,root) - -%if %{include_tkinter} -%files tkinter -%defattr(-,root,root) -%{__prefix}/%{libdirname}/python%{libvers}/lib-tk -%{__prefix}/%{libdirname}/python%{libvers}/lib-dynload/_tkinter.so* -%endif - -%if %{include_docs} -%files docs -%defattr(-,root,root) -%{config_htmldir}/* -%endif Modified: python/branches/bcannon-objcap/Misc/build.sh ============================================================================== --- python/branches/bcannon-objcap/Misc/build.sh (original) +++ python/branches/bcannon-objcap/Misc/build.sh Mon Aug 28 21:49:46 2006 @@ -58,7 +58,7 @@ PYTHON=$INSTALL_DIR/bin/python # Python options and regression test program that should always be run. -REGRTEST_ARGS="-E -tt $INSTALL_DIR/lib/python2.5/test/regrtest.py" +REGRTEST_ARGS="-E -tt $INSTALL_DIR/lib/python2.6/test/regrtest.py" REFLOG="build/reflog.txt.out" # These tests are not stable and falsely report leaks sometimes. Modified: python/branches/bcannon-objcap/Modules/_ctypes/_ctypes.c ============================================================================== --- python/branches/bcannon-objcap/Modules/_ctypes/_ctypes.c (original) +++ python/branches/bcannon-objcap/Modules/_ctypes/_ctypes.c Mon Aug 28 21:49:46 2006 @@ -152,7 +152,7 @@ parg->tag = 'V'; stgdict = PyObject_stgdict((PyObject *)self); - assert(stgdict); + assert(stgdict); /* Cannot be NULL for structure/union instances */ parg->pffi_type = &stgdict->ffi_type_pointer; /* For structure parameters (by value), parg->value doesn't contain the structure data itself, instead parg->value.p *points* to the structure's data @@ -328,7 +328,6 @@ /* If we got a PyCArgObject, we must check if the object packed in it is an instance of the type's dict->proto */ -// if(dict && ob && dict->proto == (PyObject *)ob->ob_type){ if(dict && ob && PyObject_IsInstance(ob, dict->proto)) { Py_INCREF(value); @@ -673,6 +672,7 @@ return PyInt_FromLong(0); /* NULL pointer */ typedict = PyType_stgdict(type); + assert(typedict); /* Cannot be NULL for pointer types */ /* If we expect POINTER(), but receive a instance, accept it by calling byref(). @@ -693,6 +693,7 @@ the item types are the same. */ StgDictObject *v = PyObject_stgdict(value); + assert(v); /* Cannot be NULL for pointer or array objects */ if (PyObject_IsSubclass(v->proto, typedict->proto)) { Py_INCREF(value); return value; @@ -1154,7 +1155,9 @@ if (ArrayObject_Check(value) || PointerObject_Check(value)) { /* c_wchar array instance or pointer(c_wchar(...)) */ StgDictObject *dt = PyObject_stgdict(value); - StgDictObject *dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL; + StgDictObject *dict; + assert(dt); /* Cannot be NULL for pointer or array objects */ + dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL; if (dict && (dict->setfunc == getentry("u")->setfunc)) { Py_INCREF(value); return value; @@ -1216,7 +1219,9 @@ if (ArrayObject_Check(value) || PointerObject_Check(value)) { /* c_char array instance or pointer(c_char(...)) */ StgDictObject *dt = PyObject_stgdict(value); - StgDictObject *dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL; + StgDictObject *dict; + assert(dt); /* Cannot be NULL for pointer or array objects */ + dict = dt && dt->proto ? PyType_stgdict(dt->proto) : NULL; if (dict && (dict->setfunc == getentry("c")->setfunc)) { Py_INCREF(value); return value; @@ -1468,7 +1473,7 @@ struct fielddesc *fd; dict = PyObject_stgdict((PyObject *)self); - assert(dict); + assert(dict); /* Cannot be NULL for CDataObject instances */ fmt = PyString_AsString(dict->proto); assert(fmt); @@ -2066,6 +2071,7 @@ CData_clear(CDataObject *self) { StgDictObject *dict = PyObject_stgdict((PyObject *)self); + assert(dict); /* Cannot be NULL for CDataObject instances */ Py_CLEAR(self->b_objects); if ((self->b_needsfree) && ((size_t)dict->size > sizeof(self->b_value))) @@ -2363,7 +2369,9 @@ StgDictObject *p1, *p2; PyObject *keep; p1 = PyObject_stgdict(value); + assert(p1); /* Cannot be NULL for array instances */ p2 = PyType_stgdict(type); + assert(p2); /* Cannot be NULL for pointer types */ if (p1->proto != p2->proto) { PyErr_Format(PyExc_TypeError, @@ -2512,7 +2520,7 @@ return self->restype; } dict = PyObject_stgdict((PyObject *)self); - assert(dict); + assert(dict); /* Cannot be NULL for CFuncPtrObject instances */ if (dict->restype) { Py_INCREF(dict->restype); return dict->restype; @@ -2554,7 +2562,7 @@ return self->argtypes; } dict = PyObject_stgdict((PyObject *)self); - assert(dict); + assert(dict); /* Cannot be NULL for CFuncPtrObject instances */ if (dict->argtypes) { Py_INCREF(dict->argtypes); return dict->argtypes; @@ -2581,16 +2589,22 @@ PPROC address; char *mangled_name; int i; - StgDictObject *dict = PyType_stgdict((PyObject *)type); + StgDictObject *dict; address = (PPROC)GetProcAddress(handle, name); +#ifdef _WIN64 + /* win64 has no stdcall calling conv, so it should + also not have the name mangling of it. + */ + return address; +#else if (address) return address; - if (((size_t)name & ~0xFFFF) == 0) { return NULL; } + dict = PyType_stgdict((PyObject *)type); /* It should not happen that dict is NULL, but better be safe */ if (dict==NULL || dict->flags & FUNCFLAG_CDECL) return address; @@ -2609,6 +2623,7 @@ return address; } return NULL; +#endif } #endif @@ -2647,8 +2662,12 @@ _validate_paramflags(PyTypeObject *type, PyObject *paramflags) { int i, len; - StgDictObject *dict = PyType_stgdict((PyObject *)type); - PyObject *argtypes = dict->argtypes; + StgDictObject *dict; + PyObject *argtypes; + + dict = PyType_stgdict((PyObject *)type); + assert(dict); /* Cannot be NULL. 'type' is a CFuncPtr type. */ + argtypes = dict->argtypes; if (paramflags == NULL || dict->argtypes == NULL) return 1; @@ -3118,6 +3137,13 @@ } ob = PyTuple_GET_ITEM(argtypes, i); dict = PyType_stgdict(ob); + if (dict == NULL) { + /* Cannot happen: _validate_paramflags() + would not accept such an object */ + PyErr_Format(PyExc_RuntimeError, + "NULL stgdict unexpected"); + goto error; + } if (PyString_Check(dict->proto)) { PyErr_Format( PyExc_TypeError, @@ -3260,7 +3286,7 @@ int outmask; unsigned int numretvals; - assert(dict); /* if not, it's a bug */ + assert(dict); /* Cannot be NULL for CFuncPtrObject instances */ restype = self->restype ? self->restype : dict->restype; converters = self->converters ? self->converters : dict->converters; checker = self->checker ? self->checker : dict->checker; @@ -3681,7 +3707,7 @@ } stgdict = PyObject_stgdict((PyObject *)self); - assert(stgdict); + assert(stgdict); /* Cannot be NULL for array instances */ /* Would it be clearer if we got the item size from stgdict->proto's stgdict? */ @@ -3712,8 +3738,11 @@ len = ihigh - ilow; stgdict = PyObject_stgdict((PyObject *)self); + assert(stgdict); /* Cannot be NULL for array object instances */ proto = stgdict->proto; itemdict = PyType_stgdict(proto); + assert(itemdict); /* proto is the item type of the array, a ctypes + type, so this cannot be NULL */ if (itemdict->getfunc == getentry("c")->getfunc) { char *ptr = (char *)self->b_ptr; return PyString_FromStringAndSize(ptr + ilow, len); @@ -3750,6 +3779,7 @@ } stgdict = PyObject_stgdict((PyObject *)self); + assert(stgdict); /* Cannot be NULL for array object instances */ if (index < 0 || index >= stgdict->length) { PyErr_SetString(PyExc_IndexError, "invalid index"); @@ -3941,6 +3971,7 @@ PyObject *result; StgDictObject *dict = PyObject_stgdict((PyObject *)self); + assert(dict); /* Cannot be NULL for CDataObject instances */ assert(dict->setfunc); result = dict->setfunc(self->b_ptr, value, dict->size); if (!result) @@ -3966,8 +3997,8 @@ { StgDictObject *dict; dict = PyObject_stgdict((PyObject *)self); + assert(dict); /* Cannot be NULL for CDataObject instances */ assert(dict->getfunc); - dict = PyObject_stgdict((PyObject *)self); return dict->getfunc(self->b_ptr, self->b_size); } @@ -4140,12 +4171,14 @@ } stgdict = PyObject_stgdict((PyObject *)self); - assert(stgdict); - assert(stgdict->proto); + assert(stgdict); /* Cannot be NULL for pointer object instances */ proto = stgdict->proto; - /* XXXXXX MAKE SURE PROTO IS NOT NULL! */ + assert(proto); itemdict = PyType_stgdict(proto); + assert(itemdict); /* proto is the item type of the pointer, a ctypes + type, so this cannot be NULL */ + size = itemdict->size; offset = index * itemdict->size; @@ -4175,12 +4208,15 @@ } stgdict = PyObject_stgdict((PyObject *)self); - assert(stgdict); - assert(stgdict->proto); + assert(stgdict); /* Cannot be NULL fr pointer instances */ proto = stgdict->proto; - /* XXXXXX MAKE SURE PROTO IS NOT NULL! */ + assert(proto); + itemdict = PyType_stgdict(proto); + assert(itemdict); /* Cannot be NULL because the itemtype of a pointer + is always a ctypes type */ + size = itemdict->size; offset = index * itemdict->size; @@ -4200,7 +4236,7 @@ } stgdict = PyObject_stgdict((PyObject *)self); - assert(stgdict); + assert(stgdict); /* Cannot be NULL fr pointer instances */ return CData_FromBaseObj(stgdict->proto, (PyObject *)self, 0, *(void **)self->b_ptr); @@ -4219,7 +4255,7 @@ return -1; } stgdict = PyObject_stgdict((PyObject *)self); - /* should have been catched in Pointer_new() */ + assert(stgdict); /* Cannot be NULL fr pointer instances */ assert(stgdict->proto); if (!CDataObject_Check(value) || 0 == PyObject_IsInstance(value, stgdict->proto)) { @@ -4295,8 +4331,11 @@ len = ihigh - ilow; stgdict = PyObject_stgdict((PyObject *)self); + assert(stgdict); /* Cannot be NULL fr pointer instances */ proto = stgdict->proto; + assert(proto); itemdict = PyType_stgdict(proto); + assert(itemdict); if (itemdict->getfunc == getentry("c")->getfunc) { char *ptr = *(char **)self->b_ptr; return PyString_FromStringAndSize(ptr + ilow, len); Modified: python/branches/bcannon-objcap/Modules/_ctypes/_ctypes_test.c ============================================================================== --- python/branches/bcannon-objcap/Modules/_ctypes/_ctypes_test.c (original) +++ python/branches/bcannon-objcap/Modules/_ctypes/_ctypes_test.c Mon Aug 28 21:49:46 2006 @@ -25,6 +25,16 @@ /* some functions handy for testing */ +EXPORT(int)myprintf(char *fmt, ...) +{ + int result; + va_list argptr; + va_start(argptr, fmt); + result = vprintf(fmt, argptr); + va_end(argptr); + return result; +} + EXPORT(char *)my_strtok(char *token, const char *delim) { return strtok(token, delim); Modified: python/branches/bcannon-objcap/Modules/_ctypes/callbacks.c ============================================================================== --- python/branches/bcannon-objcap/Modules/_ctypes/callbacks.c (original) +++ python/branches/bcannon-objcap/Modules/_ctypes/callbacks.c Mon Aug 28 21:49:46 2006 @@ -205,7 +205,7 @@ result = PyObject_CallObject(callable, arglist); CHECK("'calling callback function'", result); - if ((restype != &ffi_type_void) && result && result != Py_None) { + if ((restype != &ffi_type_void) && result) { PyObject *keep; assert(setfunc); #ifdef WORDS_BIGENDIAN @@ -300,7 +300,7 @@ } cc = FFI_DEFAULT_ABI; -#if defined(MS_WIN32) && !defined(_WIN32_WCE) +#if defined(MS_WIN32) && !defined(_WIN32_WCE) && !defined(MS_WIN64) if (is_cdecl == 0) cc = FFI_STDCALL; #endif Modified: python/branches/bcannon-objcap/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/bcannon-objcap/Modules/_ctypes/callproc.c (original) +++ python/branches/bcannon-objcap/Modules/_ctypes/callproc.c Mon Aug 28 21:49:46 2006 @@ -638,7 +638,7 @@ } cc = FFI_DEFAULT_ABI; -#if defined(MS_WIN32) && !defined(_WIN32_WCE) +#if defined(MS_WIN32) && !defined(MS_WIN64) && !defined(_WIN32_WCE) if ((flags & FUNCFLAG_CDECL) == 0) cc = FFI_STDCALL; #endif @@ -683,6 +683,14 @@ return -1; } #endif +#ifdef MS_WIN64 + if (delta != 0) { + PyErr_Format(PyExc_RuntimeError, + "ffi_call failed with code %d", + delta); + return -1; + } +#else if (delta < 0) { if (flags & FUNCFLAG_CDECL) PyErr_Format(PyExc_ValueError, @@ -704,6 +712,7 @@ return -1; } #endif +#endif if ((flags & FUNCFLAG_PYTHONAPI) && PyErr_Occurred()) return -1; return 0; @@ -979,7 +988,11 @@ } for (i = 0; i < argcount; ++i) { atypes[i] = args[i].ffi_type; - if (atypes[i]->type == FFI_TYPE_STRUCT) + if (atypes[i]->type == FFI_TYPE_STRUCT +#ifdef _WIN64 + && atypes[i]->size <= sizeof(void *) +#endif + ) avalues[i] = (void *)args[i].value.p; else avalues[i] = (void *)&args[i].value; @@ -1099,7 +1112,11 @@ hMod = LoadLibrary(name); if (!hMod) return PyErr_SetFromWindowsErr(GetLastError()); +#ifdef _WIN64 + return PyLong_FromVoidPtr(hMod); +#else return Py_BuildValue("i", hMod); +#endif } static char free_library_doc[] = Modified: python/branches/bcannon-objcap/Modules/_ctypes/cfield.c ============================================================================== --- python/branches/bcannon-objcap/Modules/_ctypes/cfield.c (original) +++ python/branches/bcannon-objcap/Modules/_ctypes/cfield.c Mon Aug 28 21:49:46 2006 @@ -1100,7 +1100,7 @@ if (!PyErr_Occurred()) /* Set an error if not yet set */ PyErr_SetString(PyExc_ValueError, - "PyObject is NULL?"); + "PyObject is NULL"); return NULL; } Py_INCREF(ob); @@ -1315,7 +1315,11 @@ *(char **)ptr = PyString_AS_STRING(str); return str; } else if (PyInt_Check(value) || PyLong_Check(value)) { +#if SIZEOF_VOID_P == SIZEOF_LONG_LONG + *(char **)ptr = (char *)PyInt_AsUnsignedLongLongMask(value); +#else *(char **)ptr = (char *)PyInt_AsUnsignedLongMask(value); +#endif _RET(value); } PyErr_Format(PyExc_TypeError, @@ -1360,7 +1364,11 @@ if (!value) return NULL; } else if (PyInt_Check(value) || PyLong_Check(value)) { +#if SIZEOF_VOID_P == SIZEOF_LONG_LONG + *(wchar_t **)ptr = (wchar_t *)PyInt_AsUnsignedLongLongMask(value); +#else *(wchar_t **)ptr = (wchar_t *)PyInt_AsUnsignedLongMask(value); +#endif Py_INCREF(Py_None); return Py_None; } else if (!PyUnicode_Check(value)) { Modified: python/branches/bcannon-objcap/Modules/_ctypes/libffi_msvc/ffi.c ============================================================================== --- python/branches/bcannon-objcap/Modules/_ctypes/libffi_msvc/ffi.c (original) +++ python/branches/bcannon-objcap/Modules/_ctypes/libffi_msvc/ffi.c Mon Aug 28 21:49:46 2006 @@ -34,6 +34,8 @@ /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ +extern void Py_FatalError(char *msg); + /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) /*@=exportheader@*/ @@ -44,11 +46,10 @@ register ffi_type **p_arg; argp = stack; - if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) { *(void **) argp = ecif->rvalue; - argp += 4; + argp += sizeof(void *); } p_argv = ecif->avalue; @@ -60,8 +61,8 @@ size_t z; /* Align if necessary */ - if ((sizeof(int) - 1) & (unsigned) argp) - argp = (char *) ALIGN(argp, sizeof(int)); + if ((sizeof(void *) - 1) & (size_t) argp) + argp = (char *) ALIGN(argp, sizeof(void *)); z = (*p_arg)->size; if (z < sizeof(int)) @@ -108,7 +109,11 @@ p_argv++; argp += z; } - + + if (argp - stack > ecif->cif->bytes) + { + Py_FatalError("FFI BUG: not enough stack space for arguments"); + } return; } @@ -128,6 +133,9 @@ break; case FFI_TYPE_UINT64: +#ifdef _WIN64 + case FFI_TYPE_POINTER: +#endif cif->flags = FFI_TYPE_SINT64; break; @@ -139,6 +147,7 @@ return FFI_OK; } +#ifdef _WIN32 /*@-declundef@*/ /*@-exportheader@*/ extern int @@ -160,6 +169,16 @@ void (*fn)()); /*@=declundef@*/ /*@=exportheader@*/ +#endif + +#ifdef _WIN64 +extern int +ffi_call_AMD64(void (*)(char *, extended_cif *), + /*@out@*/ extended_cif *, + unsigned, unsigned, + /*@out@*/ unsigned *, + void (*fn)()); +#endif int ffi_call(/*@dependent@*/ ffi_cif *cif, @@ -188,6 +207,7 @@ switch (cif->abi) { +#if !defined(_WIN64) case FFI_SYSV: /*@-usedef@*/ return ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, @@ -201,6 +221,14 @@ cif->flags, ecif.rvalue, fn); /*@=usedef@*/ break; +#else + case FFI_SYSV: + /*@-usedef@*/ + return ffi_call_AMD64(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + /*@=usedef@*/ + break; +#endif default: FFI_ASSERT(0); @@ -213,10 +241,14 @@ /** private members **/ static void ffi_prep_incoming_args_SYSV (char *stack, void **ret, - void** args, ffi_cif* cif); + void** args, ffi_cif* cif); /* This function is jumped to by the trampoline */ +#ifdef _WIN64 +void * +#else static void __fastcall +#endif ffi_closure_SYSV (ffi_closure *closure, int *argp) { // this is our return value storage @@ -244,6 +276,7 @@ rtype = cif->flags; +#if defined(_WIN32) && !defined(_WIN64) #ifdef _MSC_VER /* now, do a generic return based on the value of rtype */ if (rtype == FFI_TYPE_INT) @@ -303,6 +336,15 @@ : "eax", "edx"); } #endif +#endif + +#ifdef _WIN64 + /* The result is returned in rax. This does the right thing for + result types except for floats; we have to 'mov xmm0, rax' in the + caller to correct this. + */ + return *(void **)resp; +#endif } /*@-exportheader@*/ @@ -330,8 +372,8 @@ size_t z; /* Align if necessary */ - if ((sizeof(int) - 1) & (unsigned) argp) { - argp = (char *) ALIGN(argp, sizeof(int)); + if ((sizeof(char *) - 1) & (size_t) argp) { + argp = (char *) ALIGN(argp, sizeof(char*)); } z = (*p_arg)->size; @@ -347,24 +389,8 @@ return; } -/* How to make a trampoline. Derived from gcc/config/i386/i386.c. */ - -#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX,BYTES) \ -{ unsigned char *__tramp = (unsigned char*)(TRAMP); \ - unsigned int __fun = (unsigned int)(FUN); \ - unsigned int __ctx = (unsigned int)(CTX); \ - unsigned int __dis = __fun - ((unsigned int) __tramp + 8 + 4); \ - *(unsigned char*) &__tramp[0] = 0xb9; \ - *(unsigned int*) &__tramp[1] = __ctx; /* mov ecx, __ctx */ \ - *(unsigned char*) &__tramp[5] = 0x8b; \ - *(unsigned char*) &__tramp[6] = 0xd4; /* mov edx, esp */ \ - *(unsigned char*) &__tramp[7] = 0xe8; \ - *(unsigned int*) &__tramp[8] = __dis; /* call __fun */ \ - *(unsigned char*) &__tramp[12] = 0xC2; /* ret BYTES */ \ - *(unsigned short*) &__tramp[13] = BYTES; \ - } - /* the cif must already be prep'ed */ +extern void ffi_closure_OUTER(); ffi_status ffi_prep_closure (ffi_closure* closure, @@ -373,19 +399,78 @@ void *user_data) { short bytes; + char *tramp; +#ifdef _WIN64 + int mask; +#endif FFI_ASSERT (cif->abi == FFI_SYSV); if (cif->abi == FFI_SYSV) bytes = 0; +#if !defined(_WIN64) else if (cif->abi == FFI_STDCALL) bytes = cif->bytes; +#endif else return FFI_BAD_ABI; - FFI_INIT_TRAMPOLINE (&closure->tramp[0], - &ffi_closure_SYSV, - (void*)closure, - bytes); + tramp = &closure->tramp[0]; + +#define BYTES(text) memcpy(tramp, text, sizeof(text)), tramp += sizeof(text)-1 +#define POINTER(x) *(void**)tramp = (void*)(x), tramp += sizeof(void*) +#define SHORT(x) *(short*)tramp = x, tramp += sizeof(short) +#define INT(x) *(int*)tramp = x, tramp += sizeof(int) + +#ifdef _WIN64 + if (cif->nargs >= 1 && + (cif->arg_types[0]->type == FFI_TYPE_FLOAT + || cif->arg_types[0]->type == FFI_TYPE_DOUBLE)) + mask |= 1; + if (cif->nargs >= 2 && + (cif->arg_types[1]->type == FFI_TYPE_FLOAT + || cif->arg_types[1]->type == FFI_TYPE_DOUBLE)) + mask |= 2; + if (cif->nargs >= 3 && + (cif->arg_types[2]->type == FFI_TYPE_FLOAT + || cif->arg_types[2]->type == FFI_TYPE_DOUBLE)) + mask |= 4; + if (cif->nargs >= 4 && + (cif->arg_types[3]->type == FFI_TYPE_FLOAT + || cif->arg_types[3]->type == FFI_TYPE_DOUBLE)) + mask |= 8; + + /* 41 BB ---- mov r11d,mask */ + BYTES("\x41\xBB"); INT(mask); + + /* 48 B8 -------- mov rax, closure */ + BYTES("\x48\xB8"); POINTER(closure); + + /* 49 BA -------- mov r10, ffi_closure_OUTER */ + BYTES("\x49\xBA"); POINTER(ffi_closure_OUTER); + + /* 41 FF E2 jmp r10 */ + BYTES("\x41\xFF\xE2"); + +#else + + /* mov ecx, closure */ + BYTES("\xb9"); POINTER(closure); + + /* mov edx, esp */ + BYTES("\x8b\xd4"); + + /* call ffi_closure_SYSV */ + BYTES("\xe8"); POINTER((char*)&ffi_closure_SYSV - (tramp + 4)); + + /* ret bytes */ + BYTES("\xc2"); + SHORT(bytes); + +#endif + + if (tramp - &closure->tramp[0] > FFI_TRAMPOLINE_SIZE) + Py_FatalError("FFI_TRAMPOLINE_SIZE too small in " __FILE__); + closure->cif = cif; closure->user_data = user_data; closure->fun = fun; Modified: python/branches/bcannon-objcap/Modules/_ctypes/libffi_msvc/ffi.h ============================================================================== --- python/branches/bcannon-objcap/Modules/_ctypes/libffi_msvc/ffi.h (original) +++ python/branches/bcannon-objcap/Modules/_ctypes/libffi_msvc/ffi.h Mon Aug 28 21:49:46 2006 @@ -174,12 +174,10 @@ /* ---- Definitions for the raw API -------------------------------------- */ -#ifndef FFI_SIZEOF_ARG -# if LONG_MAX == 2147483647 -# define FFI_SIZEOF_ARG 4 -# elif LONG_MAX == 9223372036854775807 -# define FFI_SIZEOF_ARG 8 -# endif +#ifdef _WIN64 +#define FFI_SIZEOF_ARG 8 +#else +#define FFI_SIZEOF_ARG 4 #endif typedef union { Modified: python/branches/bcannon-objcap/Modules/_ctypes/libffi_msvc/ffitarget.h ============================================================================== --- python/branches/bcannon-objcap/Modules/_ctypes/libffi_msvc/ffitarget.h (original) +++ python/branches/bcannon-objcap/Modules/_ctypes/libffi_msvc/ffitarget.h Mon Aug 28 21:49:46 2006 @@ -44,7 +44,9 @@ /* ---- Intel x86 Win32 ---------- */ FFI_SYSV, +#ifndef _WIN64 FFI_STDCALL, +#endif /* TODO: Add fastcall support for the sake of completeness */ FFI_DEFAULT_ABI = FFI_SYSV, @@ -67,8 +69,8 @@ #define FFI_CLOSURES 1 -#ifdef X86_64 -#define FFI_TRAMPOLINE_SIZE 24 +#ifdef _WIN64 +#define FFI_TRAMPOLINE_SIZE 29 #define FFI_NATIVE_RAW_API 0 #else #define FFI_TRAMPOLINE_SIZE 15 Modified: python/branches/bcannon-objcap/Modules/_ctypes/stgdict.c ============================================================================== --- python/branches/bcannon-objcap/Modules/_ctypes/stgdict.c (original) +++ python/branches/bcannon-objcap/Modules/_ctypes/stgdict.c Mon Aug 28 21:49:46 2006 @@ -208,12 +208,12 @@ continue; } new_descr = (CFieldObject *)PyObject_CallObject((PyObject *)&CField_Type, NULL); - assert(new_descr->ob_type == &CField_Type); if (new_descr == NULL) { Py_DECREF(fdescr); Py_DECREF(fieldlist); return -1; } + assert(new_descr->ob_type == &CField_Type); new_descr->size = fdescr->size; new_descr->offset = fdescr->offset + offset; new_descr->index = fdescr->index + index; Modified: python/branches/bcannon-objcap/Modules/_elementtree.c ============================================================================== --- python/branches/bcannon-objcap/Modules/_elementtree.c (original) +++ python/branches/bcannon-objcap/Modules/_elementtree.c Mon Aug 28 21:49:46 2006 @@ -48,7 +48,7 @@ #include "Python.h" -#define VERSION "1.0.6-snapshot" +#define VERSION "1.0.6" /* -------------------------------------------------------------------- */ /* configuration */ @@ -1599,6 +1599,10 @@ treebuilder_handle_data(TreeBuilderObject* self, PyObject* data) { if (!self->data) { + if (self->last == (ElementObject*) Py_None) { + /* ignore calls to data before the first call to start */ + Py_RETURN_NONE; + } /* store the first item as is */ Py_INCREF(data); self->data = data; } else { Modified: python/branches/bcannon-objcap/Modules/arraymodule.c ============================================================================== --- python/branches/bcannon-objcap/Modules/arraymodule.c (original) +++ python/branches/bcannon-objcap/Modules/arraymodule.c Mon Aug 28 21:49:46 2006 @@ -1495,7 +1495,7 @@ copy_doc}, {"count", (PyCFunction)array_count, METH_O, count_doc}, - {"__deepcopy__",(PyCFunction)array_copy, METH_NOARGS, + {"__deepcopy__",(PyCFunction)array_copy, METH_O, copy_doc}, {"extend", (PyCFunction)array_extend, METH_O, extend_doc}, Modified: python/branches/bcannon-objcap/Modules/mmapmodule.c ============================================================================== --- python/branches/bcannon-objcap/Modules/mmapmodule.c (original) +++ python/branches/bcannon-objcap/Modules/mmapmodule.c Mon Aug 28 21:49:46 2006 @@ -470,7 +470,7 @@ mmap_tell_method(mmap_object *self, PyObject *unused) { CHECK_VALID(NULL); - return PyInt_FromLong((long) self->pos); + return PyInt_FromSize_t(self->pos); } static PyObject * Modified: python/branches/bcannon-objcap/Modules/parsermodule.c ============================================================================== --- python/branches/bcannon-objcap/Modules/parsermodule.c (original) +++ python/branches/bcannon-objcap/Modules/parsermodule.c Mon Aug 28 21:49:46 2006 @@ -74,7 +74,8 @@ node2tuple(node *n, /* node to convert */ SeqMaker mkseq, /* create sequence */ SeqInserter addelem, /* func. to add elem. in seq. */ - int lineno) /* include line numbers? */ + int lineno, /* include line numbers? */ + int col_offset) /* include column offsets? */ { if (n == NULL) { Py_INCREF(Py_None); @@ -95,7 +96,7 @@ } (void) addelem(v, 0, w); for (i = 0; i < NCH(n); i++) { - w = node2tuple(CHILD(n, i), mkseq, addelem, lineno); + w = node2tuple(CHILD(n, i), mkseq, addelem, lineno, col_offset); if (w == NULL) { Py_DECREF(v); return ((PyObject*) NULL); @@ -108,12 +109,14 @@ return (v); } else if (ISTERMINAL(TYPE(n))) { - PyObject *result = mkseq(2 + lineno); + PyObject *result = mkseq(2 + lineno + col_offset); if (result != NULL) { (void) addelem(result, 0, PyInt_FromLong(TYPE(n))); (void) addelem(result, 1, PyString_FromString(STR(n))); if (lineno == 1) (void) addelem(result, 2, PyInt_FromLong(n->n_lineno)); + if (col_offset == 1) + (void) addelem(result, 3, PyInt_FromLong(n->n_col_offset)); } return (result); } @@ -289,29 +292,35 @@ parser_st2tuple(PyST_Object *self, PyObject *args, PyObject *kw) { PyObject *line_option = 0; + PyObject *col_option = 0; PyObject *res = 0; int ok; - static char *keywords[] = {"ast", "line_info", NULL}; + static char *keywords[] = {"ast", "line_info", "col_info", NULL}; if (self == NULL) { - ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|O:st2tuple", keywords, - &PyST_Type, &self, &line_option); + ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|OO:st2tuple", keywords, + &PyST_Type, &self, &line_option, + &col_option); } else - ok = PyArg_ParseTupleAndKeywords(args, kw, "|O:totuple", &keywords[1], - &line_option); + ok = PyArg_ParseTupleAndKeywords(args, kw, "|OO:totuple", &keywords[1], + &line_option, &col_option); if (ok != 0) { int lineno = 0; + int col_offset = 0; if (line_option != NULL) { lineno = (PyObject_IsTrue(line_option) != 0) ? 1 : 0; } + if (col_option != NULL) { + col_offset = (PyObject_IsTrue(col_option) != 0) ? 1 : 0; + } /* * Convert ST into a tuple representation. Use Guido's function, * since it's known to work already. */ res = node2tuple(((PyST_Object*)self)->st_node, - PyTuple_New, PyTuple_SetItem, lineno); + PyTuple_New, PyTuple_SetItem, lineno, col_offset); } return (res); } @@ -327,28 +336,34 @@ parser_st2list(PyST_Object *self, PyObject *args, PyObject *kw) { PyObject *line_option = 0; + PyObject *col_option = 0; PyObject *res = 0; int ok; - static char *keywords[] = {"ast", "line_info", NULL}; + static char *keywords[] = {"ast", "line_info", "col_info", NULL}; if (self == NULL) - ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|O:st2list", keywords, - &PyST_Type, &self, &line_option); + ok = PyArg_ParseTupleAndKeywords(args, kw, "O!|OO:st2list", keywords, + &PyST_Type, &self, &line_option, + &col_option); else - ok = PyArg_ParseTupleAndKeywords(args, kw, "|O:tolist", &keywords[1], - &line_option); + ok = PyArg_ParseTupleAndKeywords(args, kw, "|OO:tolist", &keywords[1], + &line_option, &col_option); if (ok) { int lineno = 0; + int col_offset = 0; if (line_option != 0) { lineno = PyObject_IsTrue(line_option) ? 1 : 0; } + if (col_option != NULL) { + col_offset = (PyObject_IsTrue(col_option) != 0) ? 1 : 0; + } /* * Convert ST into a tuple representation. Use Guido's function, * since it's known to work already. */ res = node2tuple(self->st_node, - PyList_New, PyList_SetItem, lineno); + PyList_New, PyList_SetItem, lineno, col_offset); } return (res); } Modified: python/branches/bcannon-objcap/Objects/classobject.c ============================================================================== --- python/branches/bcannon-objcap/Objects/classobject.c (original) +++ python/branches/bcannon-objcap/Objects/classobject.c Mon Aug 28 21:49:46 2006 @@ -91,8 +91,22 @@ } Py_INCREF(bases); } + + if (getattrstr == NULL) { + getattrstr = PyString_InternFromString("__getattr__"); + if (getattrstr == NULL) + goto alloc_error; + setattrstr = PyString_InternFromString("__setattr__"); + if (setattrstr == NULL) + goto alloc_error; + delattrstr = PyString_InternFromString("__delattr__"); + if (delattrstr == NULL) + goto alloc_error; + } + op = PyObject_GC_New(PyClassObject, &PyClass_Type); if (op == NULL) { +alloc_error: Py_DECREF(bases); return NULL; } @@ -101,17 +115,7 @@ op->cl_dict = dict; Py_XINCREF(name); op->cl_name = name; - if (getattrstr == NULL) { - getattrstr = PyString_InternFromString("__getattr__"); - if (getattrstr == NULL) - return NULL; - setattrstr = PyString_InternFromString("__setattr__"); - if (setattrstr == NULL) - return NULL; - delattrstr = PyString_InternFromString("__delattr__"); - if (delattrstr == NULL) - return NULL; - } + op->cl_getattr = class_lookup(op, getattrstr, &dummy); op->cl_setattr = class_lookup(op, setattrstr, &dummy); op->cl_delattr = class_lookup(op, delattrstr, &dummy); Modified: python/branches/bcannon-objcap/Objects/fileobject.c ============================================================================== --- python/branches/bcannon-objcap/Objects/fileobject.c (original) +++ python/branches/bcannon-objcap/Objects/fileobject.c Mon Aug 28 21:49:46 2006 @@ -922,7 +922,7 @@ ndone += nnow; ntodo -= nnow; } - return PyInt_FromLong((long)ndone); + return PyInt_FromSsize_t(ndone); } /************************************************************************** Modified: python/branches/bcannon-objcap/Objects/listobject.c ============================================================================== --- python/branches/bcannon-objcap/Objects/listobject.c (original) +++ python/branches/bcannon-objcap/Objects/listobject.c Mon Aug 28 21:49:46 2006 @@ -1398,7 +1398,7 @@ PyObject *compare; PyObject **dest; int result = -1; /* guilty until proved innocent */ - Py_ssize_t min_gallop = ms->min_gallop; + Py_ssize_t min_gallop; assert(ms && pa && pb && na > 0 && nb > 0 && pa + na == pb); if (MERGE_GETMEM(ms, na) < 0) @@ -1414,6 +1414,7 @@ if (na == 1) goto CopyB; + min_gallop = ms->min_gallop; compare = ms->compare; for (;;) { Py_ssize_t acount = 0; /* # of times A won in a row */ @@ -1531,7 +1532,7 @@ int result = -1; /* guilty until proved innocent */ PyObject **basea; PyObject **baseb; - Py_ssize_t min_gallop = ms->min_gallop; + Py_ssize_t min_gallop; assert(ms && pa && pb && na > 0 && nb > 0 && pa + na == pb); if (MERGE_GETMEM(ms, nb) < 0) @@ -1550,6 +1551,7 @@ if (nb == 1) goto CopyA; + min_gallop = ms->min_gallop; compare = ms->compare; for (;;) { Py_ssize_t acount = 0; /* # of times A won in a row */ Modified: python/branches/bcannon-objcap/Objects/unicodeobject.c ============================================================================== --- python/branches/bcannon-objcap/Objects/unicodeobject.c (original) +++ python/branches/bcannon-objcap/Objects/unicodeobject.c Mon Aug 28 21:49:46 2006 @@ -2040,7 +2040,32 @@ static const char *hexdigit = "0123456789abcdef"; - repr = PyString_FromStringAndSize(NULL, 2 + 6*size + 1); + /* XXX(nnorwitz): rather than over-allocating, it would be + better to choose a different scheme. Perhaps scan the + first N-chars of the string and allocate based on that size. + */ + /* Initial allocation is based on the longest-possible unichr + escape. + + In wide (UTF-32) builds '\U00xxxxxx' is 10 chars per source + unichr, so in this case it's the longest unichr escape. In + narrow (UTF-16) builds this is five chars per source unichr + since there are two unichrs in the surrogate pair, so in narrow + (UTF-16) builds it's not the longest unichr escape. + + In wide or narrow builds '\uxxxx' is 6 chars per source unichr, + so in the narrow (UTF-16) build case it's the longest unichr + escape. + */ + + repr = PyString_FromStringAndSize(NULL, + 2 +#ifdef Py_UNICODE_WIDE + + 10*size +#else + + 6*size +#endif + + 1); if (repr == NULL) return NULL; @@ -2065,15 +2090,6 @@ #ifdef Py_UNICODE_WIDE /* Map 21-bit characters to '\U00xxxxxx' */ else if (ch >= 0x10000) { - Py_ssize_t offset = p - PyString_AS_STRING(repr); - - /* Resize the string if necessary */ - if (offset + 12 > PyString_GET_SIZE(repr)) { - if (_PyString_Resize(&repr, PyString_GET_SIZE(repr) + 100)) - return NULL; - p = PyString_AS_STRING(repr) + offset; - } - *p++ = '\\'; *p++ = 'U'; *p++ = hexdigit[(ch >> 28) & 0x0000000F]; @@ -2086,8 +2102,8 @@ *p++ = hexdigit[ch & 0x0000000F]; continue; } -#endif - /* Map UTF-16 surrogate pairs to Unicode \UXXXXXXXX escapes */ +#else + /* Map UTF-16 surrogate pairs to '\U00xxxxxx' */ else if (ch >= 0xD800 && ch < 0xDC00) { Py_UNICODE ch2; Py_UCS4 ucs; @@ -2112,6 +2128,7 @@ s--; size++; } +#endif /* Map 16-bit characters to '\uxxxx' */ if (ch >= 256) { Modified: python/branches/bcannon-objcap/PC/pyconfig.h ============================================================================== --- python/branches/bcannon-objcap/PC/pyconfig.h (original) +++ python/branches/bcannon-objcap/PC/pyconfig.h Mon Aug 28 21:49:46 2006 @@ -280,9 +280,9 @@ their Makefile (other compilers are generally taken care of by distutils.) */ # ifdef _DEBUG -# pragma comment(lib,"python25_d.lib") +# pragma comment(lib,"python26_d.lib") # else -# pragma comment(lib,"python25.lib") +# pragma comment(lib,"python26.lib") # endif /* _DEBUG */ # endif /* _MSC_VER */ # endif /* Py_BUILD_CORE */ Modified: python/branches/bcannon-objcap/PCbuild/_ctypes.vcproj ============================================================================== --- python/branches/bcannon-objcap/PCbuild/_ctypes.vcproj (original) +++ python/branches/bcannon-objcap/PCbuild/_ctypes.vcproj Mon Aug 28 21:49:46 2006 @@ -4,6 +4,7 @@ Version="7.10" Name="_ctypes" ProjectGUID="{F22F40F4-D318-40DC-96B3-88DC81CE0894}" + RootNamespace="_ctypes" Keyword="Win32Proj"> + + + + + + + + + + + + + + + + + Modified: python/branches/bcannon-objcap/PCbuild/_ssl.mak ============================================================================== --- python/branches/bcannon-objcap/PCbuild/_ssl.mak (original) +++ python/branches/bcannon-objcap/PCbuild/_ssl.mak Mon Aug 28 21:49:46 2006 @@ -1,21 +1,37 @@ !IFDEF DEBUG -MODULE=_ssl_d.pyd -TEMP_DIR=x86-temp-debug/_ssl +SUFFIX=_d.pyd +TEMP=x86-temp-debug/ CFLAGS=/Od /Zi /MDd /LDd /DDEBUG /D_DEBUG /DWIN32 SSL_LIB_DIR=$(SSL_DIR)/out32.dbg !ELSE -MODULE=_ssl.pyd -TEMP_DIR=x86-temp-release/_ssl +SUFFIX=.pyd +TEMP=x86-temp-release/ CFLAGS=/Ox /MD /LD /DWIN32 SSL_LIB_DIR=$(SSL_DIR)/out32 !ENDIF INCLUDES=-I ../Include -I ../PC -I $(SSL_DIR)/inc32 -LIBS=gdi32.lib wsock32.lib user32.lib advapi32.lib /libpath:$(SSL_LIB_DIR) libeay32.lib ssleay32.lib -SOURCE=../Modules/_ssl.c $(SSL_LIB_DIR)/libeay32.lib $(SSL_LIB_DIR)/ssleay32.lib +SSL_LIBS=gdi32.lib wsock32.lib user32.lib advapi32.lib /LIBPATH:$(SSL_LIB_DIR) libeay32.lib ssleay32.lib +SSL_SOURCE=../Modules/_ssl.c -$(MODULE): $(SOURCE) ../PC/*.h ../Include/*.h - @if not exist "$(TEMP_DIR)/." mkdir "$(TEMP_DIR)" - cl /nologo $(SOURCE) $(CFLAGS) /Fo$(TEMP_DIR)\$*.obj $(INCLUDES) /link /out:$(MODULE) $(LIBS) +HASH_LIBS=gdi32.lib user32.lib advapi32.lib /libpath:$(SSL_LIB_DIR) libeay32.lib +HASH_SOURCE=../Modules/_hashopenssl.c + +all: _ssl$(SUFFIX) _hashlib$(SUFFIX) + +# Split compile/link into two steps to better support VSExtComp +_ssl$(SUFFIX): $(SSL_SOURCE) $(SSL_LIB_DIR)/libeay32.lib $(SSL_LIB_DIR)/ssleay32.lib ../PC/*.h ../Include/*.h + @if not exist "$(TEMP)/_ssl/." mkdir "$(TEMP)/_ssl" + cl /nologo /c $(SSL_SOURCE) $(CFLAGS) /Fo$(TEMP)\_ssl\$*.obj $(INCLUDES) + link /nologo @<< + /dll /out:_ssl$(SUFFIX) $(TEMP)\_ssl\$*.obj $(SSL_LIBS) +<< + +_hashlib$(SUFFIX): $(HASH_SOURCE) $(SSL_LIB_DIR)/libeay32.lib ../PC/*.h ../Include/*.h + @if not exist "$(TEMP)/_hashlib/." mkdir "$(TEMP)/_hashlib" + cl /nologo /c $(HASH_SOURCE) $(CFLAGS) /Fo$(TEMP)\_hashlib\$*.obj $(INCLUDES) + link /nologo @<< + /dll /out:_hashlib$(SUFFIX) $(HASH_LIBS) $(TEMP)\_hashlib\$*.obj +<< Modified: python/branches/bcannon-objcap/PCbuild/_ssl.vcproj ============================================================================== --- python/branches/bcannon-objcap/PCbuild/_ssl.vcproj (original) +++ python/branches/bcannon-objcap/PCbuild/_ssl.vcproj Mon Aug 28 21:49:46 2006 @@ -75,6 +75,9 @@ + + Modified: python/branches/bcannon-objcap/PCbuild/build_ssl.py ============================================================================== --- python/branches/bcannon-objcap/PCbuild/build_ssl.py (original) +++ python/branches/bcannon-objcap/PCbuild/build_ssl.py Mon Aug 28 21:49:46 2006 @@ -1,7 +1,7 @@ -# Script for building the _ssl module for Windows. +# Script for building the _ssl and _hashlib modules for Windows. # Uses Perl to setup the OpenSSL environment correctly # and build OpenSSL, then invokes a simple nmake session -# for _ssl.pyd itself. +# for the actual _ssl.pyd and _hashlib.pyd DLLs. # THEORETICALLY, you can: # * Unpack the latest SSL release one level above your main Python source @@ -10,8 +10,8 @@ # * Install ActivePerl and ensure it is somewhere on your path. # * Run this script from the PCBuild directory. # -# it should configure and build SSL, then build the ssl Python extension -# without intervention. +# it should configure and build SSL, then build the _ssl and _hashlib +# Python extensions without intervention. import os, sys, re @@ -59,7 +59,8 @@ candidates = [] for s in sources: try: - s = os.path.abspath(s) + # note: do not abspath s; the build will fail if any + # higher up directory name has spaces in it. fnames = os.listdir(s) except os.error: fnames = [] @@ -82,31 +83,9 @@ print "Found an SSL directory at '%s'" % (best_name,) else: print "Could not find an SSL directory in '%s'" % (sources,) + sys.stdout.flush() return best_name -def run_32all_py(): - # ms\32all.bat will reconfigure OpenSSL and then try to build - # all outputs (debug/nondebug/dll/lib). So we filter the file - # to exclude any "nmake" commands and then execute. - tempname = "ms\\32all_py.bat" - - in_bat = open("ms\\32all.bat") - temp_bat = open(tempname,"w") - while 1: - cmd = in_bat.readline() - print 'cmd', repr(cmd) - if not cmd: break - if cmd.strip()[:5].lower() == "nmake": - continue - temp_bat.write(cmd) - in_bat.close() - temp_bat.close() - os.system(tempname) - try: - os.remove(tempname) - except: - pass - def run_configure(configure, do_script): os.system("perl Configure "+configure) os.system(do_script) @@ -117,12 +96,14 @@ arch = "x86" debug = False configure = "VC-WIN32" - makefile = "32.mak" + do_script = "ms\\do_masm" + makefile = "ms\\nt.mak" elif sys.argv[1] == "Debug": arch = "x86" debug = True configure = "VC-WIN32" - makefile="d32.mak" + do_script = "ms\\do_masm" + makefile="ms\\d32.mak" elif sys.argv[1] == "ReleaseItanium": arch = "ia64" debug = False @@ -148,8 +129,9 @@ sys.exit(1) print "Found a working perl at '%s'" % (perl,) + sys.stdout.flush() # Look for SSL 2 levels up from pcbuild - ie, same place zlib etc all live. - ssl_dir = find_best_ssl_dir(("../..",)) + ssl_dir = find_best_ssl_dir(("..\\..",)) if ssl_dir is None: sys.exit(1) @@ -157,31 +139,40 @@ try: os.chdir(ssl_dir) # If the ssl makefiles do not exist, we invoke Perl to generate them. - if not os.path.isfile(makefile): + # Due to a bug in this script, the makefile sometimes ended up empty + # Force a regeneration if it is. + if not os.path.isfile(makefile) or os.path.getsize(makefile)==0: print "Creating the makefiles..." + sys.stdout.flush() # Put our working Perl at the front of our path - os.environ["PATH"] = os.path.split(perl)[0] + \ + os.environ["PATH"] = os.path.dirname(perl) + \ os.pathsep + \ os.environ["PATH"] - if arch=="x86": - run_32all_py() - else: - run_configure(configure, do_script) + run_configure(configure, do_script) + if arch=="x86" and debug: + # the do_masm script in openssl doesn't generate a debug + # build makefile so we generate it here: + os.system("perl util\mk1mf.pl debug "+configure+" >"+makefile) # Now run make. - print "Executing nmake over the ssl makefiles..." - rc = os.system("nmake /nologo -f "+makefile) + makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile) + print "Executing ssl makefiles:", makeCommand + sys.stdout.flush() + rc = os.system(makeCommand) if rc: - print "Executing d32.mak failed" + print "Executing "+makefile+" failed" print rc sys.exit(rc) finally: os.chdir(old_cd) # And finally, we can build the _ssl module itself for Python. - defs = "SSL_DIR=%s" % (ssl_dir,) + defs = "SSL_DIR=\"%s\"" % (ssl_dir,) if debug: defs = defs + " " + "DEBUG=1" - rc = os.system('nmake /nologo -f _ssl.mak ' + defs + " " + make_flags) + makeCommand = 'nmake /nologo -f _ssl.mak ' + defs + " " + make_flags + print "Executing:", makeCommand + sys.stdout.flush() + rc = os.system(makeCommand) sys.exit(rc) if __name__=='__main__': Modified: python/branches/bcannon-objcap/PCbuild/pythoncore.vcproj ============================================================================== --- python/branches/bcannon-objcap/PCbuild/pythoncore.vcproj (original) +++ python/branches/bcannon-objcap/PCbuild/pythoncore.vcproj Mon Aug 28 21:49:46 2006 @@ -39,15 +39,15 @@ @@ -99,15 +99,15 @@ @@ -166,15 +166,15 @@ Name="VCLinkerTool" AdditionalOptions=" /MACHINE:IA64 /USELINK:MS_SDK" AdditionalDependencies="getbuildinfo.o" - OutputFile="./python25.dll" + OutputFile="./python26.dll" LinkIncremental="1" SuppressStartupBanner="FALSE" IgnoreDefaultLibraryNames="libc" GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\./python25.pdb" + ProgramDatabaseFile=".\./python26.pdb" SubSystem="2" BaseAddress="0x1e000000" - ImportLibrary=".\./python25.lib" + ImportLibrary=".\./python26.lib" TargetMachine="0"/> @@ -233,15 +233,15 @@ Name="VCLinkerTool" AdditionalOptions=" /MACHINE:AMD64 /USELINK:MS_SDK" AdditionalDependencies="getbuildinfo.o" - OutputFile="./python25.dll" + OutputFile="./python26.dll" LinkIncremental="1" SuppressStartupBanner="TRUE" IgnoreDefaultLibraryNames="libc" GenerateDebugInformation="TRUE" - ProgramDatabaseFile=".\./python25.pdb" + ProgramDatabaseFile=".\./python26.pdb" SubSystem="2" BaseAddress="0x1e000000" - ImportLibrary=".\./python25.lib" + ImportLibrary=".\./python26.lib" TargetMachine="0"/> @@ -464,6 +464,9 @@ RelativePath="..\Python\compile.c"> + + >8; arr[i+1] = val & 255 -#define CODESIZE(op) (HAS_ARG(op) ? 3 : 1) -#define ISBASICBLOCK(blocks, start, bytes) \ - (blocks[start]==blocks[start+bytes-1]) - -/* Replace LOAD_CONST c1. LOAD_CONST c2 ... LOAD_CONST cn BUILD_TUPLE n - with LOAD_CONST (c1, c2, ... cn). - The consts table must still be in list form so that the - new constant (c1, c2, ... cn) can be appended. - Called with codestr pointing to the first LOAD_CONST. - Bails out with no change if one or more of the LOAD_CONSTs is missing. - Also works for BUILD_LIST when followed by an "in" or "not in" test. -*/ -static int -tuple_of_constants(unsigned char *codestr, int n, PyObject *consts) -{ - PyObject *newconst, *constant; - Py_ssize_t i, arg, len_consts; - - /* Pre-conditions */ - assert(PyList_CheckExact(consts)); - assert(codestr[n*3] == BUILD_TUPLE || codestr[n*3] == BUILD_LIST); - assert(GETARG(codestr, (n*3)) == n); - for (i=0 ; i 20) { - Py_DECREF(newconst); - return 0; - } - - /* Append folded constant into consts table */ - len_consts = PyList_GET_SIZE(consts); - if (PyList_Append(consts, newconst)) { - Py_DECREF(newconst); - return 0; - } - Py_DECREF(newconst); - - /* Write NOP NOP NOP NOP LOAD_CONST newconst */ - memset(codestr, NOP, 4); - codestr[4] = LOAD_CONST; - SETARG(codestr, 4, len_consts); - return 1; -} - -static int -fold_unaryops_on_constants(unsigned char *codestr, PyObject *consts) -{ - PyObject *newconst=NULL, *v; - Py_ssize_t len_consts; - int opcode; - - /* Pre-conditions */ - assert(PyList_CheckExact(consts)); - assert(codestr[0] == LOAD_CONST); - - /* Create new constant */ - v = PyList_GET_ITEM(consts, GETARG(codestr, 0)); - opcode = codestr[3]; - switch (opcode) { - case UNARY_NEGATIVE: - /* Preserve the sign of -0.0 */ - if (PyObject_IsTrue(v) == 1) - newconst = PyNumber_Negative(v); - break; - case UNARY_CONVERT: - newconst = PyObject_Repr(v); - break; - case UNARY_INVERT: - newconst = PyNumber_Invert(v); - break; - default: - /* Called with an unknown opcode */ - PyErr_Format(PyExc_SystemError, - "unexpected unary operation %d on a constant", - opcode); - return 0; - } - if (newconst == NULL) { - PyErr_Clear(); - return 0; - } - - /* Append folded constant into consts table */ - len_consts = PyList_GET_SIZE(consts); - if (PyList_Append(consts, newconst)) { - Py_DECREF(newconst); - return 0; - } - Py_DECREF(newconst); - - /* Write NOP LOAD_CONST newconst */ - codestr[0] = NOP; - codestr[1] = LOAD_CONST; - SETARG(codestr, 1, len_consts); - return 1; -} - -static unsigned int * -markblocks(unsigned char *code, int len) -{ - unsigned int *blocks = (unsigned int *)PyMem_Malloc(len*sizeof(int)); - int i,j, opcode, blockcnt = 0; - - if (blocks == NULL) { - PyErr_NoMemory(); - return NULL; - } - memset(blocks, 0, len*sizeof(int)); - - /* Mark labels in the first pass */ - for (i=0 ; i= 255. - - Optimizations are restricted to simple transformations occuring within a - single basic block. All transformations keep the code size the same or - smaller. For those that reduce size, the gaps are initially filled with - NOPs. Later those NOPs are removed and the jump addresses retargeted in - a single pass. Line numbering is adjusted accordingly. */ - -static PyObject * -optimize_code(PyObject *code, PyObject* consts, PyObject *names, - PyObject *lineno_obj) -{ - Py_ssize_t i, j, codelen; - int nops, h, adj; - int tgt, tgttgt, opcode; - unsigned char *codestr = NULL; - unsigned char *lineno; - int *addrmap = NULL; - int new_line, cum_orig_line, last_line, tabsiz; - int cumlc=0, lastlc=0; /* Count runs of consecutive LOAD_CONSTs */ - unsigned int *blocks = NULL; - char *name; - - /* Bail out if an exception is set */ - if (PyErr_Occurred()) - goto exitUnchanged; - - /* Bypass optimization when the lineno table is too complex */ - assert(PyString_Check(lineno_obj)); - lineno = (unsigned char*)PyString_AS_STRING(lineno_obj); - tabsiz = PyString_GET_SIZE(lineno_obj); - if (memchr(lineno, 255, tabsiz) != NULL) - goto exitUnchanged; - - /* Avoid situations where jump retargeting could overflow */ - assert(PyString_Check(code)); - codelen = PyString_Size(code); - if (codelen > 32700) - goto exitUnchanged; - - /* Make a modifiable copy of the code string */ - codestr = (unsigned char *)PyMem_Malloc(codelen); - if (codestr == NULL) - goto exitUnchanged; - codestr = (unsigned char *)memcpy(codestr, - PyString_AS_STRING(code), codelen); - - /* Verify that RETURN_VALUE terminates the codestring. This allows - the various transformation patterns to look ahead several - instructions without additional checks to make sure they are not - looking beyond the end of the code string. - */ - if (codestr[codelen-1] != RETURN_VALUE) - goto exitUnchanged; - - /* Mapping to new jump targets after NOPs are removed */ - addrmap = (int *)PyMem_Malloc(codelen * sizeof(int)); - if (addrmap == NULL) - goto exitUnchanged; - - blocks = markblocks(codestr, codelen); - if (blocks == NULL) - goto exitUnchanged; - assert(PyList_Check(consts)); - - for (i=0 ; i a is not b - not a in b --> a not in b - not a is not b --> a is b - not a not in b --> a in b - */ - case COMPARE_OP: - j = GETARG(codestr, i); - if (j < 6 || j > 9 || - codestr[i+3] != UNARY_NOT || - !ISBASICBLOCK(blocks,i,4)) - continue; - SETARG(codestr, i, (j^1)); - codestr[i+3] = NOP; - break; - - /* Replace LOAD_GLOBAL/LOAD_NAME None - with LOAD_CONST None */ - case LOAD_NAME: - case LOAD_GLOBAL: - j = GETARG(codestr, i); - name = PyString_AsString(PyTuple_GET_ITEM(names, j)); - if (name == NULL || strcmp(name, "None") != 0) - continue; - for (j=0 ; j < PyList_GET_SIZE(consts) ; j++) { - if (PyList_GET_ITEM(consts, j) == Py_None) { - codestr[i] = LOAD_CONST; - SETARG(codestr, i, j); - cumlc = lastlc + 1; - break; - } - } - break; - - /* Skip over LOAD_CONST trueconst - JUMP_IF_FALSE xx POP_TOP */ - case LOAD_CONST: - cumlc = lastlc + 1; - j = GETARG(codestr, i); - if (codestr[i+3] != JUMP_IF_FALSE || - codestr[i+6] != POP_TOP || - !ISBASICBLOCK(blocks,i,7) || - !PyObject_IsTrue(PyList_GET_ITEM(consts, j))) - continue; - memset(codestr+i, NOP, 7); - cumlc = 0; - break; - - /* Try to fold tuples of constants (includes a case for lists - which are only used for "in" and "not in" tests). - Skip over BUILD_SEQN 1 UNPACK_SEQN 1. - Replace BUILD_SEQN 2 UNPACK_SEQN 2 with ROT2. - Replace BUILD_SEQN 3 UNPACK_SEQN 3 with ROT3 ROT2. */ - case BUILD_TUPLE: - case BUILD_LIST: - j = GETARG(codestr, i); - h = i - 3 * j; - if (h >= 0 && - j <= lastlc && - ((opcode == BUILD_TUPLE && - ISBASICBLOCK(blocks, h, 3*(j+1))) || - (opcode == BUILD_LIST && - codestr[i+3]==COMPARE_OP && - ISBASICBLOCK(blocks, h, 3*(j+2)) && - (GETARG(codestr,i+3)==6 || - GETARG(codestr,i+3)==7))) && - tuple_of_constants(&codestr[h], j, consts)) { - assert(codestr[i] == LOAD_CONST); - cumlc = 1; - break; - } - if (codestr[i+3] != UNPACK_SEQUENCE || - !ISBASICBLOCK(blocks,i,6) || - j != GETARG(codestr, i+3)) - continue; - if (j == 1) { - memset(codestr+i, NOP, 6); - } else if (j == 2) { - codestr[i] = ROT_TWO; - memset(codestr+i+1, NOP, 5); - } else if (j == 3) { - codestr[i] = ROT_THREE; - codestr[i+1] = ROT_TWO; - memset(codestr+i+2, NOP, 4); - } - break; - - /* Fold binary ops on constants. - LOAD_CONST c1 LOAD_CONST c2 BINOP --> LOAD_CONST binop(c1,c2) */ - case BINARY_POWER: - case BINARY_MULTIPLY: - case BINARY_TRUE_DIVIDE: - case BINARY_FLOOR_DIVIDE: - case BINARY_MODULO: - case BINARY_ADD: - case BINARY_SUBTRACT: - case BINARY_SUBSCR: - case BINARY_LSHIFT: - case BINARY_RSHIFT: - case BINARY_AND: - case BINARY_XOR: - case BINARY_OR: - if (lastlc >= 2 && - ISBASICBLOCK(blocks, i-6, 7) && - fold_binops_on_constants(&codestr[i-6], consts)) { - i -= 2; - assert(codestr[i] == LOAD_CONST); - cumlc = 1; - } - break; - - /* Fold unary ops on constants. - LOAD_CONST c1 UNARY_OP --> LOAD_CONST unary_op(c) */ - case UNARY_NEGATIVE: - case UNARY_CONVERT: - case UNARY_INVERT: - if (lastlc >= 1 && - ISBASICBLOCK(blocks, i-3, 4) && - fold_unaryops_on_constants(&codestr[i-3], consts)) { - i -= 2; - assert(codestr[i] == LOAD_CONST); - cumlc = 1; - } - break; - - /* Simplify conditional jump to conditional jump where the - result of the first test implies the success of a similar - test or the failure of the opposite test. - Arises in code like: - "if a and b:" - "if a or b:" - "a and b or c" - "(a and b) and c" - x:JUMP_IF_FALSE y y:JUMP_IF_FALSE z --> x:JUMP_IF_FALSE z - x:JUMP_IF_FALSE y y:JUMP_IF_TRUE z --> x:JUMP_IF_FALSE y+3 - where y+3 is the instruction following the second test. - */ - case JUMP_IF_FALSE: - case JUMP_IF_TRUE: - tgt = GETJUMPTGT(codestr, i); - j = codestr[tgt]; - if (j == JUMP_IF_FALSE || j == JUMP_IF_TRUE) { - if (j == opcode) { - tgttgt = GETJUMPTGT(codestr, tgt) - i - 3; - SETARG(codestr, i, tgttgt); - } else { - tgt -= i; - SETARG(codestr, i, tgt); - } - break; - } - /* Intentional fallthrough */ - - /* Replace jumps to unconditional jumps */ - case FOR_ITER: - case JUMP_FORWARD: - case JUMP_ABSOLUTE: - case CONTINUE_LOOP: - case SETUP_LOOP: - case SETUP_EXCEPT: - case SETUP_FINALLY: - tgt = GETJUMPTGT(codestr, i); - if (!UNCONDITIONAL_JUMP(codestr[tgt])) - continue; - tgttgt = GETJUMPTGT(codestr, tgt); - if (opcode == JUMP_FORWARD) /* JMP_ABS can go backwards */ - opcode = JUMP_ABSOLUTE; - if (!ABSOLUTE_JUMP(opcode)) - tgttgt -= i + 3; /* Calc relative jump addr */ - if (tgttgt < 0) /* No backward relative jumps */ - continue; - codestr[i] = opcode; - SETARG(codestr, i, tgttgt); - break; - - case EXTENDED_ARG: - goto exitUnchanged; - - /* Replace RETURN LOAD_CONST None RETURN with just RETURN */ - case RETURN_VALUE: - if (i+4 >= codelen || - codestr[i+4] != RETURN_VALUE || - !ISBASICBLOCK(blocks,i,5)) - continue; - memset(codestr+i+1, NOP, 4); - break; - } - } - - /* Fixup linenotab */ - for (i=0, nops=0 ; i= 0) { wrapper = PyList_GET_ITEM(c->c_stack, n); c->u = (struct compiler_unit *)PyCObject_AsVoidPtr(wrapper); + assert(c->u); /* we are deleting from a list so this really shouldn't fail */ if (PySequence_DelItem(c->c_stack, n) < 0) Py_FatalError("compiler_exit_scope()"); @@ -2288,6 +1682,8 @@ compiler_continue(struct compiler *c) { static const char LOOP_ERROR_MSG[] = "'continue' not properly in loop"; + static const char IN_FINALLY_ERROR_MSG[] = + "'continue' not supported inside 'finally' clause"; int i; if (!c->u->u_nfblocks) @@ -2299,15 +1695,18 @@ break; case EXCEPT: case FINALLY_TRY: - while (--i >= 0 && c->u->u_fblock[i].fb_type != LOOP) - ; + while (--i >= 0 && c->u->u_fblock[i].fb_type != LOOP) { + /* Prevent continue anywhere under a finally + even if hidden in a sub-try or except. */ + if (c->u->u_fblock[i].fb_type == FINALLY_END) + return compiler_error(c, IN_FINALLY_ERROR_MSG); + } if (i == -1) return compiler_error(c, LOOP_ERROR_MSG); ADDOP_JABS(c, CONTINUE_LOOP, c->u->u_fblock[i].fb_block); break; case FINALLY_END: - return compiler_error(c, - "'continue' not supported inside 'finally' clause"); + return compiler_error(c, IN_FINALLY_ERROR_MSG); } return 1; @@ -4422,7 +3821,7 @@ if (flags < 0) goto error; - bytecode = optimize_code(a->a_bytecode, consts, names, a->a_lnotab); + bytecode = PyCode_Optimize(a->a_bytecode, consts, names, a->a_lnotab); if (!bytecode) goto error; Modified: python/branches/bcannon-objcap/Python/pythonrun.c ============================================================================== --- python/branches/bcannon-objcap/Python/pythonrun.c (original) +++ python/branches/bcannon-objcap/Python/pythonrun.c Mon Aug 28 21:49:46 2006 @@ -531,11 +531,15 @@ bimod = _PyImport_FindExtension("__builtin__", "__builtin__"); if (bimod != NULL) { interp->builtins = PyModule_GetDict(bimod); + if (interp->builtins == NULL) + goto handle_error; Py_INCREF(interp->builtins); } sysmod = _PyImport_FindExtension("sys", "sys"); if (bimod != NULL && sysmod != NULL) { interp->sysdict = PyModule_GetDict(sysmod); + if (interp->sysdict == NULL) + goto handle_error; Py_INCREF(interp->sysdict); PySys_SetPath(Py_GetPath()); PyDict_SetItemString(interp->sysdict, "modules", @@ -549,6 +553,7 @@ if (!PyErr_Occurred()) return tstate; +handle_error: /* Oops, it didn't work. Undo it all. */ PyErr_Print(); Modified: python/branches/bcannon-objcap/Python/symtable.c ============================================================================== --- python/branches/bcannon-objcap/Python/symtable.c (original) +++ python/branches/bcannon-objcap/Python/symtable.c Mon Aug 28 21:49:46 2006 @@ -221,8 +221,8 @@ return st; st->st_filename = filename; st->st_future = future; - if (!symtable_enter_block(st, GET_IDENTIFIER(top), ModuleBlock, - (void *)mod, 0)) { + if (!GET_IDENTIFIER(top) || + !symtable_enter_block(st, top, ModuleBlock, (void *)mod, 0)) { PySymtable_Free(st); return NULL; } @@ -1123,12 +1123,13 @@ VISIT(st, expr, e->v.UnaryOp.operand); break; case Lambda_kind: { - if (!symtable_add_def(st, GET_IDENTIFIER(lambda), DEF_LOCAL)) + if (!GET_IDENTIFIER(lambda) || + !symtable_add_def(st, lambda, DEF_LOCAL)) return 0; if (e->v.Lambda.args->defaults) VISIT_SEQ(st, expr, e->v.Lambda.args->defaults); /* XXX how to get line numbers for expressions */ - if (!symtable_enter_block(st, GET_IDENTIFIER(lambda), + if (!symtable_enter_block(st, lambda, FunctionBlock, (void *)e, 0)) return 0; VISIT_IN_BLOCK(st, arguments, e->v.Lambda.args, (void*)e); @@ -1404,8 +1405,8 @@ /* Outermost iterator is evaluated in current scope */ VISIT(st, expr, outermost->iter); /* Create generator scope for the rest */ - if (!symtable_enter_block(st, GET_IDENTIFIER(genexpr), - FunctionBlock, (void *)e, 0)) { + if (!GET_IDENTIFIER(genexpr) || + !symtable_enter_block(st, genexpr, FunctionBlock, (void *)e, 0)) { return 0; } st->st_cur->ste_generator = 1; @@ -1419,7 +1420,5 @@ VISIT_SEQ_TAIL_IN_BLOCK(st, comprehension, e->v.GeneratorExp.generators, 1, (void*)e); VISIT_IN_BLOCK(st, expr, e->v.GeneratorExp.elt, (void*)e); - if (!symtable_exit_block(st, (void *)e)) - return 0; - return 1; + return symtable_exit_block(st, (void *)e); } Modified: python/branches/bcannon-objcap/README ============================================================================== --- python/branches/bcannon-objcap/README (original) +++ python/branches/bcannon-objcap/README Mon Aug 28 21:49:46 2006 @@ -1,5 +1,5 @@ -This is Python version 2.5 beta 3 -================================= +This is Python version 2.5 rc 1 +=============================== Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation. All rights reserved. Modified: python/branches/bcannon-objcap/Tools/buildbot/external.bat ============================================================================== --- python/branches/bcannon-objcap/Tools/buildbot/external.bat (original) +++ python/branches/bcannon-objcap/Tools/buildbot/external.bat Mon Aug 28 21:49:46 2006 @@ -28,6 +28,7 @@ cd tk8.4.12\win nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 nmake -f makefile.vc TCLDIR=..\..\tcl8.4.12 INSTALLDIR=..\..\tcltk install + cd ..\.. ) @rem sqlite Modified: python/branches/bcannon-objcap/Tools/msi/msi.py ============================================================================== --- python/branches/bcannon-objcap/Tools/msi/msi.py (original) +++ python/branches/bcannon-objcap/Tools/msi/msi.py Mon Aug 28 21:49:46 2006 @@ -89,7 +89,8 @@ '_msi.pyd', '_ctypes.pyd', '_ctypes_test.pyd', - '_sqlite3.pyd' + '_sqlite3.pyd', + '_hashlib.pyd' ] # Well-known component UUIDs @@ -871,6 +872,12 @@ version=version, language=lang) tmpfiles.append("msvcr71.dll") + # Check if _ctypes.pyd exists + have_ctypes = os.path.exists(srcdir+"/PCBuild/_ctypes.pyd") + if not have_ctypes: + print "WARNING: _ctypes.pyd not found, ctypes will not be included" + extensions.remove("_ctypes.pyd") + # Add all .py files in Lib, except lib-tk, test dirs={} pydirs = [(root,"Lib")] @@ -888,6 +895,8 @@ # data: Lib/email/test # output: Lib/test testsuite.set_current() + elif not have_ctypes and dir == "ctypes": + continue else: default_feature.set_current() lib = PyDirectory(db, cab, parent, dir, dir, "%s|%s" % (parent.make_short(dir), dir)) Modified: python/branches/bcannon-objcap/configure ============================================================================== --- python/branches/bcannon-objcap/configure (original) +++ python/branches/bcannon-objcap/configure Mon Aug 28 21:49:46 2006 @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Revision: 47267 . +# From configure.in Revision: 51173 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for python 2.5. +# Generated by GNU Autoconf 2.59 for python 2.6. # # Report bugs to . # @@ -270,8 +270,8 @@ # Identity of this package. PACKAGE_NAME='python' PACKAGE_TARNAME='python' -PACKAGE_VERSION='2.5' -PACKAGE_STRING='python 2.5' +PACKAGE_VERSION='2.6' +PACKAGE_STRING='python 2.6' PACKAGE_BUGREPORT='http://www.python.org/python-bugs' ac_unique_file="Include/object.h" @@ -781,7 +781,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures python 2.5 to adapt to many kinds of systems. +\`configure' configures python 2.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -838,7 +838,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of python 2.5:";; + short | recursive ) echo "Configuration of python 2.6:";; esac cat <<\_ACEOF @@ -991,7 +991,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -python configure 2.5 +python configure 2.6 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -1005,7 +1005,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by python $as_me 2.5, which was +It was created by python $as_me 2.6, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1357,7 +1357,7 @@ mv confdefs.h.new confdefs.h -VERSION=2.5 +VERSION=2.6 SOVERSION=1.0 @@ -22610,7 +22610,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by python $as_me 2.5, which was +This file was extended by python $as_me 2.6, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22670,7 +22670,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -python config.status 2.5 +python config.status 2.6 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Modified: python/branches/bcannon-objcap/configure.in ============================================================================== --- python/branches/bcannon-objcap/configure.in (original) +++ python/branches/bcannon-objcap/configure.in Mon Aug 28 21:49:46 2006 @@ -1,7 +1,7 @@ dnl Process this file with autoconf 2.0 or later to make a configure script. # Set VERSION so we only need to edit in one place (i.e., here) -m4_define(PYTHON_VERSION, 2.5) +m4_define(PYTHON_VERSION, 2.6) AC_REVISION($Revision$) AC_PREREQ(2.59) From python-checkins at python.org Mon Aug 28 21:55:58 2006 From: python-checkins at python.org (brett.cannon) Date: Mon, 28 Aug 2006 21:55:58 +0200 (CEST) Subject: [Python-checkins] r51636 - in python/branches: bcannon-objcap/securing_python.txt bcannon-sandboxing/securing_python.txt Message-ID: <20060828195558.61AC21E400B@bag.python.org> Author: brett.cannon Date: Mon Aug 28 21:55:57 2006 New Revision: 51636 Added: python/branches/bcannon-objcap/securing_python.txt - copied unchanged from r51635, python/branches/bcannon-sandboxing/securing_python.txt Removed: python/branches/bcannon-sandboxing/securing_python.txt Log: Moving securing_python.txt to a more proper home. Deleted: /python/branches/bcannon-sandboxing/securing_python.txt ============================================================================== --- /python/branches/bcannon-sandboxing/securing_python.txt Mon Aug 28 21:55:57 2006 +++ (empty file) @@ -1,701 +0,0 @@ -Securing Python -##################################################################### - -Introduction -/////////////////////////////////////// - -As of Python 2.5, the Python does not support any form of security -model for -executing arbitrary Python code in some form of protected interpreter. -While one can use such things as ``exec`` and ``eval`` to garner a -very weak form of sandboxing, it does not provide any thorough -protections from malicious code. - -This should be rectified. This document attempts to lay out what -would be needed to secure Python in such a way as to allow arbitrary -Python code to execute in a sandboxed interpreter without worries of -that interpreter providing access to any resource of the operating -system without being given explicit authority to do so. - -Throughout this document several terms are going to be used. A -"sandboxed interpreter" is one where the built-in namespace is not the -same as that of an interpreter whose built-ins were unaltered, which -is called an "unprotected interpreter". - -A "bare interpreter" is one where the built-in namespace has been -stripped down the bare minimum needed to run any form of basic Python -program. This means that all atomic types (i.e., syntactically -supported types), ``object``, and the exceptions provided by the -``exceptions`` module are considered in the built-in namespace. There -have also been no imports executed in the interpreter. - -The "security domain" is the boundary at which security is cared -about. For this dicussion, it is the interpreter. Anything that -happens within a security domain is considered open and unprotected. -But any action that tries to cross the boundary of the security domain -is where the security model and protection comes in. - -The "powerbox" is the thing that possesses the ultimate power in the -system for giving out abilities. In our case it is the Python -process. No interpreter can possess any ability that the overall -process does not have. It is up to the Python process to initially -hand out abilities to interpreters to use either for themselves or to -give to interpreters they create themselves. This means that we care -about interpreter<->interpreter interaction along with -interpreter<->process interactions. - - -Rationale -/////////////////////////////////////// - -Python is used extensively as an embedded language within existing -programs. These applications often times need to provide the -functionality of allowing users to run Python code written by someone -else where they can trust that no unintentional harm will come to -their system regardless of their trust of the code they are executing. - -For instance, think of an application that supports a plug-in system -with Python as the language used for writing plug-ins. You do not -want to have to examine every plug-in you download to make sure that -it does not alter your filesystem if you can help it. With a proper -security model and implementation in place this hinderance of having -to examine all code you execute should be alleviated. - - -Approaches to Security -/////////////////////////////////////// - -There are essentially two types of security: who-I-am -security and what-I-have security. - -Who-I-Am Security -======================== - -With who-I-am security (a.k.a., permissions-based security), the -ability to use a resource requires providing who you are, validating -you are allowed to access the resource you are requesting, and then -performing the requested action on the resource. - -The ACL security system on most UNIX filesystems is who-I-am security. -When you want to open a file, say ``/etc/passwd``, you make the -function call to open the file. Within that function, it fetchs -the ACL for the file, finds out who the caller is, checks to see if -the caller is on the ACL for opening the file, and then proceeds to -either deny access or return an open file object. - - -What-I-Have Security -======================== - -A contrast to who-I-am security, what-I-have security never requires -knowing who is requesting a resource. If you know what resources are -allowed or needed when you begin a security domain, you can just have -the powerbox pass in those resources to begin with and not provide a -function to retrieve them. This alleviates the worry of providing a -function that can wield more power than the security domain should -ever have if security is breached on that function. - -But if you don't know the exact resources needed ahead of time, you -pass in a proxy to the resource that checks its arguments to make sure -they are valid in terms of allowed usage of the protected resource. -With this approach, you are only doing argument validation, where the -validation happens to be related to security. No identity check is -needed at any point. - -Using our file example, the program trying to open a file is given the -open file object directly at time of creation that it will need to -work with. A proxy to the full-powered open function can be used if -you need more of a wildcard support for opening files. But -it works just as well, if not better, to pass in all needed file -objects at the beginning when the allowed files to work with is known -so as to not even risk exposing the file opening function. - -This illustrates a subtle, but key difference between who-I-am and -what-I-have security. For who-I-am, you must know who the caller is -and check that the arguments are valid for the person calling. For -what-I-have security, you only have to validate the arguments. - - -Object-Capabilities -/////////////////////////////////////// - -What-I-have security is a super-set of the object-capabilities -security model. The belief here is in POLA (Principle Of Least -Authority): you give a program exactly what it needs, and no more. By -providing a function that can open any file that relies on identity to -decide if to open something, you are still providing a fully capable -function that just requires faking one's identity to circumvent -security. It also means that if you accidentally run code that -performs actions that you did not expect (e.g., deleting all your -files), there is no way to stop it since it operates with *your* -permissions. - -Using POLA and object-capabilities, you only give access to resources -to the extent that someone needs. This means if a program only needs -access to a single file, you only give them a function that can open -that single file. If you accidentally run code that tries to delete -all of your files, it can only delete the one file you authorized the -program to open. - -Object-capabilities use the reference graph of objects to provide the -security of accessing resources. If you do not have a reference to a -resource (or a reference to an object that can references a resource), -you cannot access it, period. You can provide conditional access by -using a proxy between code and a resource, but that still requires a -reference to the resource by the proxy. This means that your security -model can be viewed simply by using a whiteboard to draw out the -interactions between your security domains where by any connection -between domains is a possible security issue if you do not put in a -proxy to mediate between the two domains. - -This leads to a much cleaner implementation of security. By not -having to change internal code in the interpreter to perform identity -checks, you can instead shift the burden of security to proxies -which are much more flexible and have less of an adverse affect on the -interpreter directly (assuming you have the basic requirements for -object-capabilities met). - - -Difficulties in Python for Object-Capabilities -////////////////////////////////////////////// - -In order to provide the proper protection of references that -object-capabilities require, you must set up a secure perimeter -defense around your security domain. The domain can be anthing: -objects, interpreters, processes, etc. The point is that the domain -is where you draw the line for allowing arbitrary access to resources. -This means that with the interpreter is the security domain, then -anything within an interpreter can be expected to be freely shared, -but beyond that, reference access is strictly controlled. - -Three key requirements for providing a proper perimeter defence is -private namespaces, immutable shared state across domains, and -unforgeable references. Unfortunately Python only has one of the -three requirements by default (you cannot forge a reference in Python -code). - - -Problem of No Private Namespace -=============================== - -Typically, in languages that are statically typed (like C++), you have -public and private attributes on objects. Those private attributes -provide a private namespace for the class and instances that are not -accessible by other objects. - -The Python language has no such thing as a private namespace. The -language has the philosophy that if exposing something to the -programmer could provide some use, then it is exposed. This has led -to Python having a wonderful amount of introspection abilities. -Unfortunately this makes the possibility of a private namespace -non-existent. This poses an issue for providing proxies for resources -since there is no way in Python code to hide the reference to a -resource. It also makes providing security at the object level using -object-capabilities non-existent in pure Python code. - -Luckily, the Python virtual machine *does* provide a private namespace, -albeit not for pure Python source code. If you use the Python/C -language barrier in extension modules, you can provide a private -namespace by using the struct allocated for each instance of an -object. This provides a way to create proxies, written in C, that can -protect resources properly. Throughout this document, when mentioning -proxies, it is assumed they have been implemented in C. - - -Problem of Mutable Shared State -=============================== - -Another problem that Python's introspection abilties cause is that of -mutable shared state. At the interpreter level, there has never been -a concerted effort to isolate state shared between all interpreters -running in the same Python process. Sometimes this is for performance -reasons, sometimes because it is just easier to implement this way. -Regardless, sharing of state that can be influenced by another -interpreter is not safe for object-capabilities. - -To rectify the situation, some changes will be needed to some built-in -objects in Python. It should mostly consist of abstracting or -refactoring certain abilities out to an extension module so that -access can be protected using import guards. For instance, as it -stands now, ``object.__subclasses__()`` will return a tuple of all of -its subclasses, regardless of what interpreter the subclass was -defined in. - - -Threat Model -/////////////////////////////////////// - -The threat that this security model is attempting to handle is the -execution of arbitrary Python code in a sandboxed interpreter such -that the code in that interpreter is not able to harm anything outside -of itself unless explicitly allowed to. This means that: - -* An interpreter cannot gain abilties the Python process possesses - without explicitly being given those abilities. - + With the Python process being the powerbox, if an interpreter - could gain whatever abilities it wanted to then the security - domain would be completely breached. -* An interpreter cannot influence another interpreter directly at the - Python level without explicitly allowing it. - + This includes preventing communicating with another interpreter. - + Mutable objects cannot be shared between interpreters without - explicit allowance for it. - + "Explicit allowance" includes the importation of C extension - modules because a technical detail requires that these modules - not be re-initialized per interpreter, meaning that all - interpreters in a single Python process share the same C - extension modules. -* An interpreter cannot use operating system resources without being - explicitly given those resources. - + This includes importing modules since that requires the ability - to use the resource of the filesystem. - + This is mediated by having to go through the process to gain the - abilities in the OS that the process possesses. - -In order to accomplish these goals, certain things must be made true. - -* The Python process is the powerbox. - + It controls the initial granting of abilties to interpreters. -* A bare Python interpreter is always trusted. - + Python source code that can be created in a bare interpreter is - always trusted. - + Python source code created within a bare interpreter cannot - crash the interpreter. -* Python bytecode is always distrusted. - + Malicious bytecode can bring down an interpreter. -* Pure Python source code is always safe on its own. - + Malicious abilities are derived from C extension modules, - built-in modules, and unsafe types implemented in C, not from - pure Python source. -* A sub-interpreter started by another interpreter does not inherit - any state. - + The sub-interpreter starts out with a fresh global namespace and - whatever built-ins it was initially given. - - -Implementation -/////////////////////////////////////// - -Guiding Principles -======================== - -To begin, the Python process garners all power as the powerbox. It is -up to the process to initially hand out access to resources and -abilities to interpreters. This might take the form of an interpreter -with all abilities granted (i.e., a standard interpreter as launched -when you execute Python), which then creates sub-interpreters with -sandboxed abilities. Another alternative is only creating -interpreters with sandboxed abilities (i.e., Python being embedded in -an application that only uses sandboxed interpreters). - -All security measures should never have to ask who an interpreter is. -This means that what abilities an interpreter has should not be stored -at the interpreter level when the security can be provided at the -Python level. This means that while supporting a memory cap can -have a per-interpreter setting that is checked (because access to the -operating system's memory allocator is not supported at the program -level), protecting files and imports should not such a per-interpreter -protection at such a low level (because those can have extension -module proxies to provide the security). This means that security is -based on possessing the authority to do something through a reference -to an object that can perform the action. And that object will most -likely decide whether to carry out its action based on the arguments -passed in (whether that is an opaque token, file path allowed to be -opened, etc.). - -For common case security measures, the Python standard library -(stdlib) should provide a simple way to provide those measures. Most -commonly this will take the form of providing factory functions that -create instances of proxies for providing protection of key resources. - -Backwards-compatibility will not be a hindrance upon the design or -implementation of the security model. Because the security model will -inherently remove resources and abilities that existing code expects, -it is not reasonable to expect existing code to work in a sandboxed -interpreter. - -Keeping Python "pythonic" is required for all design decisions. -In general, being pythonic means that something fits the general -design guidelines of the Python programming language (run -``import this`` from a Python interpreter to see the basic ones). -If removing an ability leads to something being unpythonic, it will not -be done unless there is an extremely compelling reason to do so. -This does not mean existing pythonic code must continue to work, but -the spirit of being pythonic will not be compromised in the name of the -security model. While this might lead to a weaker security model, this -is a price that must be paid in order for Python to continue to be the -language that it is. - -Restricting what is in the built-in namespace and the safe-guarding -the interpreter (which includes safe-guarding the built-in types) is -where the majority of security will come from. Imports and the -``file`` type are both part of the standard namespace and must be -restricted in order for any security implementation to be effective. -The built-in types which are needed for basic Python usage (e.g., -``object`` code objects, etc.) must be made safe to use in a sandboxed -interpreter since they are easily accessbile and yet required for -Python to function. - -The rest of the security for Python will come in the form of -protecting physical resources. For those resources that can be denied -in a Denial of Service (DoS) attack but protected in a -platform-agnositc fashion, they should. This means, for instance, -that memory should be protected but CPU usage can't. - - -Abilities of a Standard Sandboxed Interpreter -============================================= - -In the end, a standard sandboxed interpreter should (not) -allow certain things to be doable by code running within itself. -Below is a list of abilities that will (not) be allowed in the default -instance of a sandboxed interpreter comparative to an unprotected -interpreter that has not imported any modules. These protections can -be tweaked by using proxies to allow for certain extended abilities to -be accessible. - -* You cannot open any files directly. -* Importation - + You can import any pure Python module. - + You cannot import any Python bytecode module. - + You cannot import any C extension module. - + You cannot import any built-in module. -* You cannot find out any information about the operating system you - are running on. -* Only safe built-ins are provided. - - -Implementation Details -======================== - -An important point to keep in mind when reading about the -implementation details for the security model is that these are -general changes and are not special to any type of interpreter, -sandboxed or otherwise. That means if a change to a built-in type is -suggested and it does not involve a proxy, that change is meant -Python-wide for *all* interpreters. - - -Imports -------- - -A proxy for protecting imports will be provided. This is done by -setting the ``__import__()`` function in the built-in namespace of the -sandboxed interpreter to a proxied version of the function. - -The planned proxy will take in a passed-in function to use for the -import and a whitelist of C extension modules and built-in modules to -allow importation of. If an import would lead to loading an extension -or built-in module, it is checked against the whitelist and allowed -to be imported based on that list. All .pyc and .pyo file will not -be imported. All .py files will be imported. - -XXX perhaps augment 'sys' so that you list the extension of files that -can be used for importing? Thought this was controlled somewhere -already but can't find it. It is returned by ``imp.get_suffixes()``, -but I can't find where to set it from Python code. - -It must be warned that importing any C extension module is dangerous. -Not only are they able to circumvent security measures by executing C -code, but they share state across interpreters. Because an extension -module's init function is only called once for the Python *process*, -its initial state is set only once. This means that if some mutable -object is exposed at the module level, a sandboxed interpreter could -mutate that object, return, and then if the creating interpreter -accesses that mutated object it is essentially communicating and/or -acting on behalf of the sandboxed interpreter. This violates the -perimeter defence. No one should import extension modules blindly. - -Implementing Import in Python -+++++++++++++++++++++++++++++ - -To help facilitate in the exposure of more of what importation -requires (and thus make implementing a proxy easier), the import -machinery should be rewritten in Python. This will require some -bootstrapping in order for the code to be loaded into the process -without itself requiring importation, but that should be doable. Plus -some care must be taken to not lead to circular dependency on -importing modules needed to handle importing (e.g. importing sys but -having that import call the import call, etc.). - -Interaction with another interpreter that might provide an import -function must also be dealt with. One cannot expose the importation -of a needed module for the import machinery as it might not be allowed -by a proxy. This can be handled by allowing the powerbox's import -function to have modules directly injected into its global namespace. -But there is also the issue of using the proper ``sys.modules`` for -storing the modules already imported. You do not want to inject the -``sys`` module of the powerbox and have all imports end up in its -``sys.modules`` but in the interpreter making the call. This must be -dealt with in some fashion (injecting per-call, having a factory -function create a new import function based on an interpreter passed -in, etc.). - - -Sanitizing Built-In Types -------------------------- - -Python contains a wealth of bulit-in types. These are used at a basic -level so that they are easily accessible to any Python code. They are -also shared amongst all interpreters in a Python process. This means -all built-in types need to be made safe (e.g., immutable shared -state) so that they can be used by any and all interpreters in a -single Python process. Several aspects of built-in types need to be -examined. - - -Constructors -++++++++++++ - -Almost all of Python's built-in types contain a constructor that allows -code to create a new instance of a type as long as you have the type -itself. Unfortunately this does not work well in an object-capabilities -system without either providing a proxy to the constructor or just -removing it when access to such a constructor should be controlled. - -The plan is to remove select constructors of the types that are -dangerous and either relocate them to an extension module as factory -functions or create a new built-in that acts a generic factory -function for all types, missing constructor or not. The former approach -will allow for protections to be enforced by import proxy; just don't -allow the extension module to be imported. The latter approach would -allow either a unique constructor per type, or more generic built-in(s) -for construction (e.g., introducing a ``construct()`` function that -takes in a type and any arguments desired to be passed in for -constructing an instance of the type) and allowing using proxies to -provide security. - -Some might consider this unpythonic. Python very rarely separates the -constructor of an object from the class/type and require that you go -through a function. But there is some precedent for not using a -type's constructor to get an instance of a type. The ``file`` type, -for instance, typically has its instances created through the -``open()`` function. This slight shift for certain types to have their -(dangerous) constructor not on the type but in a function is -considered an acceptable compromise. - -Types whose constructors are considered dangerous are: - -* ``file`` - + Will definitely use the ``open()`` built-in. -* code objects -* XXX sockets? -* XXX type? -* XXX - - -Filesystem Information -++++++++++++++++++++++ - -When running code in a sandboxed interpreter, POLA suggests that you -do not want to expose information about your environment on top of -protecting its use. This means that filesystem paths typically should -not be exposed. Unfortunately, Python exposes file paths all over the -place that will need to be hidden: - -* Modules - + ``__file__`` attribute -* Code objects - + ``co_filename`` attribute -* Packages - + ``__path__`` attribute -* XXX - -XXX how to expose safely? ``path()`` built-in? - - -Mutable Shared State -++++++++++++++++++++ - -Because built-in types are shared between interpreters, they cannot -expose any mutable shared state. Unfortunately, as it stands, some -do. Below is a list of types that share some form of dangerous state, -how they share it, and how to fix the problem: - -* ``object`` - + ``__subclasses__()`` function - - Remove the function; never seen used in real-world code. -* XXX - - -Perimeter Defences Between a Created Interpreter and Its Creator ----------------------------------------------------------------- - -The plan is to allow interpreters to instantiate sandboxed -interpreters safely. By using the creating interpreter's abilities to -provide abilities to the created interpreter, you make sure there is -no escalation in abilities. - -But by creating a sandboxed interpreter and passing in any code into -it, you open up the chance of possible ways of getting back to the -creating interpreter or escalating privileges. Those ways are: - -* ``__del__`` created in sandboxed interpreter but object is cleaned - up in unprotected interpreter. -* Using frames to walk the frame stack back to another interpreter. -* XXX - - -Making the ``sys`` Module Safe ------------------------------- - -The ``sys`` module is an odd mix of both information and settings for -the interpreter. Because of this dichotomy, some very useful, but -innocuous information is stored in the module along with things that -should not be exposed to sandboxed interpreters. - -This means that the ``sys`` module needs to have its safe information -separated out from the unsafe settings. This will allow an import -proxy to let through safe information but block out the ability to set -values. - -XXX separate modules, ``sys.settings`` and ``sys.info``, or strip -``sys`` to settings and put info somewhere else? Or provide a method -that will create a faked sys module that has the safe values copied -into it? - -The safe information values are: - -* builtin_module_names - Information about what might be blocked from importation. -* byteorder - Needed for networking. -* copyright - Set to a string about the interpreter. -* displayhook (?) -* excepthook (?) -* __displayhook__ (?) -* __excepthook__ (?) -* exc_info() (?) -* exc_clear() -* exit() -* exitfunc -* getcheckinterval() - Returns an int. -* getdefaultencoding() - Returns a string about interpreter. -* getrefcount() - Returns an int about the passed-in object. -* getrecursionlimit() - Returns an int about the interpreter. -* hexversion - Set to an int about the interpreter. -* last_type -* last_value -* last_traceback (?) -* maxint - Set to an int that exposes ambiguous information about the - computer. -* maxunicode - Returns a string about the interpreter. -* meta_path (?) -* path_hooks (?) -* path_importer_cache (?) -* ps1 -* ps2 -* stdin -* stdout -* stderr -* traceback (?) -* version -* api_version -* version_info -* warnoptions (?) - -The dangerous settings are: - -* argv -* subversion -* _current_frames() -* dllhandle -* exc_type - Deprecated since 1.5 . -* exc_value - Deprecated since 1.5 . -* exc_traceback - Deprecated since 1.5 . -* exc_prefix - Exposes filesystem information. -* executable - Exposes filesystem information. -* _getframe() -* getwindowsversion() - Exposes OS information. -* modules -* path -* platform - Exposes OS information. -* prefix - Exposes filesystem information. -* setcheckinterval() -* setdefaultencoding() -* setdlopenflags() -* setprofile() -* setrecursionlimit() -* settrace() -* settcsdump() -* __stdin__ -* __stdout__ -* __stderr__ -* winver - Exposes OS information. - - -Protecting I/O -++++++++++++++ - -The ``print`` keyword and the built-ins ``raw_input()`` and -``input()`` use the values stored in ``sys.stdout`` and ``sys.stdin``. -By exposing these attributes to the creating interpreter, one can set -them to safe objects, such as instances of ``StringIO``. - - -Safe Networking ---------------- - -XXX proxy on socket module, modify open() to be the constructor, etc. - - -Protecting Memory Usage ------------------------ - -To protect memory, low-level hooks into the memory allocator for -Python is needed. By hooking into the C API for memory allocation and -deallocation a *very* rough running count of used memory can be kept. -This can be used to compare against the set memory cap to prevent -sandboxed interpreters from using so much memory that it impacts the -overall performance of the system. - -Because this has no direct connection with object-capabilities or has -any form of exposure at the Python level, this feature can be safely -implemented separately from the rest of the security model. - -Existing APIs to protect are: - -- _PyObject_New() : PyObject_New() -- _PyObject_NewVar() : PyObject_NewVar() -- _PyObject_Del() - remove macro that uses PyObject_Free() and protect directly -- PyObject_Del() - redefine macro to use _PyObject_Del() instead of PyObject_Free() -- PyMem_Malloc() : PyMem_New() -- PyMem_Realloc() : PyMem_Resize() -- PyMem_Free() : PyMem_Del() -- PyMem_MALLOC() : PyMem_NEW() - redefine macro to use PyMem_Malloc() -- PyMem_REALLOC() : PyMem_RESIZE() - redefine macro to use PyMem_Realloc() -- PyMem_FREE() : PyMem_DEL() - redefine macro to use PyMem_Free() -- PyObject_Malloc() - XXX -- PyObject_Realloc() - XXX -- PyObject_Free() - XXX -- PyObject_MALLOC() - XXX -- PyObject_REALLOC() - XXX -- PyObject_FREE() - XXX From python-checkins at python.org Mon Aug 28 22:07:26 2006 From: python-checkins at python.org (brett.cannon) Date: Mon, 28 Aug 2006 22:07:26 +0200 (CEST) Subject: [Python-checkins] r51637 - python/branches/bcannon-objcap/securing_python.txt Message-ID: <20060828200726.420CF1E4017@bag.python.org> Author: brett.cannon Date: Mon Aug 28 22:07:25 2006 New Revision: 51637 Modified: python/branches/bcannon-objcap/securing_python.txt Log: Add a Status section, starting with __subclasses__ handled. Modified: python/branches/bcannon-objcap/securing_python.txt ============================================================================== --- python/branches/bcannon-objcap/securing_python.txt (original) +++ python/branches/bcannon-objcap/securing_python.txt Mon Aug 28 22:07:25 2006 @@ -1,6 +1,26 @@ Securing Python ##################################################################### +Status +/////////////////////////////////////// + ++ Remove object.__subclasses__ [done] ++ Dangerous constructors + - file + - code ++ Sandboxed built-ins + - open() + - __import__() / PEP 302 importer ++ Filesystem path hiding ++ mini 'sys' module ++ Create sandboxed interpreters + - Be able to specify built-ins + - Set 'sys' module settings + - API + * Python + * C + + Introduction /////////////////////////////////////// From python-checkins at python.org Mon Aug 28 23:49:39 2006 From: python-checkins at python.org (brett.cannon) Date: Mon, 28 Aug 2006 23:49:39 +0200 (CEST) Subject: [Python-checkins] r51638 - in python/branches/bcannon-objcap/Lib: distutils/sysconfig.py idlelib/ColorDelegator.py pstats.py site.py tarfile.py test/test_bool.py test/test_bz2.py test/test_descr.py test/test_inspect.py test/test_iter.py test/test_marshal.py test/test_os.py test/test_tarfile.py test/test_unicode_file.py test/test_urllib.py test/test_urllibnet.py webbrowser.py Message-ID: <20060828214939.169821E4006@bag.python.org> Author: brett.cannon Date: Mon Aug 28 23:49:36 2006 New Revision: 51638 Modified: python/branches/bcannon-objcap/Lib/distutils/sysconfig.py python/branches/bcannon-objcap/Lib/idlelib/ColorDelegator.py python/branches/bcannon-objcap/Lib/pstats.py python/branches/bcannon-objcap/Lib/site.py python/branches/bcannon-objcap/Lib/tarfile.py python/branches/bcannon-objcap/Lib/test/test_bool.py python/branches/bcannon-objcap/Lib/test/test_bz2.py python/branches/bcannon-objcap/Lib/test/test_descr.py python/branches/bcannon-objcap/Lib/test/test_inspect.py python/branches/bcannon-objcap/Lib/test/test_iter.py python/branches/bcannon-objcap/Lib/test/test_marshal.py python/branches/bcannon-objcap/Lib/test/test_os.py python/branches/bcannon-objcap/Lib/test/test_tarfile.py python/branches/bcannon-objcap/Lib/test/test_unicode_file.py python/branches/bcannon-objcap/Lib/test/test_urllib.py python/branches/bcannon-objcap/Lib/test/test_urllibnet.py python/branches/bcannon-objcap/Lib/webbrowser.py Log: Backport rev. 51537 and 51539 from p3yk branch (replace usage of 'file()' with 'open()'). Will eventually turn off the 'file' constructor in this branch. Modified: python/branches/bcannon-objcap/Lib/distutils/sysconfig.py ============================================================================== --- python/branches/bcannon-objcap/Lib/distutils/sysconfig.py (original) +++ python/branches/bcannon-objcap/Lib/distutils/sysconfig.py Mon Aug 28 23:49:36 2006 @@ -354,7 +354,7 @@ # load the installed pyconfig.h: try: filename = get_config_h_filename() - parse_config_h(file(filename), g) + parse_config_h(open(filename), g) except IOError, msg: my_msg = "invalid Python installation: unable to open %s" % filename if hasattr(msg, "strerror"): Modified: python/branches/bcannon-objcap/Lib/idlelib/ColorDelegator.py ============================================================================== --- python/branches/bcannon-objcap/Lib/idlelib/ColorDelegator.py (original) +++ python/branches/bcannon-objcap/Lib/idlelib/ColorDelegator.py Mon Aug 28 23:49:36 2006 @@ -16,7 +16,7 @@ kw = r"\b" + any("KEYWORD", keyword.kwlist) + r"\b" builtinlist = [str(name) for name in dir(__builtin__) if not name.startswith('_')] - # self.file = file("file") : + # self.file = open("file") : # 1st 'file' colorized normal, 2nd as builtin, 3rd as string builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b" comment = any("COMMENT", [r"#[^\n]*"]) Modified: python/branches/bcannon-objcap/Lib/pstats.py ============================================================================== --- python/branches/bcannon-objcap/Lib/pstats.py (original) +++ python/branches/bcannon-objcap/Lib/pstats.py Mon Aug 28 23:49:36 2006 @@ -173,7 +173,7 @@ def dump_stats(self, filename): """Write the profile data to a file we know how to load back.""" - f = file(filename, 'wb') + f = open(filename, 'wb') try: marshal.dump(self.stats, f) finally: Modified: python/branches/bcannon-objcap/Lib/site.py ============================================================================== --- python/branches/bcannon-objcap/Lib/site.py (original) +++ python/branches/bcannon-objcap/Lib/site.py Mon Aug 28 23:49:36 2006 @@ -274,7 +274,7 @@ for filename in self.__files: filename = os.path.join(dir, filename) try: - fp = file(filename, "rU") + fp = open(filename, "rU") data = fp.read() fp.close() break Modified: python/branches/bcannon-objcap/Lib/tarfile.py ============================================================================== --- python/branches/bcannon-objcap/Lib/tarfile.py (original) +++ python/branches/bcannon-objcap/Lib/tarfile.py Mon Aug 28 23:49:36 2006 @@ -65,6 +65,8 @@ # from tarfile import * __all__ = ["TarFile", "TarInfo", "is_tarfile", "TarError"] +from __builtin__ import open as _open # Since 'open' is TarFile.open + #--------------------------------------------------------- # tar constants #--------------------------------------------------------- @@ -934,7 +936,7 @@ self.mode = {"r": "rb", "a": "r+b", "w": "wb"}[mode] if not fileobj: - fileobj = file(self.name, self.mode) + fileobj = _open(self.name, self.mode) self._extfileobj = False else: if self.name is None and hasattr(fileobj, "name"): @@ -1083,7 +1085,7 @@ tarname = pre + ext if fileobj is None: - fileobj = file(name, mode + "b") + fileobj = _open(name, mode + "b") if mode != "r": name = tarname @@ -1355,7 +1357,7 @@ # Append the tar header and data to the archive. if tarinfo.isreg(): - f = file(name, "rb") + f = _open(name, "rb") self.addfile(tarinfo, f) f.close() @@ -1617,7 +1619,7 @@ """Make a file called targetpath. """ source = self.extractfile(tarinfo) - target = file(targetpath, "wb") + target = _open(targetpath, "wb") copyfileobj(source, target) source.close() target.close() Modified: python/branches/bcannon-objcap/Lib/test/test_bool.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_bool.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_bool.py Mon Aug 28 23:49:36 2006 @@ -246,7 +246,7 @@ def test_fileclosed(self): try: - f = file(test_support.TESTFN, "w") + f = open(test_support.TESTFN, "w") self.assertIs(f.closed, False) f.close() self.assertIs(f.closed, True) Modified: python/branches/bcannon-objcap/Lib/test/test_bz2.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_bz2.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_bz2.py Mon Aug 28 23:49:36 2006 @@ -251,7 +251,7 @@ self.createTempFile() bz2f = BZ2File(self.filename, "U") bz2f.close() - f = file(self.filename) + f = open(self.filename) f.seek(0, 2) self.assertEqual(f.tell(), len(self.DATA)) f.close() Modified: python/branches/bcannon-objcap/Lib/test/test_descr.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_descr.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_descr.py Mon Aug 28 23:49:36 2006 @@ -2463,7 +2463,7 @@ self.ateof = 1 return s - f = file(name=TESTFN, mode='w') + f = open(name=TESTFN, mode='w') lines = ['a\n', 'b\n', 'c\n'] try: f.writelines(lines) @@ -2519,7 +2519,7 @@ sandbox = rexec.RExec() code1 = """f = open(%r, 'w')""" % TESTFN - code2 = """f = file(%r, 'w')""" % TESTFN + code2 = """f = open(%r, 'w')""" % TESTFN code3 = """\ f = open(%r) t = type(f) # a sneaky way to get the file() constructor Modified: python/branches/bcannon-objcap/Lib/test/test_inspect.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_inspect.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_inspect.py Mon Aug 28 23:49:36 2006 @@ -130,7 +130,7 @@ def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs) - self.source = file(inspect.getsourcefile(self.fodderFile)).read() + self.source = open(inspect.getsourcefile(self.fodderFile)).read() def sourcerange(self, top, bottom): lines = self.source.split("\n") Modified: python/branches/bcannon-objcap/Lib/test/test_iter.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_iter.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_iter.py Mon Aug 28 23:49:36 2006 @@ -674,7 +674,7 @@ # Test iterators with file.writelines(). def test_writelines(self): - f = file(TESTFN, "w") + f = open(TESTFN, "w") try: self.assertRaises(TypeError, f.writelines, None) @@ -713,7 +713,7 @@ f.writelines(Whatever(6, 6+2000)) f.close() - f = file(TESTFN) + f = open(TESTFN) expected = [str(i) + "\n" for i in range(1, 2006)] self.assertEqual(list(f), expected) Modified: python/branches/bcannon-objcap/Lib/test/test_marshal.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_marshal.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_marshal.py Mon Aug 28 23:49:36 2006 @@ -16,8 +16,8 @@ s = marshal.dumps(expected) got = marshal.loads(s) self.assertEqual(expected, got) - marshal.dump(expected, file(test_support.TESTFN, "wb")) - got = marshal.load(file(test_support.TESTFN, "rb")) + marshal.dump(expected, open(test_support.TESTFN, "wb")) + got = marshal.load( open(test_support.TESTFN, "rb")) self.assertEqual(expected, got) n = n >> 1 os.unlink(test_support.TESTFN) @@ -51,8 +51,8 @@ new = marshal.loads(marshal.dumps(b)) self.assertEqual(b, new) self.assertEqual(type(b), type(new)) - marshal.dump(b, file(test_support.TESTFN, "wb")) - new = marshal.load(file(test_support.TESTFN, "rb")) + marshal.dump(b, open(test_support.TESTFN, "wb")) + new = marshal.load(open(test_support.TESTFN, "rb")) self.assertEqual(b, new) self.assertEqual(type(b), type(new)) @@ -67,8 +67,8 @@ s = marshal.dumps(f) got = marshal.loads(s) self.assertEqual(f, got) - marshal.dump(f, file(test_support.TESTFN, "wb")) - got = marshal.load(file(test_support.TESTFN, "rb")) + marshal.dump(f, open(test_support.TESTFN, "wb")) + got = marshal.load(open(test_support.TESTFN, "rb")) self.assertEqual(f, got) n /= 123.4567 @@ -94,12 +94,12 @@ got = marshal.loads(s) self.assertEqual(f, got) - marshal.dump(f, file(test_support.TESTFN, "wb")) - got = marshal.load(file(test_support.TESTFN, "rb")) + marshal.dump(f, open(test_support.TESTFN, "wb")) + got = marshal.load(open(test_support.TESTFN, "rb")) self.assertEqual(f, got) - marshal.dump(f, file(test_support.TESTFN, "wb"), 1) - got = marshal.load(file(test_support.TESTFN, "rb")) + marshal.dump(f, open(test_support.TESTFN, "wb"), 1) + got = marshal.load(open(test_support.TESTFN, "rb")) self.assertEqual(f, got) n *= 123.4567 os.unlink(test_support.TESTFN) @@ -110,8 +110,8 @@ new = marshal.loads(marshal.dumps(s)) self.assertEqual(s, new) self.assertEqual(type(s), type(new)) - marshal.dump(s, file(test_support.TESTFN, "wb")) - new = marshal.load(file(test_support.TESTFN, "rb")) + marshal.dump(s, open(test_support.TESTFN, "wb")) + new = marshal.load(open(test_support.TESTFN, "rb")) self.assertEqual(s, new) self.assertEqual(type(s), type(new)) os.unlink(test_support.TESTFN) @@ -121,8 +121,8 @@ new = marshal.loads(marshal.dumps(s)) self.assertEqual(s, new) self.assertEqual(type(s), type(new)) - marshal.dump(s, file(test_support.TESTFN, "wb")) - new = marshal.load(file(test_support.TESTFN, "rb")) + marshal.dump(s, open(test_support.TESTFN, "wb")) + new = marshal.load(open(test_support.TESTFN, "rb")) self.assertEqual(s, new) self.assertEqual(type(s), type(new)) os.unlink(test_support.TESTFN) @@ -132,8 +132,8 @@ b = buffer(s) new = marshal.loads(marshal.dumps(b)) self.assertEqual(s, new) - marshal.dump(b, file(test_support.TESTFN, "wb")) - new = marshal.load(file(test_support.TESTFN, "rb")) + marshal.dump(b, open(test_support.TESTFN, "wb")) + new = marshal.load(open(test_support.TESTFN, "rb")) self.assertEqual(s, new) os.unlink(test_support.TESTFN) @@ -161,8 +161,8 @@ def test_dict(self): new = marshal.loads(marshal.dumps(self.d)) self.assertEqual(self.d, new) - marshal.dump(self.d, file(test_support.TESTFN, "wb")) - new = marshal.load(file(test_support.TESTFN, "rb")) + marshal.dump(self.d, open(test_support.TESTFN, "wb")) + new = marshal.load(open(test_support.TESTFN, "rb")) self.assertEqual(self.d, new) os.unlink(test_support.TESTFN) @@ -170,8 +170,8 @@ lst = self.d.items() new = marshal.loads(marshal.dumps(lst)) self.assertEqual(lst, new) - marshal.dump(lst, file(test_support.TESTFN, "wb")) - new = marshal.load(file(test_support.TESTFN, "rb")) + marshal.dump(lst, open(test_support.TESTFN, "wb")) + new = marshal.load(open(test_support.TESTFN, "rb")) self.assertEqual(lst, new) os.unlink(test_support.TESTFN) @@ -179,8 +179,8 @@ t = tuple(self.d.keys()) new = marshal.loads(marshal.dumps(t)) self.assertEqual(t, new) - marshal.dump(t, file(test_support.TESTFN, "wb")) - new = marshal.load(file(test_support.TESTFN, "rb")) + marshal.dump(t, open(test_support.TESTFN, "wb")) + new = marshal.load(open(test_support.TESTFN, "rb")) self.assertEqual(t, new) os.unlink(test_support.TESTFN) @@ -191,8 +191,8 @@ self.assertEqual(t, new) self.assert_(isinstance(new, constructor)) self.assertNotEqual(id(t), id(new)) - marshal.dump(t, file(test_support.TESTFN, "wb")) - new = marshal.load(file(test_support.TESTFN, "rb")) + marshal.dump(t, open(test_support.TESTFN, "wb")) + new = marshal.load(open(test_support.TESTFN, "rb")) self.assertEqual(t, new) os.unlink(test_support.TESTFN) Modified: python/branches/bcannon-objcap/Lib/test/test_os.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_os.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_os.py Mon Aug 28 23:49:36 2006 @@ -273,7 +273,7 @@ os.makedirs(sub11_path) os.makedirs(sub2_path) for path in tmp1_path, tmp2_path, tmp3_path: - f = file(path, "w") + f = open(path, "w") f.write("I'm " + path + " and proud of it. Blame test_os.\n") f.close() @@ -361,10 +361,10 @@ class DevNullTests (unittest.TestCase): def test_devnull(self): - f = file(os.devnull, 'w') + f = open(os.devnull, 'w') f.write('hello') f.close() - f = file(os.devnull, 'r') + f = open(os.devnull, 'r') self.assertEqual(f.read(), '') f.close() Modified: python/branches/bcannon-objcap/Lib/test/test_tarfile.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_tarfile.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_tarfile.py Mon Aug 28 23:49:36 2006 @@ -333,11 +333,11 @@ f.close() elif self.comp == "bz2": f = bz2.BZ2Decompressor() - s = file(self.dstname).read() + s = open(self.dstname).read() s = f.decompress(s) self.assertEqual(len(f.unused_data), 0, "trailing data") else: - f = file(self.dstname) + f = open(self.dstname) s = f.read() f.close() Modified: python/branches/bcannon-objcap/Lib/test/test_unicode_file.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_unicode_file.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_unicode_file.py Mon Aug 28 23:49:36 2006 @@ -152,7 +152,7 @@ # top-level 'test' functions would be if they could take params def _test_single(self, filename): remove_if_exists(filename) - f = file(filename, "w") + f = open(filename, "w") f.close() try: self._do_single(filename) @@ -170,7 +170,7 @@ def _test_equivalent(self, filename1, filename2): remove_if_exists(filename1) self.failUnless(not os.path.exists(filename2)) - f = file(filename1, "w") + f = open(filename1, "w") f.close() try: self._do_equivilent(filename1, filename2) Modified: python/branches/bcannon-objcap/Lib/test/test_urllib.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_urllib.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_urllib.py Mon Aug 28 23:49:36 2006 @@ -27,7 +27,7 @@ def setUp(self): """Setup of a temp file to use for testing""" self.text = "test_urllib: %s\n" % self.__class__.__name__ - FILE = file(test_support.TESTFN, 'wb') + FILE = open(test_support.TESTFN, 'wb') try: FILE.write(self.text) finally: @@ -139,7 +139,7 @@ self.registerFileForCleanUp(test_support.TESTFN) self.text = 'testing urllib.urlretrieve' try: - FILE = file(test_support.TESTFN, 'wb') + FILE = open(test_support.TESTFN, 'wb') FILE.write(self.text) FILE.close() finally: @@ -192,7 +192,7 @@ self.assertEqual(second_temp, result[0]) self.assert_(os.path.exists(second_temp), "copy of the file was not " "made") - FILE = file(second_temp, 'rb') + FILE = open(second_temp, 'rb') try: text = FILE.read() FILE.close() Modified: python/branches/bcannon-objcap/Lib/test/test_urllibnet.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_urllibnet.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_urllibnet.py Mon Aug 28 23:49:36 2006 @@ -120,7 +120,7 @@ file_location,info = urllib.urlretrieve("http://www.python.org/") self.assert_(os.path.exists(file_location), "file location returned by" " urlretrieve is not a valid path") - FILE = file(file_location) + FILE = open(file_location) try: self.assert_(FILE.read(), "reading from the file location returned" " by urlretrieve failed") @@ -134,7 +134,7 @@ test_support.TESTFN) self.assertEqual(file_location, test_support.TESTFN) self.assert_(os.path.exists(file_location)) - FILE = file(file_location) + FILE = open(file_location) try: self.assert_(FILE.read(), "reading from temporary file failed") finally: Modified: python/branches/bcannon-objcap/Lib/webbrowser.py ============================================================================== --- python/branches/bcannon-objcap/Lib/webbrowser.py (original) +++ python/branches/bcannon-objcap/Lib/webbrowser.py Mon Aug 28 23:49:36 2006 @@ -210,7 +210,7 @@ cmdline = [self.name] + raise_opt + args if remote or self.background: - inout = file(os.devnull, "r+") + inout = open(os.devnull, "r+") else: # for TTY browsers, we need stdin/out inout = None @@ -334,7 +334,7 @@ else: action = "openURL" - devnull = file(os.devnull, "r+") + devnull = open(os.devnull, "r+") # if possible, put browser in separate process group, so # keyboard interrupts don't affect browser as well as Python setsid = getattr(os, 'setsid', None) From python-checkins at python.org Tue Aug 29 07:40:59 2006 From: python-checkins at python.org (neal.norwitz) Date: Tue, 29 Aug 2006 07:40:59 +0200 (CEST) Subject: [Python-checkins] r51642 - python/trunk/Lib/doctest.py Message-ID: <20060829054059.116971E4008@bag.python.org> Author: neal.norwitz Date: Tue Aug 29 07:40:58 2006 New Revision: 51642 Modified: python/trunk/Lib/doctest.py Log: Fix a couple of typos. Modified: python/trunk/Lib/doctest.py ============================================================================== --- python/trunk/Lib/doctest.py (original) +++ python/trunk/Lib/doctest.py Tue Aug 29 07:40:58 2006 @@ -1561,7 +1561,7 @@ - test: the DocTest object being run - - excample: the Example object that failed + - example: the Example object that failed - got: the actual output """ @@ -1580,7 +1580,7 @@ - test: the DocTest object being run - - excample: the Example object that failed + - example: the Example object that failed - exc_info: the exception info """ From python-checkins at python.org Tue Aug 29 09:19:19 2006 From: python-checkins at python.org (georg.brandl) Date: Tue, 29 Aug 2006 09:19:19 +0200 (CEST) Subject: [Python-checkins] r51644 - peps/trunk/pep-0339.txt Message-ID: <20060829071919.7F96C1E4008@bag.python.org> Author: georg.brandl Date: Tue Aug 29 09:19:18 2006 New Revision: 51644 Modified: peps/trunk/pep-0339.txt Log: Markup fix. Modified: peps/trunk/pep-0339.txt ============================================================================== --- peps/trunk/pep-0339.txt (original) +++ peps/trunk/pep-0339.txt Tue Aug 29 09:19:18 2006 @@ -379,7 +379,7 @@ First, you must choose a name and a unique identifier number. The official list of bytecode can be found in Include/opcode.h . If the opcode is to take an argument, it must be given a unique number greater than that assigned to -``HAVE_ARGUMENT`` (as found in Include/opcode.h``). +``HAVE_ARGUMENT`` (as found in Include/opcode.h). Once the name/number pair has been chosen and entered in Include/opcode.h, you must also enter it into From python-checkins at python.org Tue Aug 29 12:34:13 2006 From: python-checkins at python.org (marc-andre.lemburg) Date: Tue, 29 Aug 2006 12:34:13 +0200 (CEST) Subject: [Python-checkins] r51647 - python/trunk/Tools/pybench/pybench.py Message-ID: <20060829103413.4CE861E4008@bag.python.org> Author: marc-andre.lemburg Date: Tue Aug 29 12:34:12 2006 New Revision: 51647 Modified: python/trunk/Tools/pybench/pybench.py Log: Fix a buglet in the error reporting (SF bug report #1546372). This should probably go into Python 2.5 or 2.5.1 as well. Modified: python/trunk/Tools/pybench/pybench.py ============================================================================== --- python/trunk/Tools/pybench/pybench.py (original) +++ python/trunk/Tools/pybench/pybench.py Tue Aug 29 12:34:12 2006 @@ -885,7 +885,7 @@ else: bench.print_benchmark(hidenoise=hidenoise, limitnames=limitnames) - except IOError: + except IOError, reason: print '* Error opening/reading file %s: %s' % ( repr(show_bench), reason) @@ -931,8 +931,13 @@ bench.name = reportfile pickle.dump(bench,f) f.close() - except IOError: + except IOError, reason: print '* Error opening/writing reportfile' + except IOError, reason: + print '* Error opening/writing reportfile %s: %s' % ( + reportfile, + reason) + print if __name__ == '__main__': PyBenchCmdline() From g.brandl at gmx.net Tue Aug 29 12:38:42 2006 From: g.brandl at gmx.net (Georg Brandl) Date: Tue, 29 Aug 2006 12:38:42 +0200 Subject: [Python-checkins] r51647 - python/trunk/Tools/pybench/pybench.py In-Reply-To: <20060829103413.4CE861E4008@bag.python.org> References: <20060829103413.4CE861E4008@bag.python.org> Message-ID: marc-andre.lemburg wrote: > Author: marc-andre.lemburg > Date: Tue Aug 29 12:34:12 2006 > New Revision: 51647 > > Modified: > python/trunk/Tools/pybench/pybench.py > Log: > Fix a buglet in the error reporting (SF bug report #1546372). > > This should probably go into Python 2.5 or 2.5.1 as well. > > > > Modified: python/trunk/Tools/pybench/pybench.py > ============================================================================== > --- python/trunk/Tools/pybench/pybench.py (original) > +++ python/trunk/Tools/pybench/pybench.py Tue Aug 29 12:34:12 2006 > @@ -885,7 +885,7 @@ > else: > bench.print_benchmark(hidenoise=hidenoise, > limitnames=limitnames) > - except IOError: > + except IOError, reason: > print '* Error opening/reading file %s: %s' % ( > repr(show_bench), Why not "... file %r: %s" % (showbench, reason)? Georg From mal at egenix.com Tue Aug 29 12:57:52 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Tue, 29 Aug 2006 12:57:52 +0200 Subject: [Python-checkins] r51647 - python/trunk/Tools/pybench/pybench.py In-Reply-To: References: <20060829103413.4CE861E4008@bag.python.org> Message-ID: <44F41DB0.8030905@egenix.com> Georg Brandl wrote: > marc-andre.lemburg wrote: >> Author: marc-andre.lemburg >> Date: Tue Aug 29 12:34:12 2006 >> New Revision: 51647 >> >> Modified: >> python/trunk/Tools/pybench/pybench.py >> Log: >> Fix a buglet in the error reporting (SF bug report #1546372). >> >> This should probably go into Python 2.5 or 2.5.1 as well. >> >> >> >> Modified: python/trunk/Tools/pybench/pybench.py >> ============================================================================== >> --- python/trunk/Tools/pybench/pybench.py (original) >> +++ python/trunk/Tools/pybench/pybench.py Tue Aug 29 12:34:12 2006 >> @@ -885,7 +885,7 @@ >> else: >> bench.print_benchmark(hidenoise=hidenoise, >> limitnames=limitnames) >> - except IOError: >> + except IOError, reason: >> print '* Error opening/reading file %s: %s' % ( >> repr(show_bench), > > Why not "... file %r: %s" % (showbench, reason)? Because Python 1.5.2 doesn't have %r. I added that as part of the Unicode integration in Python 1.6. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Aug 29 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From buildbot at python.org Tue Aug 29 13:29:37 2006 From: buildbot at python.org (buildbot at python.org) Date: Tue, 29 Aug 2006 11:29:37 +0000 Subject: [Python-checkins] buildbot warnings in alpha Tru64 5.1 trunk Message-ID: <20060829112937.9AB3C1E4008@bag.python.org> The Buildbot has detected a new failure of alpha Tru64 5.1 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%2520Tru64%25205.1%2520trunk/builds/1134 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: marc-andre.lemburg Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Wed Aug 30 07:04:28 2006 From: python-checkins at python.org (brett.cannon) Date: Wed, 30 Aug 2006 07:04:28 +0200 (CEST) Subject: [Python-checkins] r51649 - sandbox/trunk/trackers/trackers.txt Message-ID: <20060830050428.3B2BA1E4009@bag.python.org> Author: brett.cannon Date: Wed Aug 30 07:04:27 2006 New Revision: 51649 Modified: sandbox/trunk/trackers/trackers.txt Log: Add Roundup info on how to get password. Modified: sandbox/trunk/trackers/trackers.txt ============================================================================== --- sandbox/trunk/trackers/trackers.txt (original) +++ sandbox/trunk/trackers/trackers.txt Wed Aug 30 07:04:27 2006 @@ -43,3 +43,23 @@ existing password. +Roundup +========================= + +All the members of the infrastructure team listed on +http://wiki.python.org/moin/PythonSoftwareFoundationCommittees#infrastructure-committee-ic +has been given administraive rights. That is: + +Brett Cannon (brett at python.org) +Richard Jones (richard at python.org) +A.M. Kuchling (amk at amk.ca) +Martin v. L??wis (martin at v.loewis.de) +Barry Warsaw (barry at python.org) +Thomas Wouters (thomas at python.org) + +..all have accounts with the Admin role. Use the 'lost login' feature +(http://efod.se/python-tracker/user?@template=forgotten) to get a +password by entering the e-mail address listed above (i.e., Brett +Cannon should enter brett at python.org to get a password reset mail +sent to him). + From python-checkins at python.org Wed Aug 30 20:47:31 2006 From: python-checkins at python.org (brett.cannon) Date: Wed, 30 Aug 2006 20:47:31 +0200 (CEST) Subject: [Python-checkins] r51650 - python/branches/bcannon-objcap/securing_python.txt Message-ID: <20060830184731.E02001E4007@bag.python.org> Author: brett.cannon Date: Wed Aug 30 20:47:31 2006 New Revision: 51650 Modified: python/branches/bcannon-objcap/securing_python.txt Log: Add plan on how to secure opening files; both open() and at the C level. Modified: python/branches/bcannon-objcap/securing_python.txt ============================================================================== --- python/branches/bcannon-objcap/securing_python.txt (original) +++ python/branches/bcannon-objcap/securing_python.txt Wed Aug 30 20:47:31 2006 @@ -7,13 +7,32 @@ + Remove object.__subclasses__ [done] + Dangerous constructors - file + * Create PyFile_InsecureOpen() + * Switch current C-level uses of 'file' constructor to + PyFile_InsecureOpen(). + + built-in open() + + bz2 module + * Create PyFile_Safe*() version of C API that goes through + open() built-in. + + Convert C strings to Python objects and do a direct + call. + + Since I/O-bound anyway going from C->Python->C should + not be a large performance penalty. + + Function also not called in a tight loop which also + makes less of a performance-critical operation. + + Might need to add some C code for easily accessing + built-in objects. - code -+ Sandboxed built-ins + - ??? ++ Sandboxed versions of built-ins - open() - __import__() / PEP 302 importer + - ??? + Filesystem path hiding -+ mini 'sys' module -+ Create sandboxed interpreters ++ Tweaked stdlib modules + - mini 'sys' module + - genericpath module (for os.path when C modules blocked) ++ Create sandboxed interpreter stdlib module - Be able to specify built-ins - Set 'sys' module settings - API From python-checkins at python.org Wed Aug 30 20:56:20 2006 From: python-checkins at python.org (brett.cannon) Date: Wed, 30 Aug 2006 20:56:20 +0200 (CEST) Subject: [Python-checkins] r51651 - python/branches/bcannon-objcap/securing_python.txt Message-ID: <20060830185620.BFADC1E4007@bag.python.org> Author: brett.cannon Date: Wed Aug 30 20:56:20 2006 New Revision: 51651 Modified: python/branches/bcannon-objcap/securing_python.txt Log: Clean up memory cap section. Modified: python/branches/bcannon-objcap/securing_python.txt ============================================================================== --- python/branches/bcannon-objcap/securing_python.txt (original) +++ python/branches/bcannon-objcap/securing_python.txt Wed Aug 30 20:56:20 2006 @@ -709,32 +709,15 @@ any form of exposure at the Python level, this feature can be safely implemented separately from the rest of the security model. -Existing APIs to protect are: +Existing APIs to protect are (as declared in Include/pymem.h and +Include/objimpl.h; both header files must be thoroughly checked for +public API and macros): -- _PyObject_New() : PyObject_New() -- _PyObject_NewVar() : PyObject_NewVar() -- _PyObject_Del() - remove macro that uses PyObject_Free() and protect directly -- PyObject_Del() - redefine macro to use _PyObject_Del() instead of PyObject_Free() -- PyMem_Malloc() : PyMem_New() -- PyMem_Realloc() : PyMem_Resize() -- PyMem_Free() : PyMem_Del() -- PyMem_MALLOC() : PyMem_NEW() - redefine macro to use PyMem_Malloc() -- PyMem_REALLOC() : PyMem_RESIZE() - redefine macro to use PyMem_Realloc() -- PyMem_FREE() : PyMem_DEL() - redefine macro to use PyMem_Free() -- PyObject_Malloc() - XXX -- PyObject_Realloc() - XXX -- PyObject_Free() - XXX -- PyObject_MALLOC() - XXX -- PyObject_REALLOC() - XXX -- PyObject_FREE() - XXX +* PyObject_Malloc(), macros, & friends +* PyObject_New(), macros, & friends +* _PyObject_New(), & friends +* PyMem_Malloc(), macros, & friends +* PyObject_GC_New(), & friends + +An implementation is in Python's svn repository under the +bcannon-sandboxing branch. From python-checkins at python.org Wed Aug 30 20:58:44 2006 From: python-checkins at python.org (brett.cannon) Date: Wed, 30 Aug 2006 20:58:44 +0200 (CEST) Subject: [Python-checkins] r51652 - python/branches/bcannon-objcap/securing_python.txt Message-ID: <20060830185844.7254B1E4007@bag.python.org> Author: brett.cannon Date: Wed Aug 30 20:58:44 2006 New Revision: 51652 Modified: python/branches/bcannon-objcap/securing_python.txt Log: Clean up 'import' section of 'Implementation'. Modified: python/branches/bcannon-objcap/securing_python.txt ============================================================================== --- python/branches/bcannon-objcap/securing_python.txt (original) +++ python/branches/bcannon-objcap/securing_python.txt Wed Aug 30 20:58:44 2006 @@ -430,9 +430,7 @@ be imported. All .py files will be imported. XXX perhaps augment 'sys' so that you list the extension of files that -can be used for importing? Thought this was controlled somewhere -already but can't find it. It is returned by ``imp.get_suffixes()``, -but I can't find where to set it from Python code. +can be used for importing? It is returned by ``imp.get_suffixes()``. It must be warned that importing any C extension module is dangerous. Not only are they able to circumvent security measures by executing C @@ -470,6 +468,9 @@ function create a new import function based on an interpreter passed in, etc.). +One can also implement a PEP 302 import object that takes the proper +precautions of not exposing power needlessly. + Sanitizing Built-In Types ------------------------- From python-checkins at python.org Wed Aug 30 21:03:44 2006 From: python-checkins at python.org (brett.cannon) Date: Wed, 30 Aug 2006 21:03:44 +0200 (CEST) Subject: [Python-checkins] r51653 - python/branches/bcannon-objcap/securing_python.txt Message-ID: <20060830190344.B402A1E4007@bag.python.org> Author: brett.cannon Date: Wed Aug 30 21:03:44 2006 New Revision: 51653 Modified: python/branches/bcannon-objcap/securing_python.txt Log: Add references in 'Status' to parts in 'Implementation'. Modified: python/branches/bcannon-objcap/securing_python.txt ============================================================================== --- python/branches/bcannon-objcap/securing_python.txt (original) +++ python/branches/bcannon-objcap/securing_python.txt Wed Aug 30 21:03:44 2006 @@ -4,8 +4,8 @@ Status /////////////////////////////////////// -+ Remove object.__subclasses__ [done] -+ Dangerous constructors ++ Remove object.__subclasses__ (`Mutable Shared State`_) [done] ++ Dangerous constructors (`Constructors`_) - file * Create PyFile_InsecureOpen() * Switch current C-level uses of 'file' constructor to @@ -24,14 +24,15 @@ built-in objects. - code - ??? -+ Sandboxed versions of built-ins ++ Sandboxed versions of built-ins (`Sanitizing Built-In Types`_) - open() - - __import__() / PEP 302 importer + - __import__() / PEP 302 importer (`Imports`_) - ??? -+ Filesystem path hiding ++ Filesystem path hiding (`Filesystem Information`_) + Tweaked stdlib modules - - mini 'sys' module + - mini 'sys' module (`Making the ``sys`` Module Safe`_) - genericpath module (for os.path when C modules blocked) + - socket (`Safe Networking`_) + Create sandboxed interpreter stdlib module - Be able to specify built-ins - Set 'sys' module settings From python-checkins at python.org Wed Aug 30 22:30:36 2006 From: python-checkins at python.org (mateusz.rukowicz) Date: Wed, 30 Aug 2006 22:30:36 +0200 (CEST) Subject: [Python-checkins] r51654 - in sandbox/trunk/decimal-c: _decimal.c new_dt/power.decTest test_decimal.py Message-ID: <20060830203036.3C0051E4009@bag.python.org> Author: mateusz.rukowicz Date: Wed Aug 30 22:30:34 2006 New Revision: 51654 Modified: sandbox/trunk/decimal-c/_decimal.c sandbox/trunk/decimal-c/new_dt/power.decTest sandbox/trunk/decimal-c/test_decimal.py Log: Added special case to power functions. Upated test_decimal.py. Now *decTest are very the same to Cowlish except two tests that are 'extra feature'. Modified: sandbox/trunk/decimal-c/_decimal.c ============================================================================== --- sandbox/trunk/decimal-c/_decimal.c (original) +++ sandbox/trunk/decimal-c/_decimal.c Wed Aug 30 22:30:34 2006 @@ -5960,8 +5960,85 @@ if (use_exp) { decimalobject *tmp; contextobject *ctx2; + + /* check context */ if (!check_ctx(self, ctx)) return handle_InvalidContext(self->ob_type, ctx, NULL); + + /* now check operands */ + if (decimal_nonzero(self) && ( + self->ob_size > MAX_MATH || + exp_g_i(exp_add_i(self->exp, self->ob_size), MAX_MATH + 1) || + exp_l_i(exp_add_i(self->exp, self->ob_size), 2 * (1 - MAX_MATH)))) + return handle_InvalidOperation(self->ob_type, ctx, "Operand range violation", NULL); + + if (decimal_nonzero(other) && ( + other->ob_size > MAX_MATH || + exp_g_i(exp_add_i(other->exp, other->ob_size), MAX_MATH + 1) || + exp_l_i(exp_add_i(other->exp, other->ob_size), 2 * (1 - MAX_MATH)))) + return handle_InvalidOperation(other->ob_type, ctx, "Operand range violation", NULL); + + /* special cases */ + { + int i; + int special = 1; + if (!exp_eq_i(ADJUSTED(self), -1)) + special = 0; + if (special) + for (i = 0 ; i < ctx->prec; i ++) { + if (_limb_get_digit(self->limbs, self->ob_size, i) != 9) { + special = 0; + break; + } + } + + /* self is 0.999...99 */ + if (special) { + /* 0 < other < 1 */ + if (!(other->sign&1) && exp_le_i(ADJUSTED(other), -1) && decimal_nonzero(other)) { + + /* if round up then return 1 */ + if (ctx->rounding == ROUND_UP || ctx->rounding == ROUND_CEILING) { + long limb = ctx->prec / LOG; + long mul = (ctx->prec % LOG) - 1; + + if (handle_Inexact(ctx, NULL)) + return NULL; + + if (handle_Rounded(ctx, NULL)) + return NULL; + + ret = _NEW_decimalobj(ctx->prec, 0, exp_from_i(1 - ctx->prec)); + + if (!ret) + return NULL; + + for (i=0 ; i < ret->limb_count ;i ++) + ret->limbs[i] = 0; + + ret->limbs[limb] = 1; + + for (i = 0 ; i < mul ; i ++) + ret->limbs[limb] *= 10; + + return ret; + } + + /* if round down then return self */ + else if (ctx->rounding == ROUND_DOWN || ctx->rounding == ROUND_FLOOR){ + if (handle_Inexact(ctx, NULL)) + return NULL; + + if (handle_Rounded(ctx, NULL)) + return NULL; + + return _decimal_get_copy(self); + } + } + } + } + + ctx2 = context_shallow_copy(ctx); if (!ctx2) return NULL; @@ -5971,11 +6048,10 @@ ctx2->clamp = 0; ctx2->rounding = ctx->rounding; ctx2->rounding_dec = ALWAYS_ROUND; - /* we take context precision or size of self if greater - * and add some constant */ + /* we take context precision or size of self if greater and + * add some constant */ ctx2->prec = ctx->prec > self->ob_size ? ctx->prec : self->ob_size; ctx2->prec += 14; - ret = _do_decimal__ln(self, ctx2); if (!ret) { Py_DECREF(ctx2); Modified: sandbox/trunk/decimal-c/new_dt/power.decTest ============================================================================== --- sandbox/trunk/decimal-c/new_dt/power.decTest (original) +++ sandbox/trunk/decimal-c/new_dt/power.decTest Wed Aug 30 22:30:34 2006 @@ -689,6 +689,10 @@ powx1065 power '10' '999999997' -> '1.00000000E+999999997' Rounded powx1066 power '10' '333333333' -> '1.00000000E+333333333' Rounded -- next two are integer-out-of range +powx1183 power '7' '1000000000' -> NaN Invalid_context +powx1184 power '7' '1000000001' -> NaN Invalid_context +-- powx1186 power '7' '-1000000001' -> 1.38243630E-845098041 Inexact Rounded +-- powx1187 power '7' '-1000000000' -> 9.67705411E-845098041 Inexact Rounded -- out-of-range edge cases powx1118 power '10' '-333333333' -> 1E-333333333 @@ -1463,13 +1467,13 @@ -- operand range violations powx4007 power 1 1.1E+999999 -> 1 --- powx4008 power 1 1.1E+1000000 -> NaN Invalid_operation +powx4008 power 1 1.1E+1000000 -> NaN Invalid_operation powx4009 power 1.1E+999999 1.1 -> Infinity Overflow Inexact Rounded --- powx4010 power 1.1E+1000000 1.1 -> NaN Invalid_operation +powx4010 power 1.1E+1000000 1.1 -> NaN Invalid_operation powx4011 power 1 1.1E-1999997 -> 1.00000000 Inexact Rounded --- powx4012 power 1 1.1E-1999998 -> NaN Invalid_operation +powx4012 power 1 1.1E-1999998 -> NaN Invalid_operation powx4013 power 1.1E-1999997 1.1 -> 0E-1000006 Underflow Inexact Rounded Clamped Subnormal --- powx4014 power 1.1E-1999998 1.1 -> NaN Invalid_operation +powx4014 power 1.1E-1999998 1.1 -> NaN Invalid_operation -- rounding modes -- power is sensitive precision: 7 @@ -1579,3 +1583,35 @@ powx4328 power 1.000001 0.9999999 -> 1.000000 Inexact Rounded powx4329 power 1.000001 1.000000 -> 1.000001 +-- For x=prevfp(1)=0.99..99 (where the number of 9s is precision) +-- power(x,y)=x when the rounding is down for any y in (0,1]. +rounding: floor +powx4341 power 0.9999999 0 -> 1 +powx4342 power 0.9999999 1e-101 -> 0.9999999 Inexact Rounded +powx4343 power 0.9999999 1e-95 -> 0.9999999 Inexact Rounded +powx4344 power 0.9999999 1e-10 -> 0.9999999 Inexact Rounded +powx4345 power 0.9999999 0.1 -> 0.9999999 Inexact Rounded +powx4346 power 0.9999999 0.1234567 -> 0.9999999 Inexact Rounded +powx4347 power 0.9999999 0.7 -> 0.9999999 Inexact Rounded +powx4348 power 0.9999999 0.9999999 -> 0.9999999 Inexact Rounded +powx4349 power 0.9999999 1.000000 -> 0.9999999 +-- power(x,y)=1 when the rounding is up for any y in (0,1]. +rounding: ceiling +powx4361 power 0.9999999 0 -> 1 +powx4362 power 0.9999999 1e-101 -> 1.000000 Inexact Rounded +powx4363 power 0.9999999 1e-95 -> 1.000000 Inexact Rounded +powx4364 power 0.9999999 1e-10 -> 1.000000 Inexact Rounded +powx4365 power 0.9999999 0.1 -> 1.000000 Inexact Rounded +powx4366 power 0.9999999 0.1234567 -> 1.000000 Inexact Rounded +powx4367 power 0.9999999 0.7 -> 1.000000 Inexact Rounded +powx4368 power 0.9999999 0.9999999 -> 1.000000 Inexact Rounded +powx4369 power 0.9999999 1.000000 -> 0.9999999 + +-- For x=nextfp(0) +-- power(x,y)=0 when the rounding is down for any y larger than 1. +rounding: floor +powx4382 power 1e-101 0 -> 1 +powx4383 power 1e-101 0.9999999 -> 1E-101 Underflow Subnormal Inexact Rounded +powx4384 power 1e-101 1.000000 -> 1E-101 Subnormal +powx4385 power 1e-101 1.000001 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped +powx4386 power 1e-101 2.000000 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped Modified: sandbox/trunk/decimal-c/test_decimal.py ============================================================================== --- sandbox/trunk/decimal-c/test_decimal.py (original) +++ sandbox/trunk/decimal-c/test_decimal.py Wed Aug 30 22:30:34 2006 @@ -50,7 +50,7 @@ DefaultContext.traps = dict.fromkeys(Signals, 0) setcontext(DefaultContext) -TESTDATADIR = 'decimaltestdata' +TESTDATADIR = 'new_dt' if __name__ == '__main__': file = sys.argv[0] else: @@ -1048,7 +1048,7 @@ c = Context() e = pickle.loads(pickle.dumps(c)) for k in ("prec", "Emin", "Emax", "capitals", "rounding",\ - "_rounding_decision", "_clamp", "flags", "traps", "_ignored"): + "_rounding_decision", "_clamp", "flags", "traps", "_ignored_flags"): #v1 = vars(c)[k] v1 = c.__getattribute__(k) #v2 = vars(e)[k] From python-checkins at python.org Wed Aug 30 23:49:20 2006 From: python-checkins at python.org (brett.cannon) Date: Wed, 30 Aug 2006 23:49:20 +0200 (CEST) Subject: [Python-checkins] r51655 - python/branches/bcannon-objcap/securing_python.txt Message-ID: <20060830214920.617091E4013@bag.python.org> Author: brett.cannon Date: Wed Aug 30 23:49:19 2006 New Revision: 51655 Modified: python/branches/bcannon-objcap/securing_python.txt Log: Minor details in 'Status'. Modified: python/branches/bcannon-objcap/securing_python.txt ============================================================================== --- python/branches/bcannon-objcap/securing_python.txt (original) +++ python/branches/bcannon-objcap/securing_python.txt Wed Aug 30 23:49:19 2006 @@ -22,6 +22,7 @@ makes less of a performance-critical operation. + Might need to add some C code for easily accessing built-in objects. + * How to handle creating subclasses if open() only way? - code - ??? + Sandboxed versions of built-ins (`Sanitizing Built-In Types`_) From python-checkins at python.org Wed Aug 30 23:52:23 2006 From: python-checkins at python.org (brett.cannon) Date: Wed, 30 Aug 2006 23:52:23 +0200 (CEST) Subject: [Python-checkins] r51656 - in python/branches/bcannon-objcap: Include/fileobject.h Lib/test/test_descr.py Modules/bz2module.c Objects/fileobject.c Python/bltinmodule.c Message-ID: <20060830215223.9C70C1E4009@bag.python.org> Author: brett.cannon Date: Wed Aug 30 23:52:22 2006 New Revision: 51656 Modified: python/branches/bcannon-objcap/Include/fileobject.h python/branches/bcannon-objcap/Lib/test/test_descr.py python/branches/bcannon-objcap/Modules/bz2module.c python/branches/bcannon-objcap/Objects/fileobject.c python/branches/bcannon-objcap/Python/bltinmodule.c Log: Remove tp_init from 'file'. Left tp_new so as to continue to allow subclassing, although mostly useless since without tp_init you cannot actually open any file. Added PyFile_UnsafeOpen() and set built-in open to that. Also changed bz2 module to use it as well. Still need to make C API calls go through built-in open() so that if it is overridden that is used instead of blindly opening any file. Will most likely require a new set of APIs for that. Modified: python/branches/bcannon-objcap/Include/fileobject.h ============================================================================== --- python/branches/bcannon-objcap/Include/fileobject.h (original) +++ python/branches/bcannon-objcap/Include/fileobject.h Wed Aug 30 23:52:22 2006 @@ -45,6 +45,8 @@ PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *); PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *); +PyAPI_FUNC(PyObject *) PyFile_UnsafeOpen(PyObject *, PyObject *, PyObject *); + /* The default encoding used by the platform file system APIs If non-NULL, this is different than the default encoding for strings */ Modified: python/branches/bcannon-objcap/Lib/test/test_descr.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_descr.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_descr.py Wed Aug 30 23:52:22 2006 @@ -2452,10 +2452,14 @@ lineno = 0 ateof = 0 + + def __init__(self, path): + self.__file = open(path) + def readline(self): if self.ateof: return "" - s = file.readline(self) + s = file.readline(self.__file) # Next line works too. # s = super(CountedInput, self).readline() self.lineno += 1 @@ -2500,7 +2504,7 @@ # note: as of Python 2.3, dict() no longer has an "items" keyword arg for constructor in (int, float, long, complex, str, unicode, - tuple, list, file): + tuple, list): try: constructor(bogus_keyword_arg=1) except TypeError: Modified: python/branches/bcannon-objcap/Modules/bz2module.c ============================================================================== --- python/branches/bcannon-objcap/Modules/bz2module.c (original) +++ python/branches/bcannon-objcap/Modules/bz2module.c Wed Aug 30 23:52:22 2006 @@ -1293,6 +1293,7 @@ static char *kwlist[] = {"filename", "mode", "buffering", "compresslevel", 0}; PyObject *name; + PyObject *file_open_args; char *mode = "r"; int buffering = -1; int compresslevel = 9; @@ -1353,8 +1354,10 @@ mode = (mode_char == 'r') ? "rb" : "wb"; - self->file = PyObject_CallFunction((PyObject*)&PyFile_Type, "(Osi)", - name, mode, buffering); + file_open_args = Py_BuildValue("Osi", name, mode, buffering); + if (!file_open_args) + goto error; + self->file = PyFile_UnsafeOpen(NULL, file_open_args, NULL); if (self->file == NULL) return -1; Modified: python/branches/bcannon-objcap/Objects/fileobject.c ============================================================================== --- python/branches/bcannon-objcap/Objects/fileobject.c (original) +++ python/branches/bcannon-objcap/Objects/fileobject.c Wed Aug 30 23:52:22 2006 @@ -273,6 +273,7 @@ return (PyObject *)f; } + PyObject * PyFile_FromFile(FILE *fp, char *name, char *mode, int (*close)(FILE *)) { @@ -1966,25 +1967,28 @@ return self; } -static int -file_init(PyObject *self, PyObject *args, PyObject *kwds) +/* + Open a file with no regards to whether it should be allowed. + + Used as the implementation of built-in open(). +*/ +PyObject * +PyFile_UnsafeOpen(PyObject *self, PyObject *args, PyObject *kwds) { - PyFileObject *foself = (PyFileObject *)self; - int ret = 0; + PyFileObject *foself; + PyObject *ret = NULL; static char *kwlist[] = {"name", "mode", "buffering", 0}; char *name = NULL; char *mode = "r"; int bufsize = -1; int wideargument = 0; + self = file_new(&PyFile_Type, args, kwds); + if (!self) + return NULL; + foself = (PyFileObject *)self; + assert(PyFile_Check(self)); - if (foself->f_fp != NULL) { - /* Have to close the existing file first. */ - PyObject *closeresult = file_close(foself); - if (closeresult == NULL) - return -1; - Py_DECREF(closeresult); - } #ifdef Py_WIN_WIDE_FILENAMES if (GetVersion() < 0x80000000) { /* On NT, so wide API available */ @@ -2010,13 +2014,13 @@ Py_FileSystemDefaultEncoding, &name, &mode, &bufsize)) - return -1; + return NULL; /* We parse again to get the name as a PyObject */ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|si:file", kwlist, &o_name, &mode, &bufsize)) - return -1; + return NULL; if (fill_file_fields(foself, NULL, o_name, mode, fclose) == NULL) @@ -2026,10 +2030,11 @@ goto Error; foself->f_setbuf = NULL; PyFile_SetBufSize(self, bufsize); + ret = self; goto Done; Error: - ret = -1; + ret = NULL; /* fall through */ Done: PyMem_Free(name); /* free the encoded string */ @@ -2096,7 +2101,7 @@ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ - file_init, /* tp_init */ + 0, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ file_new, /* tp_new */ PyObject_Del, /* tp_free */ Modified: python/branches/bcannon-objcap/Python/bltinmodule.c ============================================================================== --- python/branches/bcannon-objcap/Python/bltinmodule.c (original) +++ python/branches/bcannon-objcap/Python/bltinmodule.c Wed Aug 30 23:52:22 2006 @@ -1341,16 +1341,29 @@ Return the octal representation of an integer or long integer."); -static PyObject * -builtin_open(PyObject *self, PyObject *args, PyObject *kwds) -{ - return PyObject_Call((PyObject*)&PyFile_Type, args, kwds); -} +/* PyFile_UnsafeOpen() used as open(). */ -PyDoc_STRVAR(open_doc, -"open(name[, mode[, buffering]]) -> file object\n\ -\n\ -Open a file using the file() type, returns a file object."); +PyDoc_VAR(open_doc) = +PyDoc_STR( +"file(name[, mode[, buffering]]) -> file object\n" +"\n" +"Open a file. The mode can be 'r', 'w' or 'a' for reading (default),\n" +"writing or appending. The file will be created if it doesn't exist\n" +"when opened for writing or appending; it will be truncated when\n" +"opened for writing. Add a 'b' to the mode for binary files.\n" +"Add a '+' to the mode to allow simultaneous reading and writing.\n" +"If the buffering argument is given, 0 means unbuffered, 1 means line\n" +"buffered, and larger numbers specify the buffer size.\n" +) +PyDoc_STR( +"Add a 'U' to mode to open the file for input with universal newline\n" +"support. Any line ending in the input file will be seen as a '\\n'\n" +"in Python. Also, a file so opened gains the attribute 'newlines';\n" +"the value for this attribute is one of None (no newline read yet),\n" +"'\\r', '\\n', '\\r\\n' or a tuple containing all the newline types seen.\n" +"\n" +"'U' cannot be combined with 'w' or '+' mode.\n" +); static PyObject * @@ -2259,7 +2272,7 @@ {"max", (PyCFunction)builtin_max, METH_VARARGS | METH_KEYWORDS, max_doc}, {"min", (PyCFunction)builtin_min, METH_VARARGS | METH_KEYWORDS, min_doc}, {"oct", builtin_oct, METH_O, oct_doc}, - {"open", (PyCFunction)builtin_open, METH_VARARGS | METH_KEYWORDS, open_doc}, + {"open", (PyCFunction)PyFile_UnsafeOpen, METH_VARARGS | METH_KEYWORDS, open_doc}, {"ord", builtin_ord, METH_O, ord_doc}, {"pow", builtin_pow, METH_VARARGS, pow_doc}, {"range", builtin_range, METH_VARARGS, range_doc}, From python-checkins at python.org Thu Aug 31 00:05:49 2006 From: python-checkins at python.org (brett.cannon) Date: Thu, 31 Aug 2006 00:05:49 +0200 (CEST) Subject: [Python-checkins] r51657 - python/branches/bcannon-objcap/BRANCHNEWS python/branches/bcannon-objcap/securing_python.txt Message-ID: <20060830220549.270411E4007@bag.python.org> Author: brett.cannon Date: Thu Aug 31 00:05:48 2006 New Revision: 51657 Modified: python/branches/bcannon-objcap/BRANCHNEWS python/branches/bcannon-objcap/securing_python.txt Log: Update status with 'file' initializer removed. Modified: python/branches/bcannon-objcap/BRANCHNEWS ============================================================================== --- python/branches/bcannon-objcap/BRANCHNEWS (original) +++ python/branches/bcannon-objcap/BRANCHNEWS Thu Aug 31 00:05:48 2006 @@ -5,5 +5,17 @@ Core and builtins ----------------- +* rev. 51656: Remove initializer from 'file'. By leaving tp_new alone you can + still subclass 'file' (although its usefulness as a subclass is doubtful when + its tp_init is empty and that is what actually opens the file descriptor). + Created a new function, PyFile_UnsafeOpen() which is what the built-in open() + function is now set to. Also changed the bz2 module to use it. + + Still need to decide how to handle subclasses of 'file' so they are not + totally useless (special function that calls the needed initializer on a + 'file' object?). Also need to come up with C API that opens files through + the built-in open() instead of doing it directly so as to not bypass + security. + * rev. 51392: Introduce objcap module to hold removed functions/methods. Begin with moving object.__subclasses__(). Modified: python/branches/bcannon-objcap/securing_python.txt ============================================================================== --- python/branches/bcannon-objcap/securing_python.txt (original) +++ python/branches/bcannon-objcap/securing_python.txt Thu Aug 31 00:05:48 2006 @@ -7,11 +7,11 @@ + Remove object.__subclasses__ (`Mutable Shared State`_) [done] + Dangerous constructors (`Constructors`_) - file - * Create PyFile_InsecureOpen() + * Create PyFile_UnsafeOpen() [done] * Switch current C-level uses of 'file' constructor to - PyFile_InsecureOpen(). - + built-in open() - + bz2 module + PyFile_UnsafeOpen(). [done] + + built-in open() [done] + + bz2 module [done] * Create PyFile_Safe*() version of C API that goes through open() built-in. + Convert C strings to Python objects and do a direct From python-checkins at python.org Thu Aug 31 10:51:07 2006 From: python-checkins at python.org (armin.rigo) Date: Thu, 31 Aug 2006 10:51:07 +0200 (CEST) Subject: [Python-checkins] r51663 - python/trunk/Doc/lib/libhashlib.tex Message-ID: <20060831085107.6DE7D1E400B@bag.python.org> Author: armin.rigo Date: Thu Aug 31 10:51:06 2006 New Revision: 51663 Modified: python/trunk/Doc/lib/libhashlib.tex Log: Doc fix: hashlib objects don't always return a digest of 16 bytes. Backport candidate for 2.5. Modified: python/trunk/Doc/lib/libhashlib.tex ============================================================================== --- python/trunk/Doc/lib/libhashlib.tex (original) +++ python/trunk/Doc/lib/libhashlib.tex Thu Aug 31 10:51:06 2006 @@ -86,8 +86,8 @@ \begin{methoddesc}[hash]{digest}{} Return the digest of the strings passed to the \method{update()} -method so far. This is a 16-byte string which may contain -non-\ASCII{} characters, including null bytes. +method so far. This is a string of \member{digest_size} bytes which may +contain non-\ASCII{} characters, including null bytes. \end{methoddesc} \begin{methoddesc}[hash]{hexdigest}{} From python-checkins at python.org Thu Aug 31 14:00:44 2006 From: python-checkins at python.org (nick.coghlan) Date: Thu, 31 Aug 2006 14:00:44 +0200 (CEST) Subject: [Python-checkins] r51664 - in python/trunk: Doc/lib/libdecimal.tex Lib/decimal.py Lib/test/test_decimal.py Message-ID: <20060831120044.67F121E4007@bag.python.org> Author: nick.coghlan Date: Thu Aug 31 14:00:43 2006 New Revision: 51664 Modified: python/trunk/Doc/lib/libdecimal.tex python/trunk/Lib/decimal.py python/trunk/Lib/test/test_decimal.py Log: Fix the wrongheaded implementation of context management in the decimal module and add unit tests. (python-dev discussion is ongoing regarding what we do about Python 2.5) Modified: python/trunk/Doc/lib/libdecimal.tex ============================================================================== --- python/trunk/Doc/lib/libdecimal.tex (original) +++ python/trunk/Doc/lib/libdecimal.tex Thu Aug 31 14:00:43 2006 @@ -435,26 +435,34 @@ the \function{getcontext()} and \function{setcontext()} functions: \begin{funcdesc}{getcontext}{} - Return the current context for the active thread. + Return the current context for the active thread. \end{funcdesc} \begin{funcdesc}{setcontext}{c} - Set the current context for the active thread to \var{c}. + Set the current context for the active thread to \var{c}. \end{funcdesc} Beginning with Python 2.5, you can also use the \keyword{with} statement -to temporarily change the active context. For example the following code -increases the current decimal precision by 2 places, performs a -calculation, and then automatically restores the previous context: +to temporarily change the active context. -\begin{verbatim} -from __future__ import with_statement -import decimal - -with decimal.getcontext() as ctx: - ctx.prec += 2 # add 2 more digits of precision - calculate_something() +\begin{funcdesc}{localcontext}{\optional{c}} + Return a context manager that will set the current context for + the active thread to a copy of \var{c} on entry to the with statement + and restore the previous context when exiting the with statement. + + For example the following code increases the current decimal precision + by 2 places, performs a calculation, and then automatically restores + the previous context: +\begin{verbatim} + from __future__ import with_statement + import decimal + + with decimal.localcontext() as ctx: + ctx.prec += 2 # add 2 more digits of precision + s = calculate_something() + s = +s # Round the final result back to the default precision \end{verbatim} +\end{funcdesc} The context that's active in the body of the \keyword{with} statement is a \emph{copy} of the context you provided to the \keyword{with} Modified: python/trunk/Lib/decimal.py ============================================================================== --- python/trunk/Lib/decimal.py (original) +++ python/trunk/Lib/decimal.py Thu Aug 31 14:00:43 2006 @@ -130,8 +130,11 @@ 'ROUND_DOWN', 'ROUND_HALF_UP', 'ROUND_HALF_EVEN', 'ROUND_CEILING', 'ROUND_FLOOR', 'ROUND_UP', 'ROUND_HALF_DOWN', + # helper for context management + 'ContextManager', + # Functions for manipulating contexts - 'setcontext', 'getcontext' + 'setcontext', 'getcontext', 'localcontext' ] import copy as _copy @@ -458,6 +461,49 @@ del threading, local # Don't contaminate the namespace +def localcontext(ctx=None): + """Return a context manager for a copy of the supplied context + + Uses a copy of the current context if no context is specified + The returned context manager creates a local decimal context + in a with statement: + def sin(x): + with localcontext() as ctx: + ctx.prec += 2 + # Rest of sin calculation algorithm + # uses a precision 2 greater than normal + return +s # Convert result to normal precision + + def sin(x): + with localcontext(ExtendedContext): + # Rest of sin calculation algorithm + # uses the Extended Context from the + # General Decimal Arithmetic Specification + return +s # Convert result to normal context + + """ + # The below can't be included in the docstring until Python 2.6 + # as the doctest module doesn't understand __future__ statements + """ + >>> from __future__ import with_statement + >>> print getcontext().prec + 28 + >>> with localcontext(): + ... ctx = getcontext() + ... ctx.prec() += 2 + ... print ctx.prec + ... + 30 + >>> with localcontext(ExtendedContext): + ... print getcontext().prec + ... + 9 + >>> print getcontext().prec + 28 + """ + if ctx is None: ctx = getcontext().copy() + return ContextManager(ctx.copy()) + ##### Decimal class ########################################### @@ -2174,20 +2220,27 @@ del name, val, globalname, rounding_functions class ContextManager(object): - """Helper class to simplify Context management. + """Context manager class to support localcontext(). - Sample usage: - - with decimal.ExtendedContext: - s = ... - return +s # Convert result to normal precision - - with decimal.getcontext() as ctx: - ctx.prec += 2 - s = ... - return +s + Sets the supplied context in __enter__() and restores + the previous decimal context in __exit__() """ + # The below can't be included in the docstring until Python 2.6 + # as the doctest module doesn't understand __future__ statements + """ + Sample usage: + >>> from __future__ import with_statement + >>> print getcontext().prec + 28 + >>> ctx = Context(prec=15) + >>> with ContextManager(ctx): + ... print getcontext().prec + ... + 15 + >>> print getcontext().prec + 28 + """ def __init__(self, new_context): self.new_context = new_context def __enter__(self): @@ -2248,9 +2301,6 @@ s.append('traps=[' + ', '.join([t.__name__ for t, v in self.traps.items() if v]) + ']') return ', '.join(s) + ')' - def get_manager(self): - return ContextManager(self.copy()) - def clear_flags(self): """Reset all flags to zero""" for flag in self.flags: Modified: python/trunk/Lib/test/test_decimal.py ============================================================================== --- python/trunk/Lib/test/test_decimal.py (original) +++ python/trunk/Lib/test/test_decimal.py Thu Aug 31 14:00:43 2006 @@ -23,6 +23,7 @@ you're working through IDLE, you can import this test module and call test_main() with the corresponding argument. """ +from __future__ import with_statement import unittest import glob @@ -1064,6 +1065,43 @@ self.assertNotEqual(id(c.flags), id(d.flags)) self.assertNotEqual(id(c.traps), id(d.traps)) +class WithStatementTest(unittest.TestCase): + # Can't do these as docstrings until Python 2.6 + # as doctest can't handle __future__ statements + def test_ContextManager(self): + # The basic context manager uses the supplied context + # without making a copy of it + orig_ctx = getcontext() + new_ctx = Context() + with ContextManager(new_ctx) as enter_ctx: + set_ctx = getcontext() + final_ctx = getcontext() + self.assert_(orig_ctx is final_ctx, 'did not restore context correctly') + self.assert_(new_ctx is set_ctx, 'did not set correct context') + self.assert_(set_ctx is enter_ctx, '__enter__ returned wrong context') + + def test_localcontext(self): + # The helper function makes a copy of the supplied context + orig_ctx = getcontext() + with localcontext() as enter_ctx: + set_ctx = getcontext() + final_ctx = getcontext() + self.assert_(orig_ctx is final_ctx, 'did not restore context correctly') + self.assert_(orig_ctx is not set_ctx, 'did not copy the context') + self.assert_(set_ctx is enter_ctx, '__enter__ returned wrong context') + + def test_localcontextarg(self): + # The helper function makes a copy of the supplied context + orig_ctx = getcontext() + new_ctx = Context(prec=42) + with localcontext(new_ctx) as enter_ctx: + set_ctx = getcontext() + final_ctx = getcontext() + self.assert_(orig_ctx is final_ctx, 'did not restore context correctly') + self.assert_(set_ctx.prec == new_ctx.prec, 'did not set correct context') + self.assert_(new_ctx is not set_ctx, 'did not copy the context') + self.assert_(set_ctx is enter_ctx, '__enter__ returned wrong context') + def test_main(arith=False, verbose=None): """ Execute the tests. @@ -1084,6 +1122,7 @@ DecimalPythonAPItests, ContextAPItests, DecimalTest, + WithStatementTest, ] try: From buildbot at python.org Thu Aug 31 14:06:12 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 12:06:12 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20060831120612.B85731E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%2520Debian%2520unstable%2520trunk/builds/1151 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo,nick.coghlan BUILD FAILED: failed configure sincerely, -The Buildbot From buildbot at python.org Thu Aug 31 14:23:40 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 12:23:40 +0000 Subject: [Python-checkins] buildbot warnings in x86 gentoo trunk Message-ID: <20060831122340.C78DA1E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520gentoo%2520trunk/builds/1567 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo,nick.coghlan Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 31 14:24:26 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 12:24:26 +0000 Subject: [Python-checkins] buildbot warnings in amd64 gentoo trunk Message-ID: <20060831122426.6C0EC1E4002@bag.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%2520gentoo%2520trunk/builds/1484 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo,nick.coghlan Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 31 14:25:33 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 12:25:33 +0000 Subject: [Python-checkins] buildbot warnings in x86 W2k trunk Message-ID: <20060831122533.2F39D1E4002@bag.python.org> The Buildbot has detected a new failure of x86 W2k trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520W2k%2520trunk/builds/1474 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo,nick.coghlan Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 31 14:30:36 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 12:30:36 +0000 Subject: [Python-checkins] buildbot warnings in x86 OpenBSD trunk Message-ID: <20060831123037.0342F1E4016@bag.python.org> The Buildbot has detected a new failure of x86 OpenBSD trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520OpenBSD%2520trunk/builds/1245 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo,nick.coghlan Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 31 14:40:37 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 12:40:37 +0000 Subject: [Python-checkins] buildbot warnings in x86 XP trunk Message-ID: <20060831124037.7CDED1E4009@bag.python.org> The Buildbot has detected a new failure of x86 XP trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520XP%2520trunk/builds/1415 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo,nick.coghlan Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 31 14:43:21 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 12:43:21 +0000 Subject: [Python-checkins] buildbot warnings in g4 osx.4 trunk Message-ID: <20060831124321.73D3C1E4007@bag.python.org> The Buildbot has detected a new failure of g4 osx.4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/g4%2520osx.4%2520trunk/builds/1409 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo,nick.coghlan Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 31 14:44:14 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 12:44:14 +0000 Subject: [Python-checkins] buildbot warnings in sparc solaris10 gcc trunk Message-ID: <20060831124414.F3A8B1E4002@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520solaris10%2520gcc%2520trunk/builds/1423 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo,nick.coghlan Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 31 14:50:48 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 12:50:48 +0000 Subject: [Python-checkins] buildbot warnings in ia64 Ubuntu trunk trunk Message-ID: <20060831125048.378271E4002@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu trunk trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%2520Ubuntu%2520trunk%2520trunk/builds/72 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo,nick.coghlan Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Thu Aug 31 14:51:25 2006 From: python-checkins at python.org (nick.coghlan) Date: Thu, 31 Aug 2006 14:51:25 +0200 (CEST) Subject: [Python-checkins] r51665 - python/trunk/Lib/test/test_contextlib.py Message-ID: <20060831125125.918991E4007@bag.python.org> Author: nick.coghlan Date: Thu Aug 31 14:51:25 2006 New Revision: 51665 Modified: python/trunk/Lib/test/test_contextlib.py Log: Remove the old decimal context management tests from test_contextlib (guess who didn't run the test suite before committing...) Modified: python/trunk/Lib/test/test_contextlib.py ============================================================================== --- python/trunk/Lib/test/test_contextlib.py (original) +++ python/trunk/Lib/test/test_contextlib.py Thu Aug 31 14:51:25 2006 @@ -330,32 +330,6 @@ return True self.boilerPlate(lock, locked) -class DecimalContextTestCase(unittest.TestCase): - - # XXX Somebody should write more thorough tests for this - - def testBasic(self): - ctx = decimal.getcontext() - orig_context = ctx.copy() - try: - ctx.prec = save_prec = decimal.ExtendedContext.prec + 5 - with decimal.ExtendedContext.get_manager(): - self.assertEqual(decimal.getcontext().prec, - decimal.ExtendedContext.prec) - self.assertEqual(decimal.getcontext().prec, save_prec) - try: - with decimal.ExtendedContext.get_manager(): - self.assertEqual(decimal.getcontext().prec, - decimal.ExtendedContext.prec) - 1/0 - except ZeroDivisionError: - self.assertEqual(decimal.getcontext().prec, save_prec) - else: - self.fail("Didn't raise ZeroDivisionError") - finally: - decimal.setcontext(orig_context) - - # This is needed to make the test actually run under regrtest.py! def test_main(): run_suite( From buildbot at python.org Thu Aug 31 15:00:39 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 13:00:39 +0000 Subject: [Python-checkins] buildbot warnings in S-390 Debian trunk Message-ID: <20060831130039.6A0ED1E4011@bag.python.org> The Buildbot has detected a new failure of S-390 Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/S-390%2520Debian%2520trunk/builds/359 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo,nick.coghlan Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 31 15:05:18 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 13:05:18 +0000 Subject: [Python-checkins] buildbot warnings in x86 Ubuntu dapper (icc) trunk Message-ID: <20060831130518.99CC41E4002@bag.python.org> The Buildbot has detected a new failure of x86 Ubuntu dapper (icc) trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520Ubuntu%2520dapper%2520%2528icc%2529%2520trunk/builds/933 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo,nick.coghlan Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 31 15:18:28 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 13:18:28 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060831131829.093721E4002@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/74 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo,nick.coghlan Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 31 18:51:51 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 16:51:51 +0000 Subject: [Python-checkins] buildbot warnings in sparc Ubuntu dapper trunk Message-ID: <20060831165151.3DD511E4002@bag.python.org> The Buildbot has detected a new failure of sparc Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%2520Ubuntu%2520dapper%2520trunk/builds/676 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: armin.rigo,nick.coghlan Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Thu Aug 31 19:34:30 2006 From: python-checkins at python.org (georg.brandl) Date: Thu, 31 Aug 2006 19:34:30 +0200 (CEST) Subject: [Python-checkins] r51666 - peps/trunk/pep-3099.txt Message-ID: <20060831173430.83BED1E4002@bag.python.org> Author: georg.brandl Date: Thu Aug 31 19:34:30 2006 New Revision: 51666 Modified: peps/trunk/pep-3099.txt Log: No messing around with zip(). Modified: peps/trunk/pep-3099.txt ============================================================================== --- peps/trunk/pep-3099.txt (original) +++ peps/trunk/pep-3099.txt Thu Aug 31 19:34:30 2006 @@ -140,9 +140,16 @@ Thread: "No Container Literals", http://mail.python.org/pipermail/python-3000/2006-July/002550.html + Builtins ======== +* ``zip()`` won't grow keyword arguments or other mechanisms to prevent + it from stopping at the end of the shortest sequence. + + Thread: "have zip() raise exception for sequences of different lengths", + http://mail.python.org/pipermail/python-3000/2006-August/003338.html + * ``hash()`` won't become an attribute since attributes should be cheap to compute, which isn't necessarily the case for a hash. From python-checkins at python.org Thu Aug 31 20:40:52 2006 From: python-checkins at python.org (brett.cannon) Date: Thu, 31 Aug 2006 20:40:52 +0200 (CEST) Subject: [Python-checkins] r51667 - python/branches/bcannon-objcap/securing_python.txt Message-ID: <20060831184052.EBF421E4011@bag.python.org> Author: brett.cannon Date: Thu Aug 31 20:40:52 2006 New Revision: 51667 Modified: python/branches/bcannon-objcap/securing_python.txt Log: Rework how to remove initializer of 'file' to make more flexible and keep subclasses of 'file' useful with minimal changes to them. Modified: python/branches/bcannon-objcap/securing_python.txt ============================================================================== --- python/branches/bcannon-objcap/securing_python.txt (original) +++ python/branches/bcannon-objcap/securing_python.txt Thu Aug 31 20:40:52 2006 @@ -7,11 +7,13 @@ + Remove object.__subclasses__ (`Mutable Shared State`_) [done] + Dangerous constructors (`Constructors`_) - file - * Create PyFile_UnsafeOpen() [done] + * Create PyFile_Init() from file_init() * Switch current C-level uses of 'file' constructor to - PyFile_UnsafeOpen(). [done] - + built-in open() [done] - + bz2 module [done] + use PyFile_Type.tp_new() and PyFile_Init(). + + built-in open() + + bz2 module + * Expose PyFile_Init() in objcap module so that file + subclasses are actually worth something. * Create PyFile_Safe*() version of C API that goes through open() built-in. + Convert C strings to Python objects and do a direct @@ -22,7 +24,6 @@ makes less of a performance-critical operation. + Might need to add some C code for easily accessing built-in objects. - * How to handle creating subclasses if open() only way? - code - ??? + Sandboxed versions of built-ins (`Sanitizing Built-In Types`_) From python-checkins at python.org Thu Aug 31 20:48:47 2006 From: python-checkins at python.org (brett.cannon) Date: Thu, 31 Aug 2006 20:48:47 +0200 (CEST) Subject: [Python-checkins] r51668 - in python/branches/bcannon-objcap: BRANCHNEWS Include/fileobject.h Lib/test/test_descr.py Modules/bz2module.c Objects/fileobject.c Python/bltinmodule.c Message-ID: <20060831184847.2591C1E401B@bag.python.org> Author: brett.cannon Date: Thu Aug 31 20:48:46 2006 New Revision: 51668 Modified: python/branches/bcannon-objcap/BRANCHNEWS python/branches/bcannon-objcap/Include/fileobject.h python/branches/bcannon-objcap/Lib/test/test_descr.py python/branches/bcannon-objcap/Modules/bz2module.c python/branches/bcannon-objcap/Objects/fileobject.c python/branches/bcannon-objcap/Python/bltinmodule.c Log: Revert back to rev. 51655 state to start from scratch for new approach to removing the 'file' objects initializer. Modified: python/branches/bcannon-objcap/BRANCHNEWS ============================================================================== --- python/branches/bcannon-objcap/BRANCHNEWS (original) +++ python/branches/bcannon-objcap/BRANCHNEWS Thu Aug 31 20:48:46 2006 @@ -5,17 +5,5 @@ Core and builtins ----------------- -* rev. 51656: Remove initializer from 'file'. By leaving tp_new alone you can - still subclass 'file' (although its usefulness as a subclass is doubtful when - its tp_init is empty and that is what actually opens the file descriptor). - Created a new function, PyFile_UnsafeOpen() which is what the built-in open() - function is now set to. Also changed the bz2 module to use it. - - Still need to decide how to handle subclasses of 'file' so they are not - totally useless (special function that calls the needed initializer on a - 'file' object?). Also need to come up with C API that opens files through - the built-in open() instead of doing it directly so as to not bypass - security. - * rev. 51392: Introduce objcap module to hold removed functions/methods. Begin with moving object.__subclasses__(). Modified: python/branches/bcannon-objcap/Include/fileobject.h ============================================================================== --- python/branches/bcannon-objcap/Include/fileobject.h (original) +++ python/branches/bcannon-objcap/Include/fileobject.h Thu Aug 31 20:48:46 2006 @@ -45,8 +45,6 @@ PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *); PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *); -PyAPI_FUNC(PyObject *) PyFile_UnsafeOpen(PyObject *, PyObject *, PyObject *); - /* The default encoding used by the platform file system APIs If non-NULL, this is different than the default encoding for strings */ Modified: python/branches/bcannon-objcap/Lib/test/test_descr.py ============================================================================== --- python/branches/bcannon-objcap/Lib/test/test_descr.py (original) +++ python/branches/bcannon-objcap/Lib/test/test_descr.py Thu Aug 31 20:48:46 2006 @@ -2452,14 +2452,10 @@ lineno = 0 ateof = 0 - - def __init__(self, path): - self.__file = open(path) - def readline(self): if self.ateof: return "" - s = file.readline(self.__file) + s = file.readline(self) # Next line works too. # s = super(CountedInput, self).readline() self.lineno += 1 @@ -2504,7 +2500,7 @@ # note: as of Python 2.3, dict() no longer has an "items" keyword arg for constructor in (int, float, long, complex, str, unicode, - tuple, list): + tuple, list, file): try: constructor(bogus_keyword_arg=1) except TypeError: Modified: python/branches/bcannon-objcap/Modules/bz2module.c ============================================================================== --- python/branches/bcannon-objcap/Modules/bz2module.c (original) +++ python/branches/bcannon-objcap/Modules/bz2module.c Thu Aug 31 20:48:46 2006 @@ -1293,7 +1293,6 @@ static char *kwlist[] = {"filename", "mode", "buffering", "compresslevel", 0}; PyObject *name; - PyObject *file_open_args; char *mode = "r"; int buffering = -1; int compresslevel = 9; @@ -1354,10 +1353,8 @@ mode = (mode_char == 'r') ? "rb" : "wb"; - file_open_args = Py_BuildValue("Osi", name, mode, buffering); - if (!file_open_args) - goto error; - self->file = PyFile_UnsafeOpen(NULL, file_open_args, NULL); + self->file = PyObject_CallFunction((PyObject*)&PyFile_Type, "(Osi)", + name, mode, buffering); if (self->file == NULL) return -1; Modified: python/branches/bcannon-objcap/Objects/fileobject.c ============================================================================== --- python/branches/bcannon-objcap/Objects/fileobject.c (original) +++ python/branches/bcannon-objcap/Objects/fileobject.c Thu Aug 31 20:48:46 2006 @@ -273,7 +273,6 @@ return (PyObject *)f; } - PyObject * PyFile_FromFile(FILE *fp, char *name, char *mode, int (*close)(FILE *)) { @@ -1967,28 +1966,25 @@ return self; } -/* - Open a file with no regards to whether it should be allowed. - - Used as the implementation of built-in open(). -*/ -PyObject * -PyFile_UnsafeOpen(PyObject *self, PyObject *args, PyObject *kwds) +static int +file_init(PyObject *self, PyObject *args, PyObject *kwds) { - PyFileObject *foself; - PyObject *ret = NULL; + PyFileObject *foself = (PyFileObject *)self; + int ret = 0; static char *kwlist[] = {"name", "mode", "buffering", 0}; char *name = NULL; char *mode = "r"; int bufsize = -1; int wideargument = 0; - self = file_new(&PyFile_Type, args, kwds); - if (!self) - return NULL; - foself = (PyFileObject *)self; - assert(PyFile_Check(self)); + if (foself->f_fp != NULL) { + /* Have to close the existing file first. */ + PyObject *closeresult = file_close(foself); + if (closeresult == NULL) + return -1; + Py_DECREF(closeresult); + } #ifdef Py_WIN_WIDE_FILENAMES if (GetVersion() < 0x80000000) { /* On NT, so wide API available */ @@ -2014,13 +2010,13 @@ Py_FileSystemDefaultEncoding, &name, &mode, &bufsize)) - return NULL; + return -1; /* We parse again to get the name as a PyObject */ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|si:file", kwlist, &o_name, &mode, &bufsize)) - return NULL; + return -1; if (fill_file_fields(foself, NULL, o_name, mode, fclose) == NULL) @@ -2030,11 +2026,10 @@ goto Error; foself->f_setbuf = NULL; PyFile_SetBufSize(self, bufsize); - ret = self; goto Done; Error: - ret = NULL; + ret = -1; /* fall through */ Done: PyMem_Free(name); /* free the encoded string */ @@ -2101,7 +2096,7 @@ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ - 0, /* tp_init */ + file_init, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ file_new, /* tp_new */ PyObject_Del, /* tp_free */ Modified: python/branches/bcannon-objcap/Python/bltinmodule.c ============================================================================== --- python/branches/bcannon-objcap/Python/bltinmodule.c (original) +++ python/branches/bcannon-objcap/Python/bltinmodule.c Thu Aug 31 20:48:46 2006 @@ -1341,29 +1341,16 @@ Return the octal representation of an integer or long integer."); -/* PyFile_UnsafeOpen() used as open(). */ +static PyObject * +builtin_open(PyObject *self, PyObject *args, PyObject *kwds) +{ + return PyObject_Call((PyObject*)&PyFile_Type, args, kwds); +} -PyDoc_VAR(open_doc) = -PyDoc_STR( -"file(name[, mode[, buffering]]) -> file object\n" -"\n" -"Open a file. The mode can be 'r', 'w' or 'a' for reading (default),\n" -"writing or appending. The file will be created if it doesn't exist\n" -"when opened for writing or appending; it will be truncated when\n" -"opened for writing. Add a 'b' to the mode for binary files.\n" -"Add a '+' to the mode to allow simultaneous reading and writing.\n" -"If the buffering argument is given, 0 means unbuffered, 1 means line\n" -"buffered, and larger numbers specify the buffer size.\n" -) -PyDoc_STR( -"Add a 'U' to mode to open the file for input with universal newline\n" -"support. Any line ending in the input file will be seen as a '\\n'\n" -"in Python. Also, a file so opened gains the attribute 'newlines';\n" -"the value for this attribute is one of None (no newline read yet),\n" -"'\\r', '\\n', '\\r\\n' or a tuple containing all the newline types seen.\n" -"\n" -"'U' cannot be combined with 'w' or '+' mode.\n" -); +PyDoc_STRVAR(open_doc, +"open(name[, mode[, buffering]]) -> file object\n\ +\n\ +Open a file using the file() type, returns a file object."); static PyObject * @@ -2272,7 +2259,7 @@ {"max", (PyCFunction)builtin_max, METH_VARARGS | METH_KEYWORDS, max_doc}, {"min", (PyCFunction)builtin_min, METH_VARARGS | METH_KEYWORDS, min_doc}, {"oct", builtin_oct, METH_O, oct_doc}, - {"open", (PyCFunction)PyFile_UnsafeOpen, METH_VARARGS | METH_KEYWORDS, open_doc}, + {"open", (PyCFunction)builtin_open, METH_VARARGS | METH_KEYWORDS, open_doc}, {"ord", builtin_ord, METH_O, ord_doc}, {"pow", builtin_pow, METH_VARARGS, pow_doc}, {"range", builtin_range, METH_VARARGS, range_doc}, From python-checkins at python.org Thu Aug 31 20:54:26 2006 From: python-checkins at python.org (brett.cannon) Date: Thu, 31 Aug 2006 20:54:26 +0200 (CEST) Subject: [Python-checkins] r51669 - python/trunk/Objects/fileobject.c Message-ID: <20060831185426.D0A1B1E4002@bag.python.org> Author: brett.cannon Date: Thu Aug 31 20:54:26 2006 New Revision: 51669 Modified: python/trunk/Objects/fileobject.c Log: Make sure memory is properly cleaned up in file_init. Backport candidate. Modified: python/trunk/Objects/fileobject.c ============================================================================== --- python/trunk/Objects/fileobject.c (original) +++ python/trunk/Objects/fileobject.c Thu Aug 31 20:54:26 2006 @@ -2016,7 +2016,7 @@ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|si:file", kwlist, &o_name, &mode, &bufsize)) - return -1; + goto Error; if (fill_file_fields(foself, NULL, o_name, mode, fclose) == NULL) From buildbot at python.org Thu Aug 31 21:09:55 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 19:09:55 +0000 Subject: [Python-checkins] buildbot warnings in hppa Ubuntu dapper trunk Message-ID: <20060831190955.2361A1E4002@bag.python.org> The Buildbot has detected a new failure of hppa Ubuntu dapper trunk. Full details are available at: http://www.python.org/dev/buildbot/all/hppa%2520Ubuntu%2520dapper%2520trunk/builds/76 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: brett.cannon Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 31 21:17:15 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 19:17:15 +0000 Subject: [Python-checkins] buildbot warnings in x86 gentoo trunk Message-ID: <20060831191715.8611E1E400B@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%2520gentoo%2520trunk/builds/1569 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: brett.cannon Build Had Warnings: warnings test sincerely, -The Buildbot From buildbot at python.org Thu Aug 31 21:46:32 2006 From: buildbot at python.org (buildbot at python.org) Date: Thu, 31 Aug 2006 19:46:32 +0000 Subject: [Python-checkins] buildbot warnings in ia64 Ubuntu trunk trunk Message-ID: <20060831194632.B5F801E4002@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu trunk trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%2520Ubuntu%2520trunk%2520trunk/builds/74 Buildbot URL: http://www.python.org/dev/buildbot/all/ Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: brett.cannon Build Had Warnings: warnings test sincerely, -The Buildbot From python-checkins at python.org Thu Aug 31 23:47:53 2006 From: python-checkins at python.org (brett.cannon) Date: Thu, 31 Aug 2006 23:47:53 +0200 (CEST) Subject: [Python-checkins] r51671 - python/trunk/Misc/Vim/vimrc Message-ID: <20060831214753.118241E4002@bag.python.org> Author: brett.cannon Date: Thu Aug 31 23:47:52 2006 New Revision: 51671 Modified: python/trunk/Misc/Vim/vimrc Log: Fix comment about indentation level in C files. Modified: python/trunk/Misc/Vim/vimrc ============================================================================== --- python/trunk/Misc/Vim/vimrc (original) +++ python/trunk/Misc/Vim/vimrc Thu Aug 31 23:47:52 2006 @@ -19,7 +19,7 @@ " Number of spaces to use for an indent. " This will affect Ctrl-T and 'autoindent'. " Python: 4 spaces -" C: tab (8 spaces) +" C: 4 spaces au BufRead,BufNewFile *.py,*pyw set shiftwidth=4 au BufRead,BufNewFile *.c,*.h set shiftwidth=4