users-prolog
[Top][All Lists]
Advanced

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

Fwd: Re: min and max in arithmetic ?


From: Jasper Taylor
Subject: Fwd: Re: min and max in arithmetic ?
Date: Fri, 21 Jun 2002 15:48:06 +0100
User-agent: KMail/1.4.1

OK I have managed to do this now! So far the result is always a float but I 
could see how to make integers too.

How do I submit a patch?

        --Jasper

----------  Forwarded Message  ----------

Subject: Re: min and max in arithmetic ?
Date: Fri, 21 Jun 2002 13:36:18 +0100
From: Jasper Taylor <address@hidden>
To: "Jean Michel LECONTE" <address@hidden>
Cc: address@hidden

On Friday 21 Jun 2002 1:13 pm, Jean Michel LECONTE wrote:
> min(X,Y,X) :- X #=< Y.
> min(X,Y,Y) :- Y #=< Y.
>
> is working (with X and Y constrained variables), isnt it ?

I guess so, but I want it in the arithmetic evaluator so I can go, eg.,

        RealSize is min( max( LIC, Size ), 10 ).

to get the equivalent of

max(Size, LIC, Size1),
min(Size1, 10, RealSize).

Ie. implement min and max in the same way that, eg., trig functions are
implemented (as in Sicstus) -- this is what I tried (and failed) to do

...please?
        --Jasper

-------------------------------------------------------




reply via email to

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