FRAMES NO FRAMES

IlcNull

public IlcConstraint IlcNull(const IlcFloatExp x)
Definition file: ilsolver/linfloat.h
Include file: <ilsolver/ilosolver.h>

This function is a constraint that forces a constrained floating-point expression to be included in the interval [-IlcFloatMin, IlcFloatMin]. It is equivalent to -IlcFloatMin <= x <= IlcFloatMin.

This constraint should be used instead of a comparison to 0 (zero). Thus the statement

 s.add(IlcNull(x)); // Good Practice

is better than

 s.add(x==0.);     // Bad Practice

The statement we recommend gives more accurate results in the context of the usual floating-point pitfalls.

See Also: