So basically it seems that GNU Prolog use 28bit integer on my 32bit x86 Linux.
The code below can not be compiled:
foo(A) :-
A0 is 0xdeadbeef,
A1 is A0 >> 8,
A2 is A0 >> 16,
A3 is A0 >> 24.
Then I am confused with two typical situations below:
How to represent a
32bit
integer in GNU Prolog (like 0xdeadbeef)? and pushing it further, how to represent a 64 bit integer ? On 64 bit x86 Linux,long long
type in C has 64 bit.When using GNU Prolog to call C, the interface defined in the manual has
integer
,positive
and others.. then if I want to pass a32bit
integer from Prolog to C, which type should I choose..? I found an ad-hoc solution and writing it in this question, is there any better solution?
Could anyone give me some help?