-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
make \minus equivalent to - operator #26193 #40948
make \minus equivalent to - operator #26193 #40948
Conversation
Welcome and great first PR! Seems like a good idea. |
This should make it work as an operator, but we also parse |
Oh wait I'm wrong, negative literals go through The remaining case is floating point exponents, e.g. |
|
@JeffBezanson very good points! I'll see what I can do. |
|
4b03ef4
to
d96cd8e
Compare
btw: I remembered the existence of |
in case "- 42" (unary operator) will get parsed like "-42" (negative literal) in the future
triage approves. |
* make \minus equivalent to - operator JuliaLang#26193
* make \minus equivalent to - operator JuliaLang#26193
Add the typographically more correct minus sign
−
(\minus
) as an alternative for the traditionally used hyphen-minus-
(which is readilly available on all keyboard layouts).To many, it is aesthetically more pleasing because it has the same width as
+
. But the main advantage is that it would allow for copy-pasting negative numbers (and to some degree, formulas with subtractions) from correctly typeset PDF/HTML/... documents into Julia code. Actual code snippets can also accidentally be "beautified" by CMS/blog software, word processors, e-mail clients, etc.Fixes #26193.