Why a bignumber is shown incomplete in ECLiPSe Prolog?

128 Views Asked by At

I use the latest version of ECLiPSe Prolog 64-bit for Windows, then I compile the code:

:- op(200, yf, !).
!(N, F) :- fac(N, 1, F).
fac(0, F0, F) :- !, F=F0.
fac(N, F0, F) :- N1 is N-1, F1 is F0*N, fac(N1, F1, F).

Query entered:

?- X is 100000 !.
X = 28242294079603478742934215200555696886678...
Yes (8.17s cpu)

First question: Why shows only 1999 digits and no the 456574 complete digits in TkEclipse?

Second question: Offers the possibility to log the interaction with the user on a file ECLiPSe Prolog as protocol(+File) of SWI-Prolog?

I'm sorry for doing two questions. I will be grateful for any help you can provide.

2

There are 2 best solutions below

0
On

ECLiPSe does print the complete result to a stream called answer_output, but the text is later truncated by the graphical user interface.

The easiest way to get the result into a file is to write it there explicitly, e.g.

?- open(myresult,write,S), X is 100000!, writeln(S,'X'=X), close(S).
0
On

Works with DosEclipse from Version 7.0 #36 (x86_64_nt):

enter image description here

Edit 31.01.2018: Time shown the same when no output is generated.