Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix simple problem with cproj() pointed out by Damian #19142

Merged
merged 1 commit into from Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/standard/Math.chpl
Expand Up @@ -459,11 +459,11 @@ module Math {
}

/* Returns the projection of `z` on a Riemann sphere. */
inline proc cproj(z: complex(?w)): real(w/2) {
inline proc cproj(z: complex(?w)): complex(w) {
pragma "fn synchronization free"
extern proc cprojf(z: complex(64)): real(32);
extern proc cprojf(z: complex(64)): complex(64);
pragma "fn synchronization free"
extern proc cproj(z: complex(128)): real(64);
extern proc cproj(z: complex(128)): complex(128);
if w == 64 then
return cprojf(z);
else
Expand Down
2 changes: 1 addition & 1 deletion test/types/complex/diten/cplxMathFnTypes.chpl
Expand Up @@ -9,7 +9,7 @@ proc testTypes(x: complex(?w)) {
assert(res3.type == complex(w));

const res4 = cproj(x);
assert(res4.type == real(w/2));
assert(res4.type == complex(w));

const res5 = exp(x);
assert(res5.type == complex(w));
Expand Down