Skip to content

Commit

Permalink
Update src/Imath/ImathRoots.h
Browse files Browse the repository at this point in the history
use copy sign

Co-authored-by: Nick Porcino <[email protected]>
Signed-off-by: Piotr Barejko <[email protected]>
  • Loading branch information
bareya and meshula committed Oct 28, 2021
1 parent f912b0c commit e2fe4b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Imath/ImathRoots.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ solveNormalizedCubic (T r, T s, T t, T x[3])
if (D > 0)
{
auto real_root = [] (T a, T x) -> T {
T sign = a < T (0) ? T (-1) : T (1);
T sign = std::copysign(T(1), a);
return sign * std::pow (sign * a, T (1) / x);
};

Expand Down

0 comments on commit e2fe4b7

Please sign in to comment.