Repository: Zuzu-Typ/PyGLM (language: python)

Issue:
Additional vector operators
I'm hitting you with another request right away.

A few vector operators that would be useful to have are missing:
- `ivec // ivec`
  Note that this is not equivalent to ```ivec / ivec```! The former should floor while the latter truncates towards zero:
  ```python3
  >>> ivec2(-3,-3) / 2
  ivec2(-1,-1)
  >>> -3 // 2
  -2
  ```
- `bvec & bvec` (`bvec and bvec` does work)
- `bvec | bvec` (`bvec or bvec` does work)
- `bvec ^ bvec` (there is no single-operator alternative)

Could you add support for these operators?


Discussion / hints:

Fix patch:
diff --git a/PyGLM/type_methods/mvec.h b/PyGLM/type_methods/mvec.h
index 174b22b..88697bc 100644
--- a/PyGLM/type_methods/mvec.h
+++ b/PyGLM/type_methods/mvec.h
@@ -6,6 +6,8 @@
 
 #include "../types/mvec/all.h"
 
+#include "vec.h"
+
 static void
 mvec_dealloc(PyObject* self)
 {
@@ -222,6 +224,49 @@ mvec_div(PyObject *obj1, PyObject *obj2)
 	return  pack_vec<L, T>(o / o2);
 }
 
+template<int L, typename T>
+static PyObject *
+imvec_floordiv(PyObject *obj1, PyObject *obj2)
+{
+	if (PyGLM_Number_Check(obj1)) { // obj1 is a scalar, obj2 is self
+		PyObject* temp = pack_vec(glm::vec<L, T>(PyGLM_Number_FromPyObject<T>(obj1)));
+		PyObject* result = imvec_floordiv<L, T>(temp, obj2);
+		Py_DECREF(temp);
+		return result;
+	}
+
+	if (PyGLM_Number_Check(obj2)) { // obj2 is a scalar, obj1 is self
+		PyObject* temp = pack_vec(glm::vec<L, T>(PyGLM_Number_FromPyObject<T>(obj2)));
+		PyObject* result = imvec_floordiv<L, T>(obj1, temp);
+		Py_DECREF(temp);
+		return result;
+	}
+
+	PyGLM_PTI_Init0(obj1, (get_vec_PTI_info<L, T>()));
+
+	if (PyGLM_PTI_IsNone(0)) { // obj1 is not supported.
+		PyGLM_TYPEERROR_O("unsupported operand type(s) for /: 'glm.vec' and ", obj1);
+		return NULL;
+	}
+
+	glm::vec<L, T> o = PyGLM_Vec_PTI_Get0(L, T, obj1);
+
+	PyGLM_PTI_Init1(obj2, (get_vec_PTI_info<L, T>()));
+
+	if (PyGLM_PTI_IsNone(1)) { // obj1 is self, obj2 is something else
+		Py_RETURN_NOTIMPLEMENTED;
+	}
+
+	glm::vec<L, T> o2 = PyGLM_Vec_PTI_Get1(L, T, obj2);
+
+	if (!glm::all((glm::vec<L, bool>)o2)) {
+		PyGLM_ZERO_DIVISION_ERROR_T(T);
+	}
+
+	// obj1 and obj2 can be interpreted as a mvec
+	return  pack_vec<L, T>(ivec_floordivmod(o, o2));
+}
+
 template<int L, typename T>
 static PyObject *
 mvec_mod(PyObject *obj1, PyObject *obj2)
@@ -683,6 +728,21 @@ mvec_ifloordiv(mvec<L, T> *self, PyObject *obj)
 	return (PyObject*)self;
 }
 
+template<int L, typename T>
+static PyObject *
+imvec_ifloordiv(mvec<L, T> *self, PyObject *obj)
+{
+	vec<L, T> * temp = (vec<L, T>*)imvec_floordiv<L, T>((PyObject*)self, obj);
+
+	if (Py_IS_NOTIMPLEMENTED(temp)) return (PyObject*)temp;
+
+	*self->super_type = temp->super_type;
+
+	Py_DECREF(temp);
+	Py_INCREF(self);
+	return (PyObject*)self;
+}
+
 template<int L, typename T>
 static PyObject*
 mvec_imatmul(mvec<L, T>* self, PyObject* obj)
diff --git a/PyGLM/type_methods/vec.h b/PyGLM/type_methods/vec.h
index e13157b..9f9678d 100644
--- a/PyGLM/type_methods/vec.h
+++ b/PyGLM/type_methods/vec.h
@@ -719,6 +719,70 @@ vec_div(PyObject *obj1, PyObject *obj2)
 	return  pack_vec<L, T>(o / o2);
 }
 
