EDCS Reference Manual
Functions
EDCS CompareLongFloatIntervals
extern int
EDCS_CompareLongFloatIntervals
(
constEDCS_Long_Float_Interval *a_ptr,1
constEDCS_Long_Float_Interval *b_ptr2
);

Definition

Compares two EDCS_Long_Float_Intervals. This function's signature is compatible with qsort.

The comparison compares lower bounds, then uses upper bounds to break any ties. If the lower bound and upper bound values match, closed bounds are considered less than open bounds.

In this instance, the compare operation is as follows. Note that it does not behave differently if either interval is invalid; it is the user's responsibility to check for valid input.

  1. If either argument is NULL, then the result is based on comparing the pointers.

  2. If the two lower bounds are unequal, the comparison of the lower bound values determines the result of the compare operation on the intervals

  3. If the two lower bounds are equal, then

         3.1) If the interval types are equal, then the comparison of the
              upper bounds determines the interval comparison result.
    
         3.2) If the interval types are not equal, and if one interval
              has a closed lower bound but the other does not, the
              interval with the closed lower bound is determined to be
              "less than" the interval with the open lower bound.
    
         3.3) Otherwise,
    
              3.3.1) If the upper bound values are unequal, then
                     the comparison of the upper bound values determines
                     the result
    


Returns

-1 if *a_ptr is NULL and *b_ptr is non-NULL, or *a_ptr < *b_ptr
0 if both arguments are NULL, or *a_ptr == *b_ptr
1 if *b_ptr is NULL and *a_ptr is non-NULL, or *a_ptr > *b_ptr

Parameters Notes

1 handle to 1st EDCS_Long_Float_Interval to be compared

2 handle to 2nd EDCS_Long_Float_Interval to be compared


Prev: EDCS_CompareLocales. Next: EDCS_CompareLongFloatValues. Up:Index.

Last updated: July 26, 2006 Copyright © 2006 SEDRIS