(-) precedence
12-23-2022, 05:11 AM (This post was last modified: 12-23-2022 05:26 AM by Sukiari.)
Post: #61
 Sukiari Member Posts: 180 Joined: Dec 2014
RE: (-) precedence
(12-22-2022 05:46 PM)Maximilian Hohmann Wrote:  Hello!

(12-22-2022 03:16 PM)Sukiari Wrote:  Glad I could clear this up. Sadly planes are falling out of the sky because not enough people get the message.

No, they don't, because those who make them are not too lazy to use parentheses :-) Which was already written three pages up in this thread.

Regards
Max

They make them, the dead bodies are proof. By perpetuating this fun clever game real people will die. It’s infected schools, engineers think - before a number is a “unary negation operator” even though this is a sort of mental masturbation game for number theorists and isn’t part of natural philosophy.

We’re one short step from the number 3 expanding to anything you like as long as it can be reduced to 3. Is 3, 3? Or is it an implied (9-6)?

But the deaths are worth the snarky humor. I for one stopped flying already so my own personal risk is quite minimal.
12-23-2022, 06:04 AM
Post: #62
 Matt Agajanian Senior Member Posts: 941 Joined: Dec 2013
RE: (-) precedence
(12-23-2022 12:02 AM)Albert Chan Wrote:  Hi, ijabbott

If we pickup tokens in reversed order, "precedence inversion" / "not making sense" does not happen.

How to distinguish subtraction from negation
Quote:If you can subtract, do it; if you can’t, then take it as a negation. Subtraction has priority.

Scanning backward, it will handle (op +/-) without issue.

2^-3^4
2^-(3^4)
2^(-(3^4))

2*-3/4
(2*-3)/4
(2*(-3))/4

A bit of advice, please. I get the second example. What is it about the first example, I am supposed to interpret the expression the you illustrated?
12-23-2022, 07:16 AM
Post: #63
 Thomas Okken Senior Member Posts: 1,842 Joined: Feb 2014
RE: (-) precedence
(12-23-2022 05:11 AM)Sukiari Wrote:
(12-22-2022 05:46 PM)Maximilian Hohmann Wrote:  Hello!

No, they don't, because those who make them are not too lazy to use parentheses :-) Which was already written three pages up in this thread.

Regards
Max

They make them, the dead bodies are proof. By perpetuating this fun clever game real people will die. It’s infected schools, engineers think - before a number is a “unary negation operator” even though this is a sort of mental masturbation game for number theorists and isn’t part of natural philosophy.

We’re one short step from the number 3 expanding to anything you like as long as it can be reduced to 3. Is 3, 3? Or is it an implied (9-6)?

But the deaths are worth the snarky humor. I for one stopped flying already so my own personal risk is quite minimal.

I see it is possible to come up with insane conspiracy theories about absolutely anything.

Insane being the operative word here. Mr. Sukiari, I sincerely recommend seeing a shrink. You may think you are making an important contribution to this conversation here, but you really, really are not.
12-23-2022, 07:54 AM
Post: #64
 Thomas Okken Senior Member Posts: 1,842 Joined: Feb 2014
RE: (-) precedence
(12-23-2022 12:02 AM)Albert Chan Wrote:  Hi, ijabbott

If we pickup tokens in reversed order, "precedence inversion" / "not making sense" does not happen.

How to distinguish subtraction from negation
Quote:If you can subtract, do it; if you can’t, then take it as a negation. Subtraction has priority.

Scanning backward, it will handle (op +/-) without issue.

2^-3^4
2^-(3^4)
2^(-(3^4))

2*-3/4
(2*-3)/4
(2*(-3))/4

Scanning backward is not necessary for this. Whether a + or - is unary or binary is unambiguously clear from when it is found during parsing: if it is found while looking for a subexpression, then it is unary, else it is binary. And what follows is parsed as an additive term in both cases.
12-23-2022, 08:04 AM
Post: #65
 Albert Chan Senior Member Posts: 2,347 Joined: Jul 2018
RE: (-) precedence
(12-23-2022 06:04 AM)Matt Agajanian Wrote:  What is it about the first example, I am supposed to interpret the expression the you illustrated?

Yes. By math convention, ^ operator is right associative.

On Casio FX-115ES-Plus, type "2 ^ - 3 ^ 4", you get "2 ^( - 3 ^( 4"
12-23-2022, 10:32 AM
Post: #66
 toml_12953 Senior Member Posts: 2,044 Joined: Dec 2013
RE: (-) precedence
(12-23-2022 08:04 AM)Albert Chan Wrote:
(12-23-2022 06:04 AM)Matt Agajanian Wrote:  What is it about the first example, I am supposed to interpret the expression the you illustrated?

Yes. By math convention, ^ operator is right associative.

On Casio FX-115ES-Plus, type "2 ^ - 3 ^ 4", you get "2 ^( - 3 ^( 4"

