pike.git/
src/
operators.c
Branch:
Tag:
Non-build tags
All tags
No tags
2006-04-24
2006-04-24 11:59:35 by Henrik Grubbström (Grubba) <grubba@grubba.org>
b19198184127b82e39e07e5fb157d0791aa47573 (
14
lines) (+
12
/-
2
)
[
Show
|
Annotate
]
Branch:
7.9
Added some float checks to cast_to_int().
Rev: src/operators.c:1.208
2:
|| This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: operators.c,v 1.
207
2006/
03
/
25
12
:
45
:
51
grubba Exp $
+
|| $Id: operators.c,v 1.
208
2006/
04
/
24
11
:
59
:
35
grubba Exp $
*/ #include "global.h"
261:
break; case T_FLOAT:
-
{
+
if (
+
#ifdef HAVE_ISINF
+
isinf(sp[-1].u.float_number) ||
+
#endif
+
#ifdef HAVE_ISNAN
+
isnan(sp[-1].u.float_number) ||
+
#endif
+
0)
{
+
Pike_error("Can't cast inifinites or NaN to int.\n");
+
} else {
int i=DO_NOT_WARN((int)(sp[-1].u.float_number)); #ifdef AUTO_BIGNUM if((i < 0 ? -i : i) < floor(fabs(sp[-1].u.float_number)))