Conversation started Jul 17, 2019 at 19:32.
Jul 17, 2019 19:32
Another fun one is 4/2/2
I'd say that is pretty much always evaluated left to right, isn't it?
@flawr Except in TMN, where it really should be right-to-left.
what is TMN?
@flawr Traditional Mathematical Notation.
@Adám Even then I'd say it is (4/2)/2, but really it is just a bad idea to use an inline / in such a case
Jul 17, 2019 19:37
@flawr Precedence is evil.
oh matlab has a fun one: what is 2\4/2 ? :)
Ah, a\b is b/a, right?
right, except when the operands are not commutative
@flawr It evaluates to the sound of a programmer quietly sobbing
2
Well actually the one I posted was kinda obvious
try 2/4\3 instead:)
Jul 17, 2019 19:41
What is 4 ÷ 2 × a ?
(4/2)*a
@flawr What is 4 ÷ 2 a ?
@Adám 4 / (2a) :)
@flawr Precedence is evil.
@Adám Error: ambiguous expression
Jul 17, 2019 19:43
What is sin a × b ?
It's a sin.
@dzaima Interestingly, a few (but very few) language have that.
@Adám once i wanted to get an answer to something like that from my math teacher. didn't get a conclusive one :D
What I do like in haskell is that you can define the precedence as well as the associativity of binary operators.
@dzaima Right, it is because it (officially?) depends on the goodwill of the reader.
Jul 17, 2019 19:44
Caused by the incompetence of the writer
In math one should really try to avoid expressions like these, even if not everyone is doing so.
sin a cos a is "obviously" (sin a)(cos a), but sin 2 a is "obviously sin(2 a) so there is no blanket precedence of sin vs (implied) ×.
@flawr even more evil, sin 2a × a
@dzaima lol
@Adám the latter depends on how much space there is between the consecutive symbols :D
i wonder if there'd a big difference from interpreting sin 2a × a and sin 2a×a
Jul 17, 2019 19:47
Bob eying quilts, quietly sobbing
but really the unclear conventions caused us to use monstrosities like ⫋
@flawr Well, I does that.
@Adám funnily enough, I tried to see what google thought was more 'obvious'. sin 2 pi is sin(2 * pi) but sin pi 2 just doesn't get evaluated by the calculator haha
@dzaima Wow!
Jul 17, 2019 19:48
That's because 2 is actually a monadic function that multiplies its argument by two
while pi is a mathematical constant
‽‽‽ \○/
@JohnDvorak I can't tell if that's a joke or not
@JohnDvorak and in this context I use unary because monadic has other meanings in programming and math:)
ah, yes, unary.
@dzaima But sin 2a × b and sin 2a×b are both sin(2a)b!!!
Jul 17, 2019 19:51
@DJMcMayhem bah, I would read that as sin 2 × π
not as sin(2 × π)
unfortunately it's not really my choice though
There needs to be a jimmy tag. — MilkyWay90 24 hours ago
What do y'all think?
(Got to run now, meetings.)
Nice series of questions, BTW.
I would lean towards no
definitely no, trends come and go
@Hosch250 just because some guy decided to repeatedly use the name "jimmy" in his challenges?
I think we've even banned the useless backstories a while back...
Jul 17, 2019 19:55
@Hosch250 Nope. It adds nothing to the site.
Useless backstories are an integral part of any challenge. Please don't get rid of them!
@flawr they've not been completely banned, they just shouldn't be long enough to distract from the challenge
more like discouraged
If sin²x is (sin x)² and sin⁻¹x is arcsin x, what is sin⁻²x? (arcsin x)²?
totally unrelated, did you guys know you could eat (some of them) physalis fruits?
they are delicious, I just recently found out that there are actually edible varieties
@flawr sure, they are common as desert decor.
Jul 17, 2019 19:59
@Adám sin ^ (-2) x is a debated topic
sin sin2x2 vs sin sinx2 vs sin sin x2. ok that's enough precedence for me
the convention that sin ^ a x means (sin(x)) ^ a and not (sin ^ a)(x) is stupid IMHO
@Adám sin⁻²x = sin⁻⁻¹*² x = (sin⁻¹ x)^2 = (arcsin x)^2
@EriktheOutgolfer it is usually very clear which one it is from the context
@flawr W⍺ says (sin x)⁻²
yeah, "context" shouldn't do the justice in maths, ever
Jul 17, 2019 20:03
and if you want to be sure that people understand that you mean repeated composition, then prepend a composition circle symbol to the exponent
It is not a very standard thing to do but people will always understand.
I'm pretty sure that the composition symbol doesn't take a number as its right operand...
@EriktheOutgolfer yes but people understand:)
In math so many notations and notions do depend on the context.
Otherwise we would have long run out of symbols
Whoa, W⍺ splits sin^-1.2 x between 1 and . !!!
 
Conversation ended Jul 17, 2019 at 20:04.