CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2008
    Posts
    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.

  2. #2
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: Incrementing a value

    [ Redirected thread ]

  3. #3
    Join Date
    Jan 2004
    Location
    Düsseldorf, Germany
    Posts
    2,401

    Re: Incrementing a value

    Quote 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
  •  





Click Here to Expand Forum to Full Width

Featured