News for hackers. Stuff that matters.
Re:GCD and the magic of subtraction by roelschroeven on Tuesday August 25, 2020 @03:57AM (#24269070)
Off-topic, a question about the notation used for multiplication in this article.

I'm used to see multiplication written as 3⋅12 or sometimes 3×12, but recently I encountered this notation using parentheses, 3(12), and now I see that in this article too. Is that commonly used? It looks weird to me, and not very readable, perhaps just because I'm not used to it. To me 2⋅2⋅2⋅3⋅7 is much more readable than 2(2)(2)(3)(7) (which at first sight looks like function calls to me). Is the parentheses-notation used just to get rid of the explicit multiplication sign?

I guess there are situations where you can't easily use a proper multiplication sign, in which case I can see the parentheses notation as an effective alternative. But I've seen it used in handwritten equations too, so that can't be the only explanation.

Just wondering.

Re:GCD and the magic of subtraction by owl57 on Tuesday August 25, 2020 @11:27AM (#24272330)
which at first sight looks like function calls to me

This is at least consistent. Let's try to think of numbers as functions. Then dots or juxtaposition must mean function composition, right? Then, f(x)=f⋅x is consistent with arithmetic as we know it and this dual interpretation of dots. I suspect that it's also the only such consistent mapping from numbers to functions, but couldn't prove this right away.

Re:GCD and the magic of subtraction by giantDinosaur on Tuesday August 25, 2020 @06:46AM (#24269940)
I usually only recall seeing it where it's the expansion or replacement of a variable with the actual value, when solving equations or similar. It's not great. I've seen it used in a text talking about programming, with letters: so a(x) was actually multiplication but looked exactly like a function. Ugh!
Re:GCD and the magic of subtraction by benmmurphy on Tuesday August 25, 2020 @05:06AM (#24269434)
It’s not uncommon to write a x b as ‘ab’. So if you wanted to put two literals together using this syntax you could wrap one in brackets.
Re:GCD and the magic of subtraction by thaumasiotes on Tuesday August 25, 2020 @05:15AM (#24269462)
Yes, it is extremely common. What country are you from?

It is used particularly in things like 3(x + 5) or (a + b)(a - b).

Re:GCD and the magic of subtraction by quietbritishjim on Tuesday August 25, 2020 @06:44AM (#24269927)
In your examples, it's not the brackets signifying the multiplication. It's the adjacency that signifies the multiplication (as in e.g. 3x) and in they happen to need brackets to highlight the precendence which would be lost in e.g. 3x + 5.

The notation of the article logically follows because e.g. (4) = 4 but using that as a "cheat" to enable multiplication of numeric literals using adjacency is very rare I think.

Re:GCD and the magic of subtraction by thaumasiotes on Tuesday August 25, 2020 @06:47AM (#24269956)
No, it's not rare. It's still quite common when you have people manipulating literal numbers. The literal numbers are what's rare.
Re:GCD and the magic of subtraction by hansbo on Tuesday August 25, 2020 @07:07AM (#24270081)
You say it's not rare, but I can't remember ever seeing it before reading this article.
Re:GCD and the magic of subtraction by dhosek on Tuesday August 25, 2020 @11:57AM (#24272641)
Likely because you haven't encountered it since junior high school. It's not uncommon notation in pre-algebra and occasionally beginning algebra.
Re:GCD and the magic of subtraction by roelschroeven on Tuesday August 25, 2020 @11:19AM (#24272230)
Yes, of course, I do know that. It's not what I meant.

Suppose we expand that first example. I would write: 3(x + 5) = 3x + 3⋅5 The notation I'm talking about writes: 3(x + 5) = 3x + 3(5)

It's that 3(5) instead of 3⋅5 I'm talking about.

Re:GCD and the magic of subtraction by zodiac on Tuesday August 25, 2020 @02:01PM (#24274090)
I prefer to use a dot like you, but find calculations like "let x=5, then 3(1+x) = 3(1+5) = 3(6) = 18" acceptable, because each equation is just a lock substitution
Re:GCD and the magic of subtraction by andi999 on Tuesday August 25, 2020 @08:04AM (#24270470)
In (high energy) physics the digits in the parenthensis states the error bar.