In ANSI/ISO Standard BASIC, PRINT 2^-3^4 gives an error. You can't have two operators directly next to each other so you have to use either

2^(-3^4) or
2^(-3)^4

so there is no ambiguity. In some versions of BASIC (Microsoft-style) and the HP Prime:
2^-3^4 = 4.135903...E-25

In other BASICs:
2^-3^4 = 0.000244

Even interpreter/compiler writers can't decide which to do!

Tom L
Cui bono?
12-23-2022, 03:54 PM
Post: #67
 Thomas Okken Senior Member Posts: 1,842 Joined: Feb 2014
RE: (-) precedence
(12-23-2022 10:32 AM)toml_12953 Wrote:  In some versions of BASIC (Microsoft-style) and the HP Prime:
2^-3^4 = 4.135903...E-25

In other BASICs:
2^-3^4 = 0.000244

Even interpreter/compiler writers can't decide which to do!

HP had a change of heart about that one at some point. The HP-17B/19B/27S evaluate that expression to 0.000244, while the 48 and its successors return 4.135903...E-25. So ^ went from being left-associative to right-associative.
12-23-2022, 07:40 PM
Post: #68
 ijabbott Senior Member Posts: 1,274 Joined: Jul 2015
RE: (-) precedence
(12-23-2022 03:54 PM)Thomas Okken Wrote:
(12-23-2022 10:32 AM)toml_12953 Wrote:  In some versions of BASIC (Microsoft-style) and the HP Prime:
2^-3^4 = 4.135903...E-25

In other BASICs:
2^-3^4 = 0.000244

Even interpreter/compiler writers can't decide which to do!

HP had a change of heart about that one at some point. The HP-17B/19B/27S evaluate that expression to 0.000244, while the 48 and its successors return 4.135903...E-25. So ^ went from being left-associative to right-associative.

It kind of makes sense with the way the 17B/19B/27S partially evaluate expressions as they are being input.

— Ian Abbott
12-25-2022, 11:46 PM (This post was last modified: 12-26-2022 12:39 AM by Sukiari.)
Post: #69
 Sukiari Member Posts: 180 Joined: Dec 2014
RE: (-) precedence
(12-23-2022 07:16 AM)Thomas Okken Wrote:
(12-23-2022 05:11 AM)Sukiari Wrote:  They make them, the dead bodies are proof. By perpetuating this fun clever game real people will die. It’s infected schools, engineers think - before a number is a “unary negation operator” even though this is a sort of mental masturbation game for number theorists and isn’t part of natural philosophy.

We’re one short step from the number 3 expanding to anything you like as long as it can be reduced to 3. Is 3, 3? Or is it an implied (9-6)?

But the deaths are worth the snarky humor. I for one stopped flying already so my own personal risk is quite minimal.

I see it is possible to come up with insane conspiracy theories about absolutely anything.

Insane being the operative word here. Mr. Sukiari, I sincerely recommend seeing a shrink. You may think you are making an important contribution to this conversation here, but you really, really are not.

Euler and Newton would both have physically slapped a man for implying that a - before a number is a ‘unary negation operator.’ Slapped them at a bare minimum, perhaps ran them through. And it would have improved the species if they were run through.

I did a little research on the concept and it’s rooted in computer programming, it was welded onto the back of this shambling monstrosity called new math sometime in the 1990s. There is no mention of it at all before the 1960s and no mention of it outside the context of computer programming before the 1990s. It’s a mistake. But I guess CAS’s are too difficult to make without this concept so it was strapped onto mathematics as an afterthought. It can safely be ignored unless you’re flying, driving over bridges, or otherwise relying on engineers to keep you from dying. If you are, you should be deathly afraid.
12-26-2022, 01:21 AM
Post: #70
 rprosperi Super Moderator Posts: 5,980 Joined: Dec 2013
RE: (-) precedence
PLEASE STAY ON TOPIC AND AVOID CASTING ASPERSIONS AT OTHER READER'S VIEWS, and also avoid things like speculating on how other people may have interpreted something you don't agree with. This is not Facebook and such posts have no place here.

--Bob Prosperi
12-26-2022, 06:11 AM
Post: #71
 Thomas Okken Senior Member Posts: 1,842 Joined: Feb 2014
RE: (-) precedence
"Casting aspersions on other people's views"?

I'm sorry, but that is a pretty weak response to someone proclaiming that it would improve the species if I were dead. I'm getting slapped on the wrist for pointing out that Sukiari is making insane comments here and he, in turn, is allowed to turn up the insanity to the level of homicidal fantasy? Seriously?
12-26-2022, 09:43 AM
Post: #72
 ijabbott Senior Member Posts: 1,274 Joined: Jul 2015
