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

Inconsistent use of power sign with "Format reduce" #359

Closed
spj101 opened this issue Jul 14, 2020 · 1 comment
Closed

Inconsistent use of power sign with "Format reduce" #359

spj101 opened this issue Jul 14, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@spj101
Copy link
Contributor

spj101 commented Jul 14, 2020

I understand that the REDUCE computer algebra system admits the use of the characters "^" and "**" as a power sign.

I am not completely familiar with the syntax of the system but I noticed that when using "Format reduce" FORM actually uses a mixture of these two power signs. Is this intentional behaviour?

Example:

Symbols x;
CFunctions f;
Local F = f(x^2)+f(x)^2;
Format reduce;
Print;
.end

Outputs:

F = f(x**2) + f(x)^2;

I believe the cause of this is in the file sources/sch.c, around line 1786 we see:

if ( AC.OutputMode == FORTRANMODE || AC.OutputMode == PFORTRANMODE
 || AC.OutputMode == REDUCEMODE )
TokenToLine((UBYTE *)")**(");

but later around line 2057 we see:

if ( AC.OutputMode == FORTRANMODE
|| AC.OutputMode == PFORTRANMODE ) { TokenToLine((UBYTE *)"**"); }

Is the omission in the latter block deliberate?

@vermaseren
Copy link
Owner

vermaseren commented Jul 14, 2020 via email

vermaseren added a commit that referenced this issue Jul 15, 2020
@spj101 spj101 closed this as completed Jul 15, 2020
tueda added a commit that referenced this issue Jul 17, 2020
@tueda tueda added the bug Something isn't working label Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants