Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

I'm not afraid of death -- I just don't want to be there when it happens. -- Woody Allen


aus+uk / uk.d-i-y / OT: Arithmetic - Order of evaluating multiple divisions

SubjectAuthor
* OT: Arithmetic - Order of evaluating multiple divisionsNY
+* Re: OT: Arithmetic - Order of evaluating multiple divisionsPaul
|`* Re: OT: Arithmetic - Order of evaluating multiple divisionsNY
| +- Re: OT: Arithmetic - Order of evaluating multiple divisionsPaul
| `* Re: OT: Arithmetic - Order of evaluating multiple divisionsPaul
|  `* Re: OT: Arithmetic - Order of evaluating multiple divisionsnib
|   +- Re: OT: Arithmetic - Order of evaluating multiple divisionsPaul
|   `* Re: OT: Arithmetic - Order of evaluating multiple divisionsbrian
|    `- Re: OT: Arithmetic - Order of evaluating multiple divisionsnib
+* Re: OT: Arithmetic - Order of evaluating multiple divisionsThe Natural Philosopher
|`- Re: OT: Arithmetic - Order of evaluating multiple divisionsTim Lamb
+- Re: OT: Arithmetic - Order of evaluating multiple divisionsAnthonyL
`- Re: OT: Arithmetic - Order of evaluating multiple divisionsbrian

1
OT: Arithmetic - Order of evaluating multiple divisions

<gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>

  copy mid

https://news.novabbs.com/aus+uk/article-flat.php?id=122554&group=uk.d-i-y#122554

  copy link   Newsgroups: uk.d-i-y
Path: i2pn2.org!i2pn.org!weretis.net!feeder9.news.weretis.net!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 01 May 2024 21:28:56 +0000
Date: Wed, 1 May 2024 22:28:54 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: me...@privacy.net (NY)
Subject: OT: Arithmetic - Order of evaluating multiple divisions
Newsgroups: uk.d-i-y
Content-Language: en-GB
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: AVG (VPS 240501-6, 1/5/2024), Outbound message
X-Antivirus-Status: Clean
Message-ID: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
Lines: 29
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-Wkzfv6r3msePLx1KvuNbHV45DOJRnlC0tCIhGf3Cyl1O3mX8dBdN06+RPlT2DJTq/TPyykE4c+aQgEB!QKnSWp0N1LkDmFOF1dpk9HV8zlq8ko7OkvPyEfxKz8jdwN01kZUXbGbpbGaVTr8MNO4h6Ry3OAFw!1Sojy+SlPLwyBfadSTYbpLSBVmw=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: NY - Wed, 1 May 2024 21:28 UTC

There is a question doing the rounds on Facebook as to the correct
answer to this expression https://i.postimg.cc/Yqk0sL0j/Image1.png

9
---------
9 / 9 / 9

or (for Brian Gaff) a fraction whose numerator is 9 and whose
denominator is 9 division-sign 9 division-sign 9

Three possible answers are given: 1, 9, 81

My understanding is that the denominator 9 / 9 / 9 is *defined* to be
parsed from left to right because both operators are the same, and
therefore it is parsed as (9/9)/9 = 1/9 rather than 9/(9/9) = 9. And
hence the value of the overall expression is 9 / (1/9) = 81.

But is there an online source which supports the left-to-right order of
parsing? Is it more of a common convention than a
there-is-only-one-answer rule?

It's one of those things that probably wouldn't arise in practice
because if there was the slightest chance that it could be parsed in
different ways, you'd use explicit brackets to remove any doubt and to
force the answer that you want, but that would take the fun out of these
Facebook "puzzles" ;-)

Re: OT: Arithmetic - Order of evaluating multiple divisions

<v0uhsj$3e5bb$1@dont-email.me>

  copy mid

https://news.novabbs.com/aus+uk/article-flat.php?id=122557&group=uk.d-i-y#122557

  copy link   Newsgroups: uk.d-i-y
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@needed.invalid (Paul)
Newsgroups: uk.d-i-y
Subject: Re: OT: Arithmetic - Order of evaluating multiple divisions
Date: Wed, 1 May 2024 19:05:54 -0400
Organization: A noiseless patient Spider
Lines: 271
Message-ID: <v0uhsj$3e5bb$1@dont-email.me>
References: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 02 May 2024 01:05:56 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f7045253961b9be9fc307ce8d4cf3f77";
logging-data="3609963"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+DwFeRJ1KvBfLCh+pY4Of1loZ18s4QEzU="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:WWwqO6QP6tgcjV9VJGYcMWl7KVA=
In-Reply-To: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
Content-Language: en-US
 by: Paul - Wed, 1 May 2024 23:05 UTC

On 5/1/2024 5:28 PM, NY wrote:
> There is a question doing the rounds on Facebook as to the correct answer to this expression https://i.postimg.cc/Yqk0sL0j/Image1.png
>
>     9
> ---------
> 9 / 9 / 9
>
> or (for Brian Gaff) a fraction whose numerator is 9 and whose denominator is 9 division-sign 9 division-sign 9
>
> Three possible answers are given: 1, 9, 81
>
>
> My understanding is that the denominator 9 / 9 / 9 is *defined* to be parsed from left to right because both operators are the same, and therefore it is parsed as (9/9)/9 = 1/9 rather than 9/(9/9) = 9. And hence the value of the overall expression is 9 / (1/9) = 81.
>
>
> But is there an online source which supports the left-to-right order of parsing? Is it more of a common convention than a there-is-only-one-answer rule?
>
>
> It's one of those things that probably wouldn't arise in practice because if there was the slightest chance that it could be parsed in different ways, you'd use explicit brackets to remove any doubt and to force the answer that you want, but that would take the fun out of these Facebook "puzzles" ;-)

A jokey question deserves a jokey answer.

https://rosettacode.org/wiki/Arithmetic_evaluation#C

C++
Works with: g++ version clang++

This version does not require boost. It works by:
- converting infix strings to postfix strings using shunting yard algorithm
- converting postfix expression to list of tokens
- builds AST bottom up from list of tokens
- evaluates expression tree by performing postorder traversal.

g++ -o parse-crispies.exe parse-crispies.cc # For the Windows users :-) I always like to throw in the compile line.

**************************************** parse-crispies.cc ****************************************
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

template <class T>
class stack {
private:
vector<T> st;
T sentinel;
public:
stack() { sentinel = T(); }
bool empty() { return st.empty(); }
void push(T info) { st.push_back(info); }
T& top() {
if (!st.empty()) {
return st.back();
}
return sentinel;
}
T pop() {
T ret = top();
if (!st.empty()) st.pop_back();
return ret;
}
};

//determine associativity of operator, returns true if left, false if right
bool leftAssociate(char c) {
switch (c) {
case '^': return false;
case '*': return true;
case '/': return true;
case '%': return true;
case '+': return true;
case '-': return true;
default:
break;
}
return false;
}

//determins precedence level of operator
int precedence(char c) {
switch (c) {
case '^': return 7;
case '*': return 5;
case '/': return 5;
case '%': return 5;
case '+': return 3;
case '-': return 3;
default:
break;
}
return 0;
}

//converts infix expression string to postfix expression string
string shuntingYard(string expr) {
stack<char> ops;
string output;
for (char c : expr) {
if (c == '(') {
ops.push(c);
} else if (c == '+' || c == '-' || c == '*' || c == '/' || c == '^' || c == '%') {
if (precedence(c) < precedence(ops.top()) ||
(precedence(c) == precedence(ops.top()) && leftAssociate(c))) {
output.push_back(' ');
output.push_back(ops.pop());
output.push_back(' ');
ops.push(c);
} else {
ops.push(c);
output.push_back(' ');
}
} else if (c == ')') {
while (!ops.empty()) {
if (ops.top() != '(') {
output.push_back(ops.pop());
} else {
ops.pop();
break;
}
}
} else {
output.push_back(c);
}
}
while (!ops.empty())
if (ops.top() != '(')
output.push_back(ops.pop());
else ops.pop();
cout<<"Postfix: "<<output<<endl;
return output;
}

struct Token {
int type;
union {
double num;
char op;
};
Token(double n) : type(0), num(n) { }
Token(char c) : type(1), op(c) { }
};

//converts postfix expression string to vector of tokens
vector<Token> lex(string pfExpr) {
vector<Token> tokens;
for (int i = 0; i < pfExpr.size(); i++) {
char c = pfExpr[i];
if (isdigit(c)) {
string num;
do {
num.push_back(c);
c = pfExpr[++i];
} while (i < pfExpr.size() && isdigit(c));
tokens.push_back(Token(stof(num)));
i--;
continue;
} else if (c == '+' || c == '-' || c == '*' || c == '/' || c == '^' || c == '%') {
tokens.push_back(Token(c));
}
}
return tokens;
}

//structure used for nodes of expression tree
struct node {
Token token;
node* left;
node* right;
node(Token tok) : token(tok), left(nullptr), right(nullptr) { }
};

//builds expression tree from vector of tokens
node* buildTree(vector<Token> tokens) {
cout<<"Building Expression Tree: "<<endl;
stack<node*> sf;
for (int i = 0; i < tokens.size(); i++) {
Token c = tokens[i];
if (c.type == 1) {
node* x = new node(c);
x->right = sf.pop();
x->left = sf.pop();
sf.push(x);
cout<<"Push Operator Node: "<<sf.top()->token.op<<endl;
} else
if (c.type == 0) {
sf.push(new node(c));
cout<<"Push Value Node: "<<c.num<<endl;
continue;
}
}
return sf.top();
}

//evaluate expression tree, while anotating steps being performed.
int recd = 0;
double eval(node* x) {
recd++;
if (x == nullptr) {
recd--;
return 0;
}
if (x->token.type == 0) {
for (int i = 0; i < recd; i++) cout<<" ";
cout<<"Value Node: "<<x->token.num<<endl;
recd--;
return x->token.num;
}
if (x->token.type == 1) {
for (int i = 0; i < recd; i++) cout<<" ";
cout<<"Operator Node: "<<x->token.op<<endl;
double lhs = eval(x->left);
double rhs = eval(x->right);
for (int i = 0; i < recd; i++) cout<<" ";
cout<<lhs<<" "<<x->token.op<<" "<<rhs<<endl;
recd--;
switch (x->token.op) {
case '^': return pow(lhs, rhs);
case '*': return lhs*rhs;
case '/':
if (rhs == 0) {
cout<<"Error: divide by zero."<<endl;
} else
return lhs/rhs;
case '%':
return (int)lhs % (int)rhs;
case '+': return lhs+rhs;
case '-': return lhs-rhs;
default:
break;
}
}
return 0;
}

int main() {
// string expr = "3 + 4 * 2 / ( 1 - 5 ) ^ 2 ^ 3";
string expr = "9 / 9 / 9 / 9"; // Your desired expression goes here

cout<<eval(buildTree(lex(shuntingYard(expr))))<<endl;
return 0;
}

**************************************** end parse-crispies.cc ****************************************

$ parse-crispies.exe
Postfix: 9 9 / 9 / 9/
Building Expression Tree:
Push Value Node: 9
Push Value Node: 9
Push Operator Node: /
Push Value Node: 9
Push Operator Node: /
Push Value Node: 9
Push Operator Node: /
Operator Node: /
Operator Node: /
Operator Node: /
Value Node: 9
Value Node: 9
9 / 9
Value Node: 9
1 / 9
Value Node: 9
0.111111 / 9
0.0123457

Which is, roughly speaking, 1/81


Click here to read the complete article
Re: OT: Arithmetic - Order of evaluating multiple divisions

<NledndbSxu2tSK_7nZ2dnZfqn_idnZ2d@brightview.co.uk>

  copy mid

https://news.novabbs.com/aus+uk/article-flat.php?id=122558&group=uk.d-i-y#122558

  copy link   Newsgroups: uk.d-i-y
Path: i2pn2.org!i2pn.org!weretis.net!feeder9.news.weretis.net!border-2.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 01 May 2024 23:50:08 +0000
Date: Thu, 2 May 2024 00:50:08 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: me...@privacy.net (NY)
Subject: Re: OT: Arithmetic - Order of evaluating multiple divisions
Newsgroups: uk.d-i-y
References: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
<v0uhsj$3e5bb$1@dont-email.me>
Content-Language: en-GB
In-Reply-To: <v0uhsj$3e5bb$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: AVG (VPS 240501-6, 1/5/2024), Outbound message
X-Antivirus-Status: Clean
Message-ID: <NledndbSxu2tSK_7nZ2dnZfqn_idnZ2d@brightview.co.uk>
Lines: 219
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-P2zDXF+W6bPPVA9QtJYRNVqgmAqVg6ovUeFVF+CHSI/tpiOim7gyhpLfpFwJHwLxaR1Hm3B18jhhJaI!c9zLAnjTWv5etBdpGBKzb67rYtIWszVvnqaluQX5chZL9ijFpqC2HcOWG1h25O6YXf1t1mm6NVRN!dHBJkMsKaXVmoeZiqVktT55sD5k=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: NY - Wed, 1 May 2024 23:50 UTC

On 02/05/2024 00:05, Paul wrote:

Apart from the fact that "9 / 9 / 9 / 9" isn't the same as the question
uses (*), this proves the point: it evaluates "9 / 9 / 9" as 0.111111 or
1/9, and then if you do the initial 9 / 0.111111111 division *last*
instead of first, then the overall answer would be 81.

(*) The long line of a numerator / denominator fraction is executed
last, not first, so you fully evaluate the numerator and the
denominator, then evaluate the fraction.

> **************************************** parse-crispies.cc ****************************************
> #include <iostream>
> #include <vector>
> #include <cmath>
> using namespace std;
>
> template <class T>
> class stack {
> private:
> vector<T> st;
> T sentinel;
> public:
> stack() { sentinel = T(); }
> bool empty() { return st.empty(); }
> void push(T info) { st.push_back(info); }
> T& top() {
> if (!st.empty()) {
> return st.back();
> }
> return sentinel;
> }
> T pop() {
> T ret = top();
> if (!st.empty()) st.pop_back();
> return ret;
> }
> };
>
> //determine associativity of operator, returns true if left, false if right
> bool leftAssociate(char c) {
> switch (c) {
> case '^': return false;
> case '*': return true;
> case '/': return true;
> case '%': return true;
> case '+': return true;
> case '-': return true;
> default:
> break;
> }
> return false;
> }
>
> //determins precedence level of operator
> int precedence(char c) {
> switch (c) {
> case '^': return 7;
> case '*': return 5;
> case '/': return 5;
> case '%': return 5;
> case '+': return 3;
> case '-': return 3;
> default:
> break;
> }
> return 0;
> }
>
> //converts infix expression string to postfix expression string
> string shuntingYard(string expr) {
> stack<char> ops;
> string output;
> for (char c : expr) {
> if (c == '(') {
> ops.push(c);
> } else if (c == '+' || c == '-' || c == '*' || c == '/' || c == '^' || c == '%') {
> if (precedence(c) < precedence(ops.top()) ||
> (precedence(c) == precedence(ops.top()) && leftAssociate(c))) {
> output.push_back(' ');
> output.push_back(ops.pop());
> output.push_back(' ');
> ops.push(c);
> } else {
> ops.push(c);
> output.push_back(' ');
> }
> } else if (c == ')') {
> while (!ops.empty()) {
> if (ops.top() != '(') {
> output.push_back(ops.pop());
> } else {
> ops.pop();
> break;
> }
> }
> } else {
> output.push_back(c);
> }
> }
> while (!ops.empty())
> if (ops.top() != '(')
> output.push_back(ops.pop());
> else ops.pop();
> cout<<"Postfix: "<<output<<endl;
> return output;
> }
>
> struct Token {
> int type;
> union {
> double num;
> char op;
> };
> Token(double n) : type(0), num(n) { }
> Token(char c) : type(1), op(c) { }
> };
>
> //converts postfix expression string to vector of tokens
> vector<Token> lex(string pfExpr) {
> vector<Token> tokens;
> for (int i = 0; i < pfExpr.size(); i++) {
> char c = pfExpr[i];
> if (isdigit(c)) {
> string num;
> do {
> num.push_back(c);
> c = pfExpr[++i];
> } while (i < pfExpr.size() && isdigit(c));
> tokens.push_back(Token(stof(num)));
> i--;
> continue;
> } else if (c == '+' || c == '-' || c == '*' || c == '/' || c == '^' || c == '%') {
> tokens.push_back(Token(c));
> }
> }
> return tokens;
> }
>
> //structure used for nodes of expression tree
> struct node {
> Token token;
> node* left;
> node* right;
> node(Token tok) : token(tok), left(nullptr), right(nullptr) { }
> };
>
> //builds expression tree from vector of tokens
> node* buildTree(vector<Token> tokens) {
> cout<<"Building Expression Tree: "<<endl;
> stack<node*> sf;
> for (int i = 0; i < tokens.size(); i++) {
> Token c = tokens[i];
> if (c.type == 1) {
> node* x = new node(c);
> x->right = sf.pop();
> x->left = sf.pop();
> sf.push(x);
> cout<<"Push Operator Node: "<<sf.top()->token.op<<endl;
> } else
> if (c.type == 0) {
> sf.push(new node(c));
> cout<<"Push Value Node: "<<c.num<<endl;
> continue;
> }
> }
> return sf.top();
> }
>
> //evaluate expression tree, while anotating steps being performed.
> int recd = 0;
> double eval(node* x) {
> recd++;
> if (x == nullptr) {
> recd--;
> return 0;
> }
> if (x->token.type == 0) {
> for (int i = 0; i < recd; i++) cout<<" ";
> cout<<"Value Node: "<<x->token.num<<endl;
> recd--;
> return x->token.num;
> }
> if (x->token.type == 1) {
> for (int i = 0; i < recd; i++) cout<<" ";
> cout<<"Operator Node: "<<x->token.op<<endl;
> double lhs = eval(x->left);
> double rhs = eval(x->right);
> for (int i = 0; i < recd; i++) cout<<" ";
> cout<<lhs<<" "<<x->token.op<<" "<<rhs<<endl;
> recd--;
> switch (x->token.op) {
> case '^': return pow(lhs, rhs);
> case '*': return lhs*rhs;
> case '/':
> if (rhs == 0) {
> cout<<"Error: divide by zero."<<endl;
> } else
> return lhs/rhs;
> case '%':
> return (int)lhs % (int)rhs;
> case '+': return lhs+rhs;
> case '-': return lhs-rhs;
> default:
> break;
> }
> }
> return 0;
> }
>
> int main() {
> // string expr = "3 + 4 * 2 / ( 1 - 5 ) ^ 2 ^ 3";
> string expr = "9 / 9 / 9 / 9"; // Your desired expression goes here
>
> cout<<eval(buildTree(lex(shuntingYard(expr))))<<endl;
> return 0;
> }

Re: OT: Arithmetic - Order of evaluating multiple divisions

<v0uqpp$3fr1k$1@dont-email.me>

  copy mid

https://news.novabbs.com/aus+uk/article-flat.php?id=122559&group=uk.d-i-y#122559

  copy link   Newsgroups: uk.d-i-y
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@needed.invalid (Paul)
Newsgroups: uk.d-i-y
Subject: Re: OT: Arithmetic - Order of evaluating multiple divisions
Date: Wed, 1 May 2024 21:38:00 -0400
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <v0uqpp$3fr1k$1@dont-email.me>
References: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
<v0uhsj$3e5bb$1@dont-email.me>
<NledndbSxu2tSK_7nZ2dnZfqn_idnZ2d@brightview.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 02 May 2024 03:38:02 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f7045253961b9be9fc307ce8d4cf3f77";
logging-data="3664948"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+IBsfpCEZLZ02g3ldQUZ9PbeBkNAUTGyc="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:aM6JhW4CwcVDvHKbV9tfD7VrCyo=
Content-Language: en-US
In-Reply-To: <NledndbSxu2tSK_7nZ2dnZfqn_idnZ2d@brightview.co.uk>
 by: Paul - Thu, 2 May 2024 01:38 UTC

On 5/1/2024 7:50 PM, NY wrote:

> (*) The long line of a numerator / denominator fraction is executed last, not first, so you fully evaluate the numerator and the denominator, then evaluate the fraction.

https://www.cnet.com/a/img/resize/97cd348f6d692a4492696b306fa359063a51b7e3/hub/2019/05/22/f9ac1a6a-e900-4095-9357-19e2369892f7/saucy-picard-meme.jpg?auto=webp&precrop=645,593,x0,y28&width=1200

Paul

Re: OT: Arithmetic - Order of evaluating multiple divisions

<v0uu43$3k6pv$1@dont-email.me>

  copy mid

https://news.novabbs.com/aus+uk/article-flat.php?id=122560&group=uk.d-i-y#122560

  copy link   Newsgroups: uk.d-i-y
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@needed.invalid (Paul)
Newsgroups: uk.d-i-y
Subject: Re: OT: Arithmetic - Order of evaluating multiple divisions
Date: Wed, 1 May 2024 22:34:41 -0400
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <v0uu43$3k6pv$1@dont-email.me>
References: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
<v0uhsj$3e5bb$1@dont-email.me>
<NledndbSxu2tSK_7nZ2dnZfqn_idnZ2d@brightview.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 02 May 2024 04:34:43 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f7045253961b9be9fc307ce8d4cf3f77";
logging-data="3808063"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/PJW+4++yTiAO76kCvKhVY5Pz7nThORjM="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:p1bWIwGtTi3I5XrWgoCdVxGDcjA=
In-Reply-To: <NledndbSxu2tSK_7nZ2dnZfqn_idnZ2d@brightview.co.uk>
Content-Language: en-US
 by: Paul - Thu, 2 May 2024 02:34 UTC

On 5/1/2024 7:50 PM, NY wrote:
> On 02/05/2024 00:05, Paul wrote:
>
> Apart from the fact that "9 / 9 / 9 / 9" isn't the same as the question uses (*), this proves the point: it evaluates "9 / 9 / 9" as 0.111111 or 1/9, and then if you do the initial 9 / 0.111111111 division *last* instead of first, then the overall answer would be 81.
>
> (*) The long line of a numerator / denominator fraction is executed last, not first, so you fully evaluate the numerator and the denominator, then evaluate the fraction.
>

I see that providing the program, was unintentionally a good idea.

As a thought experiment, pick up your calculator.

How many division symbols are on it ? [one]

Does the calculator have a "long horizontal line" and a "regular division" symbol ? [no]

There is no instantiation of a long horizontal line with magic properties, on computers.

There are only the rules of operator precedence.

If you, as a mathematician, wish to communicate with other mathematicians,
then you use accepted notation, with accepted operator precedence.

In cases where there is the possibility of an ambiguity (such as drawing
a long line, and wishing the audience to interpret it a certain way),
then you have the option of adding additional symbols, so that there is
no ambiguity about what you intend.

*******

Now, pick up that computer program. The C++ program I provided (from Rosetta).

Go to the input line.

Craft an expression that the program will use to achieve the answer you want.

Now, go back to your Facebook diagram and add the missing two items to the drawing.

Then, surprise us.

*******

https://en.wikipedia.org/wiki/Order_of_operations

[Picture]

https://i.postimg.cc/N0rvb7tW/division.gif

Paul

Re: OT: Arithmetic - Order of evaluating multiple divisions

<v0vc2g$3mq43$2@dont-email.me>

  copy mid

https://news.novabbs.com/aus+uk/article-flat.php?id=122562&group=uk.d-i-y#122562

  copy link   Newsgroups: uk.d-i-y
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tnp...@invalid.invalid (The Natural Philosopher)
Newsgroups: uk.d-i-y
Subject: Re: OT: Arithmetic - Order of evaluating multiple divisions
Date: Thu, 2 May 2024 07:32:48 +0100
Organization: A little, after lunch
Lines: 40
Message-ID: <v0vc2g$3mq43$2@dont-email.me>
References: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 02 May 2024 08:32:48 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7d58caf6c08cf289a5ac6854eb631983";
logging-data="3893379"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QrhygRSgtyb9JyJhXSCSfcwlB50sMoo8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:G4xIvUtiwiYasNpXRXWGYyU8090=
In-Reply-To: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
Content-Language: en-GB
 by: The Natural Philosop - Thu, 2 May 2024 06:32 UTC

On 01/05/2024 22:28, NY wrote:
> There is a question doing the rounds on Facebook as to the correct
> answer to this expression https://i.postimg.cc/Yqk0sL0j/Image1.png
>
>     9
> ---------
> 9 / 9 / 9
>
> or (for Brian Gaff) a fraction whose numerator is 9 and whose
> denominator is 9 division-sign 9 division-sign 9
>
> Three possible answers are given: 1, 9, 81
>
>
> My understanding is that the denominator 9 / 9 / 9 is *defined* to be
> parsed from left to right because both operators are the same, and
> therefore it is parsed as (9/9)/9 = 1/9 rather than 9/(9/9) = 9. And
> hence the value of the overall expression is 9 / (1/9) = 81.
>
>
> But is there an online source which supports the left-to-right order of
> parsing? Is it more of a common convention than a
> there-is-only-one-answer rule?
>
>
> It's one of those things that probably wouldn't arise in practice
> because if there was the slightest chance that it could be parsed in
> different ways, you'd use explicit brackets to remove any doubt and to
> force the answer that you want, but that would take the fun out of these
> Facebook "puzzles" ;-)

It's (or variants thereof) everywhere. It's called a math puzzle, but
it's a convention puzzle

--
“when things get difficult you just have to lie”

― Jean Claud Jüncker

Re: OT: Arithmetic - Order of evaluating multiple divisions

<l9h2f0Fk5e3U1@mid.individual.net>

  copy mid

https://news.novabbs.com/aus+uk/article-flat.php?id=122565&group=uk.d-i-y#122565

  copy link   Newsgroups: uk.d-i-y
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: new...@caffnib.co.uk (nib)
Newsgroups: uk.d-i-y
Subject: Re: OT: Arithmetic - Order of evaluating multiple divisions
Date: Thu, 2 May 2024 09:51:09 +0100
Lines: 24
Message-ID: <l9h2f0Fk5e3U1@mid.individual.net>
References: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
<v0uhsj$3e5bb$1@dont-email.me>
<NledndbSxu2tSK_7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<v0uu43$3k6pv$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net YAbCu38AwV70LHsgngAEyQpofQB6FkZcOeLDvVAq05pKAUFQB6
Cancel-Lock: sha1:2DoqLG5Ynz37t+kDfRseL4/4nGY= sha256:YuijYtaxUPeeFXbF6C7sduB+92f7mAn15K6TOIoWAEQ=
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <v0uu43$3k6pv$1@dont-email.me>
 by: nib - Thu, 2 May 2024 08:51 UTC

On 2024-05-02 03:34, Paul wrote:
> On 5/1/2024 7:50 PM, NY wrote:
>> On 02/05/2024 00:05, Paul wrote:
>>
>> Apart from the fact that "9 / 9 / 9 / 9" isn't the same as the question uses (*), this proves the point: it evaluates "9 / 9 / 9" as 0.111111 or 1/9, and then if you do the initial 9 / 0.111111111 division *last* instead of first, then the overall answer would be 81.
>>
>> (*) The long line of a numerator / denominator fraction is executed last, not first, so you fully evaluate the numerator and the denominator, then evaluate the fraction.
>>
>
> I see that providing the program, was unintentionally a good idea.
>
> As a thought experiment, pick up your calculator.
>
> How many division symbols are on it ? [one]
>
> Does the calculator have a "long horizontal line" and a "regular division" symbol ? [no]
>
> There is no instantiation of a long horizontal line with magic properties, on computers.

Not quite always! On my Casio fx-991EX I can do this:

https://drive.google.com/file/d/1iYFBZHodWZjA6fza2I0wgMbn1T0wZf-R/view?usp=sharing

nib

Re: OT: Arithmetic - Order of evaluating multiple divisions

<0zjt1QEGS1MmFwWR@marfordfarm.demon.co.uk>

  copy mid

https://news.novabbs.com/aus+uk/article-flat.php?id=122566&group=uk.d-i-y#122566

  copy link   Newsgroups: uk.d-i-y
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: tim...@marfordfarm.demon.co.uk (Tim Lamb)
Newsgroups: uk.d-i-y
Subject: Re: OT: Arithmetic - Order of evaluating multiple divisions
Date: Thu, 2 May 2024 09:53:26 +0100
Lines: 35
Message-ID: <0zjt1QEGS1MmFwWR@marfordfarm.demon.co.uk>
References: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
<v0vc2g$3mq43$2@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1;format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net b71gXJUdIZqRG3bheAcmrQ2JdJw2TtAtr94Tv69OLO8zg0GarY
X-Orig-Path: marfordfarm.demon.co.uk!tim
Cancel-Lock: sha1:1cu/ioQnDqL+r6l+vtXbqx0e11k= sha256:Tp5PVbKiYkTYH6S8iPPRDjB31+Pefo6BnGD5LQX+2Kc=
User-Agent: Turnpike/6.07-M (<ip5j1i7KW97zhDXJZgahQjPitn>)
 by: Tim Lamb - Thu, 2 May 2024 08:53 UTC

In message <v0vc2g$3mq43$2@dont-email.me>, The Natural Philosopher
<tnp@invalid.invalid> writes
>On 01/05/2024 22:28, NY wrote:
>> There is a question doing the rounds on Facebook as to the correct
>>answer to this expression https://i.postimg.cc/Yqk0sL0j/Image1.png
>>     9
>> ---------
>> 9 / 9 / 9
>> or (for Brian Gaff) a fraction whose numerator is 9 and whose
>>denominator is 9 division-sign 9 division-sign 9
>> Three possible answers are given: 1, 9, 81
>> My understanding is that the denominator 9 / 9 / 9 is *defined* to
>>be parsed from left to right because both operators are the same, and
>>therefore it is parsed as (9/9)/9 = 1/9 rather than 9/(9/9) = 9. And
>>hence the value of the overall expression is 9 / (1/9) = 81.
>> But is there an online source which supports the left-to-right
>>order of parsing? Is it more of a common convention than a
>>there-is-only-one-answer rule?
>> It's one of those things that probably wouldn't arise in practice
>>because if there was the slightest chance that it could be parsed in
>>different ways, you'd use explicit brackets to remove any doubt and to
>>force the answer that you want, but that would take the fun out of
>>these Facebook "puzzles" ;-)
>
>It's (or variants thereof) everywhere. It's called a math puzzle, but
>it's a convention puzzle

I was 13 when *Jonnie Roscoe* taught us to follow the convention BODMAS
(brackets,oving,division,multiplication,addition,subtraction)
I have never had reason to doubt him.
>
>

--
Tim Lamb

Re: OT: Arithmetic - Order of evaluating multiple divisions

<v0vr51$3q9o1$1@dont-email.me>

  copy mid

https://news.novabbs.com/aus+uk/article-flat.php?id=122570&group=uk.d-i-y#122570

  copy link   Newsgroups: uk.d-i-y
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@needed.invalid (Paul)
Newsgroups: uk.d-i-y
Subject: Re: OT: Arithmetic - Order of evaluating multiple divisions
Date: Thu, 2 May 2024 06:50:08 -0400
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <v0vr51$3q9o1$1@dont-email.me>
References: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
<v0uhsj$3e5bb$1@dont-email.me>
<NledndbSxu2tSK_7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<v0uu43$3k6pv$1@dont-email.me> <l9h2f0Fk5e3U1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 02 May 2024 12:50:09 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f7045253961b9be9fc307ce8d4cf3f77";
logging-data="4007681"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rJGyfxbKLc7xnxD8y/xOvvprxBcflQg4="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:lBJsG54Xpec3tZIe3GSG2kPYE6E=
In-Reply-To: <l9h2f0Fk5e3U1@mid.individual.net>
Content-Language: en-US
 by: Paul - Thu, 2 May 2024 10:50 UTC

On 5/2/2024 4:51 AM, nib wrote:
> On 2024-05-02 03:34, Paul wrote:
>> On 5/1/2024 7:50 PM, NY wrote:
>>> On 02/05/2024 00:05, Paul wrote:
>>>
>>> Apart from the fact that "9 / 9 / 9 / 9" isn't the same as the question uses (*), this proves the point: it evaluates "9 / 9 / 9" as 0.111111 or 1/9, and then if you do the initial 9 / 0.111111111 division *last* instead of first, then the overall answer would be 81.
>>>
>>> (*) The long line of a numerator / denominator fraction is executed last, not first, so you fully evaluate the numerator and the denominator, then evaluate the fraction.
>>>
>>
>> I see that providing the program, was unintentionally a good idea.
>>
>> As a thought experiment, pick up your calculator.
>>
>> How many division symbols are on it ?  [one]
>>
>> Does the calculator have a "long horizontal line" and a "regular division" symbol ? [no]
>>
>> There is no instantiation of a long horizontal line with magic properties, on computers.
>
> Not quite always! On my Casio fx-991EX I can do this:
>
> https://drive.google.com/file/d/1iYFBZHodWZjA6fza2I0wgMbn1T0wZf-R/view?usp=sharing
>
> nib

That is probably what everyone in Facebook uses.

https://www.casio.com/content/dam/casio/global/support/manuals/calculators/pdf/004-en/f/fx-570_991EX_EN.pdf

$ parse-crispies.exe
Original: 9 / ( 9 / 9 / 9 )
Postfix: 9 9 9 / 9 //
Building Expression Tree:
Push Value Node: 9
Push Value Node: 9
Push Value Node: 9
Push Operator Node: /
Push Value Node: 9
Push Operator Node: /
Push Operator Node: /
Operator Node: /
Value Node: 9
Operator Node: /
Operator Node: /
Value Node: 9
Value Node: 9
9 / 9
Value Node: 9
1 / 9
9 / 0.111111
81

Paul

Re: OT: Arithmetic - Order of evaluating multiple divisions

<6633f032.957442828@news.eternal-september.org>

  copy mid

https://news.novabbs.com/aus+uk/article-flat.php?id=122592&group=uk.d-i-y#122592

  copy link   Newsgroups: uk.d-i-y
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.invalid (AnthonyL)
Newsgroups: uk.d-i-y
Subject: Re: OT: Arithmetic - Order of evaluating multiple divisions
Date: Thu, 02 May 2024 19:59:59 GMT
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <6633f032.957442828@news.eternal-september.org>
References: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
Injection-Date: Thu, 02 May 2024 21:59:59 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="92ceaafc2ec79ac28352b082392cdce5";
logging-data="57290"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OG83WqqYF+8pVViDdyCEQ"
Cancel-Lock: sha1:TPcqp3KYdE2AycG3p8Nhb2FQr/k=
X-Newsreader: Forte Free Agent 1.21/32.243
 by: AnthonyL - Thu, 2 May 2024 19:59 UTC

On Wed, 1 May 2024 22:28:54 +0100, NY <me@privacy.net> wrote:

>There is a question doing the rounds on Facebook as to the correct
>answer to this expression https://i.postimg.cc/Yqk0sL0j/Image1.png
>
> 9
>---------
>9 / 9 / 9
>
>or (for Brian Gaff) a fraction whose numerator is 9 and whose
>denominator is 9 division-sign 9 division-sign 9
>
>Three possible answers are given: 1, 9, 81
>
>
>My understanding is that the denominator 9 / 9 / 9 is *defined* to be
>parsed from left to right because both operators are the same, and
>therefore it is parsed as (9/9)/9 = 1/9 rather than 9/(9/9) = 9. And
>hence the value of the overall expression is 9 / (1/9) = 81.
>
>
>But is there an online source which supports the left-to-right order of
>parsing? Is it more of a common convention than a
>there-is-only-one-answer rule?
>
>
>It's one of those things that probably wouldn't arise in practice
>because if there was the slightest chance that it could be parsed in
>different ways, you'd use explicit brackets to remove any doubt and to
>force the answer that you want, but that would take the fun out of these
>Facebook "puzzles" ;-)

FWIW LibreCalc and an old Excel both give 81 assuming it is parsed as
9/(9/9/9/)

--
AnthonyL

Why ever wait to finish a job before starting the next?

Re: OT: Arithmetic - Order of evaluating multiple divisions

<ns8xfkJmhQNmFwtb@b-howie.co.uk>

  copy mid

https://news.novabbs.com/aus+uk/article-flat.php?id=122624&group=uk.d-i-y#122624

  copy link   Newsgroups: uk.d-i-y
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@b-howie.co.uk (brian)
Newsgroups: uk.d-i-y
Subject: Re: OT: Arithmetic - Order of evaluating multiple divisions
Date: Fri, 3 May 2024 16:53:10 +0100
Organization: A noiseless patient Spider
Lines: 61
Message-ID: <ns8xfkJmhQNmFwtb@b-howie.co.uk>
References: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
Reply-To: brian <brian@b-howie.co.uk>
MIME-Version: 1.0
Content-Type: text/plain;charset=us-ascii
Injection-Date: Fri, 03 May 2024 17:58:30 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a9925e1b7b4fe42476764944379dc365";
logging-data="669578"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/w0CmM1tThVqEaQm4cdXpT"
User-Agent: Turnpike/6.07-S (<3WeO5sJ2MLOAupa43YphrSTTt$>)
Cancel-Lock: sha1:sSSg19+YuKS/ki3ERaKx6bWVVp4=
 by: brian - Fri, 3 May 2024 15:53 UTC

In message <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>, NY
<me@privacy.net> writes
>There is a question doing the rounds on Facebook as to the correct
>answer to this expression https://i.postimg.cc/Yqk0sL0j/Image1.png
>
> 9
>---------
>9 / 9 / 9
>
>or (for Brian Gaff) a fraction whose numerator is 9 and whose denominator
>is 9 division-sign 9 division-sign 9
>
>Three possible answers are given: 1, 9, 81
>
>
>My understanding is that the denominator 9 / 9 / 9 is *defined* to be
>parsed from left to right because both operators are the same, and
>therefore it is parsed as (9/9)/9 = 1/9 rather than 9/(9/9) = 9. And hence
>the value of the overall expression is 9 / (1/9) = 81.
>
>
>But is there an online source which supports the left-to-right order of
>parsing? Is it more of a common convention than a there-is-only-one-
>answer rule?
>
>
>It's one of those things that probably wouldn't arise in practice because if
>there was the slightest chance that it could be parsed in different ways,
>you'd use explicit brackets to remove any doubt and to force the answer
>that you want, but that would take the fun out of these Facebook
>"puzzles" ;-)

SMath Studio says 1

divide top and bottom by 9( iff 9 ne 0 )

1
------
1/9/9

the denominator reduces to

9/9 =1 because dividing a denominator by a number is the same as
multiplying the numerator

1/1 = 1

9
---------
9*9^-1*9 =1 someone will say ah but that's 3.8742*10^8

general case

f(x) = x/x/x/x

simplifies to x iff x ne 0

Brian
--
Brian Howie

Re: OT: Arithmetic - Order of evaluating multiple divisions

<l9kn46F1sdfU1@mid.individual.net>

  copy mid

https://news.novabbs.com/aus+uk/article-flat.php?id=122635&group=uk.d-i-y#122635

  copy link   Newsgroups: uk.d-i-y
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: new...@caffnib.co.uk (nib)
Newsgroups: uk.d-i-y
Subject: Re: OT: Arithmetic - Order of evaluating multiple divisions
Date: Fri, 3 May 2024 19:02:10 +0100
Lines: 64
Message-ID: <l9kn46F1sdfU1@mid.individual.net>
References: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
<v0uhsj$3e5bb$1@dont-email.me>
<NledndbSxu2tSK_7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<v0uu43$3k6pv$1@dont-email.me> <l9h2f0Fk5e3U1@mid.individual.net>
<YNLundL4wRNmFwZ9@b-howie.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net ACbrJr0reYlve5jd6vFwPgElTgBMB2x/Zx8gLZW05gT8DyU7B+
Cancel-Lock: sha1:hakopEe8siFbBD37EPp7VqL+AgA= sha256:7W2bHqhZ51qGyXiyIgXO931fbUvJwcgV6vHFBrJn8YM=
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <YNLundL4wRNmFwZ9@b-howie.co.uk>
 by: nib - Fri, 3 May 2024 18:02 UTC

On 2024-05-03 18:17, brian wrote:
> In message <l9h2f0Fk5e3U1@mid.individual.net>, nib <news@caffnib.co.uk>
> writes
>> On 2024-05-02 03:34, Paul wrote:
>>> On 5/1/2024 7:50 PM, NY wrote:
>>>> On 02/05/2024 00:05, Paul wrote:
>>>>
>>>> Apart from the fact that "9 / 9 / 9 / 9" isn't the same as the
>>>> question uses (*), this proves the point: it evaluates "9 / 9 / 9"
>>>> as 0.111111 or 1/9, and then if you do the initial 9 / 0.111111111
>>>> division *last* instead of first, then the overall answer would be 81.
>>>>
>>>> (*) The long line of a numerator / denominator fraction is executed
>>>> last, not first, so you fully evaluate the numerator and the
>>>> denominator, then evaluate the fraction.
>>>>
>>>  I see that providing the program, was unintentionally a good idea.
>>>  As a thought experiment, pick up your calculator.
>>>  How many division symbols are on it ?  [one]
>>>  Does the calculator have a "long horizontal line" and a "regular
>>> division" symbol ? [no]
>>>  There is no instantiation of a long horizontal line with magic
>>> properties, on computers.
>>
>> Not quite always! On my Casio fx-991EX I can do this:
>>
>> https://drive.google.com/file/d/1iYFBZHodWZjA6fza2I0wgMbn1T0wZf-R/view?u
>> sp=sharing
>>
>> nib
>
> Reverse Polish gives 1
>
> there are 3 operators and 4 numbers
>
> 9 enter 9  enter 9 enter 9 enter div div div
>
> Or maybe my calculator is totally Hewlett.
>
> The long line is an implied parenthesis (magical property),so  the
> answer is 81
>
> Compare
>
>      9
> -----------
> 1+1+1
>
> Enuf  arith for the day.
>
> Brian
>

That's exactly what the Casios do.

When you create the template for entering a fraction it effectively creates

( xxx ) / ( yyy )

which displays as the long line with holding marks above and below and
then fills in xxx and yyy as two separate expressions as you edit them.

nib

Re: OT: Arithmetic - Order of evaluating multiple divisions

<YNLundL4wRNmFwZ9@b-howie.co.uk>

  copy mid

https://news.novabbs.com/aus+uk/article-flat.php?id=122639&group=uk.d-i-y#122639

  copy link   Newsgroups: uk.d-i-y
Path: i2pn2.org!i2pn.org!usenet.network!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@b-howie.co.uk (brian)
Newsgroups: uk.d-i-y
Subject: Re: OT: Arithmetic - Order of evaluating multiple divisions
Date: Fri, 3 May 2024 18:17:44 +0100
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <YNLundL4wRNmFwZ9@b-howie.co.uk>
References: <gw2dne6pMaGFKa_7nZ2dnZfqnPidnZ2d@brightview.co.uk>
<v0uhsj$3e5bb$1@dont-email.me>
<NledndbSxu2tSK_7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<v0uu43$3k6pv$1@dont-email.me> <l9h2f0Fk5e3U1@mid.individual.net>
Reply-To: brian <brian@b-howie.co.uk>
MIME-Version: 1.0
Content-Type: text/plain;charset=us-ascii;format=flowed
Injection-Date: Fri, 03 May 2024 19:28:36 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a9925e1b7b4fe42476764944379dc365";
logging-data="707922"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/qrAvRiFljDAgk7Cb+x7SX"
User-Agent: Turnpike/6.07-S (<n4cO5ULGMLOkFpa4ZYlhrSqZCI>)
Cancel-Lock: sha1:Vi4eXWhd9ssK4HRv4d++bz3xkLE=
 by: brian - Fri, 3 May 2024 17:17 UTC

In message <l9h2f0Fk5e3U1@mid.individual.net>, nib <news@caffnib.co.uk>
writes
>On 2024-05-02 03:34, Paul wrote:
>> On 5/1/2024 7:50 PM, NY wrote:
>>> On 02/05/2024 00:05, Paul wrote:
>>>
>>> Apart from the fact that "9 / 9 / 9 / 9" isn't the same as the
>>>question uses (*), this proves the point: it evaluates "9 / 9 / 9" as
>>>0.111111 or 1/9, and then if you do the initial 9 / 0.111111111
>>>division *last* instead of first, then the overall answer would be 81.
>>>
>>> (*) The long line of a numerator / denominator fraction is executed
>>>last, not first, so you fully evaluate the numerator and the
>>>denominator, then evaluate the fraction.
>>>
>> I see that providing the program, was unintentionally a good idea.
>> As a thought experiment, pick up your calculator.
>> How many division symbols are on it ? [one]
>> Does the calculator have a "long horizontal line" and a "regular
>>division" symbol ? [no]
>> There is no instantiation of a long horizontal line with magic
>>properties, on computers.
>
>Not quite always! On my Casio fx-991EX I can do this:
>
>https://drive.google.com/file/d/1iYFBZHodWZjA6fza2I0wgMbn1T0wZf-R/view?u
>sp=sharing
>
>nib

Reverse Polish gives 1

there are 3 operators and 4 numbers

9 enter 9 enter 9 enter 9 enter div div div

Or maybe my calculator is totally Hewlett.

The long line is an implied parenthesis (magical property),so the
answer is 81

Compare

9
-----------
1+1+1

Enuf arith for the day.

Brian

--
Brian Howie


aus+uk / uk.d-i-y / OT: Arithmetic - Order of evaluating multiple divisions

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor