Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: [Phys-L] [External] math notation puzzles



Anyone want to throw pointers, typecasts, and bitwise operators into the
mix?


int a = 8;

int b = 4;

int c = 2;

a*=++b>>--c>=7+*(&a+1);

printf("%d %d %d\n",a,b,c);

Also...
http://collaboration.cmc.ec.gc.ca/science/rpn/biblio/ddj/Website/articles/CUJ/1993/9303/skelly/list1.htm



On Wed, Feb 6, 2019 at 6:33 PM Don via Phys-l <phys-l@mail.phys-l.org>
wrote:

Sorry, I meant to say -9 and -300.
Don

-----Original Message-----
From: Don [mailto:dgpolvani@gmail.com]
Sent: Wednesday, February 6, 2019 7:32 PM
To: Phys-L@Phys-L.org
Subject: RE: [Phys-L] [External] math notation puzzles

My Excel (Excel 2013) gives -9 and 300 for Cases 1 and 2.
Don

-----Original Message-----
From: Phys-l [mailto:phys-l-bounces@mail.phys-l.org] On Behalf Of
LaMontagne, Bob
Sent: Wednesday, February 6, 2019 1:27 PM
To: Phys-L@Phys-L.org
Subject: Re: [Phys-L] [External] math notation puzzles

Excel gives +9 and 25.


That surprised me because I have always used parentheses so the issue
never came up.


Bob at PC

________________________________
From: Phys-l <phys-l-bounces@mail.phys-l.org> on behalf of John Denker
via Phys-l <phys-l@mail.phys-l.org>
Sent: Tuesday, February 5, 2019 6:05:10 PM
To: Phys-L@Phys-L.org
Cc: John Denker
Subject: [External] [Phys-L] math notation puzzles

Some puzzle questions:

1) Some computer languages use ^ as the exponentiation operator. In
that case, what is the numerical value of:
-3​^​2

How do you know?
How sure are you?

2) Some computer languages use ** as the exponentiation operator. In
that case, what is the numerical value of:
-3**2

How do you know?
How sure are you?

3) What is the numerical value of:
3⋅3 + 4⋅4

How do you know?
How sure are you?


==============
For each question:

-- I have an answer in mind.
-- I expect that after the dust settles, there will be near-universal
agreement as to the right answer.
-- There is a reason for asking the question.
-- I have not done anything to make it trickier than it needs to be.
-- You are warned that the question might not be as easy as it
initially appears. That is to say, there is a certain amount of
irreducible
trickiness.

_______________________________________________
Forum for Physics Educators
Phys-l@mail.phys-l.org

https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.p
hys-l.org%2Fmailman%2Flistinfo%2Fphys-

l&amp;data=01%7C01%7Crlamont%40providence.edu%7C08ed78567d98429

e0c9408d68bbe681b%7C29196f361d5e4d2689453be41ba81178%7C0&amp;sd

ata=ecyvQygK1GCVXB4%2B3eL1axy5Mc%2BaeBXj%2BZauRi84eSQ%3D&amp
;reserved=0

This email originated from outside of Providence College. Do not click
links or open attachments unless you recognize the sender and know the
content is safe.


_______________________________________________
Forum for Physics Educators
Phys-l@mail.phys-l.org
http://www.phys-l.org/mailman/listinfo/phys-l


_______________________________________________
Forum for Physics Educators
Phys-l@mail.phys-l.org
http://www.phys-l.org/mailman/listinfo/phys-l