Thread: DIFF doesn't compare numerical values?

  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    48

    DIFF doesn't compare numerical values?

    Dear there,

    I downloaded a numerical package, which includes test code and its output txt files. After I run a few tests and eyeballed some discrepancy, I felt a thorough comparison is necessary. I run DIFF and get numerous lines, most of them are caused by difference between 0 and 1e-16, or -0 and 0. Is there a way I can ignore these small difference as well?

    Michael

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,662
    Are you comparing floats for equality?
    Question 14.5
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. reading values from a file
    By megastar in forum C Programming
    Replies: 4
    Last Post: 06-25-2007, 02:08 AM
  2. Need help comparing db field values in c++
    By misha in forum C++ Programming
    Replies: 18
    Last Post: 07-09-2003, 09:37 AM
  3. unsigned char vs signed char and range of values
    By Silvercord in forum C++ Programming
    Replies: 5
    Last Post: 01-22-2003, 01:30 PM
  4. adding ASCII values
    By watshamacalit in forum C Programming
    Replies: 1
    Last Post: 12-26-2002, 07:16 PM
  5. How to read in empty values into array from input file
    By wpr101 in forum C++ Programming
    Replies: 5
    Last Post: 11-28-2002, 10:59 PM