summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/C/lapack-aux.h
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Internal/C/lapack-aux.h')
-rw-r--r--packages/base/src/Internal/C/lapack-aux.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/base/src/Internal/C/lapack-aux.h b/packages/base/src/Internal/C/lapack-aux.h
index b38ca7a..e0dd5f6 100644
--- a/packages/base/src/Internal/C/lapack-aux.h
+++ b/packages/base/src/Internal/C/lapack-aux.h
@@ -88,3 +88,24 @@ typedef short ftnlen;
88#define AT(m,i,j) (m##p[(i)*m##Xr + (j)*m##Xc]) 88#define AT(m,i,j) (m##p[(i)*m##Xr + (j)*m##Xc])
89#define TRAV(m,i,j) int i,j; for (i=0;i<m##r;i++) for (j=0;j<m##c;j++) 89#define TRAV(m,i,j) int i,j; for (i=0;i<m##r;i++) for (j=0;j<m##c;j++)
90 90
91/********************************************************/
92
93inline
94int mod (int a, int b) {
95 int m = a % b;
96 if (b>0) {
97 return m >=0 ? m : m+b;
98 } else {
99 return m <=0 ? m : m+b;
100 }
101}
102
103inline
104int64_t mod_l (int64_t a, int64_t b) {
105 int64_t m = a % b;
106 if (b>0) {
107 return m >=0 ? m : m+b;
108 } else {
109 return m <=0 ? m : m+b;
110 }
111}