mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
SF patch #474590 -- RISC OS support
This commit is contained in:
parent
c6ac8a78f6
commit
e2ae77b8b8
33 changed files with 256 additions and 188 deletions
|
@ -610,6 +610,13 @@ float_int(PyObject *v)
|
|||
long aslong; /* (long)wholepart */
|
||||
|
||||
(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
|
||||
is whether converting back to double again reproduces what we
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue