diff options
author | David Monniaux <David.Monniaux@univ-grenoble-alpes.fr> | 2021-12-06 17:11:43 +0100 |
---|---|---|
committer | David Monniaux <David.Monniaux@univ-grenoble-alpes.fr> | 2021-12-06 17:11:43 +0100 |
commit | 6b62e98a0809a9ac22e64f82943473994e79bfaf (patch) | |
tree | 0d7c57c21a327b4816f217a2aef070e003aba4ed /kvx/ExtZ.v | |
parent | 20cdd9c6c3962f7bec5c85719cfa7b0ee22f0100 (diff) | |
download | compcert-kvx-6b62e98a0809a9ac22e64f82943473994e79bfaf.tar.gz compcert-kvx-6b62e98a0809a9ac22e64f82943473994e79bfaf.zip |
ExtZ
Diffstat (limited to 'kvx/ExtZ.v')
-rw-r--r-- | kvx/ExtZ.v | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kvx/ExtZ.v b/kvx/ExtZ.v new file mode 100644 index 00000000..095fd0cc --- /dev/null +++ b/kvx/ExtZ.v @@ -0,0 +1,12 @@ +Require Import Coq.ZArith.Zdiv. + +Open Scope Z. + +Definition Zdiv_ne (a b : Z) := + let q := Z.div a b in + let q1 := Z.succ q in + match Z.compare (a-b*q) (b*q1-a) with + | Lt => q + | Gt => q1 + | Eq => (if Z.even q then q else q1) + end. |