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.
16
1997/
08
/
30
18
:
35
:
48
grubba
Exp $");
+
RCSID("$Id: operators.c,v 1.
17
1997/
09
/
12
00
:
07
:
28
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:1054:
} case T_INT: if (sp[-1].u.integer == 0) error("Modulo by zero.\n"); sp--; if(sp[-1].u.integer>=0) { if(sp[0].u.integer>=0) { sp[-1].u.integer %= sp[0].u.integer; }else{
-
sp[-1].u.integer=sp[
0
].u.integer+
(
sp[
-1
].u.integer
%
-sp[0].u.integer);
+
sp[-1].u.integer=
((
sp[
-1
].u.integer+
~
sp[
0
].u.integer
)
%-sp[0].u.integer)
-~sp[0].u.integer
;
} }else{ if(sp[0].u.integer>=0) {
-
sp[-1].u.integer=sp[0].u.
integer-
(
-
sp[-1].u.integer % sp[0].u.integer);
+
sp[-1].u.integer=sp[0].u.
integer+~
(
(~
sp[-1].u.integer
)
% sp[0].u.integer);
}else{ sp[-1].u.integer=-(-sp[-1].u.integer % -sp[0].u.integer); } } return; default: error("Bad argument 1 to modulo.\n"); } }