source:
CIVL/examples/arithmetic/divisionBad.cvl
| Last change on this file was b689afd, checked in by , 4 weeks ago | |
|---|---|
|
|
| File size: 257 bytes | |
| Line | |
|---|---|
| 1 | /* divisionBad.cvl: denominator in division could be 0, |
| 2 | * so error should be reported. |
| 3 | * |
| 4 | * Commandline execution: |
| 5 | * civl verify divisionBad.cvl |
| 6 | */ |
| 7 | $input double x; |
| 8 | $input double y; // could be 0 |
| 9 | |
| 10 | void main() { |
| 11 | double z = x/y; |
| 12 | $assert(y*z==x); |
| 13 | } |
Note:
See TracBrowser
for help on using the repository browser.
