number_chars/2に負の値を代入すると異常な値が帰ってきます。
% AZ-Prolog Version 9.63 (Linux/x64) GCC 5.4.0<br />
% Copyright (C) SOFNEC CO., LTD. 1987-2017/06/2<br />
?- number_chars(-1,L).
L = [‘1′,’8′,’4′,’4′,’6′,’7′,’4′,’4′,’0′,’7′,’3′,’7′,’0′,’9′,’5′,’5′,’1′,’6′,’1′,’5’]
<br />
?- number_chars(+1,L).
Type error: number expected —- Backtrace
number_chars(+(1),L_10) ?-
<br />
% SWI-Prolog (threaded, 64 bits, version 7.6.4)
?- number_chars(-1,L).
L = [-, ‘1’].
<br />
?- number_chars(+1,L).
L = [‘1’].
<br />
% GNU Prolog 1.4.4 (64 bits)
?- number_chars(-1,L).
L = [-, ‘1’].
<br />
?- number_chars(+1,L).
uncaught exception: error(type_error(number,+1),number_chars/2)