users-prolog
[Top][All Lists]
Advanced

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

arithmetic functions


From: Jeff Koster
Subject: arithmetic functions
Date: Fri, 7 Feb 2003 17:55:11 -0500
User-agent: KMail/1.4.2

Hi,

Does anyone know of a way to implement arithmetic functions in gprolog? I'm 
porting over from SWI which allows:
-------
:- op(25,xf,[minutes]).
:- arithmetic_function(minutes/1).
minutes(M,S) :-
        S is M * 60.
-------
enabling me to use 'minutes' as a function, for example:
        ?- Time is 3 minutes.
would produce
        Time = 180

The efficiency of these particular operators is not of major importance in my 
application.

Thanks in advance,
J.




reply via email to

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