Commit 7a3e4788 authored by Pietro Abate's avatar Pietro Abate

[r2004-07-08 17:26:28 by cmiachon] adding max

Original author: cmiachon
Date: 2004-07-08 17:26:28+00:00
parent c97bea3f
......@@ -634,3 +634,12 @@ let query_min = function
| _ -> assert false
in aux p i
|_ -> assert false
let query_max = function
| Pair(Integer i,p) ->
let rec aux l i = match l with
| Pair(Integer j,r) -> if (compare (Integer i) (Integer
j) >0) then aux r i else aux r j
| Atom(_) -> Integer i
| _ -> assert false
in aux p i
|_ -> assert false
......@@ -117,4 +117,6 @@ val cduce2ocaml_bigint : t -> Big_int.big_int
val print_utf8: U.t -> unit
val query_min: t-> t
val query_max: t-> t
......@@ -319,3 +319,5 @@ register_fun "raise" any Types.empty
register_fun "min" Sequence.int int
(Value.query_min );;
register_fun "max" Sequence.int int
(Value.query_max );;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment