CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #6
    Join Date
    May 2009
    Posts
    2,413

    Re: Ask a question about algorithm

    Well, does it seem to work?

    Note that incrementing a floating point in a loop like this,

    for (double cx = recVertex.x; cx <= recVertex.x + LENGTH; cx += 0.5)

    generally should be avoided because small conversion errors tend to be magnified as looping proceeds. It may not cause any harm in this case because the increment 0.5 can be exactly represented in binary but still it's safer to avoid it.
    Last edited by nuzzle; February 12th, 2010 at 11:13 AM.

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