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
24c6c62f
Commit
24c6c62f
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2004-09-22 11:51:48 by afrisch] Warning for division by zero
Original author: afrisch Date: 2004-09-22 11:51:48+00:00
parent
8a4d040e
Changes
3
Hide whitespace changes
Inline
Side-by-side
types/builtin.ml
View file @
24c6c62f
...
...
@@ -276,14 +276,14 @@ binary_op_cst "*"
|
(
Value
.
Integer
x
,
Value
.
Integer
y
)
->
Value
.
Integer
(
Intervals
.
V
.
mult
x
y
)
|
_
->
assert
false
);;
binary_op_
cst
"/"
int
int
int
binary_op_
warning2
"/"
int
int
non_zero_int
int
(
fun
v1
v2
->
match
(
v1
,
v2
)
with
|
(
Value
.
Integer
x
,
Value
.
Integer
y
)
->
Value
.
Integer
(
Intervals
.
V
.
div
x
y
)
|
_
->
assert
false
);;
binary_op_
cst
"mod"
int
int
int
binary_op_
warning2
"mod"
int
int
non_zero_int
int
(
fun
v1
v2
->
match
(
v1
,
v2
)
with
|
(
Value
.
Integer
x
,
Value
.
Integer
y
)
->
Value
.
Integer
(
Intervals
.
V
.
modulo
x
y
)
|
_
->
assert
false
);;
...
...
types/builtin_defs.ml
View file @
24c6c62f
...
...
@@ -13,6 +13,8 @@ let short_int = mk_interval_type "-32768" "32767"
let
byte_int
=
mk_interval_type
"-128"
"127"
let
caml_int
=
mk_interval_type
(
string_of_int
min_int
)
(
string_of_int
max_int
)
let
non_zero_int
=
Types
.
cup
pos_int
neg_int
let
pos_intstr
=
Sequence
.
plus
(
Types
.
char
(
Chars
.
char_class
(
Chars
.
V
.
mk_char
'
0
'
)
...
...
types/builtin_defs.mli
View file @
24c6c62f
...
...
@@ -10,6 +10,8 @@ val short_int : Types.t (** -32768 .. 32767 *)
val
byte_int
:
Types
.
t
(** -128 .. 127 *)
val
caml_int
:
Types
.
t
(** min_int .. max_int *)
val
non_zero_int
:
Types
.
t
val
intstr
:
Types
.
t
val
pos_intstr
:
Types
.
t
val
neg_intstr
:
Types
.
t
...
...
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