mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2021-12-07, 20:43   #45
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

5×7×283 Posts
Default

This reminds me of a Russian joke (used to be popular):

Wife sends her husband who is a programmer to buy groceries. She tells him: "Buy two loaves of bread, and if they have eggs, buy a dozen." Guess what he brings back?
12 loaves of bread, of course.
Batalov is offline   Reply With Quote
Old 2021-12-07, 20:48   #46
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

5×7×283 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
After making a fool of myself on the pari-users list server, I was told, and with further experimentation, that something like

a || b && c || d

should be interpreted as

((a || b) && c) || d.
And there! We have circled back to nearly exactly the same as the thread header.
So, my aside was on-topic (pats himself on the back).
Batalov is offline   Reply With Quote
Old 2021-12-07, 22:25   #47
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

2×5×227 Posts
Default

Quote:
Originally Posted by Batalov View Post
This reminds me of a Russian joke (used to be popular):

Wife sends her husband who is a programmer to buy groceries. She tells him: "Buy two loaves of bread, and if they have eggs, buy a dozen." Guess what he brings back?
12 loaves of bread, of course.
I fail to see why would anyone, find that to be funny.

ETA: OK I get it now:
He should have bought 13 Loaves instead:

https://www.britannica.com/story/why...akers-dozen-13

Last fiddled with by a1call on 2021-12-07 at 22:35
a1call is offline   Reply With Quote
Old 2021-12-07, 23:56   #48
Dr Sardonicus
 
Dr Sardonicus's Avatar
 
Feb 2017
Nowhere

5,903 Posts
Default

Quote:
Originally Posted by Batalov View Post
This reminds me of a Russian joke (used to be popular)
<snip>
This reminds me of a joke I heard as a child:
The village blacksmith told his apprentice, "When I take the shoe out of the fire, I'll lay it on the anvil; and when I nod my head, you hit it with this hammer."

The apprentice did just as he was told. Now he's the village blacksmith.
Dr Sardonicus is online now   Reply With Quote
Old 2021-12-08, 01:46   #49
Dr Sardonicus
 
Dr Sardonicus's Avatar
 
Feb 2017
Nowhere

5,903 Posts
Default

I asked Bill Allombert, who writes Pari-GP code, about the parsing of a && b || c. According to him,
Quote:
a && (b || c) is the C convention.
Dr Sardonicus is online now   Reply With Quote
Old 2021-12-08, 02:15   #50
Viliam Furik
 
Viliam Furik's Avatar
 
"Viliam Furík"
Jul 2018
Martin, Slovakia

30116 Posts
Default

Quote:
Originally Posted by Dr Sardonicus View Post
This reminds me of a joke I heard as a child:
The village blacksmith told his apprentice, "When I take the shoe out of the fire, I'll lay it on the anvil; and when I nod my head, you hit it with this hammer."

The apprentice did just as he was told. Now he's the village blacksmith.
Took a moment to understand, but still very funny.
Viliam Furik is online now   Reply With Quote
Old 2021-12-08, 02:18   #51
axn
 
axn's Avatar
 
Jun 2003

5,387 Posts
Default

Quote:
Originally Posted by Dr Sardonicus View Post
I asked Bill Allombert, who writes Pari-GP code, about the parsing of a && b || c. According to him,
https://en.cppreference.com/w/c/lang...tor_precedence

&& has higher priority than ||
Same prioirity is evaluated left-to-right. So that's exactly backwards ?!
axn is offline   Reply With Quote
Old 2021-12-08, 10:18   #52
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

17×19×31 Posts
Default

Quote:
Originally Posted by Dr Sardonicus View Post
This reminds me of a joke I heard as a child:
The village blacksmith told his apprentice, "When I take the shoe out of the fire, I'll lay it on the anvil; and when I nod my head, you hit it with this hammer."

The apprentice did just as he was told. Now he's the village blacksmith.
bwaaa, haha, this is new for me
LaurV is offline   Reply With Quote
Old 2021-12-08, 10:22   #53
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
"name field"
Jun 2011
Thailand

271D16 Posts
Default

Quote:
Originally Posted by a1call View Post
I fail to see why would anyone, find that to be funny.

ETA: OK I get it now:
He should have bought 13 Loaves instead:

https://www.britannica.com/story/why...akers-dozen-13
Well, in that case you are all wrong. He would have bought 15 loaves of bread.
Two, plus the thirteen because they had eggs.

LaurV is offline   Reply With Quote
Reply

Thread Tools


All times are UTC. The time now is 13:22.


Mon Aug 15 13:22:08 UTC 2022 up 39 days, 8:09, 1 user, load averages: 1.01, 1.07, 1.16

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