Fix fmt formatter unconditional parentheses

Summary

  • Fix fmt::formatter<std::complex<T>> and fmt::formatter<duals::dual<T>> unconditionally wrapping output in parentheses
  • Parentheses now only appear when both components are nonzero (e.g. (3+4i)) or in pair/comma style — purely real (2), purely imaginary (3i), and zero (0) values no longer get wrapped
  • Updated tests to match corrected behavior
  • Fix C++20 rewritten comparison operator error in test_eigen.cpp (Eigen 3.3.8 array operator==/!= returns non-bool, conflicts with GCC C++20 rewriting rules)
  • Bump version to 0.7.2

Test plan

  • All 29 libfmt tests pass
  • init.Constant eigen test passes
Edited by Michael Tesch

Merge request reports

Loading