RE: (-) precedence
(12-25-2022 11:46 PM)Sukiari Wrote:  Euler and Newton would both have physically slapped a man for implying that a - before a number is a ‘unary negation operator.’ Slapped them at a bare minimum, perhaps ran them through. And it would have improved the species if they were run through.

Newton would have probably have slapped a man for suggesting that negative quantities exist at all.

— Ian Abbott
12-26-2022, 03:25 PM
Post: #73
 Sukiari Member Posts: 180 Joined: Dec 2014
RE: (-) precedence
(12-26-2022 06:11 AM)Thomas Okken Wrote:  "Casting aspersions on other people's views"?

I'm sorry, but that is a pretty weak response to someone proclaiming that it would improve the species if I were dead. I'm getting slapped on the wrist for pointing out that Sukiari is making insane comments here and he, in turn, is allowed to turn up the insanity to the level of homicidal fantasy? Seriously?

These insanity accusations are clearly a form of projection. Unary minus operator is fiction and it’s killing people. It’s not funny.
12-26-2022, 03:55 PM (This post was last modified: 12-26-2022 03:57 PM by Eddie W. Shore.)
Post: #74
 Eddie W. Shore Senior Member Posts: 1,534 Joined: Dec 2013
RE: (-) precedence
Please leave the conspiracy theories on Twitter or Reddit, not here. Thank you.
12-26-2022, 06:10 PM
Post: #75
 Thomas Okken Senior Member Posts: 1,842 Joined: Feb 2014
RE: (-) precedence
(12-26-2022 03:25 PM)Sukiari Wrote:
(12-26-2022 06:11 AM)Thomas Okken Wrote:  "Casting aspersions on other people's views"?

I'm sorry, but that is a pretty weak response to someone proclaiming that it would improve the species if I were dead. I'm getting slapped on the wrist for pointing out that Sukiari is making insane comments here and he, in turn, is allowed to turn up the insanity to the level of homicidal fantasy? Seriously?

These insanity accusations are clearly a form of projection. Unary minus operator is fiction and it’s killing people. It’s not funny.

Yes, sure. On your planet, entire generations of mathematicians and engineers fail to grasp the basics of how numbers work, and the mathematical notation that has been in use all over the world for generations is fatally flawed in ways that is killing people and which despite being ubiquitous, no one understands except for a few especially gifted geniuses like yourself.

Oooookay.
12-26-2022, 08:23 PM
Post: #76
 Matt Agajanian Senior Member Posts: 941 Joined: Dec 2013
RE: (-) precedence
I’m thinking that since Unicode allows for an infinite number of icons and symbols, a brand new symbol or two should be implemented, maybe one devoted to unary minus and whatever unambiguous symbol for any other ambiguous implication regarding the use of - in general.
12-26-2022, 08:50 PM
Post: #77
 Sukiari Member Posts: 180 Joined: Dec 2014
RE: (-) precedence
(12-26-2022 03:55 PM)Eddie W. Shore Wrote:  Please leave the conspiracy theories on Twitter or Reddit, not here. Thank you.

It’s not a conspiracy theory at all. Unary minus operator simply isn’t a concept in mathematics, pre-1990s. It was invented and slid into math without even so much as a meeting. You can confirm this easily for yourself with the wonderful Google Books search, or Google Scholar.

Inventing mathematical neologisms and sneaking around and pretending it’s always been a thing isn’t how it’s done.
12-26-2022, 09:00 PM
Post: #78
 Thomas Okken Senior Member Posts: 1,842 Joined: Feb 2014
RE: (-) precedence
I guess I need to travel back in time to the '70s and tell my younger self that all those math textbooks I saw with my own eyes were just a hallucination.
12-26-2022, 09:10 PM
Post: #79
 Thomas Okken Senior Member Posts: 1,842 Joined: Feb 2014
RE: (-) precedence
I just learned that I received an official warning from the forum admins. Apparently calling for my death is fine, but pushing back against raging insanity is not.

Fine. This isn't the first time I've encountered awful moderation on this forum but this one takes the cake by a mile. I'm done here.
12-26-2022, 09:42 PM
Post: #80
 klesl Member Posts: 128 Joined: Mar 2016
RE: (-) precedence
(12-26-2022 08:50 PM)Sukiari Wrote:
(12-26-2022 03:55 PM)Eddie W. Shore Wrote:  Please leave the conspiracy theories on Twitter or Reddit, not here. Thank you.

It’s not a conspiracy theory at all. Unary minus operator simply isn’t a concept in mathematics, pre-1990s. It was invented and slid into math without even so much as a meeting. You can confirm this easily for yourself with the wonderful Google Books search, or Google Scholar.

Inventing mathematical neologisms and sneaking around and pretending it’s always been a thing isn’t how it’s done.

The unary minus operator convert positive numbers to the negative ones (convert X to -X). So do you think the negative numbers don't exist before 1990s?
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)