+template<int L, typename T>
+static glm::vec<L, T>
+ivec_floordivmod(glm::vec<L, T> a, glm::vec<L, T> b) {
+	const glm::vec<L, T> u = glm::abs(a);
+	const glm::vec<L, T> v = glm::abs(b);
+
+	glm::vec<L, T> result;
+
+	for (int i = 0; i < L; i++) {
+		T q = u[i] / v[i];
+		T r = u[i] % v[i];
+		if ((a[i] < 0) != (b[i] < 0)) {
+			result[i] = -(q + (r > 0));
+		} else {
+			result[i] = q;
+		}
+	}
+
+	return result;
+}
+
+template<int L, typename T>
+static PyObject *
+ivec_floordiv(PyObject *obj1, PyObject *obj2)
+{
+	if (PyGLM_Number_Check(obj1)) { // obj1 is a scalar, obj2 is self
+		PyObject* temp = pack_vec(glm::vec<L, T>(PyGLM_Number_FromPyObject<T>(obj1)));
+		PyObject* result = ivec_floordiv<L, T>(temp, obj2);
+		Py_DECREF(temp);
+		return result;
+	}
+
+	if (PyGLM_Number_Check(obj2)) { // obj1 is self, obj2 is a scalar
+		PyObject* temp = pack_vec(glm::vec<L, T>(PyGLM_Number_FromPyObject<T>(obj2)));
+		PyObject* result = ivec_floordiv<L, T>(obj1, temp);
+		Py_DECREF(temp);
+		return result;
+	}
+
+	PyGLM_PTI_Init0(obj1, (get_vec_PTI_info<L, T>()));
+
+	if (PyGLM_PTI_IsNone(0)) { // obj1 is not supported.
+		PyGLM_TYPEERROR_O("unsupported operand type(s) for /: 'glm.vec' and ", obj1);
+		return NULL;
+	}
+
+	glm::vec<L, T> o = PyGLM_Vec_PTI_Get0(L, T, obj1);
+
+	PyGLM_PTI_Init1(obj2, (get_vec_PTI_info<L, T>()));
+
+	if (PyGLM_PTI_IsNone(1)) { // obj1 is self, obj2 is something else
+		Py_RETURN_NOTIMPLEMENTED;
+	}
+
+	glm::vec<L, T> o2 = PyGLM_Vec_PTI_Get1(L, T, obj2);
+
+	if (!glm::all((glm::vec<L, bool>)o2)) {
+		PyGLM_ZERO_DIVISION_ERROR_T(T);
+	}
+
+	// obj1 and obj2 can be interpreted as a vec
+	return  pack_vec<L, T>(ivec_floordivmod<L, T>(o, o2));
+}
+
 template<int L>
 static inline glm::vec<L, float>
 vec_mod_f(glm::vec<L, float> a, glm::vec<L, float> b) {
@@ -1234,6 +1298,21 @@ vec_ifloordiv(vec<L, T> *self, PyObject *obj)
 	return (PyObject*)self;
 }
 
+template<int L, typename T>
+static PyObject *
+ivec_ifloordiv(vec<L, T> *self, PyObject *obj)
+{
+	vec<L, T> * temp = (vec<L, T>*)ivec_floordiv<L, T>((PyObject*)self, obj);
+
+	if (Py_IS_NOTIMPLEMENTED(temp)) return (PyObject*)temp;
+
+	self->super_type = temp->super_type;
+
+	Py_DECREF(temp);
+	Py_INCREF(self);
+	return (PyObject*)self;
+}
+
 template<int L, typename T>
 static PyObject*
 vec_imatmul(vec<L, T>* self, PyObject* obj)
diff --git a/PyGLM/types/mvec/forward_declarations.h b/PyGLM/types/mvec/forward_declarations.h
index ccb32a4..56e436e 100644
--- a/PyGLM/types/mvec/forward_declarations.h
+++ b/PyGLM/types/mvec/forward_declarations.h
@@ -122,9 +122,15 @@ static PyObject * mvec_floordiv(PyObject *obj1, PyObject *obj2);
 template<int L, typename T>
 static PyObject * mvec_div(PyObject *obj1, PyObject *obj2);
 
+template<int L, typename T>
+static PyObject* imvec_floordiv(PyObject* obj1, PyObject* obj2);
+
 template<int L, typename T>
 static PyObject * mvec_ifloordiv(mvec<L, T>* self, PyObject *obj);
 
+template<int L, typename T>
+static PyObject* imvec_ifloordiv(mvec<L, T>* self, PyObject* obj);
+
 template<int L, typename T>
 static PyObject * mvec_idiv(mvec<L, T>* self, PyObject *obj);
 
diff --git a/PyGLM/types/mvec/int/mvec2.h b/PyGLM/types/mvec/int/mvec2.h
index e74a733..b4199d5 100644
--- a/PyGLM/types/mvec/int/mvec2.h
+++ b/PyGLM/types/mvec/int/mvec2.h
@@ -60,9 +60,9 @@ static PyNumberMethods himvec2NumMethods = {
 	(binaryfunc)mvec_iand<2, glm::i32>, //nb_inplace_and
 	(binaryfunc)mvec_ixor<2, glm::i32>, //nb_inplace_xor
 	(binaryfunc)mvec_ior<2, glm::i32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)imvec_floordiv<2, glm::i32>, //nb_floor_divide
 	(binaryfunc)mvec_div<2, glm::i32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)imvec_ifloordiv<2, glm::i32>, //nb_inplace_floor_divide
 	(binaryfunc)mvec_idiv<2, glm::i32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)mvec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/mvec/int/mvec3.h b/PyGLM/types/mvec/int/mvec3.h
index 54473d8..21c8ccc 100644
--- a/PyGLM/types/mvec/int/mvec3.h
+++ b/PyGLM/types/mvec/int/mvec3.h
@@ -60,9 +60,9 @@ static PyNumberMethods himvec3NumMethods = {
 	(binaryfunc)mvec_iand<3, glm::i32>, //nb_inplace_and
 	(binaryfunc)mvec_ixor<3, glm::i32>, //nb_inplace_xor
 	(binaryfunc)mvec_ior<3, glm::i32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)imvec_floordiv<3, glm::i32>, //nb_floor_divide
 	(binaryfunc)mvec_div<3, glm::i32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)imvec_ifloordiv<3, glm::i32>, //nb_inplace_floor_divide
 	(binaryfunc)mvec_idiv<3, glm::i32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)mvec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/mvec/int/mvec4.h b/PyGLM/types/mvec/int/mvec4.h
