[ library(range) | The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]

int_tolerance(-Tol)

Get the integer tolerance value.
Tol
Current Tolerance

Description

The range library is designed to be provide ranged variables for use with other libraries. This can involve the conversion between floats and integer, and in some external libraries, an integer tolerance is needed to ensure the correct conversion. Consider the setting of bounds for a integer ranged variable. Normally,

  [eclipse 3]: integers(X), lwb(X,2.000000000001).

  X = X{3 .. 1.0Inf}
is correct, because 2 is not a valid value for the range. However, an external value might return such a value when the intended value is 2. Thus, a tolerance can be set to allow values close to an integer be correctly converted.
  [eclipse 5]: set_int_tolerance(0.0001), integers(X), lwb(X,2.000000000001).

  X = X{2 .. 1.0Inf}
  yes.
  [eclipse 6]: set_int_tolerance(0.0001), integers(X), lwb(X,2.01).

  X = X{3 .. 1.0Inf}
  yes.

The initial default for int_tolerance is 0.0. It is not needed by the range library itself, or ria, which performs the correct conversions.

See Also

set_int_tolerance / 1