Changeset 8e56ad in git for kernel/rmodulon.h
 Timestamp:
 Jan 30, 2008, 2:03:41 PM (16 years ago)
 Branches:
 (u'spielwiese', 'e7cc1ebecb61be8b9ca6c18016352af89940b21a')
 Children:
 faa7df853a3237b63560a72ed208619df8d26215
 Parents:
 b18621d3f9473a4a76cf41af06dfefe3b7a400f5
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

kernel/rmodulon.h
rb18621 r8e56ad 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: rmodulon.h,v 1. 4 20070620 09:39:25wienand Exp $ */6 /* $Id: rmodulon.h,v 1.5 20080130 13:03:41 wienand Exp $ */ 7 7 /* 8 8 * ABSTRACT: numbers modulo n … … 14 14 #define NATNUMBER unsigned long 15 15 #endif 16 17 extern int nrnExp;18 extern NATNUMBER nrnModul;19 16 20 17 BOOLEAN nrnGreaterZero (number k); … … 51 48 void nrnInitExp(int c, ring r); 52 49 53 54 static inline number nrnMultM(number a, number b)55 {56 return (number)57 ((((NATNUMBER) a)*((NATNUMBER) b)) % ((NATNUMBER) nrnModul));58 }59 60 static inline number nrnAddM(number a, number b)61 {62 NATNUMBER r = (NATNUMBER)a + (NATNUMBER)b;63 return (number) (r >= nrnModul ? r  nrnModul : r);64 }65 66 static inline number nrnSubM(number a, number b)67 {68 return (number)((NATNUMBER)a<(NATNUMBER)b ?69 nrnModul(NATNUMBER)b+(NATNUMBER)a : (NATNUMBER)a(NATNUMBER)b);70 }71 72 #define nrnNegM(A) (number)(nrnModul(NATNUMBER)(A))73 #define nrnEqualM(A,B) ((A)==(B))74 75 50 #endif 76 51 #endif
Note: See TracChangeset
for help on using the changeset viewer.