Dear list,
this is my little prolog script:
init :-
set_prolog_flag(float_overflow, infinity).
:- init.
example :-
A is 1 + 1.0Inf,
writeln(A).
Under Windows, Ctrl-x, ctrl-s for saving, then ctrl-c, ctrl-b for compiling/consulting. When I type example.
I get
ERROR: Arithmetic: evaluation error: `float_overflow’
ERROR: In:
ERROR: [11] _13436 is 1+1.0Inf
ERROR: [10] example at c:/users/matth/documents/prolog/flag.pl:7
ERROR: [9]
I need to explicitly invoke init.
and only then example.
works as expected (i.e., prints an infinite number).
Seems like a bug (?)
Best wishes, Matthias