source:
CIVL/mods/dev.civl.com/examples/arithmetic/sqrt.cvl@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 236 bytes | |
| Line | |
|---|---|
| 1 | #include <civlc.cvh> |
| 2 | #include <math.h> |
| 3 | #include <stdio.h> |
| 4 | |
| 5 | $input double x; |
| 6 | $assume(x >= 0.0); |
| 7 | |
| 8 | int main(int argc, char * argv[]) { |
| 9 | double y = sqrt(x) + 1; |
| 10 | |
| 11 | if(x == 0.0) |
| 12 | $assert(y == 1); |
| 13 | else |
| 14 | $assert(y > 1); |
| 15 | return 0; |
| 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
