Minimum and Maximum float value in MiniZinc

189 views Asked by At

From the MiniZinc specification :

Floats represent real numbers. Float representations are implementation-defined. This means that the representable range and precision of floats is implementation-defined. However, an implementation should abort at run-time on exceptional float operations (e.g., those that produce NaN, if using IEEE754 floats).

What does it means that Float representations are implementation-defined? Does it depends on the solver which will be used?

And how the Float representation is handled by the mzn2fzn tool? Which are its bound?

1

There are 1 answers

0
Dekker1 On BEST ANSWER

MiniZinc tries to adhere to the IEEE standard. The compiler itself (the minizinc driver or its older brother mzn2fzn) adheres to this standard, as far as my knowledge goes. Internally the compiler uses a 64 bit precision for its floating point values. If there are any problems where the compiler does not adhere to these standards, I would encourage you to report them.

The standards for the solvers are a different matter. MiniZinc only enforces minimal control over the solvers. If you want to ensure they employ the correct standards you will have to verify with the manufacturer of the solver. This is why the specification says it is implementation-defined, as the solver might use 32-bits, like Gecode, 64-bit, as most solvers do, or a fully different technique like an interval library.