Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
question
Browse files Browse the repository at this point in the history
  • Loading branch information
walchko committed Aug 23, 2022
1 parent 71436e8 commit fd9498a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/squaternion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ struct Quaternion {
data_t m = sqrt(w * w + x * x + y * y + z * z);

if (m < 1.0e-6) {
// throw QuaternionError();
return 1;
}

// use isinf(inv_m) instead?
// the above test will capture really large inv_m
// in addition to infinate
data_t inv_m = 1.0 / m;

this->w *= inv_m;
Expand Down

0 comments on commit fd9498a

Please sign in to comment.