Search the web
Sign In
New User? Sign Up
squeak
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: power of a number   Message List  
Reply | Forward Message #94857 of 145177 |
Re: power of a number

On Mon, May 23, 2005 at 02:53:16PM +0200, Guenther Schmidt wrote:
> I want to do an arithmetic expression like:
>
> 2 power 3, ie. (2 * 2 * 2).

Others have answered the question. Just so you know, though, Ted Kaehler's
method finder is excellent for finding these answers. If you start up
Squeak, open a method finder (with the "open" menu), and type in:

2 . 3 . 8

Then you will find the existing method for this operation. This is
a fantastic tool for all the little basic questions that people have
when they are learning a new language.

-Lex




Mon May 23, 2005 2:39 pm

lex@...
Send Email Send Email

Forward
Message #94857 of 145177 |
Expand Messages Author Sort by Date

... my suggestion would be to implement a method called power: in the category Number power: aNumber ... aNumber timesRepeat: [result := result * self]. ...
Cornelius Huber
corny@...
Send Email
May 23, 2005
1:05 pm

Hi ! If you want ABSOLUTELY a #power: or a #** method you should alias #raisedTo: Number>>power: aNumber ^ (self raisedTo:aNumber) The #raisedTo: method is...
Julien Bourdon
bourdux@...
Send Email
May 23, 2005
1:18 pm

... Others have answered the question. Just so you know, though, Ted Kaehler's method finder is excellent for finding these answers. If you start up Squeak,...
Lex Spoon
lex@...
Send Email
May 23, 2005
2:47 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help