Base: Use std::numeric_limits and std::numbers instead of defines

This commit is contained in:
Benjamin Nauck
2025-03-27 18:59:37 +01:00
parent 81e0b408fa
commit ae686942a7
18 changed files with 97 additions and 140 deletions

View File

@@ -218,7 +218,7 @@ PyObject* MatrixPy::number_power_handler(PyObject* self, PyObject* other, PyObje
}
if (b < 0) {
if (fabs(a.determinant()) > DBL_EPSILON) {
if (fabs(a.determinant()) > std::numeric_limits<double>::epsilon()) {
a.inverseGauss();
}
else {
@@ -667,7 +667,7 @@ PyObject* MatrixPy::invert()
{
PY_TRY
{
if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON) {
if (fabs(getMatrixPtr()->determinant()) > std::numeric_limits<double>::epsilon()) {
getMatrixPtr()->inverseGauss();
Py_Return;
}
@@ -682,7 +682,7 @@ PyObject* MatrixPy::inverse()
{
PY_TRY
{
if (fabs(getMatrixPtr()->determinant()) > DBL_EPSILON) {
if (fabs(getMatrixPtr()->determinant()) > std::numeric_limits<double>::epsilon()) {
Base::Matrix4D m = *getMatrixPtr();
m.inverseGauss();
return new MatrixPy(m);