[Python-checkins] CVS: python/dist/src/Objects floatobject.c,2.101,2.102
Guido van Rossum
gvanrossum@users.sourceforge.net
Wed, 24 Oct 2001 13:39:14 -0700
- Previous message: [Python-checkins] CVS: python/dist/src/Modules selectmodule.c,2.56,2.57 socketmodule.c,1.185,1.186 structmodule.c,2.50,2.51 timemodule.c,2.115,2.116
- Next message: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.241,2.242 import.c,2.188,2.189
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv18992
Modified Files:
floatobject.c
Log Message:
SF patch #474590 -- RISC OS support
Index: floatobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v
retrieving revision 2.101
retrieving revision 2.102
diff -C2 -d -r2.101 -r2.102
*** floatobject.c 2001/10/05 20:51:38 2.101
--- floatobject.c 2001/10/24 20:39:12 2.102
***************
*** 611,614 ****
--- 611,621 ----
(void)modf(x, &wholepart);
+ #ifdef RISCOS
+ /* conversion from floating to integral type would raise exception */
+ if (wholepart>LONG_MAX || wholepart<LONG_MIN) {
+ PyErr_SetString(PyExc_OverflowError, "float too large to convert");
+ return NULL;
+ }
+ #endif
/* doubles may have more bits than longs, or vice versa; and casting
to long may yield gibberish in either case. What really matters
- Previous message: [Python-checkins] CVS: python/dist/src/Modules selectmodule.c,2.56,2.57 socketmodule.c,1.185,1.186 structmodule.c,2.50,2.51 timemodule.c,2.115,2.116
- Next message: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.241,2.242 import.c,2.188,2.189
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]