Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: VictorN

Search: Search took 0.06 seconds.

  1. Replies
    22
    Views
    6,981

    Re: 0 isn't 0 in C++ math

    Again: did you read about FP arithmetic?
  2. Replies
    22
    Views
    6,981

    Re: 0 isn't 0 in C++ math

    I'd say it is the only way. The question is only about this 'delta' value. In some case your choice with 0.000001 can work, in other - not. It all depends on the problem / values you are working on /...
  3. Replies
    22
    Views
    6,981

    Re: 0 isn't 0 in C++ math

    Haven't you read yet what I referred to in the post#2?
  4. Replies
    22
    Views
    6,981

    Re: 0 isn't 0 in C++ math

    Well, I meant this abs, _abs64

    However, you can use fabs instead.
  5. Replies
    22
    Views
    6,981

    Re: 0 isn't 0 in C++ math

    In general you cannot just compare floats as "a == c". You have to implement some relative small (with respect to the "a" and "c") value ("delta") and compare like:
    if(abs(a - c) < delta)
    {
    ......
  6. Replies
    22
    Views
    6,981

    Re: 0 isn't 0 in C++ math

    Scripts are not discussed in this Forum.
    There is a Visual C++ Programming forum, and Visual C++ is code, not script.

    Did you, perhaps, mean "A is a value within intetrval [Ap;Ag]"?

    Anyway,...
Results 1 to 6 of 6


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


On-Demand Webinars (sponsored)