summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/C/lapack-aux.h
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2015-08-11 10:49:13 +0200
committerAlberto Ruiz <aruiz@um.es>2015-08-11 10:49:13 +0200
commit773eeb0583dc49ab2d6725e4aae50e34e0672225 (patch)
tree1c7bdc4b76a14520e16ed41bd35e2feefcfcfdb2 /packages/base/src/Internal/C/lapack-aux.h
parent8811656fba770ba5ee6e6fe8df7b7c94300cd190 (diff)
parent6dc70f79414ded94e88755755ffa1c1d16509d9d (diff)
Merge pull request #142 from ntfrgl/master
Possible fix for #141
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}