1 /*
2  * Copyright 2014      Ecole Normale Superieure
3  *
4  * Use of this software is governed by the MIT license
5  *
6  * Written by Sven Verdoolaege,
7  * Ecole Normale Superieure, 45 rue d'Ulm, 75230 Paris, France
8  */
9 
10 #include <isl_multi_macro.h>
11 
12 /* Given f, return floor(f).
13  */
MULTI(BASE)14 __isl_give MULTI(BASE) *FN(MULTI(BASE),floor)(__isl_take MULTI(BASE) *multi)
15 {
16 	int i;
17 
18 	multi = FN(MULTI(BASE),cow)(multi);
19 	if (!multi)
20 		return NULL;
21 
22 	for (i = 0; i < multi->n; ++i) {
23 		multi->u.p[i] = FN(EL,floor)(multi->u.p[i]);
24 		if (!multi->u.p[i])
25 			return FN(MULTI(BASE),free)(multi);
26 	}
27 
28 	return multi;
29 }
30