Code cleanup: use sqrtf when input and output are float

This commit is contained in:
2014-03-28 14:53:37 +11:00
parent e6e7438181
commit 7199e2288f
20 changed files with 41 additions and 39 deletions

View File

@@ -621,7 +621,7 @@ static PyObject *C_Matrix_Scale(PyObject *cls, PyObject *args)
for (x = 0; x < vec_size; x++) {
norm += tvec[x] * tvec[x];
}
norm = (float) sqrt(norm);
norm = sqrtf(norm);
for (x = 0; x < vec_size; x++) {
tvec[x] /= norm;
}
@@ -742,7 +742,7 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args)
for (x = 0; x < vec_size; x++) {
norm += tvec[x] * tvec[x];
}
norm = (float) sqrt(norm);
norm = sqrtf(norm);
for (x = 0; x < vec_size; x++) {
tvec[x] /= norm;
}