[Chapel Merge] Fix simple problem with cproj() pointed out by Dam

Branch: refs/heads/main
Revision: d3f3a55
Author: bradcray
Link: Fix simple problem with cproj() pointed out by Damian by bradcray · Pull Request #19142 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #19142 from bradcray/cproj-returns-complex

Fix simple problem with cproj() pointed out by Damian

[reviewed by @daviditen and @damianmoz]

In discussing math stuff recently, @damianmoz pointed out that Chapel's
cproj() function returned (and assumed C was returning) reals/floats
rather than complexes. This makes the simple update to address that.
Though the imaginary part is always 0.0, Damian points out that it can
matter since it should retain the sign of the original value (+0.0 or -0.0).
And also that users expect these routines to be closed on the input type.

Damian also suggested that cproj() is so simple that we ought to
implement it in Chapel (from a simplicity / optimizability of code
perspective), but I did not feel I had the time or energy to take that up late
on a Friday. Someone should open an issue about this or take it on
themselves if they feel strongly about it.

Modified Files:
M modules/standard/Math.chpl

M test/types/complex/diten/cplxMathFnTypes.chpl

Compare: https://github.com/chapel-lang/chapel/compare/fcbd194466bc...d3f3a55c2964