[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Iteratively calling Prolog from C

From: Lindsey Spratt
Subject: Re: Iteratively calling Prolog from C
Date: Thu, 17 Jul 2003 11:02:57 -0500

On Thursday, July 17, 2003, at 10:53  AM, Daniel Dudley wrote:
Yes, that's was my first impression, Lindsey. However, it
doesn't explain:

    ?- factorial(12,F).
    F = -57869312

A signed integer on a 32-bit platform is -2147483648 to
2147483647. Compare this with Win-Prolog and ECLiPSe:

    ?- factorial(12,F).
    F = 479001600

    ?- factorial(12, F).
    F = 479001600
    Yes (0.00s cpu)

When I run the code I posted previously under gprolog I get:
?- factorial(12, F)
F = 479001600.0

The change to float processing does seem to produce the correct results.

Lindsey Spratt

reply via email to

[Prev in Thread] Current Thread [Next in Thread]