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