source:
CIVL/examples/arithmetic/division.cvl@
1aaefd4
| Last change on this file since 1aaefd4 was ea777aa, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 276 bytes | |
| Rev | Line | |
|---|---|---|
| [06b8536c] | 1 | /* division.cvl: simple real division, whose correctness |
| 2 | * depends on real arithmetic. | |
| [89b55f5] | 3 | * |
| 4 | * Commandline execution: | |
| 5 | * civl verify division.cvl | |
| [06b8536c] | 6 | */ |
| [9803bc1] | 7 | #include<civlc.cvh> |
| [06b8536c] | 8 | $input double x; |
| 9 | $input double y; | |
| [3ff27cf] | 10 | $assume(y!=0); |
| [95a2a9e] | 11 | |
| 12 | void main() { | |
| [06b8536c] | 13 | double z = x/y; |
| [95a2a9e] | 14 | |
| [d980649] | 15 | $assert(y*z==x); |
| [95a2a9e] | 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
