pike.git
/
src
/
operators.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/operators.c:1:
/*\ ||| This file a part of Pike, and is copyright by Fredrik Hubinette ||| Pike is distributed as GPL (General Public License) ||| See the files COPYING and DISCLAIMER for more information. \*/ #include <math.h> #include "global.h"
-
RCSID("$Id: operators.c,v 1.
20
1997/
10
/
11
06
:
48
:
24
hubbe Exp $");
+
RCSID("$Id: operators.c,v 1.
21
1997/
12
/
03
22
:
46
:
17
hubbe Exp $");
#include "interpret.h" #include "svalue.h" #include "multiset.h" #include "mapping.h" #include "array.h" #include "stralloc.h" #include "opcodes.h" #include "operators.h" #include "language.h" #include "pike_memory.h"
pike.git/src/operators.c:1064:
sp[-1].u.float_number /= sp[0].u.float_number; return; case T_INT: { INT32 tmp; if (sp[-1].u.integer == 0) error("Division by zero\n"); sp--;
-
tmp=sp[-1].u.integer
/
sp[0].u.integer;
-
if(
tmp
<0)
-
if(tmp
*
sp[0].u.integer
>
sp[-1].u.integer)
+
tmp=sp[-1].u.integer/sp[0].u.integer;
+
+
if(
(sp[-1].u.integer
<0)
!= (sp[0].u.integer<0))
+
if(tmp*sp[0].u.integer
!=
sp[-1].u.integer)
tmp--;
-
+
sp[-1].u.integer=tmp; return; } default: error("Bad argument 1 to divide.\n"); } } void f_divide(INT32 args)