Page 1 of 1

Real value 1.#INF is out of the range

Posted: 29 Apr 2013 12:34
by Martin Meyer
Hello Thomas, hi all,

this compiles and outputs "X is infinity_positive":

Code: Select all

    ...     X = math::infinity_positive,     if X = math::infinity_positive then         stdIo::write("X is infinity_positive")     end if.     ...
On that however the compiler (7.4 build 7401) throws error c224 : The value 1.#INF is out of the range [ -1.79769313486232e+308 .. 1.79769313486232e+308 ] for the domain '::real':

Code: Select all

    ...     X = math::infinity_positive,     test(X),     ...   class predicates     test : (real X). clauses     test(math::infinity_positive):-         !,         stdIo::write("X is infinity_positive").     test(_).
Is it a bug? If not, please explain how to use math::infinity_positive and similar constants of class math correctly.

Thank you,
Martin

Posted: 30 Apr 2013 13:39
by Thomas Linder Puls
The standard defining the real/floating point representation used on our processor defines these special patterns that does not represent a number but some meta-value(s).

We have defined the corresponding bit patterns without really considering what it should mean for Visual Prolog and how we intend them to be used.

The compiler does not pay any special attention to these constants, so in cases where the compiler itself needs a number it may issue the error you see, and in cases where the compiler just needs a bit pattern it will not react to these values. From a language semantics point of view you can say that the semantics of these values is underspecified.

I am not sure if or when we will deal with this underspecification.

Posted: 4 Jun 2013 7:52
by Thomas Linder Puls
This is fixed in Build 7402. IDE: Web -> Check for updates...