index 227a48d..12e7a6f 100644
--- a/PyGLM/types/mvec/int/mvec4.h
+++ b/PyGLM/types/mvec/int/mvec4.h
@@ -60,9 +60,9 @@ static PyNumberMethods himvec4NumMethods = {
 	(binaryfunc)mvec_iand<4, glm::i32>, //nb_inplace_and
 	(binaryfunc)mvec_ixor<4, glm::i32>, //nb_inplace_xor
 	(binaryfunc)mvec_ior<4, glm::i32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)imvec_floordiv<4, glm::i32>, //nb_floor_divide
 	(binaryfunc)mvec_div<4, glm::i32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)imvec_ifloordiv<4, glm::i32>, //nb_inplace_floor_divide
 	(binaryfunc)mvec_idiv<4, glm::i32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)mvec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/mvec/uint/mvec2.h b/PyGLM/types/mvec/uint/mvec2.h
index 367bd2d..78ea0f8 100644
--- a/PyGLM/types/mvec/uint/mvec2.h
+++ b/PyGLM/types/mvec/uint/mvec2.h
@@ -60,9 +60,9 @@ static PyNumberMethods humvec2NumMethods = {
 	(binaryfunc)mvec_iand<2, glm::u32>, //nb_inplace_and
 	(binaryfunc)mvec_ixor<2, glm::u32>, //nb_inplace_xor
 	(binaryfunc)mvec_ior<2, glm::u32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)mvec_div<2, glm::u32>, //nb_floor_divide
 	(binaryfunc)mvec_div<2, glm::u32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)mvec_idiv<2, glm::u32>, //nb_inplace_floor_divide
 	(binaryfunc)mvec_idiv<2, glm::u32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)mvec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/mvec/uint/mvec3.h b/PyGLM/types/mvec/uint/mvec3.h
index 217baf1..d5b3364 100644
--- a/PyGLM/types/mvec/uint/mvec3.h
+++ b/PyGLM/types/mvec/uint/mvec3.h
@@ -60,9 +60,9 @@ static PyNumberMethods humvec3NumMethods = {
 	(binaryfunc)mvec_iand<3, glm::u32>, //nb_inplace_and
 	(binaryfunc)mvec_ixor<3, glm::u32>, //nb_inplace_xor
 	(binaryfunc)mvec_ior<3, glm::u32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)mvec_div<3, glm::u32>, //nb_floor_divide
 	(binaryfunc)mvec_div<3, glm::u32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)mvec_idiv<3, glm::u32>, //nb_inplace_floor_divide
 	(binaryfunc)mvec_idiv<3, glm::u32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)mvec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/mvec/uint/mvec4.h b/PyGLM/types/mvec/uint/mvec4.h
index 914fb38..7c7d28c 100644
--- a/PyGLM/types/mvec/uint/mvec4.h
+++ b/PyGLM/types/mvec/uint/mvec4.h
@@ -60,9 +60,9 @@ static PyNumberMethods humvec4NumMethods = {
 	(binaryfunc)mvec_iand<4, glm::u32>, //nb_inplace_and
 	(binaryfunc)mvec_ixor<4, glm::u32>, //nb_inplace_xor
 	(binaryfunc)mvec_ior<4, glm::u32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)mvec_div<4, glm::u32>, //nb_floor_divide
 	(binaryfunc)mvec_div<4, glm::u32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)mvec_idiv<4, glm::u32>, //nb_inplace_floor_divide
 	(binaryfunc)mvec_idiv<4, glm::u32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)mvec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/bool/vec1.h b/PyGLM/types/vec/bool/vec1.h
