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

Feature request: Allow for multiplication by juxtaposition of root operators #24226

Closed
Sleort opened this issue Oct 20, 2017 · 5 comments
Closed
Labels
parser Language parsing and surface syntax speculative Whether the change will be implemented is speculative

Comments

@Sleort
Copy link
Contributor

Sleort commented Oct 20, 2017

It would be great if writing e.g. 2√2 could be made valid syntax. (Currently, one has to write either 2sqrt(2) or insert an explicit multiplication sign, like 2*√2.)

@Sleort Sleort changed the title Allow for multiplication by juxtaposition of root operators Feature request: Allow for multiplication by juxtaposition of root operators Oct 20, 2017
@ararslan ararslan added parser Language parsing and surface syntax speculative Whether the change will be implemented is speculative labels Oct 20, 2017
@ararslan
Copy link
Member

My only reservation about this would be that p√a could be mistaken for the pth root of a:

oaz9e

(p and a chosen based on first Google result for that image)

@Sleort
Copy link
Contributor Author

Sleort commented Oct 20, 2017

I see your point, but to me p√a = p*√a is more natural (and very common in mathematical literature). I think the "could be mistaken for the pth root of a" is more of a symptom of being used to bad mathematical typography, and hence "you parse the expression in your head" to something like $\sqrt[p]{a}$ (Latex)?

Also, the manual says

The prefix operator √ is equivalent to sqrt

so why shouldn't 2√a == 2sqrt(a)? To the non-expert user, I don't think this is obvious at all. At least I was surprised when 2√2 gave me an error...

@martinholters
Copy link
Member

Should this be special to , or for all unary-only operators? Not that 2!false is particularly useful, but for consistency, it should then probably work (and give 2)?

@cossio
Copy link
Contributor

cossio commented Apr 6, 2018

@martinholters I agree. There should not be a special rule for

@knuesel
Copy link
Member

knuesel commented Dec 16, 2022

I think this can be closed following the merge of #40173.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Language parsing and surface syntax speculative Whether the change will be implemented is speculative
Projects
None yet
Development

No branches or pull requests

6 participants