Changeset 68e012 in git
- Timestamp:
- May 7, 2014, 5:31:21 PM (10 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 83ce221ff06900901bec39d172e89083a2a00b8f
- Parents:
- db307034db2dde8aab44eb52538a2043154907c5
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2014-05-07 17:31:21+02:00
- git-committer:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2014-05-07 19:22:55+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/bigintm/bigintm.cc
rdb3070 r68e012 15 15 #include <Singular/ipshell.h> 16 16 17 #include <Singular/ipid.h> 17 #include <Singular/ipid.h> 18 18 // extern coeffs coeffs_BIGINT 19 19 … … 47 47 { 48 48 assume( l->Typ() == bigintm_type_id ); 49 49 50 50 // blackbox *ll=getBlackboxStuff(l->Typ()); 51 51 52 52 if (r->Typ()>MAX_TOK) 53 53 { … … 55 55 { 56 56 // blackbox *rr=getBlackboxStuff(r->Typ()); 57 57 58 58 if (l->Data()!=NULL) { number n1=(number)l->Data(); n_Delete(&n1,coeffs_BIGINT); } 59 59 number n2=(number)r->CopyD(); … … 92 92 else 93 93 Werror("assign %d = %d",l->Typ(),r->Typ()); 94 94 95 95 return TRUE; 96 96 } … … 109 109 } 110 110 */ 111 111 112 112 if( op=='(' ) // <bigintm> VAR(); 113 113 { 114 114 Werror("bigintm_Op1: What do you mean by '<bigintm>()'?!"); 115 return TRUE; 115 return TRUE; 116 116 } 117 117 … … 127 127 // interpreter: a1 is ist bigintm 128 128 assume( a1->Typ() == bigintm_type_id ); 129 129 130 130 // blackbox *a=getBlackboxStuff(a1->Typ()); 131 number n1=(number)a1->Data(); 131 number n1=(number)a1->Data(); 132 132 switch(op) 133 133 { … … 144 144 else if (a2->Typ()==a1->Typ()) 145 145 { 146 number n2=(number)a2->Data(); 146 number n2=(number)a2->Data(); 147 147 number n=n_Add(n1,n2, coeffs_BIGINT); 148 148 res->data=(void *)n; … … 152 152 153 153 Werror("bigintm_Op2: Op: '+': Sorry unsupported 2nd argument-type: %s in", Tok2Cmdname(a2->Typ())); 154 return WrongOp("bigintm_Op2", op, a1);154 return TRUE; 155 155 } 156 156 … … 167 167 else if (a2->Typ()==a1->Typ()) 168 168 { 169 number n2=(number)a2->Data(); 169 number n2=(number)a2->Data(); 170 170 number n=n_Sub(n1,n2, coeffs_BIGINT); 171 171 res->data=(void *)n; … … 173 173 return FALSE; 174 174 } 175 175 176 176 Werror("bigintm_Op2: Op: '-': Sorry unsupported 2nd argument-type: %s in", Tok2Cmdname(a2->Typ())); 177 WrongOp("bigintm_Op2", op, a1);178 177 return TRUE; 179 178 } … … 192 191 else if (a2->Typ()==a1->Typ()) 193 192 { 194 number n2=(number)a2->Data(); 193 number n2=(number)a2->Data(); 195 194 number n=n_Mult(n1,n2, coeffs_BIGINT); 196 195 res->data=(void *)n; … … 199 198 } 200 199 Werror("bigintm_Op2: Op: '*': Sorry unsupported 2nd argument-type: '%s' in", Tok2Cmdname(a2->Typ())); 201 WrongOp("bigintm_Op2", op, a1);202 200 return TRUE; 203 201 } … … 207 205 { 208 206 Werror("bigintm_Op2: What du you mean by '<bigintm>(...%s...)'?!", Tok2Cmdname(a2->Typ())); 209 return TRUE; 207 return TRUE; 210 208 } 211 209 */ … … 227 225 else if (a2->Typ()==a1->Typ()) 228 226 { 229 number n2=(number)a2->Data(); 227 number n2=(number)a2->Data(); 230 228 res->data=(void *) (long) n_Equal(n1,n2, coeffs_BIGINT); 231 229 res->rtyp= INT_CMD; … … 234 232 235 233 Werror("bigintm_Op2: Op: '==': Sorry unsupported 2nd argument-type: '%s' in", Tok2Cmdname(a2->Typ())); 236 WrongOp("bigintm_Op2", op, a1);237 234 return TRUE; 238 235 } … … 243 240 if (a2->name==NULL) 244 241 { 245 Werror("bigintm_Op2: Op: '.': 2nd argument-type: '%s'(%d) should be a NAME", Tok2Cmdname(a2->Typ()), a2->Typ()); 242 Werror("bigintm_Op2: Op: '.': 2nd argument-type: '%s'(%d) should be a NAME", Tok2Cmdname(a2->Typ()), a2->Typ()); 246 243 return TRUE; 247 244 } 248 249 Werror("bigintm_Op2: Op: '.': 2nd argument-type: '%s'(%d) is called '%s' in ", Tok2Cmdname(a2->Typ()), a2->Typ(), a2->name); 245 246 Werror("bigintm_Op2: Op: '.': 2nd argument-type: '%s'(%d) is called '%s' in ", Tok2Cmdname(a2->Typ()), a2->Typ(), a2->name); 250 247 return blackboxDefaultOp2(op,res,a1,a2); 251 return TRUE;252 248 } 253 249 254 250 default: 255 {256 WrongOp("bigintm_Op2", op, a1);257 251 return blackboxDefaultOp2(op,res,a1,a2); 258 break;259 }260 252 } 261 253 } … … 279 271 { 280 272 Werror("bigintm_OpM: What do you mean by '<bigintm>(...)'?!"); 281 return TRUE; 282 } 283 273 return TRUE; 274 } 275 284 276 default: 285 WrongOp("bigintm_OpM", op, args); 286 break; 287 } 288 return blackbox_default_OpM(op, res, args); 277 return blackbox_default_OpM(op, res, args); 278 } 279 return TRUE; 289 280 } 290 281 … … 333 324 334 325 return FALSE; // ok, TRUE = error! 335 } else 326 } 327 else 336 328 { 337 329 Werror("bigintm_setup: Sorry should NOT be run twice!");
Note: See TracChangeset
for help on using the changeset viewer.