I basically added a button labeled "pi" which was copied from "+". You then
need to add a new conditional for handling case of "pi" (in
CalculatorBrain.m) which is an operation with no parameters that simply
adds the result pi to the operand stack. I ended up using <math.h> which
defines a constant M_PI. I think the confusing part is that you would
expect "pi" to act as if you are entering a number but rather it's treated
as an operation (unintuitive).

Hope that helps.

-Basil

2011/12/7 zak <yzhangwei@gmail.com>
Any one can give a better explanation what Assignment1 expects π to
work? The Assignment expiation was not so clear.

π: calculates (well, conjures up) the value of π. Examples: 3 π *
should put three times the value of π into the display on your
calculator, so should 3 Enter π *, so should π 3 *. Perhaps
unexpectedly, π Enter 3 * + would result in 4 times π being shown. You
should understand why this is the case. NOTE: This required task is to
add π as an operation (an operation which takes no arguments off of
the operand stack), not a new way of entering an operand into the
display.

--
You received this message because you are subscribed to the Google Groups
"iPhone Application Development Auditors" group.
To post to this group, send email to
iphone-appdev-auditors@googlegroups.com.
To unsubscribe from this group, send email to
iphone-appdev-auditors+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/iphone-appdev-auditors?hl=en.

--
Basil Hashem
bhashem@gmail.com

--
You received this message because you are subscribed to the Google Groups "iPhone Application Development Auditors" group.
To post to this group, send email to iphone-appdev-auditors@googlegroups.com.
To unsubscribe from this group, send email to iphone-appdev-auditors+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/iphone-appdev-auditors?hl=en.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 8 | next ›
Discussion Overview
groupiphone-appdev-auditors @
categoriesiphone
postedDec 8, '11 at 5:11a
activeDec 10, '11 at 7:33a
posts8
users6
websitedeveloper.apple.com...
irc#iphone

People

Translate

site design / logo © 2017 Grokbase