index 2e0868d..b019ce6 100644
--- a/PyGLM/types/vec/bool/vec1.h
+++ b/PyGLM/types/vec/bool/vec1.h
@@ -49,9 +49,9 @@ static PyNumberMethods hbvec1NumMethods = {
 	0, //nb_invert
 	0, //nb_lshift
 	0, //nb_rshift
-	0, //nb_and
-	0, //nb_xor
-	0, //nb_or
+	vec_and<1, bool>, //nb_and
+	vec_xor<1, bool>, //nb_xor
+	vec_or<1, bool>, //nb_or
 	0, //nb_int
 	0, //nb_reserved
 	0, //nb_int
diff --git a/PyGLM/types/vec/bool/vec2.h b/PyGLM/types/vec/bool/vec2.h
index 5bc36c4..61aae1d 100644
--- a/PyGLM/types/vec/bool/vec2.h
+++ b/PyGLM/types/vec/bool/vec2.h
@@ -50,9 +50,9 @@ static PyNumberMethods hbvec2NumMethods = {
 	0, //nb_invert
 	0, //nb_lshift
 	0, //nb_rshift
-	0, //nb_and
-	0, //nb_xor
-	0, //nb_or
+	vec_and<2, bool>, //nb_and
+	vec_xor<2, bool>, //nb_xor
+	vec_or<2, bool>, //nb_or
 	0, //nb_int
 	0, //nb_reserved
 	0, //nb_int
diff --git a/PyGLM/types/vec/bool/vec3.h b/PyGLM/types/vec/bool/vec3.h
index d65c280..1c21c18 100644
--- a/PyGLM/types/vec/bool/vec3.h
+++ b/PyGLM/types/vec/bool/vec3.h
@@ -51,9 +51,9 @@ static PyNumberMethods hbvec3NumMethods = {
 	0, //nb_invert
 	0, //nb_lshift
 	0, //nb_rshift
-	0, //nb_and
-	0, //nb_xor
-	0, //nb_or
+	vec_and<3, bool>, //nb_and
+	vec_xor<3, bool>, //nb_xor
+	vec_or<3, bool>, //nb_or
 	0, //nb_int
 	0, //nb_reserved
 	0, //nb_int
diff --git a/PyGLM/types/vec/bool/vec4.h b/PyGLM/types/vec/bool/vec4.h
index 1ab6df0..2da0406 100644
--- a/PyGLM/types/vec/bool/vec4.h
+++ b/PyGLM/types/vec/bool/vec4.h
@@ -52,9 +52,9 @@ static PyNumberMethods hbvec4NumMethods = {
 	0, //nb_invert
 	0, //nb_lshift
 	0, //nb_rshift
-	0, //nb_and
-	0, //nb_xor
-	0, //nb_or
+	vec_and<4, bool>, //nb_and
+	vec_xor<4, bool>, //nb_xor
+	vec_or<4, bool>, //nb_or
 	0, //nb_int
 	0, //nb_reserved
 	0, //nb_int
diff --git a/PyGLM/types/vec/forward_declarations.h b/PyGLM/types/vec/forward_declarations.h
index 1d1568b..bc99fc3 100644
--- a/PyGLM/types/vec/forward_declarations.h
+++ b/PyGLM/types/vec/forward_declarations.h
@@ -153,12 +153,18 @@ static PyObject * vec_ipow(vec<L, T>* self, PyObject * obj2, PyObject * obj3);
 template<int L, typename T>
 static PyObject * vec_floordiv(PyObject *obj1, PyObject *obj2);
 
+template<int L, typename T>
+static PyObject * ivec_floordiv(PyObject *obj1, PyObject *obj2);
+
 template<int L, typename T>
 static PyObject * vec_div(PyObject *obj1, PyObject *obj2);
 
 template<int L, typename T>
 static PyObject * vec_ifloordiv(vec<L, T>* self, PyObject *obj);
 
+template<int L, typename T>
+static PyObject * ivec_ifloordiv(vec<L, T> *self, PyObject *obj);
+
 template<int L, typename T>
 static PyObject * vec_idiv(vec<L, T>* self, PyObject *obj);
 
diff --git a/PyGLM/types/vec/int16/vec1.h b/PyGLM/types/vec/int16/vec1.h
index 964bd99..d5a2558 100644
--- a/PyGLM/types/vec/int16/vec1.h
+++ b/PyGLM/types/vec/int16/vec1.h
@@ -65,9 +65,9 @@ static PyNumberMethods hi16vec1NumMethods = {
 	(binaryfunc)vec_iand<1, glm::i16>, //nb_inplace_and
 	(binaryfunc)vec_ixor<1, glm::i16>, //nb_inplace_xor
 	(binaryfunc)vec_ior<1, glm::i16>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<1, glm::i16>, //nb_floor_divide
 	(binaryfunc)vec_div<1, glm::i16>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<1, glm::i16>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<1, glm::i16>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int16/vec2.h b/PyGLM/types/vec/int16/vec2.h
index d23193b..2adfe2b 100644
--- a/PyGLM/types/vec/int16/vec2.h
+++ b/PyGLM/types/vec/int16/vec2.h
@@ -66,9 +66,9 @@ static PyNumberMethods hi16vec2NumMethods = {
 	(binaryfunc)vec_iand<2, glm::i16>, //nb_inplace_and
 	(binaryfunc)vec_ixor<2, glm::i16>, //nb_inplace_xor
 	(binaryfunc)vec_ior<2, glm::i16>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<2, glm::i16>, //nb_floor_divide
 	(binaryfunc)vec_div<2, glm::i16>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<2, glm::i16>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<2, glm::i16>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int16/vec3.h b/PyGLM/types/vec/int16/vec3.h
index 6e22cfd..ffe69e5 100644
--- a/PyGLM/types/vec/int16/vec3.h
+++ b/PyGLM/types/vec/int16/vec3.h
@@ -67,9 +67,9 @@ static PyNumberMethods hi16vec3NumMethods = {
 	(binaryfunc)vec_iand<3, glm::i16>, //nb_inplace_and
 	(binaryfunc)vec_ixor<3, glm::i16>, //nb_inplace_xor
 	(binaryfunc)vec_ior<3, glm::i16>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<3, glm::i16>, //nb_floor_divide
 	(binaryfunc)vec_div<3, glm::i16>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<3, glm::i16>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<3, glm::i16>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int16/vec4.h b/PyGLM/types/vec/int16/vec4.h
index 29b9099..18de978 100644
--- a/PyGLM/types/vec/int16/vec4.h
+++ b/PyGLM/types/vec/int16/vec4.h
@@ -68,9 +68,9 @@ static PyNumberMethods hi16vec4NumMethods = {
 	(binaryfunc)vec_iand<4, glm::i16>, //nb_inplace_and
 	(binaryfunc)vec_ixor<4, glm::i16>, //nb_inplace_xor
 	(binaryfunc)vec_ior<4, glm::i16>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<4, glm::i16>, //nb_floor_divide
 	(binaryfunc)vec_div<4, glm::i16>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<4, glm::i16>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<4, glm::i16>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int32/vec1.h b/PyGLM/types/vec/int32/vec1.h
index cfda10d..413ea1b 100644
--- a/PyGLM/types/vec/int32/vec1.h
+++ b/PyGLM/types/vec/int32/vec1.h
@@ -65,9 +65,9 @@ static PyNumberMethods hivec1NumMethods = {
 	(binaryfunc)vec_iand<1, glm::i32>, //nb_inplace_and
 	(binaryfunc)vec_ixor<1, glm::i32>, //nb_inplace_xor
 	(binaryfunc)vec_ior<1, glm::i32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<1, glm::i32>, //nb_floor_divide
 	(binaryfunc)vec_div<1, glm::i32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<1, glm::i32>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<1, glm::i32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int32/vec2.h b/PyGLM/types/vec/int32/vec2.h
index b331fb0..b86ea58 100644
--- a/PyGLM/types/vec/int32/vec2.h
+++ b/PyGLM/types/vec/int32/vec2.h
@@ -66,9 +66,9 @@ static PyNumberMethods hivec2NumMethods = {
 	(binaryfunc)vec_iand<2, glm::i32>, //nb_inplace_and
 	(binaryfunc)vec_ixor<2, glm::i32>, //nb_inplace_xor
 	(binaryfunc)vec_ior<2, glm::i32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<2, glm::i32>, //nb_floor_divide
 	(binaryfunc)vec_div<2, glm::i32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<2, glm::i32>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<2, glm::i32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int32/vec3.h b/PyGLM/types/vec/int32/vec3.h
index 8b763ed..e897111 100644
--- a/PyGLM/types/vec/int32/vec3.h
+++ b/PyGLM/types/vec/int32/vec3.h
@@ -67,9 +67,9 @@ static PyNumberMethods hivec3NumMethods = {
 	(binaryfunc)vec_iand<3, glm::i32>, //nb_inplace_and
 	(binaryfunc)vec_ixor<3, glm::i32>, //nb_inplace_xor
 	(binaryfunc)vec_ior<3, glm::i32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<3, glm::i32>, //nb_floor_divide
 	(binaryfunc)vec_div<3, glm::i32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<3, glm::i32>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<3, glm::i32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int32/vec4.h b/PyGLM/types/vec/int32/vec4.h
index 1a617e3..39a2868 100644
--- a/PyGLM/types/vec/int32/vec4.h
+++ b/PyGLM/types/vec/int32/vec4.h
@@ -68,9 +68,9 @@ static PyNumberMethods hivec4NumMethods = {
 	(binaryfunc)vec_iand<4, glm::i32>, //nb_inplace_and
 	(binaryfunc)vec_ixor<4, glm::i32>, //nb_inplace_xor
 	(binaryfunc)vec_ior<4, glm::i32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<4, glm::i32>, //nb_floor_divide
 	(binaryfunc)vec_div<4, glm::i32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<4, glm::i32>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<4, glm::i32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int64/vec1.h b/PyGLM/types/vec/int64/vec1.h
index 4735607..b211ae0 100644
--- a/PyGLM/types/vec/int64/vec1.h
+++ b/PyGLM/types/vec/int64/vec1.h
@@ -65,9 +65,9 @@ static PyNumberMethods hi64vec1NumMethods = {
 	(binaryfunc)vec_iand<1, glm::i64>, //nb_inplace_and
 	(binaryfunc)vec_ixor<1, glm::i64>, //nb_inplace_xor
 	(binaryfunc)vec_ior<1, glm::i64>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<1, glm::i64>, //nb_floor_divide
 	(binaryfunc)vec_div<1, glm::i64>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<1, glm::i64>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<1, glm::i64>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int64/vec2.h b/PyGLM/types/vec/int64/vec2.h
index 67324e8..c2f8a99 100644
--- a/PyGLM/types/vec/int64/vec2.h
+++ b/PyGLM/types/vec/int64/vec2.h
@@ -66,9 +66,9 @@ static PyNumberMethods hi64vec2NumMethods = {
 	(binaryfunc)vec_iand<2, glm::i64>, //nb_inplace_and
 	(binaryfunc)vec_ixor<2, glm::i64>, //nb_inplace_xor
 	(binaryfunc)vec_ior<2, glm::i64>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<2, glm::i64>, //nb_floor_divide
 	(binaryfunc)vec_div<2, glm::i64>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<2, glm::i64>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<2, glm::i64>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int64/vec3.h b/PyGLM/types/vec/int64/vec3.h
index da5c7b7..1fa1eaf 100644
--- a/PyGLM/types/vec/int64/vec3.h
+++ b/PyGLM/types/vec/int64/vec3.h
@@ -67,9 +67,9 @@ static PyNumberMethods hi64vec3NumMethods = {
 	(binaryfunc)vec_iand<3, glm::i64>, //nb_inplace_and
 	(binaryfunc)vec_ixor<3, glm::i64>, //nb_inplace_xor
 	(binaryfunc)vec_ior<3, glm::i64>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<3, glm::i64>, //nb_floor_divide
 	(binaryfunc)vec_div<3, glm::i64>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<3, glm::i64>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<3, glm::i64>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int64/vec4.h b/PyGLM/types/vec/int64/vec4.h
index ac77798..85bc3f6 100644
--- a/PyGLM/types/vec/int64/vec4.h
+++ b/PyGLM/types/vec/int64/vec4.h
@@ -68,9 +68,9 @@ static PyNumberMethods hi64vec4NumMethods = {
 	(binaryfunc)vec_iand<4, glm::i64>, //nb_inplace_and
 	(binaryfunc)vec_ixor<4, glm::i64>, //nb_inplace_xor
 	(binaryfunc)vec_ior<4, glm::i64>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<4, glm::i64>, //nb_floor_divide
 	(binaryfunc)vec_div<4, glm::i64>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<4, glm::i64>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<4, glm::i64>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int8/vec1.h b/PyGLM/types/vec/int8/vec1.h
index 8c4d3c4..1368f0a 100644
--- a/PyGLM/types/vec/int8/vec1.h
+++ b/PyGLM/types/vec/int8/vec1.h
@@ -65,9 +65,9 @@ static PyNumberMethods hi8vec1NumMethods = {
 	(binaryfunc)vec_iand<1, glm::i8>, //nb_inplace_and
 	(binaryfunc)vec_ixor<1, glm::i8>, //nb_inplace_xor
 	(binaryfunc)vec_ior<1, glm::i8>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<1, glm::i8>, //nb_floor_divide
 	(binaryfunc)vec_div<1, glm::i8>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<1, glm::i8>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<1, glm::i8>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int8/vec2.h b/PyGLM/types/vec/int8/vec2.h
index f88e8b0..fcc01e4 100644
--- a/PyGLM/types/vec/int8/vec2.h
+++ b/PyGLM/types/vec/int8/vec2.h
@@ -66,9 +66,9 @@ static PyNumberMethods hi8vec2NumMethods = {
 	(binaryfunc)vec_iand<2, glm::i8>, //nb_inplace_and
 	(binaryfunc)vec_ixor<2, glm::i8>, //nb_inplace_xor
 	(binaryfunc)vec_ior<2, glm::i8>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<2, glm::i8>, //nb_floor_divide
 	(binaryfunc)vec_div<2, glm::i8>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<2, glm::i8>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<2, glm::i8>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int8/vec3.h b/PyGLM/types/vec/int8/vec3.h
index cee6c36..e0d748f 100644
--- a/PyGLM/types/vec/int8/vec3.h
+++ b/PyGLM/types/vec/int8/vec3.h
@@ -67,9 +67,9 @@ static PyNumberMethods hi8vec3NumMethods = {
 	(binaryfunc)vec_iand<3, glm::i8>, //nb_inplace_and
 	(binaryfunc)vec_ixor<3, glm::i8>, //nb_inplace_xor
 	(binaryfunc)vec_ior<3, glm::i8>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<3, glm::i8>, //nb_floor_divide
 	(binaryfunc)vec_div<3, glm::i8>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<3, glm::i8>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<3, glm::i8>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/int8/vec4.h b/PyGLM/types/vec/int8/vec4.h
index a94af4a..06c25cd 100644
--- a/PyGLM/types/vec/int8/vec4.h
+++ b/PyGLM/types/vec/int8/vec4.h
@@ -68,9 +68,9 @@ static PyNumberMethods hi8vec4NumMethods = {
 	(binaryfunc)vec_iand<4, glm::i8>, //nb_inplace_and
 	(binaryfunc)vec_ixor<4, glm::i8>, //nb_inplace_xor
 	(binaryfunc)vec_ior<4, glm::i8>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)ivec_floordiv<4, glm::i8>, //nb_floor_divide
 	(binaryfunc)vec_div<4, glm::i8>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)ivec_ifloordiv<4, glm::i8>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<4, glm::i8>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint16/vec1.h b/PyGLM/types/vec/uint16/vec1.h
index 41ffc47..aa7030d 100644
--- a/PyGLM/types/vec/uint16/vec1.h
+++ b/PyGLM/types/vec/uint16/vec1.h
@@ -65,9 +65,9 @@ static PyNumberMethods hu16vec1NumMethods = {
 	(binaryfunc)vec_iand<1, glm::u16>, //nb_inplace_and
 	(binaryfunc)vec_ixor<1, glm::u16>, //nb_inplace_xor
 	(binaryfunc)vec_ior<1, glm::u16>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<1, glm::u16>, //nb_floor_divide
 	(binaryfunc)vec_div<1, glm::u16>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<1, glm::u16>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<1, glm::u16>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint16/vec2.h b/PyGLM/types/vec/uint16/vec2.h
index 448e109..7e183f2 100644
--- a/PyGLM/types/vec/uint16/vec2.h
+++ b/PyGLM/types/vec/uint16/vec2.h
@@ -66,9 +66,9 @@ static PyNumberMethods hu16vec2NumMethods = {
 	(binaryfunc)vec_iand<2, glm::u16>, //nb_inplace_and
 	(binaryfunc)vec_ixor<2, glm::u16>, //nb_inplace_xor
 	(binaryfunc)vec_ior<2, glm::u16>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<2, glm::u16>, //nb_floor_divide
 	(binaryfunc)vec_div<2, glm::u16>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<2, glm::u16>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<2, glm::u16>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint16/vec3.h b/PyGLM/types/vec/uint16/vec3.h
index 8271d33..0b8b0be 100644
--- a/PyGLM/types/vec/uint16/vec3.h
+++ b/PyGLM/types/vec/uint16/vec3.h
@@ -67,9 +67,9 @@ static PyNumberMethods hu16vec3NumMethods = {
 	(binaryfunc)vec_iand<3, glm::u16>, //nb_inplace_and
 	(binaryfunc)vec_ixor<3, glm::u16>, //nb_inplace_xor
 	(binaryfunc)vec_ior<3, glm::u16>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<3, glm::u16>, //nb_floor_divide
 	(binaryfunc)vec_div<3, glm::u16>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<3, glm::u16>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<3, glm::u16>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint16/vec4.h b/PyGLM/types/vec/uint16/vec4.h
index 25c32cc..ce7e0a1 100644
--- a/PyGLM/types/vec/uint16/vec4.h
+++ b/PyGLM/types/vec/uint16/vec4.h
@@ -68,9 +68,9 @@ static PyNumberMethods hu16vec4NumMethods = {
 	(binaryfunc)vec_iand<4, glm::u16>, //nb_inplace_and
 	(binaryfunc)vec_ixor<4, glm::u16>, //nb_inplace_xor
 	(binaryfunc)vec_ior<4, glm::u16>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<4, glm::u16>, //nb_floor_divide
 	(binaryfunc)vec_div<4, glm::u16>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<4, glm::u16>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<4, glm::u16>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint32/vec1.h b/PyGLM/types/vec/uint32/vec1.h
index 0dd0982..ad8bff7 100644
--- a/PyGLM/types/vec/uint32/vec1.h
+++ b/PyGLM/types/vec/uint32/vec1.h
@@ -65,9 +65,9 @@ static PyNumberMethods huvec1NumMethods = {
 	(binaryfunc)vec_iand<1, glm::u32>, //nb_inplace_and
 	(binaryfunc)vec_ixor<1, glm::u32>, //nb_inplace_xor
 	(binaryfunc)vec_ior<1, glm::u32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<1, glm::u32>, //nb_floor_divide
 	(binaryfunc)vec_div<1, glm::u32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<1, glm::u32>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<1, glm::u32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint32/vec2.h b/PyGLM/types/vec/uint32/vec2.h
index 2485f14..5448913 100644
--- a/PyGLM/types/vec/uint32/vec2.h
+++ b/PyGLM/types/vec/uint32/vec2.h
@@ -66,9 +66,9 @@ static PyNumberMethods huvec2NumMethods = {
 	(binaryfunc)vec_iand<2, glm::u32>, //nb_inplace_and
 	(binaryfunc)vec_ixor<2, glm::u32>, //nb_inplace_xor
 	(binaryfunc)vec_ior<2, glm::u32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<2, glm::u32>, //nb_floor_divide
 	(binaryfunc)vec_div<2, glm::u32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<2, glm::u32>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<2, glm::u32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint32/vec3.h b/PyGLM/types/vec/uint32/vec3.h
index e93b390..93f4974 100644
--- a/PyGLM/types/vec/uint32/vec3.h
+++ b/PyGLM/types/vec/uint32/vec3.h
@@ -67,9 +67,9 @@ static PyNumberMethods huvec3NumMethods = {
 	(binaryfunc)vec_iand<3, glm::u32>, //nb_inplace_and
 	(binaryfunc)vec_ixor<3, glm::u32>, //nb_inplace_xor
 	(binaryfunc)vec_ior<3, glm::u32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<3, glm::u32>, //nb_floor_divide
 	(binaryfunc)vec_div<3, glm::u32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<3, glm::u32>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<3, glm::u32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint32/vec4.h b/PyGLM/types/vec/uint32/vec4.h
index 4daad5b..dfec837 100644
--- a/PyGLM/types/vec/uint32/vec4.h
+++ b/PyGLM/types/vec/uint32/vec4.h
@@ -68,9 +68,9 @@ static PyNumberMethods huvec4NumMethods = {
 	(binaryfunc)vec_iand<4, glm::u32>, //nb_inplace_and
 	(binaryfunc)vec_ixor<4, glm::u32>, //nb_inplace_xor
 	(binaryfunc)vec_ior<4, glm::u32>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<4, glm::u32>, //nb_floor_divide
 	(binaryfunc)vec_div<4, glm::u32>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<4, glm::u32>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<4, glm::u32>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint64/vec1.h b/PyGLM/types/vec/uint64/vec1.h
index a526885..6f0140a 100644
--- a/PyGLM/types/vec/uint64/vec1.h
+++ b/PyGLM/types/vec/uint64/vec1.h
@@ -65,9 +65,9 @@ static PyNumberMethods hu64vec1NumMethods = {
 	(binaryfunc)vec_iand<1, glm::u64>, //nb_inplace_and
 	(binaryfunc)vec_ixor<1, glm::u64>, //nb_inplace_xor
 	(binaryfunc)vec_ior<1, glm::u64>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<1, glm::u64>, //nb_floor_divide
 	(binaryfunc)vec_div<1, glm::u64>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<1, glm::u64>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<1, glm::u64>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint64/vec2.h b/PyGLM/types/vec/uint64/vec2.h
index ded9b7e..564a2ed 100644
--- a/PyGLM/types/vec/uint64/vec2.h
+++ b/PyGLM/types/vec/uint64/vec2.h
@@ -66,9 +66,9 @@ static PyNumberMethods hu64vec2NumMethods = {
 	(binaryfunc)vec_iand<2, glm::u64>, //nb_inplace_and
 	(binaryfunc)vec_ixor<2, glm::u64>, //nb_inplace_xor
 	(binaryfunc)vec_ior<2, glm::u64>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<2, glm::u64>, //nb_floor_divide
 	(binaryfunc)vec_div<2, glm::u64>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<2, glm::u64>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<2, glm::u64>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint64/vec3.h b/PyGLM/types/vec/uint64/vec3.h
index 932aa2b..ba8a0da 100644
--- a/PyGLM/types/vec/uint64/vec3.h
+++ b/PyGLM/types/vec/uint64/vec3.h
@@ -67,9 +67,9 @@ static PyNumberMethods hu64vec3NumMethods = {
 	(binaryfunc)vec_iand<3, glm::u64>, //nb_inplace_and
 	(binaryfunc)vec_ixor<3, glm::u64>, //nb_inplace_xor
 	(binaryfunc)vec_ior<3, glm::u64>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<3, glm::u64>, //nb_floor_divide
 	(binaryfunc)vec_div<3, glm::u64>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<3, glm::u64>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<3, glm::u64>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint64/vec4.h b/PyGLM/types/vec/uint64/vec4.h
index 4b69f1d..fd657d3 100644
--- a/PyGLM/types/vec/uint64/vec4.h
+++ b/PyGLM/types/vec/uint64/vec4.h
@@ -68,9 +68,9 @@ static PyNumberMethods hu64vec4NumMethods = {
 	(binaryfunc)vec_iand<4, glm::u64>, //nb_inplace_and
 	(binaryfunc)vec_ixor<4, glm::u64>, //nb_inplace_xor
 	(binaryfunc)vec_ior<4, glm::u64>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<4, glm::u64>, //nb_floor_divide
 	(binaryfunc)vec_div<4, glm::u64>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<4, glm::u64>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<4, glm::u64>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint8/vec1.h b/PyGLM/types/vec/uint8/vec1.h
index e8a32d8..cbe53bb 100644
--- a/PyGLM/types/vec/uint8/vec1.h
+++ b/PyGLM/types/vec/uint8/vec1.h
@@ -65,9 +65,9 @@ static PyNumberMethods hu8vec1NumMethods = {
 	(binaryfunc)vec_iand<1, glm::u8>, //nb_inplace_and
 	(binaryfunc)vec_ixor<1, glm::u8>, //nb_inplace_xor
 	(binaryfunc)vec_ior<1, glm::u8>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<1, glm::u8>, //nb_floor_divide
 	(binaryfunc)vec_div<1, glm::u8>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<1, glm::u8>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<1, glm::u8>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint8/vec2.h b/PyGLM/types/vec/uint8/vec2.h
index ede2612..5d3dd15 100644
--- a/PyGLM/types/vec/uint8/vec2.h
+++ b/PyGLM/types/vec/uint8/vec2.h
@@ -66,9 +66,9 @@ static PyNumberMethods hu8vec2NumMethods = {
 	(binaryfunc)vec_iand<2, glm::u8>, //nb_inplace_and
 	(binaryfunc)vec_ixor<2, glm::u8>, //nb_inplace_xor
 	(binaryfunc)vec_ior<2, glm::u8>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<2, glm::u8>, //nb_floor_divide
 	(binaryfunc)vec_div<2, glm::u8>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<2, glm::u8>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<2, glm::u8>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint8/vec3.h b/PyGLM/types/vec/uint8/vec3.h
index 4d00f36..90b1eb9 100644
--- a/PyGLM/types/vec/uint8/vec3.h
+++ b/PyGLM/types/vec/uint8/vec3.h
@@ -67,9 +67,9 @@ static PyNumberMethods hu8vec3NumMethods = {
 	(binaryfunc)vec_iand<3, glm::u8>, //nb_inplace_and
 	(binaryfunc)vec_ixor<3, glm::u8>, //nb_inplace_xor
 	(binaryfunc)vec_ior<3, glm::u8>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<3, glm::u8>, //nb_floor_divide
 	(binaryfunc)vec_div<3, glm::u8>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<3, glm::u8>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<3, glm::u8>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply
diff --git a/PyGLM/types/vec/uint8/vec4.h b/PyGLM/types/vec/uint8/vec4.h
index c051500..0375498 100644
--- a/PyGLM/types/vec/uint8/vec4.h
+++ b/PyGLM/types/vec/uint8/vec4.h
@@ -68,9 +68,9 @@ static PyNumberMethods hu8vec4NumMethods = {
 	(binaryfunc)vec_iand<4, glm::u8>, //nb_inplace_and
 	(binaryfunc)vec_ixor<4, glm::u8>, //nb_inplace_xor
 	(binaryfunc)vec_ior<4, glm::u8>, //nb_inplace_or
-	0, //nb_floor_divide
+	(binaryfunc)vec_div<4, glm::u8>, //nb_floor_divide
 	(binaryfunc)vec_div<4, glm::u8>,
-	0, //nb_inplace_floor_divide
+	(binaryfunc)vec_idiv<4, glm::u8>, //nb_inplace_floor_divide
 	(binaryfunc)vec_idiv<4, glm::u8>, //nb_inplace_true_divide
 	0, //nb_index
 	(binaryfunc)vec_matmul, //nb_matrix_multiply


Test patch:
diff --git a/test/PyGLM_test.py b/test/PyGLM_test.py
index 90646da..f815211 100644
--- a/test/PyGLM_test.py
+++ b/test/PyGLM_test.py
@@ -780,6 +780,36 @@ def test_div():
             pass
 #/div #
 
+# floordiv #
+def test_int_floordiv():
+    for obj in gen_obj("#MV__iqsuIQSU"):
+        fassert(obj.__floordiv__, (1,))
+        fassert(obj.__floordiv__, (obj * 0 + 1,))
+
+    for obj in gen_obj("V__iqsuIQSU"):
+        fassert(obj.__floordiv__, (type(obj)(1),))
+
+    for obj in gen_obj("V__iqsuIQSU"):
+        try:
+            obj.__floordiv__(type(obj)(0))
+            fail(obj)
+        except ZeroDivisionError:
+            pass
+    for obj in gen_obj("P__iI"):
+        try:
+            obj.__floordiv__(obj)
+            fail(obj)
+        except ZeroDivisionError:
+            pass
+
+    for obj in gen_obj("#MV__iqsuIQSU"):
+        try:
+            obj.__floordiv__(0)
+            fail(obj)
+        except ZeroDivisionError:
+            pass
+#/floordiv #
+
 # mod #
 def test_mod():
     for obj in gen_obj("#MV__fF"):
@@ -819,21 +849,21 @@ def test_rshift():
 
 # and #
 def test_and():
-    for obj in gen_obj("#MV__iqsuIQSU"):
+    for obj in gen_obj("#MV__iqsuIQSUB"):
         fassert(obj.__and__, (1,))
         fassert(obj.__and__, (obj,))
 #/and #
 
 # or #
 def test_or():
-    for obj in gen_obj("#MV__iqsuIQSU"):
+    for obj in gen_obj("#MV__iqsuIQSUB"):
         fassert(obj.__or__, (1,))
         fassert(obj.__or__, (obj,))
 #/or #
 
 # xor #
 def test_xor():
-    for obj in gen_obj("#MV__iqsuIQSU"):
+    for obj in gen_obj("#MV__iqsuIQSUB"):
         fassert(obj.__xor__, (1,))
         fassert(obj.__xor__, (obj,))
 #/xor #
@@ -898,7 +928,7 @@ def test_imod():
 
 # ifloordiv #
 def test_ifloordiv():
-    for obj in gen_obj("#MV__fF"):
+    for obj in gen_obj("#MV__fFiqsuIQSU"):
         fassert(obj.__ifloordiv__, (1,))
 #/ifloordiv #