|
-
February 23rd, 2008, 06:56 AM
#1
Incrementing a value
Would it be wise to use a loop to do the following?
enter a number eg 5 then multiply 0.2 by 1.0 squared then 1.2 squared and so forth until you reach the number then user typed in.
-
February 23rd, 2008, 07:43 AM
#2
-
February 23rd, 2008, 08:46 AM
#3
Re: Incrementing a value
 Originally Posted by MainManDan
Would it be wise to use a loop to do the following?
enter a number eg 5 then multiply 0.2 by 1.0 squared then 1.2 squared and so forth until you reach the number then user typed in.
Yes, the way how you implement an "until" in most languages is a loop. Just that the keyword is "while", not "until".
More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity. --W.A.Wulf
Premature optimization is the root of all evil --Donald E. Knuth
Please read Information on posting before posting, especially the info on using [code] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|