Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The smallest value of a variable?

Status
Not open for further replies.

Ju

Technical User
Jul 4, 2000
61
FR
I'd like to know the way I can get the smallest value of a variable I have...

Thank you very much.
 
min([N], N) :- !.
min([N|NR], V) :- min(NR, TMP), V is ((N + TMP) - abs(N - TMP)) / 2.

?- min([3], V).
V = 3 ;

?- min([3, 9, 2, 6], V).
V = 2 ;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top