`
template
qbVector qbVector::Normalized()
{
// Compute the vector norm.
T vecNorm = this->norm();
// Compute the normalized version of the vector.
qbVector<T> result(m_vectorData);
return result * (static_cast<T>(1.0) / vecNorm);
}
`
In case type T is substituted to int, the decimal part of 1.0 will be left out. vecNorm is T type as well, and in case this is int, the overall result will be 0.
Would you like me to create a branch, which will solve this issue?
Function Normalize could have the issue of two integer division. Specifically, line: 158 in file https://github.com/QuantitativeBytes/qbLinAlg/blob/main/qbVector.h.
` template
qbVector qbVector::Normalized()
{
// Compute the vector norm.
T vecNorm = this->norm();
} `
In case type T is substituted to int, the decimal part of 1.0 will be left out. vecNorm is T type as well, and in case this is int, the overall result will be 0.
Would you like me to create a branch, which will solve this issue?