[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Iteratively calling Prolog from C
From: |
Daniel Dudley |
Subject: |
Re: Iteratively calling Prolog from C |
Date: |
Thu, 17 Jul 2003 18:19:46 +0200 |
Lindsey Spratt wrote:
> 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
> > yes
> >
> > 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)
> Success
> F = 479001600.0
>
> The change to float processing does seem to produce the
> correct results.
Yes, I don't doubt that. I also noted that you're using a
pure recursive algorithm.
But it doesn't explain the result of ?- factorial(12,F)
when doing integer processing, using the backtracking
algorithm (you might give it try with your one).
Daniel
- Re: Iteratively calling Prolog from C, (continued)
- Re: Iteratively calling Prolog from C, Daniele Peri, 2003/07/17
- A note of belated politeness., tvetunge, 2003/07/17
- Re: Iteratively calling Prolog from C, Daniel Dudley, 2003/07/17
- Re: Iteratively calling Prolog from C, Daniele Peri, 2003/07/17
- Re: Iteratively calling Prolog from C, Daniel Dudley, 2003/07/17
- Re: Iteratively calling Prolog from C, Daniel Dudley, 2003/07/17
- Re: Iteratively calling Prolog from C, Daniel Dudley, 2003/07/17
- Re: Iteratively calling Prolog from C, Lindsey Spratt, 2003/07/17
- Re: Iteratively calling Prolog from C, Daniel Dudley, 2003/07/17
- Re: Iteratively calling Prolog from C, Lindsey Spratt, 2003/07/17
- Re: Iteratively calling Prolog from C,
Daniel Dudley <=
- Re: Iteratively calling Prolog from C, Lindsey Spratt, 2003/07/17
- Re: Iteratively calling Prolog from C, Alexandre Tessier, 2003/07/17
- Re: Iteratively calling Prolog from C, Daniele Peri, 2003/07/17
- Re: Iteratively calling Prolog from C, Daniel Dudley, 2003/07/17
- Re: Iteratively calling Prolog from C, Daniele Peri, 2003/07/17
- Re: Iteratively calling Prolog from C, Bartek Wilczynski, 2003/07/17
- Re: Iteratively calling Prolog from C, Daniel Dudley, 2003/07/17
- Re: Iteratively calling Prolog from C, Daniele Peri, 2003/07/18
- Re: Iteratively calling Prolog from C, Daniele Peri, 2003/07/18
- Re: Iteratively calling Prolog from C, Fergus Henderson, 2003/07/18