Changeset ffde366 in git
- Timestamp:
- Jun 13, 2006, 12:21:01 PM (18 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 92fab96123fabea4a561ea96ce147ddd6baa9dff
- Parents:
- 7523a7be6875be53eb42a20b61a5e091af63d18a
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ipconv.cc
r7523a7 rffde366 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipconv.cc,v 1. 29 2006-05-29 16:10:50 Singular Exp $ */4 /* $Id: ipconv.cc,v 1.30 2006-06-13 10:21:00 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: automatic type conversions … … 18 18 #include "numbers.h" 19 19 #include "modulop.h" 20 #include "longrat.h" 20 21 #include "longalg.h" 21 22 #include "matpol.h" … … 186 187 } 187 188 189 static void * iiN2BI(void *data) 190 { 191 number n,i; i=(number)data; 192 if (rField_is_Zp()) n=nlInit((int)(long)data); 193 else if (rField_is_Q()) 194 { 195 if ((SR_HDL(i)&SR_INT)==SR_INT) n=nlInit((int)SR_TO_INT(i)); 196 else if (i->s==3) n=nlCopy(i); 197 else { WerrorS("cannot convert to bigint"); n=nlInit(0); } 198 } 199 else { WerrorS("cannot convert to bigint"); n=nInit(0); } 200 return (void *)n; 201 } 188 202 static void * iiN2P(void *data) 189 203 { … … 281 295 // number -> matrix 282 296 { NUMBER_CMD, MATRIX_CMD, iiN2Ma , NULL }, 297 // number -> bigint 298 { NUMBER_CMD, BIGINT_CMD, iiN2P , NULL }, 283 299 // number -> ideal 284 300 // number -> vector -
Singular/mpsr.h
r7523a7 rffde366 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: mpsr.h,v 1.2 1 2005-07-28 17:25:25Singular Exp $ */4 /* $Id: mpsr.h,v 1.22 2006-06-13 10:21:01 Singular Exp $ */ 5 5 /*************************************************************** 6 6 * … … 256 256 #endif // MPSR_DEBUG 257 257 258 // those defines are from longrat.cc259 // It would be nice if we could include them, but they are not defined260 // in a header file261 262 #define SR_HDL(A) ((long)(A))263 #define INT_TO_SR(INT) ((number) (((long)INT << 2) + SR_INT))264 #define SR_TO_INT(SR) (((long)SR) >> 2)265 266 258 union nf 267 259 { -
kernel/longrat.h
r7523a7 rffde366 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: longrat.h,v 1. 3 2006-05-02 16:25:17Singular Exp $ */6 /* $Id: longrat.h,v 1.4 2006-06-13 10:21:01 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: computation with long rational numbers … … 13 13 14 14 typedef MP_INT lint; 15 16 #define SR_HDL(A) ((long)(A)) 15 17 16 18 #define SR_INT 1L
Note: See TracChangeset
for help on using the changeset viewer.