You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SWI-Prolog can compute 9^(9^9) without a resource error and
very quickly ( :-) ), even if despite it has ca. 370 million digits:
Welcome to SWI-Prolog (threaded, 64 bits, version 7.7.15)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
?- [user].
pow(_,0,1) :- !.
pow(X,1,X) :- !.
pow(X,N,Y) :-
M is N//2, pow(X,M,A),
J is N mod 2, pow(X,J,B),
Y is (A*A)*B.
^D
?- pow(9,9,X).
X = 387420489.
?- time((pow(9,9,X), pow(9,X,_))).
% 159 inferences, 7.500 CPU in 8.514 seconds (88% CPU, 21 Lips)
The text was updated successfully, but these errors were encountered:
SWI-Prolog can compute 9^(9^9) without a resource error and
very quickly ( :-) ), even if despite it has ca. 370 million digits:
The text was updated successfully, but these errors were encountered: