Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
7a3e4788
Commit
7a3e4788
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2004-07-08 17:26:28 by cmiachon] adding max
Original author: cmiachon Date: 2004-07-08 17:26:28+00:00
parent
c97bea3f
Changes
3
Hide whitespace changes
Inline
Side-by-side
runtime/value.ml
View file @
7a3e4788
...
...
@@ -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
runtime/value.mli
View file @
7a3e4788
...
...
@@ -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
types/builtin.ml
View file @
7a3e4788
...
...
@@ -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
);;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment